public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>, edk2-devel@lists.01.org
Cc: leif.lindholm@linaro.org
Subject: Re: [PATCH 09/15] ArmVirtPkg/ArmVirtPlatformLib: remove support for uncached mappings
Date: Tue, 21 Nov 2017 17:15:49 +0100	[thread overview]
Message-ID: <13c4f39e-0156-b753-aee6-539fdc062c98@redhat.com> (raw)
In-Reply-To: <20171117160913.17292-10-ard.biesheuvel@linaro.org>

On 11/17/17 17:09, Ard Biesheuvel wrote:
> QEMU/KVM has very little tolerance for using anything except writeback
> cacheable mappings of DRAM, so let's remove the 'feature' that allows
> us to select uncached mappings at build time.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c | 15 ++-------------
>  1 file changed, 2 insertions(+), 13 deletions(-)
> 
> diff --git a/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c b/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c
> index d10548f86dfc..4368d05f76ef 100644
> --- a/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c
> +++ b/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c
> @@ -22,10 +22,6 @@
>  // Number of Virtual Memory Map Descriptors
>  #define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS          5
>  
> -// DDR attributes
> -#define DDR_ATTRIBUTES_CACHED    ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK
> -#define DDR_ATTRIBUTES_UNCACHED  ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED
> -
>  EFI_PHYSICAL_ADDRESS
>  ArmGetPhysAddrTop (
>    VOID
> @@ -48,7 +44,6 @@ ArmPlatformGetVirtualMemoryMap (
>    IN ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap
>    )
>  {
> -  ARM_MEMORY_REGION_ATTRIBUTES  CacheAttributes;
>    ARM_MEMORY_REGION_DESCRIPTOR  *VirtualMemoryTable;
>  
>    ASSERT (VirtualMemoryMap != NULL);
> @@ -65,17 +60,11 @@ ArmPlatformGetVirtualMemoryMap (
>      return;
>    }
>  
> -  if (FeaturePcdGet (PcdCacheEnable) == TRUE) {
> -    CacheAttributes = DDR_ATTRIBUTES_CACHED;
> -  } else {
> -    CacheAttributes = DDR_ATTRIBUTES_UNCACHED;
> -  }
> -
>    // System DRAM
>    VirtualMemoryTable[0].PhysicalBase = PcdGet64 (PcdSystemMemoryBase);
>    VirtualMemoryTable[0].VirtualBase  = VirtualMemoryTable[0].PhysicalBase;
>    VirtualMemoryTable[0].Length       = PcdGet64 (PcdSystemMemorySize);
> -  VirtualMemoryTable[0].Attributes   = CacheAttributes;
> +  VirtualMemoryTable[0].Attributes   = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;
>  
>    DEBUG ((EFI_D_INFO, "%a: Dumping System DRAM Memory Map:\n"
>        "\tPhysicalBase: 0x%lX\n"
> @@ -104,7 +93,7 @@ ArmPlatformGetVirtualMemoryMap (
>    VirtualMemoryTable[3].PhysicalBase = FixedPcdGet64 (PcdFdBaseAddress);
>    VirtualMemoryTable[3].VirtualBase  = VirtualMemoryTable[3].PhysicalBase;
>    VirtualMemoryTable[3].Length       = FixedPcdGet32 (PcdFdSize);
> -  VirtualMemoryTable[3].Attributes   = CacheAttributes;
> +  VirtualMemoryTable[3].Attributes   = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;
>  
>    // End of Table
>    ZeroMem (&VirtualMemoryTable[4], sizeof (ARM_MEMORY_REGION_DESCRIPTOR));
> 

Looks OK.

I see that PcdCacheEnable is removed from -- or, well, "with" -- all the
affected INF files in the last patch. I also see that the EmbeddedPkg
default for the PCD is FALSE. So it likely makes sense to keep our TRUE
default in "ArmVirt.dsc.inc", for any other (external) modules that
depend on the PCD.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>



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

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-17 16:08 [PATCH 00/15] ArmVirtPkg: get rid of ArmPlatformLib Ard Biesheuvel
2017-11-17 16:08 ` [PATCH 01/15] ArmPlatformPkg/ArmPlatformLibNull: remove bogus PCD dependencies Ard Biesheuvel
2017-11-17 16:20   ` Leif Lindholm
2017-11-17 16:23     ` Ard Biesheuvel
2017-11-17 16:28       ` Leif Lindholm
2017-11-17 19:10         ` Ard Biesheuvel
2017-11-17 16:09 ` [PATCH 02/15] ArmVirtPkg/PrePi: run all library constructors by hand Ard Biesheuvel
2017-11-21 15:32   ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 03/15] ArmVirtPkg/PrePi: remove unused GetPlatformPpi() function Ard Biesheuvel
2017-11-21 15:36   ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 04/15] ArmVirtPkg/PrePi: remove bogus primary core check Ard Biesheuvel
2017-11-21 15:40   ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 05/15] ArmVirtPkg/PrePi: remove dependency on ArmPlatformLib Ard Biesheuvel
2017-11-21 15:46   ` Laszlo Ersek
2017-11-21 15:47     ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 06/15] ArmVirtPkg/PrePi: move DRAM discovery code into PrePi Ard Biesheuvel
2017-11-21 15:48   ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 07/15] ArmVirtPkg/PrePi: remove ArmPlatformStackLib dependency Ard Biesheuvel
2017-11-21 15:51   ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 08/15] ArmVirtPkg/PrePi: remove bogus IntelFrameworkModulePkg.dec dependency Ard Biesheuvel
2017-11-21 15:52   ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 09/15] ArmVirtPkg/ArmVirtPlatformLib: remove support for uncached mappings Ard Biesheuvel
2017-11-21 16:15   ` Laszlo Ersek [this message]
2017-11-17 16:09 ` [PATCH 10/15] ArmVirtPkg: introduce ArmVirtMemInfoLib library class Ard Biesheuvel
2017-11-21 16:23   ` Laszlo Ersek
2017-11-21 16:27     ` Laszlo Ersek
2017-11-21 16:32       ` Ard Biesheuvel
2017-11-17 16:09 ` [PATCH 11/15] ArmVirtPkg/ArmVirtXen: add ArmVirtMemInfoLib implementation Ard Biesheuvel
2017-11-21 16:30   ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 12/15] ArmVirtPkg/ArmVirtQemu: " Ard Biesheuvel
2017-11-21 16:47   ` Ard Biesheuvel
2017-11-21 16:56   ` Laszlo Ersek
2017-11-21 17:11     ` Ard Biesheuvel
2017-11-17 16:09 ` [PATCH 13/15] ArmVirtPkg: implement ArmVirtMemInfo PPI, PEIM and library Ard Biesheuvel
2017-11-21 17:49   ` Laszlo Ersek
2017-11-21 17:57     ` Ard Biesheuvel
2017-11-21 20:17       ` Laszlo Ersek
2017-11-21 20:32         ` Ard Biesheuvel
2017-11-22  8:45           ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 14/15] ArmVirtPkg/ArmVirtMemoryInitPeiLib: move to ArmVirtMemInfoLib Ard Biesheuvel
2017-11-21 17:51   ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 15/15] ArmVirtPkg: remove ArmPlatformLib implementations Ard Biesheuvel
2017-11-21 17:52   ` Laszlo Ersek

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=13c4f39e-0156-b753-aee6-539fdc062c98@redhat.com \
    --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