[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8f8b063c-45cf-166d-bd94-ff96831314c0@redhat.com>
Date: Fri, 20 Dec 2019 13:18:40 +0100
From: Auger Eric <eric.auger@...hat.com>
To: Zenghui Yu <yuzenghui@...wei.com>, maz@...nel.org
Cc: andre.przywara@....com, linux-kernel@...r.kernel.org,
wanghaibin.wang@...wei.com, kvmarm@...ts.cs.columbia.edu,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] KVM: arm/arm64: vgic: Handle GICR_PENDBASER.PTZ filed as
RAZ
Hi Zenghui,
On 12/20/19 12:18 PM, Zenghui Yu wrote:
> Although guest will hardly read and use the PTZ (Pending Table Zero)
> bit in GICR_PENDBASER, let us emulate the architecture strictly.
> As per IHI 0069E 9.11.30, PTZ field is WO, and reads as 0.
>
> Signed-off-by: Zenghui Yu <yuzenghui@...wei.com>
> ---
>
> Noticed when checking all fields of GICR_PENDBASER register.
> But _not_ sure whether it's worth a fix, as Linux never sets
> the PTZ bit before enabling LPI (set GICR_CTLR_ENABLE_LPIS).
>
> And I wonder under which scenarios can this bit be written as 1.
> It seems difficult for software to determine whether the pending
> table contains all zeros when writing this bit.
>
> virt/kvm/arm/vgic/vgic-mmio-v3.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/virt/kvm/arm/vgic/vgic-mmio-v3.c b/virt/kvm/arm/vgic/vgic-mmio-v3.c
> index 7dfd15dbb308..ebc218840fc2 100644
> --- a/virt/kvm/arm/vgic/vgic-mmio-v3.c
> +++ b/virt/kvm/arm/vgic/vgic-mmio-v3.c
> @@ -414,8 +414,11 @@ static unsigned long vgic_mmio_read_pendbase(struct kvm_vcpu *vcpu,
> gpa_t addr, unsigned int len)
> {
> struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
> + u64 value = vgic_cpu->pendbaser;
>
> - return extract_bytes(vgic_cpu->pendbaser, addr & 7, len);
> + value &= ~GICR_PENDBASER_PTZ;
> +
> + return extract_bytes(value, addr & 7, len);
> }
>
> static void vgic_mmio_write_pendbase(struct kvm_vcpu *vcpu,
>
Reviewed-by: Eric Auger <eric.auger@...hat.com>
Thanks
Eric
Powered by blists - more mailing lists