From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::22c; helo=mail-io0-x22c.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5DAEE22551B8C for ; Thu, 22 Mar 2018 10:32:08 -0700 (PDT) Received: by mail-io0-x22c.google.com with SMTP id r18so11946669ioa.1 for ; Thu, 22 Mar 2018 10:38:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=q5tIsJv3jUwYdCFGTmJsb1o+wDvwLaKCojkjEMzZT6A=; b=csB19D8ItizzuubGlxUSSKv7mXh8u/UPHtg9zyZw2pW5UbmHPFH1g95NTElCtn38iO r1NVAAtm9KE+Y2qWOqD0QKU9JWn1CiufFqw5LXJIUbvzyha4CIpexLDsW1tntAtURAWT eJEmaaEpyjrc5Pp1WX2dmor/siVerSJhk44S8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=q5tIsJv3jUwYdCFGTmJsb1o+wDvwLaKCojkjEMzZT6A=; b=VssYykniVjh1KjxAHheOcqJrFkHrTrO1j7JV7WQ3XJnKTYfh+oTPlDi49H9Zwx0l1e 49CvTnnSfJzOmIACAlYWActd1TGg6ndbeff8T2+hN+VcBgJ+snXQrZufq6Rg0YNUMlO8 8gsv2fwTogSu/Og6YBbJNjZW9xFRoMTW4uoXZTlkJF+csC2wwJtx1ja8KDMp2TtuQ2H0 Xp8ttVL5YLrdb/g9oVrt5ZClCWS/EZ1qOuehxyXZ83GpC/PdDFiUr/yK7DshM1QCSaht dr5jVAH0KV7UKGGHapRFhfkrHh4mWRuG9zTIfHIdOmfsjer0dMsom70vqFyEtbBWepc2 /MEA== X-Gm-Message-State: AElRT7EhSvy7QFAElMH3mk2Ewx6xxsLWUuqL8YnvBGpvDM+Q90kdnhfJ oo3wkEjnpd+YhBAVKmZDhzHHio3UxLgeJBQ2jqJLjQ== X-Google-Smtp-Source: AG47ELt56mwhtA32X7Ww+1j07jJlhzdxGblbo4oMBuehA+PRvSWU7NNCVWKDL7p3yHJSEFRv1aeE3g+18LKbQUtDPYw= X-Received: by 10.107.164.17 with SMTP id n17mr26317286ioe.173.1521740319250; Thu, 22 Mar 2018 10:38:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.187.67 with HTTP; Thu, 22 Mar 2018 10:38:38 -0700 (PDT) In-Reply-To: References: <20180320161823.54020-1-girish.pathak@arm.com> <20180320161823.54020-13-girish.pathak@arm.com> From: Ard Biesheuvel Date: Thu, 22 Mar 2018 17:38:38 +0000 Message-ID: To: Evan Lloyd Cc: Girish Pathak , nd , "edk2-devel@lists.01.org" , Leif Lindholm , Stephanie Hughes-Fitt , Arvind Chauhan Subject: Re: [PATCH edk2-platforms v3 12/17] ARM/VExpressPkg: Allocate framebuffer using EfiRuntimeServicesData X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2018 17:32:09 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 22 March 2018 at 15:20, Evan Lloyd wrote: > Hi Ard. > >> -----Original Message----- >> From: edk2-devel On Behalf Of Ard >> Biesheuvel >> Sent: 21 March 2018 18:27 >> To: Girish Pathak >> Cc: nd ; edk2-devel@lists.01.org; Leif Lindholm >> ; Stephanie Hughes-Fitt > Fitt@arm.com>; Arvind Chauhan >> Subject: Re: [edk2] [PATCH edk2-platforms v3 12/17] ARM/VExpressPkg: >> Allocate framebuffer using EfiRuntimeServicesData >> >> On 21 March 2018 at 19:07, Girish Pathak >> wrote: >> > >> > >> >> -----Original Message----- >> >> From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] >> >> Sent: 21 March 2018 03:38 >> >> To: Girish Pathak >> >> Cc: edk2-devel@lists.01.org; Leif Lindholm >> >> ; Matteo Carlini ; >> >> Stephanie Hughes-Fitt ; nd >> >> ; Arvind Chauhan ; Daniil >> Egranov >> >> ; Thomas Abraham >> >> >> Subject: Re: [PATCH edk2-platforms v3 12/17] ARM/VExpressPkg: >> >> Allocate framebuffer using EfiRuntimeServicesData >> >> >> >> On 21 March 2018 at 00:18, Girish Pathak >> wrote: >> >> > As per the UEFI specification(2.7) section 12.9, the GOP >> >> > framebuffer memory can be accessed in the pre-boot and the post >> >> > boot phase (by OS) Therefore the memory type EfiBootServicesData is >> >> > incorrect for the framebuffer memory allocation. Change >> >> > EfiBootServicesData with EfiRuntimeServicesData flag so that >> >> > allocated memory can be access by the OS in the post boot phase. >> >> > >> >> >> >> EfiRuntimeServicesData is intended for allocations that the EFI >> >> runtime services need to access themselves at runtime, and will hence >> >> be virtually remapped by SetVirtualAddressMap(). >> >> >> >> This does not apply to the framebuffer. Even if it may be used at OS >> >> runtime, the firmware itself will never access it, so >> >> EfiRuntimeServicesData is not appropriate >> >> >> >> Please use EfiReservedMemory instead. >> > >> > Specification (UEFI Spec 2_7_A Sept 6.pdf) describes >> > EfiReservedMemoryType as Not usable before and after ExitBootServices= , >> See Table 28 & 29 Hence EfiReservedMemoryType is not suitable in this >> case. Agree? >> > >> >> It is not usable as ordinary memory, given that you turn it into 'specia= l' >> memory (with side effects) by turning it into a framebuffer. >> >> So EfiReservedMemory is perfectly appropriate here. > [[Evan Lloyd]] First, I agree EfiReservedMemory is probably the sensible = option. The only alternative would be EfiMemoryMappedIO, and that, as you = have pointed out in the past, introduces alignment requirements. If you ar= e happy to accept it, I'll ask Girish to go with that. EfiReservedMemory is the only appropriate type to use here, and if the spec is unclear, we should fix that. > However, Girish has a point, if only that the UEFI spec need more clarit= y on this, especially as https://lists.01.org/pipermail/edk2-devel/2017-Feb= ruary/007494.html pretty much confirms it is the right way to go. In parti= cular, the bald statement "EfiReservedMemoryType Not usable.", seems unf= ortunate. > > Regards, > Evan > >> _______________________________________________ >> edk2-devel mailing list >> edk2-devel@lists.01.org >> https://lists.01.org/mailman/listinfo/edk2-devel