summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorChristoffer Dall <christoffer.dall@linaro.org>2015-08-30 08:42:16 -0400
committerChristoffer Dall <christoffer.dall@linaro.org>2015-10-22 17:01:42 -0400
commit8bf9a701e103fd17dbdf0355e43ff5200b4823aa (patch)
treedf5138a2240d14af25cf284ae10a5618c3e54c28 /virt
parent9103617df202d74e5c65f8af84a9aa727f812a06 (diff)
arm/arm64: KVM: Implement GICD_ICFGR as RO for PPIs
The GICD_ICFGR allows the bits for the SGIs and PPIs to be read only. We currently simulate this behavior by writing a hardcoded value to the register for the SGIs and PPIs on every write of these bits to the register (ignoring what the guest actually wrote), and by writing the same value as the reset value to the register. This is a bit counter-intuitive, as the register is RO for these bits, and we can just implement it that way, allowing us to control the value of the bits purely in the reset code. Reviewed-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/arm/vgic.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
index 367a180fb5ac..f8ca2e9d2f0b 100644
--- a/virt/kvm/arm/vgic.c
+++ b/virt/kvm/arm/vgic.c
@@ -690,10 +690,9 @@ bool vgic_handle_cfg_reg(u32 *reg, struct kvm_exit_mmio *mmio,
690 vgic_reg_access(mmio, &val, offset, 690 vgic_reg_access(mmio, &val, offset,
691 ACCESS_READ_VALUE | ACCESS_WRITE_VALUE); 691 ACCESS_READ_VALUE | ACCESS_WRITE_VALUE);
692 if (mmio->is_write) { 692 if (mmio->is_write) {
693 if (offset < 8) { 693 /* Ignore writes to read-only SGI and PPI bits */
694 *reg = ~0U; /* Force PPIs/SGIs to 1 */ 694 if (offset < 8)
695 return false; 695 return false;
696 }
697 696
698 val = vgic_cfg_compress(val); 697 val = vgic_cfg_compress(val);
699 if (offset & 4) { 698 if (offset & 4) {