On Wed, Mar 11, 2020 at 16:39:41 +0100, Laszlo Ersek wrote:
> 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 <ler...@redhat.com>
> > Cc: Ard Biesheuvel <ard.biesheu...@linaro.org>
> > Signed-off-by: Leif Lindholm <l...@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 <ler...@redhat.com>

Thanks!
Pushed as 01ce872739d2f.
BZ closed.

/
    Leif


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55931): https://edk2.groups.io/g/devel/message/55931
Mute This Topic: https://groups.io/mt/71881668/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to