Re: [PATCH v5 02/22] KVM: arm/arm64: Add GICV3 pending table save API documentation

Auger Eric
2017-04-26T14:47:09Z

Hi Peter, Christoffer,

On 26/04/2017 15:26, Peter Maydell wrote:
> On 26 April 2017 at 14:14, Christoffer Dall <christoffer.dall@linaro.org> wrote:
>> On Wed, Apr 26, 2017 at 02:01:55PM +0100, Peter Maydell wrote:
>>> On 26 April 2017 at 14:00, Christoffer Dall <cdall@linaro.org> wrote:
>>>> Alternatively we should mark a pending error notification to the guest
>>>> in KVM, so that when the guest boots it gets something like an SError
>>>> instead, given that presumably the guest wrote the weird value. Except
>>>> of course if the problem is caused by QEMU fudging with the register
>>>> value for the PENDBASER.
>>>
>>> If we have scope for complaining at the guest we should do it at
>>> the point where the guest sets PENDBASER in the first place...
>>>
>>
>> Is that what the hardware would have done?
>
> I think it's UNPREDICTABLE to enable the GIC with a bogus PENDBASER,
> but I can't find the bit in the spec that actually says that.
> I don't know what hardware actually does, but I imagine it will
> only notice that it's been handed bogus memory at the point where
> it tries to use it.
>
>> Also, userspace could restore a bogus value in the PENDBASER (even
>> though the guest wrote something sane), so maybe we should just keep
>> this as is and handle it nicely in QEMU?
>
> Yeah, I don't have a strong objection to doing it that way round.

OK. I will only update the QEMU code then.

For info, without talking about save/restore, the GICR_PENDBASER is
sync'ed on LPI enable. if the vITS gets an error on kvm_read_guest, we
currently abort the sync without reporting any error.

GICR_PROPBASER is read on cmd execution (MAPI, INV, INVALL). No error is
reported at the moment. My understanding is our implementation chose the
3d alternative of GICV3 arch spec (6.3.2), ie. "the data that generated
the error or errors is treated as having a legal value", increment the
read cursor and currently we don't report any system error to the guest.

Thanks

Eric
>
> thanks
> -- PMM
>