From: "Laszlo Ersek" <lersek@redhat.com>
To: Leif Lindholm <leif@nuviainc.com>, devel@edk2.groups.io
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [PATCH 1/1] ArmVirtPkg: fix ASSERT in ArmVirtGicArchLib with virtualization=on
Date: Wed, 11 Mar 2020 16:39:41 +0100 [thread overview]
Message-ID: <5787d2ae-3e0a-2443-64bd-049743f8891b@redhat.com> (raw)
In-Reply-To: <20200311153217.18253-1-leif@nuviainc.com>
On 03/11/20 16:32, Leif Lindholm wrote:
> ArmVirtGicArchLib was originally implemented before virtualization
> emulation was implemented in QEMU, and the GICv2 model implemented only
> the physical copy of control registers.
>
> Enabling virtualization emulation to QEMU adds also the virtual copy,
> doubling the RegSize returned by FindCompatibleNodeReg () in
> ArmVirtGicArchLibConstructor (). This triggered an ASSERT when running
> QEMU with -M virt,virtualization=on. Address this by testing for both
> possible valid values of RegSize.
>
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2588
>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Signed-off-by: Leif Lindholm <leif@nuviainc.com>
> ---
> ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c
> index af6b3af60edf..5448865ad8e8 100644
> --- a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c
> +++ b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c
> @@ -110,7 +110,12 @@ ArmVirtGicArchLibConstructor (
> break;
>
> case 2:
> - ASSERT (RegSize == 32);
> + //
> + // When the GICv2 is emulated with virtualization=on, it adds a virtual
> + // set of control registers. This means the register property can be
> + // either 32 or 64 bytes in size.
> + //
> + ASSERT ((RegSize == 32) || (RegSize == 64));
>
> DistBase = SwapBytes64 (Reg[0]);
> CpuBase = SwapBytes64 (Reg[2]);
>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
next prev parent reply other threads:[~2020-03-11 15:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-11 15:32 [PATCH 1/1] ArmVirtPkg: fix ASSERT in ArmVirtGicArchLib with virtualization=on Leif Lindholm
2020-03-11 15:39 ` Laszlo Ersek [this message]
2020-03-17 15:08 ` 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=5787d2ae-3e0a-2443-64bd-049743f8891b@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