]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
arm/arm64: KVM: add opaque private pointer to MMIO data
authorAndre Przywara <andre.przywara@arm.com>
Thu, 13 Nov 2014 16:21:35 +0000 (16:21 +0000)
committerChristoffer Dall <christoffer.dall@linaro.org>
Tue, 20 Jan 2015 17:25:30 +0000 (18:25 +0100)
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>
arch/arm/include/asm/kvm_mmio.h
arch/arm64/include/asm/kvm_mmio.h
virt/kvm/arm/vgic.c

index adcc0d7d317571b7b0b8f62af262b67180c4aa1d..3f83db2f6cf053cb083c15b5fa910b5d7ae7ee61 100644 (file)
@@ -37,6 +37,7 @@ struct kvm_exit_mmio {
        u8              data[8];
        u32             len;
        bool            is_write;
+       void            *private;
 };
 
 static inline void kvm_prepare_mmio(struct kvm_run *run,
index fc2f689c0694eb65e74e7a43474e32fc9a24df74..9f52beb7cb1355e1ebf129b899830b7b463d67b2 100644 (file)
@@ -40,6 +40,7 @@ struct kvm_exit_mmio {
        u8              data[8];
        u32             len;
        bool            is_write;
+       void            *private;
 };
 
 static inline void kvm_prepare_mmio(struct kvm_run *run,
index 0e84292c2197afe84f4b9730f11cea4666217798..b6e17c886ce2b2aff261ec7529e87055b4665eec 100644 (file)
@@ -709,6 +709,7 @@ static bool call_range_handler(struct kvm_vcpu *vcpu,
 
        mmio32.len = 4;
        mmio32.is_write = mmio->is_write;
+       mmio32.private = mmio->private;
 
        mmio32.phys_addr = mmio->phys_addr + 4;
        if (mmio->is_write)