diff options
author | Andre Przywara <andre.przywara@arm.com> | 2014-11-13 11:21:35 -0500 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2015-01-20 12:25:30 -0500 |
commit | 9fedf146778e6d1c26319ebaf56131a4f3a6be03 (patch) | |
tree | e573eca5d001e396134f2bd2afd596ebbc4f479f | |
parent | 1d916229e348c628ddc9cf97528e76d13f52c122 (diff) |
arm/arm64: KVM: add opaque private pointer to MMIO data
For a GICv2 there is always only one (v)CPU involved: the one that
does the access. On a GICv3 the access to a CPU redistributor is
memory-mapped, but not banked, so the (v)CPU affected is determined by
looking at the MMIO address region being accessed.
To allow passing the affected CPU into the accessors later, extend
struct kvm_exit_mmio to add an opaque private pointer parameter.
The current GICv2 emulation just does not use it.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
-rw-r--r-- | arch/arm/include/asm/kvm_mmio.h | 1 | ||||
-rw-r--r-- | arch/arm64/include/asm/kvm_mmio.h | 1 | ||||
-rw-r--r-- | virt/kvm/arm/vgic.c | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/include/asm/kvm_mmio.h b/arch/arm/include/asm/kvm_mmio.h index adcc0d7d3175..3f83db2f6cf0 100644 --- a/arch/arm/include/asm/kvm_mmio.h +++ b/arch/arm/include/asm/kvm_mmio.h | |||
@@ -37,6 +37,7 @@ struct kvm_exit_mmio { | |||
37 | u8 data[8]; | 37 | u8 data[8]; |
38 | u32 len; | 38 | u32 len; |
39 | bool is_write; | 39 | bool is_write; |
40 | void *private; | ||
40 | }; | 41 | }; |
41 | 42 | ||
42 | static inline void kvm_prepare_mmio(struct kvm_run *run, | 43 | static inline void kvm_prepare_mmio(struct kvm_run *run, |
diff --git a/arch/arm64/include/asm/kvm_mmio.h b/arch/arm64/include/asm/kvm_mmio.h index fc2f689c0694..9f52beb7cb13 100644 --- a/arch/arm64/include/asm/kvm_mmio.h +++ b/arch/arm64/include/asm/kvm_mmio.h | |||
@@ -40,6 +40,7 @@ struct kvm_exit_mmio { | |||
40 | u8 data[8]; | 40 | u8 data[8]; |
41 | u32 len; | 41 | u32 len; |
42 | bool is_write; | 42 | bool is_write; |
43 | void *private; | ||
43 | }; | 44 | }; |
44 | 45 | ||
45 | static inline void kvm_prepare_mmio(struct kvm_run *run, | 46 | static inline void kvm_prepare_mmio(struct kvm_run *run, |
diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 0e84292c2197..b6e17c886ce2 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c | |||
@@ -709,6 +709,7 @@ static bool call_range_handler(struct kvm_vcpu *vcpu, | |||
709 | 709 | ||
710 | mmio32.len = 4; | 710 | mmio32.len = 4; |
711 | mmio32.is_write = mmio->is_write; | 711 | mmio32.is_write = mmio->is_write; |
712 | mmio32.private = mmio->private; | ||
712 | 713 | ||
713 | mmio32.phys_addr = mmio->phys_addr + 4; | 714 | mmio32.phys_addr = mmio->phys_addr + 4; |
714 | if (mmio->is_write) | 715 | if (mmio->is_write) |