public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: edk2-devel@lists.01.org, Christopher.Co@microsoft.com
Subject: Re: [PATCH] ArmPkg/ArmMmuLib ARM: remove cache maintenance of block mapping contents
Date: Wed, 20 Jun 2018 23:05:59 +0100	[thread overview]
Message-ID: <20180620220559.2g5wvickl6bgtnzi@bivouac.eciton.net> (raw)
In-Reply-To: <20180620191007.1250-1-ard.biesheuvel@linaro.org>

On Wed, Jun 20, 2018 at 09:10:07PM +0200, Ard Biesheuvel wrote:
> Peculiarly enough, the current page table manipulation code takes it
> upon itself to write back and invalidate the memory contents covered
> by section mappings when their memory attributes change. It is not
> generally the case that data must be written back when such a change
> occurs, even when switching from cacheable to non-cacheable attributes,
> and in some cases, it is actually causing problems. (The cache
> maintenance is also performed on the PCIe MMIO regions as they get
> mapped by the PCI bus driver, and under virtualization, each cache
> maintenance operation on an emulated MMIO region triggers a round
> trip to the host and back)
> 
> So let's just drop this code.

I guess this is a remnant from pre-ARMv7 days, when translation table
walks weren't inner-cacheable. I think we've already determined that
ARMv7-A+ is required for PI compliance anyway, so I guess dropping
this should be fine.

But if so, don't we also want to get rid of the other two instances of
WriteBackInvalidateDataCacheRange() in this file?

/
    Leif

> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c
> index 9bf4ba03fd5b..d1bca4c601b8 100644
> --- a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c
> +++ b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c
> @@ -718,12 +718,6 @@ UpdateSectionEntries (
>        if (CurrentDescriptor  != Descriptor) {
>          Mva = (VOID *)(UINTN)(((UINTN)FirstLevelIdx + i) << TT_DESCRIPTOR_SECTION_BASE_SHIFT);
>  
> -        // Clean/invalidate the cache for this section, but only
> -        // if we are modifying the memory type attributes
> -        if (((CurrentDescriptor ^ Descriptor) & TT_DESCRIPTOR_SECTION_CACHE_POLICY_MASK) != 0) {
> -          WriteBackInvalidateDataCacheRange (Mva, SIZE_1MB);
> -        }
> -
>          // Only need to update if we are changing the descriptor
>          FirstLevelTable[FirstLevelIdx + i] = Descriptor;
>          ArmUpdateTranslationTableEntry ((VOID *)&FirstLevelTable[FirstLevelIdx + i], Mva);
> -- 
> 2.17.1
> 


  reply	other threads:[~2018-06-20 22:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-20 19:10 [PATCH] ArmPkg/ArmMmuLib ARM: remove cache maintenance of block mapping contents Ard Biesheuvel
2018-06-20 22:05 ` Leif Lindholm [this message]
2018-06-21  6:21   ` Ard Biesheuvel
2018-06-21 10:48     ` Leif Lindholm

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=20180620220559.2g5wvickl6bgtnzi@bivouac.eciton.net \
    --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