Skip to content

Commit

Permalink
KVM: arm/arm64: vgic: Handle GICR_PENDBASER.PTZ filed as RAZ
Browse files Browse the repository at this point in the history
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@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Link: https://lore.kernel.org/r/20191220111833.1422-1-yuzenghui@huawei.com
  • Loading branch information
Zenghui Yu authored and Marc Zyngier committed Jan 19, 2020
1 parent 8c58be3 commit 5f675c5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion virt/kvm/arm/vgic/vgic-mmio-v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5f675c5

Please sign in to comment.