Abstract the calls to kvm_vgic_vcpu_load/put() via the irqchip_flow structure. No functional change. Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx> --- arch/arm64/include/asm/kvm_irq.h | 8 ++++++++ arch/arm64/kvm/arm.c | 4 ++-- arch/arm64/kvm/vgic/vgic-init.c | 2 ++ arch/arm64/kvm/vgic/vgic.h | 3 +++ include/kvm/arm_vgic.h | 3 --- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/kvm_irq.h b/arch/arm64/include/asm/kvm_irq.h index 493b59dae256..50dfd641cd67 100644 --- a/arch/arm64/include/asm/kvm_irq.h +++ b/arch/arm64/include/asm/kvm_irq.h @@ -22,6 +22,8 @@ struct kvm_irqchip_flow { int (*irqchip_vcpu_init)(struct kvm_vcpu *); void (*irqchip_vcpu_blocking)(struct kvm_vcpu *); void (*irqchip_vcpu_unblocking)(struct kvm_vcpu *); + void (*irqchip_vcpu_load)(struct kvm_vcpu *); + void (*irqchip_vcpu_put)(struct kvm_vcpu *); }; /* @@ -62,4 +64,10 @@ struct kvm_irqchip_flow { #define kvm_irqchip_vcpu_unblocking(v) \ __vcpu_irqchip_action((v), vcpu_unblocking, (v)) +#define kvm_irqchip_vcpu_load(v) \ + __vcpu_irqchip_action((v), vcpu_load, (v)) + +#define kvm_irqchip_vcpu_put(v) \ + __vcpu_irqchip_action((v), vcpu_put, (v)) + #endif diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index b60265f575cd..84d48c312b84 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -322,7 +322,7 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) vcpu->cpu = cpu; - kvm_vgic_load(vcpu); + kvm_irqchip_vcpu_load(vcpu); kvm_timer_vcpu_load(vcpu); if (has_vhe()) kvm_vcpu_load_sysregs_vhe(vcpu); @@ -346,7 +346,7 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) if (has_vhe()) kvm_vcpu_put_sysregs_vhe(vcpu); kvm_timer_vcpu_put(vcpu); - kvm_vgic_put(vcpu); + kvm_irqchip_vcpu_put(vcpu); kvm_vcpu_pmu_restore_host(vcpu); vcpu->cpu = -1; diff --git a/arch/arm64/kvm/vgic/vgic-init.c b/arch/arm64/kvm/vgic/vgic-init.c index b519fb56a8cd..24b3ed9bae5d 100644 --- a/arch/arm64/kvm/vgic/vgic-init.c +++ b/arch/arm64/kvm/vgic/vgic-init.c @@ -20,6 +20,8 @@ static struct kvm_irqchip_flow vgic_irqchip_flow = { .irqchip_vcpu_init = kvm_vgic_vcpu_init, .irqchip_vcpu_blocking = kvm_vgic_vcpu_blocking, .irqchip_vcpu_unblocking = kvm_vgic_vcpu_unblocking, + .irqchip_vcpu_load = kvm_vgic_load, + .irqchip_vcpu_put = kvm_vgic_put, }; /* diff --git a/arch/arm64/kvm/vgic/vgic.h b/arch/arm64/kvm/vgic/vgic.h index d8a0e3729de4..190737402365 100644 --- a/arch/arm64/kvm/vgic/vgic.h +++ b/arch/arm64/kvm/vgic/vgic.h @@ -321,4 +321,7 @@ int vgic_v4_init(struct kvm *kvm); void vgic_v4_teardown(struct kvm *kvm); void vgic_v4_configure_vsgis(struct kvm *kvm); +void kvm_vgic_load(struct kvm_vcpu *vcpu); +void kvm_vgic_put(struct kvm_vcpu *vcpu); + #endif diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index 2bffc2d513ef..a06d9483e3a6 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h @@ -349,9 +349,6 @@ bool kvm_vgic_map_is_active(struct kvm_vcpu *vcpu, unsigned int vintid); int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu); -void kvm_vgic_load(struct kvm_vcpu *vcpu); -void kvm_vgic_put(struct kvm_vcpu *vcpu); - #define vgic_initialized(k) ((k)->arch.vgic.initialized) #define vgic_ready(k) ((k)->arch.vgic.ready) #define vgic_valid_spi(k, i) (((i) >= VGIC_NR_PRIVATE_IRQS) && \ -- 2.27.0