public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	edk2-devel@lists.01.org, lersek@redhat.com
Subject: Re: [PATCH v2 10/14] ArmVirtPkg/ArmVirtXen: add ArmVirtMemInfoLib implementation
Date: Wed, 22 Nov 2017 17:03:37 +0000	[thread overview]
Message-ID: <8a73140f-616f-f2ec-69ae-46ec3f98f6ef@linaro.org> (raw)
In-Reply-To: <20171122100731.24525-11-ard.biesheuvel@linaro.org>

Hi Ard,

On 11/22/2017 10:07 AM, Ard Biesheuvel wrote:
> Clone the existing ArmPlatformGetVirtualMemoryMap () for this platform,
> clean it up slightly (by using a static buffer rather than a heap
> allocation, and removing the support for uncached DRAM mappings), and
> turn it into a new ArmVirtMemInfoLib implementation.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Acked-by: Laszlo Ersek <lersek@redhat.com>
> Cc: Julien Grall <julien.grall@linaro.org>

I have tested the series on both Arm32 and Arm64 guests:

Tested-by: Julien Grall <julien.grall@linaro.org>

[...]

> +VOID
> +EFIAPI
> +ArmVirtGetMemoryMap (
> +  OUT ARM_MEMORY_REGION_DESCRIPTOR   **VirtualMemoryMap
> +  )
> +{
> +  ASSERT (VirtualMemoryMap != NULL);
> +
> +  //
> +  // Map the entire physical memory space as cached. The only device
> +  // we care about is the GIC, which will be stage 2 mapped as a device
> +  // by the hypervisor, overriding the cached mapping we install here.
> +  //

I was about to complain about the fact you rely on the hypervisor 
setting correct stage-2 memory attribute. But I see this is a copy of 
the current code :).

We did relax the attribute for MMIO in the case of the Hardware Domain. 
I will keep the UEFI implementation in mind if we ever decide to relax 
for guests too.


> +  mVirtualMemoryTable[0].PhysicalBase = 0x0;
> +  mVirtualMemoryTable[0].VirtualBase  = 0x0;
> +  mVirtualMemoryTable[0].Length       = ArmGetPhysAddrTop ();
> +  mVirtualMemoryTable[0].Attributes   = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;
> +
> +  mVirtualMemoryTable[1].PhysicalBase = 0x0;
> +  mVirtualMemoryTable[1].VirtualBase  = 0x0;
> +  mVirtualMemoryTable[1].Length       = 0x0;
> +  mVirtualMemoryTable[1].Attributes   = 0x0;
> +
> +  *VirtualMemoryMap = mVirtualMemoryTable;
> +}

Cheers,

-- 
Julien Grall


  reply	other threads:[~2017-11-22 16:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22 10:07 [PATCH v2 00/14] ArmVirtPkg: get rid of ArmPlatformLib Ard Biesheuvel
2017-11-22 10:07 ` [PATCH v2 01/14] ArmVirtPkg/PrePi: run all library constructors by hand Ard Biesheuvel
2017-11-22 10:07 ` [PATCH v2 02/14] ArmVirtPkg/PrePi: remove unused GetPlatformPpi() function Ard Biesheuvel
2017-11-22 10:07 ` [PATCH v2 03/14] ArmVirtPkg/PrePi: remove bogus primary core check Ard Biesheuvel
2017-11-22 10:07 ` [PATCH v2 04/14] ArmVirtPkg/PrePi: move DRAM discovery code into PrePi Ard Biesheuvel
2017-11-22 10:07 ` [PATCH v2 05/14] ArmVirtPkg/PrePi: remove dependency on ArmPlatformLib Ard Biesheuvel
2017-11-22 10:07 ` [PATCH v2 06/14] ArmVirtPkg/PrePi: remove ArmPlatformStackLib dependency Ard Biesheuvel
2017-11-22 10:07 ` [PATCH v2 07/14] ArmVirtPkg/PrePi: remove bogus IntelFrameworkModulePkg.dec dependency Ard Biesheuvel
2017-11-22 10:07 ` [PATCH v2 08/14] ArmVirtPkg/ArmVirtPlatformLib: remove support for uncached mappings Ard Biesheuvel
2017-11-22 10:07 ` [PATCH v2 09/14] ArmVirtPkg: introduce ArmVirtMemInfoLib library class Ard Biesheuvel
2017-11-23 16:00   ` Laszlo Ersek
2017-11-22 10:07 ` [PATCH v2 10/14] ArmVirtPkg/ArmVirtXen: add ArmVirtMemInfoLib implementation Ard Biesheuvel
2017-11-22 17:03   ` Julien Grall [this message]
2017-11-22 10:07 ` [PATCH v2 11/14] ArmVirtPkg/ArmVirtQemu: " Ard Biesheuvel
2017-11-23 16:18   ` Laszlo Ersek
2017-11-22 10:07 ` [PATCH v2 12/14] ArmVirtPkg: create QemuVirtMemInfoLib version for ArmVirtQemu Ard Biesheuvel
2017-11-23 16:26   ` Laszlo Ersek
2017-11-22 10:07 ` [PATCH v2 13/14] ArmVirtPkg/ArmVirtMemoryInitPeiLib: move to ArmVirtMemInfoLib Ard Biesheuvel
2017-11-23 16:32   ` Laszlo Ersek
2017-11-22 10:07 ` [PATCH v2 14/14] ArmVirtPkg: remove ArmPlatformLib implementations Ard Biesheuvel
2017-11-23 16:56 ` [PATCH v2 00/14] ArmVirtPkg: get rid of ArmPlatformLib Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8a73140f-616f-f2ec-69ae-46ec3f98f6ef@linaro.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox