public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Leif Lindholm <leif.lindholm@linaro.org>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	Ryan Harkin <ryan.harkin@linaro.org>,
	 Evan Lloyd <evan.lloyd@arm.com>,
	Jeremy Linton <jeremy.linton@arm.com>
Subject: Re: [PATCH v2 1/5] ArmPlatformPkg/FVP: map motherboard VRAM as uncached memory
Date: Thu, 6 Apr 2017 21:01:57 +0100	[thread overview]
Message-ID: <CAKv+Gu9f3rRFYTGkWbfZtxDBF6yOO2O6zGZbRNR4Z5L2BSK+2Q@mail.gmail.com> (raw)
In-Reply-To: <20170406190610.GP25239@bivouac.eciton.net>

On 6 April 2017 at 20:06, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Thu, Apr 06, 2017 at 07:46:50PM +0100, Ard Biesheuvel wrote:
>> >> >> +  // VRAM
>> >> >> +  VirtualMemoryTable[++Index].PhysicalBase = PL111_CLCD_VRAM_MOTHERBOARD_BASE;
>> >> >> +  VirtualMemoryTable[Index].VirtualBase = PL111_CLCD_VRAM_MOTHERBOARD_BASE;
>> >> >> +  VirtualMemoryTable[Index].Length = PL111_CLCD_VRAM_MOTHERBOARD_SIZE;
>> >> >> +  VirtualMemoryTable[Index].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED;
>> >> >
>> >> > Hmm, looking at this made me a bit confused though. Normal uncached
>> >> > memory is certainly bufferable (that's basically what write-combining
>> >> > means).
>> >> >
>> >>
>> >> It maps to MAIR attribute encoding 0x44, which translates as
>> >>
>> >> Normal Memory, Outer Non-Cacheable, Inner Non-Cacheable
>> >
>> > Exactly - which is definitely "buffered".
>> >
>> >> > This looks like a naming hangover from ARMv5 translation table format.
>> >> > Is it about time we clean this up?
>> >>
>> >> The whole 'ARM_MEMORY_REGION_xxxx' intermediate namespace should be
>> >> removed, I think.
>> >
>> > That sounds like a good idea to me.
>> > There's also _NONSECURE crud in there.
>> >
>>
>> Yes. But I hope you're not saying you want that to be done first
>> before this patch can go in?
>
> No, but it may mean it makes sense to add a comment regarding the
> Attributes line, since it looks like it's doing the opposite of what
> is actually being done.
>

Something like

--- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c
+++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c
@@ -134,6 +134,12 @@ ArmPlatformGetVirtualMemoryMap (
   VirtualMemoryTable[++Index].PhysicalBase = PL111_CLCD_VRAM_MOTHERBOARD_BASE;
   VirtualMemoryTable[Index].VirtualBase = PL111_CLCD_VRAM_MOTHERBOARD_BASE;
   VirtualMemoryTable[Index].Length = PL111_CLCD_VRAM_MOTHERBOARD_SIZE;
+  //
+  // Map the VRAM region as Normal Non-Cacheable memory and not device memory,
+  // so that we can use the accelerated string routines that may use unaligned
+  // accesses or DC ZVA instructions. The enum identifier is slightly awkward
+  // here, but it maps to a memory type that allows buffering and reordering.
+  //
   VirtualMemoryTable[Index].Attributes =
ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED;

   // Map sparse memory region if present

perhaps?


  reply	other threads:[~2017-04-06 20:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06 13:15 [PATCH v2 0/5] ArmPlatformPkg: map VRAM using memory semantics Ard Biesheuvel
2017-04-06 13:15 ` [PATCH v2 1/5] ArmPlatformPkg/FVP: map motherboard VRAM as uncached memory Ard Biesheuvel
2017-04-06 18:26   ` Leif Lindholm
2017-04-06 18:31     ` Ard Biesheuvel
2017-04-06 18:45       ` Leif Lindholm
2017-04-06 18:46         ` Ard Biesheuvel
2017-04-06 19:06           ` Leif Lindholm
2017-04-06 20:01             ` Ard Biesheuvel [this message]
2017-04-06 20:09               ` Leif Lindholm
2017-04-06 13:15 ` [PATCH v2 2/5] ArmPlatformPkg/HdLcdArmVExpressLib: fix incorrect FreePool () call Ard Biesheuvel
2017-04-06 13:15 ` [PATCH v2 3/5] ArmPlatformPkg/PL111LcdArmVExpressLib: " Ard Biesheuvel
2017-04-06 13:15 ` [PATCH v2 4/5] ArmPlatformPkg/HdLcdArmVExpressLib: use write-combine mapping for VRAM Ard Biesheuvel
2017-04-06 13:15 ` [PATCH v2 5/5] ArmPlatformPkg/PL111LcdArmVExpressLib: " Ard Biesheuvel
2017-04-06 16:29 ` [PATCH v2 0/5] ArmPlatformPkg: map VRAM using memory semantics Jeremy Linton
2017-04-06 18:02   ` Ard Biesheuvel
2017-04-06 18:08 ` Ryan Harkin
2017-04-06 18:29 ` Leif Lindholm
2017-04-06 20:32   ` 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=CAKv+Gu9f3rRFYTGkWbfZtxDBF6yOO2O6zGZbRNR4Z5L2BSK+2Q@mail.gmail.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