From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, sami.mujawar@arm.com
Cc: ard.biesheuvel@arm.com, leif@nuviainc.com,
Alexandru.Elisei@arm.com, Andre.Przywara@arm.com,
Matteo.Carlini@arm.com, Laura.Moretta@arm.com, nd@arm.com
Subject: Re: [edk2-devel] [PATCH v1 10/11] ArmVirtPkg: Link NorFlashDxe with BaseMemoryLibMmio
Date: Thu, 14 May 2020 14:28:45 +0200 [thread overview]
Message-ID: <f64e6b42-e2a4-4113-21e1-335f4b2668fb@redhat.com> (raw)
In-Reply-To: <20200514084019.71368-11-sami.mujawar@arm.com>
On 05/14/20 10:40, Sami Mujawar wrote:
> NorFlashDxe must use aligned MMIO accesses to
> read data from flash as this is device memory.
>
> The AlignedCopyMem() in NorFlashDxe was used to
> copy the flash data which prevented unaligned
> access to device memory. However, the compiler
> could optimize the code to generate pre/post
> indexed or LDP operations. This is a problem
> for guest/virtual firmware as the hypervisor
> code cannot get the syndrome information for
> the trapped accesses.
>
> To address the such issues, BaseMemoryLibMmio
> library has been introduced to perform aligned
> MMIO accesses.
>
> The NorFlashDxe has been updated to use
> CopyMem() instead of using AlignedCopyMem()
> and therefore the NorFlashDxe must be linked
> with BaseMemoryLibMmio.
>
> This patch updates the workspace files to link
> NorFlashDxe with BaseMemoryLibMmio for the
> following platforms:
> - Arm Qemu
> - Arm Qemu Kernel
>
> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
> ---
> ArmVirtPkg/ArmVirtQemu.dsc | 8 ++++++--
> ArmVirtPkg/ArmVirtQemuKernel.dsc | 8 ++++++--
> 2 files changed, 12 insertions(+), 4 deletions(-)
Based on Ard's comment under "MdePkg: Base Memory Lib instance using
MMIO" ("I don't think we need this library"), this patch would be
unnecessary too.
(This applies to the
"BaseMemoryLib|MdePkg/Library/BaseMemoryLibMmio/BaseMemoryLibMmio.inf"
resolutions in the previous patch as well, apparently.)
Thanks
Laszlo
>
> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
> index 3f649c91d8d6a2e3f3e62f35aa40906e048a15c4..82b7d54c2031fed60dccff38353d3ec19cfdefd0 100644
> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> @@ -1,5 +1,5 @@
> #
> -# Copyright (c) 2011-2015, ARM Limited. All rights reserved.
> +# Copyright (c) 2011-2020, ARM Limited. All rights reserved.
> # Copyright (c) 2014, Linaro Limited. All rights reserved.
> # Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
> #
> @@ -384,7 +384,11 @@ [Components.common]
> <LibraryClasses>
> NULL|ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf
> }
> - ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
> + ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf {
> + <LibraryClasses>
> + BaseMemoryLib|MdePkg/Library/BaseMemoryLibMmio/BaseMemoryLibMmio.inf
> + }
> +
> MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
>
> #
> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> index 2a6fd6bc06be1cc20d8c6f2bf00d88d593061edf..6cceb61e493c8c84f6564b120b0864ff817c3f31 100644
> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> @@ -1,5 +1,5 @@
> #
> -# Copyright (c) 2011-2015, ARM Limited. All rights reserved.
> +# Copyright (c) 2011-2020, ARM Limited. All rights reserved.
> # Copyright (c) 2014, Linaro Limited. All rights reserved.
> # Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
> #
> @@ -323,7 +323,11 @@ [Components.common]
> <LibraryClasses>
> NULL|ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf
> }
> - ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
> + ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf {
> + <LibraryClasses>
> + BaseMemoryLib|MdePkg/Library/BaseMemoryLibMmio/BaseMemoryLibMmio.inf
> + }
> +
> MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
>
> #
>
next prev parent reply other threads:[~2020-05-14 12:29 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-14 8:40 [PATCH v2 00/11] Kvmtool guest firmware support for Arm Sami Mujawar
2020-05-14 8:40 ` [PATCH v2 01/11] PcAtChipsetPkg: Add MMIO Support to RTC driver Sami Mujawar
2020-05-14 9:24 ` Ard Biesheuvel
2020-05-15 10:50 ` André Przywara
2020-05-27 0:37 ` [edk2-devel] " Guomin Jiang
2020-05-14 8:40 ` [PATCH v1 02/11] MdePkg: Add NULL implementation for PCILib Sami Mujawar
2020-05-14 9:23 ` Ard Biesheuvel
2020-05-14 16:21 ` Michael D Kinney
2020-05-14 8:40 ` [PATCH v1 03/11] MdePkg: Base Memory Lib instance using MMIO Sami Mujawar
2020-05-14 9:22 ` Ard Biesheuvel
2020-05-14 17:21 ` Ard Biesheuvel
2020-05-14 16:33 ` [edk2-devel] " Michael D Kinney
2020-05-14 8:40 ` [PATCH v1 04/11] ArmPlatformPkg: Use MMIO to read device memory Sami Mujawar
2020-05-14 8:40 ` [PATCH v1 05/11] ArmPlatformPkg: Dynamic flash variable base Sami Mujawar
2020-05-14 9:24 ` Ard Biesheuvel
2020-05-27 11:48 ` [edk2-devel] " Philippe Mathieu-Daudé
2020-05-14 8:40 ` [PATCH v2 06/11] ArmVirtPkg: Add kvmtool platform driver Sami Mujawar
2020-05-14 9:29 ` Ard Biesheuvel
2020-05-14 12:12 ` [edk2-devel] " Laszlo Ersek
2020-05-14 12:17 ` Ard Biesheuvel
2020-05-14 16:05 ` Laszlo Ersek
2020-05-14 17:25 ` Ard Biesheuvel
2020-05-15 7:28 ` Laszlo Ersek
2020-05-14 12:20 ` Laszlo Ersek
2020-05-14 8:40 ` [PATCH v1 07/11] ArmVirtPkg: kvmtool platform memory map Sami Mujawar
2020-05-14 9:30 ` Ard Biesheuvel
2020-05-14 12:15 ` [edk2-devel] " Laszlo Ersek
2020-05-14 8:40 ` [PATCH v1 08/11] ArmVirtPkg: Add Kvmtool NOR flash lib Sami Mujawar
2020-05-14 9:32 ` Ard Biesheuvel
2020-05-14 12:17 ` [edk2-devel] " Laszlo Ersek
2020-05-27 11:59 ` Philippe Mathieu-Daudé
2020-06-04 6:30 ` Philippe Mathieu-Daudé
2020-06-04 15:00 ` Sami Mujawar
2020-05-14 8:40 ` [PATCH v2 09/11] ArmVirtPkg: Support for kvmtool emulated platform Sami Mujawar
2020-05-14 9:56 ` Ard Biesheuvel
2020-05-14 12:24 ` [edk2-devel] " Laszlo Ersek
2020-05-14 8:40 ` [PATCH v1 10/11] ArmVirtPkg: Link NorFlashDxe with BaseMemoryLibMmio Sami Mujawar
2020-05-14 12:28 ` Laszlo Ersek [this message]
2020-05-14 8:40 ` [PATCH v1 11/11] Maintainer.txt: Add Kvmtool emulated plat maintainer Sami Mujawar
2020-05-14 12:31 ` [edk2-devel] " 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=f64e6b42-e2a4-4113-21e1-335f4b2668fb@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