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>
Cc: edk2-devel@ml01.01.org
Subject: Re: [PATCH] ArmVirtPkg: move all platforms to MdePkg/ BaseMemoryLib implementations
Date: Thu, 22 Sep 2016 05:32:06 +0200	[thread overview]
Message-ID: <dd4a15a2-e4b6-78a7-1b06-914b57722b4e@redhat.com> (raw)
In-Reply-To: <1473787681-27142-1-git-send-email-ard.biesheuvel@linaro.org>

Hi Ard,

On 09/13/16 19:28, Ard Biesheuvel wrote:
> The BaseMemoryLibStm implementation under ArmPkg/ is being deprecated,
> in favor of the generic versions under MdePkg, now that ARM and AARCH64
> support has been added to both the generic C version (BaseMemoryLib) and
> the accelerated version (BaseMemoryLibOptDxe). The latter uses unaligned
> accesses and special cache maintenance instructions, and can therefore
> not be used when the MMU is off.
> 
> So move to BaseMemoryLibOptDxe for the DXE phase and later, and to the
> generic BaseMemoryLib before that.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  ArmVirtPkg/ArmVirt.dsc.inc | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)

unfortunately the optimized BaseMemoryLib implementation regresses the
graphics display with VirtioGpuDxe.

The Blt() implementation in VirtioGpuDxe [OvmfPkg/VirtioGpuDxe/Gop.c]
uses SetMem32() and CopyMem(). I think they hit on a corner case in the
optimized BaseMemoryLib instance.

I'm attaching two screenshots (they are small, approx. 12KB each). The
first screenshot ("Screenshot_aarch64-vgpu-2_2016-09-22_04:45:19.png")
shows the corrupted display, when ArmVirtQemu is built at 7f1bf51bdbca.

The second screenshot
("Screenshot_aarch64-vgpu-2_2016-09-22_04:50:08.png") shows the correct
display, with 3c3cf1cd731f (i.e., this patch) reverted.

There are two differences. The first difference is that on the corrupt
display, the "Console Started" message is not cleared. I think this
means that the SetMem32() function call, under case label
EfiBltVideoFill in function GopBlt() "OvmfPkg/VirtioGpuDxe/Gop.c", is
not working.

The other difference is (obviously) in the progress bar. The progress
bar is drawn as a series of filled rectangles / EfiBltVideoFill
operations; see BootLogoUpdateProgress() in
"MdeModulePkg/Library/BootLogoLib/BootLogoLib.c". Thus, the second
difference implicates SetMem32() again.

In commit c86cd1e175fb "MdePkg/BaseMemoryLibOptDxe: add accelerated
AARCH64 routines", you added the optimized InternalSetMem32() like this
(file "MdePkg/Library/BaseMemoryLibOptDxe/AArch64/SetMem.S"):

ASM_GLOBAL ASM_PFX(InternalMemSetMem32)
ASM_PFX(InternalMemSetMem32):
    dup     v0.4S, valw
    b       0f

According to the ARM ARM, this is "Duplicate general-purpose register to
vector". I tried to match the above assembly against the insn spec
(including to "Vector formats in AArch64 state"), but I failed. Are you
sure the above is correct?

Thanks
Laszlo


  parent reply	other threads:[~2016-09-22  3:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13 17:28 [PATCH] ArmVirtPkg: move all platforms to MdePkg/ BaseMemoryLib implementations Ard Biesheuvel
2016-09-13 18:06 ` Laszlo Ersek
2016-09-22  3:32 ` Laszlo Ersek [this message]
2016-09-22  8:09   ` 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=dd4a15a2-e4b6-78a7-1b06-914b57722b4e@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