[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bb59df5a-be43-1132-e78a-3c6b354694d6@huawei.com>
Date: Wed, 1 Apr 2020 20:52:20 +0800
From: Zenghui Yu <yuzenghui@...wei.com>
To: Marc Zyngier <maz@...nel.org>
CC: <kvmarm@...ts.cs.columbia.edu>, <eric.auger@...hat.com>,
<andre.przywara@....com>, <james.morse@....com>,
<julien.thierry.kdev@...il.com>, <suzuki.poulose@....com>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <wanghaibin.wang@...wei.com>
Subject: Re: [PATCH] KVM: arm64: vgic-v3: Clear pending bit in guest memory
after synchronization
On 2020/4/1 18:27, Marc Zyngier wrote:
>>> And I think there is a similar issue in vgic_v3_lpi_sync_pending_status().
>>> Why sync something back from the pending table when the LPI wasn't
>>> mapped yet?
>>
>> vgic_v3_lpi_sync_pending_status() can be called on the ITE restore path:
>> vgic_its_restore_ite/vgic_add_lpi/vgic_v3_lpi_sync_pending_status.
>> We should rely on it to sync the pending bit from guest memory (which
>> was saved on the source side).
>
> The fact that we have *two* paths to restore pending bits is pretty
> annoying. There is certainly some scope for simplification here.
One thing need to be clarified first (if we're going to do some
simplification here) is that if we follow the "ITS Restore Sequence"
rule (in Documentation/virt/kvm/devices/arm-vgic-its.rst, which says
that all redistributors are restored *before* ITS table data), then
the pending bits will *only* be restored on the ITE restore path.
When we're restoring the GICR_CTLR, we invoke vgic_enable_lpis()->
its_sync_lpi_pending_table(). But since no LPI has been restored yet,
we will get an empty lpi_list snapshot from vgic_copy_lpi_list().
No pending table synchronization will happen on this path.
I think this is what we have in the current code.
Thanks,
Zenghui
Powered by blists - more mailing lists