[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 00/20] GICv3 emulation

From: Ard Biesheuvel
Subject: Re: [Qemu-devel] [PATCH v3 00/20] GICv3 emulation
Date: Thu, 23 Jun 2016 22:03:14 +0200

On 23 June 2016 at 16:52, Laszlo Ersek <address@hidden> wrote:
> On 06/23/16 16:18, Ed Maste wrote:
>> On 23 June 2016 at 07:36, Laszlo Ersek <address@hidden> wrote:
>>> On 06/22/16 22:53, Peter Maydell wrote:
>>>> On 22 June 2016 at 19:09, Ed Maste <address@hidden> wrote:
>>>>> On 15 June 2016 at 06:10, Peter Maydell <address@hidden> wrote:
>>>>>> A quick scan through 
>>>>>> http://fxr.watson.org/fxr/source/arm64/arm64/gic_v3.c
>>>>>> doesn't seem to show it setting the IGROUPR registers anywhere,
>>>>>> so it probably is a guest bug. (You can use "-d 'trace:gicv3*'" to
>>>>>> enable the tracepoints for the GIC which would let you check whether
>>>>>> the guest ever tries to write to the group config registers.)
>>>>> Is there a prebuilt QEMU_EFI.fd available somewhere for testing a
>>>>> FreeBSD change to address this? I've been using the prebuilt ones from
>>>>> https://wiki.linaro.org/LEG/UEFIforQEMU and the latest one I had did
>>>>> not start with gic-version=3.
>>>> Yeah, it looks like the same bug is also present in UEFI itself
>>>> (it's super popular!). Laszlo, Ard, do you have a prebuilt
>>>> UEFI binary with Ard's fix?
>>> I just put up one here, in case it's still needed:
>>> http://people.redhat.com/~lersek/82a5e88f-f1e1-42e2-8462-66974c9cbfff/
>> Thank you. I ran your QEMU_EFI.fd with gic_version=3 and UEFI and
>> FreeBSD start up successfully (as expected, based on the discussion in
>> this thread).
>> It sounds like we'll need to build a hacked UEFI build as Peter
>> Maydell suggested in order to actually test a FreeBSD fix when we have
>> it.
> Ah, sorry, I failed to understand this nuance from the discussion
> (although I quoted it myself -- sorry I'm not having a great day today).
> So apparently you need a recent enough firmware binary that *starts*
> with gicv3, but doesn't configure the gicv3 as otherwise needed, so you
> can reproduce the FreeBSD bug, and verify the FreeBSD bugfix, while
> booting with UEFI.
> Ard's patch has just been committed to upstream edk2 (c7fefb690661 --
> <https://github.com/tianocore/edk2/commits/master>), but I can build a
> binary for you right before it (at
> bf57a42a0e2cf1c68e9db2f61c82ce93c806ab07)...
> http://people.redhat.com/~lersek/82a5e88f-f1e1-42e2-8462-66974c9cbfff/QEMU_EFI.fd.bf57a42a0e2c

Thanks, but that image will never make it to the FreeBSD bootloader,
given that it requires the GIC to be operational.

It should not be that difficult to revert the changes to the GIC
registers that my patch adds when it hands over to the OS loader, but
if the FreeBSD code then simply pokes the same values into the same
registers, I am not convinced this is a useful test case. The fact
that FreeBSD can only load via UEFI actually suggests that it may not
require this fix in the first place, since UEFI is guaranteed to leave
the GIC in a usable state for the OS if it runs from the same
exception level, and there are no other boot methods supported by
FreeBSD on AArch64

reply via email to

[Prev in Thread] Current Thread [Next in Thread]