Abstract the calls to kvm_vgic_vcpu_pending_irq() via the irqchip_flow structure. No functional change. Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx> --- arch/arm64/include/asm/kvm_irq.h | 4 ++++ arch/arm64/kvm/arm.c | 4 ++-- arch/arm64/kvm/vgic/vgic-init.c | 1 + arch/arm64/kvm/vgic/vgic.h | 6 ++++++ include/kvm/arm_vgic.h | 3 --- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/kvm_irq.h b/arch/arm64/include/asm/kvm_irq.h index 50dfd641cd67..e7a244176ade 100644 --- a/arch/arm64/include/asm/kvm_irq.h +++ b/arch/arm64/include/asm/kvm_irq.h @@ -24,6 +24,7 @@ struct kvm_irqchip_flow { void (*irqchip_vcpu_unblocking)(struct kvm_vcpu *); void (*irqchip_vcpu_load)(struct kvm_vcpu *); void (*irqchip_vcpu_put)(struct kvm_vcpu *); + int (*irqchip_vcpu_pending_irq)(struct kvm_vcpu *); }; /* @@ -70,4 +71,7 @@ struct kvm_irqchip_flow { #define kvm_irqchip_vcpu_put(v) \ __vcpu_irqchip_action((v), vcpu_put, (v)) +#define kvm_irqchip_vcpu_pending_irq(v) \ + __vcpu_irqchip_action_ret((v), vcpu_pending_irq, (v)) + #endif diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 84d48c312b84..3496d200e488 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -399,8 +399,8 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, int kvm_arch_vcpu_runnable(struct kvm_vcpu *v) { bool irq_lines = *vcpu_hcr(v) & (HCR_VI | HCR_VF); - return ((irq_lines || kvm_vgic_vcpu_pending_irq(v)) - && !v->arch.power_off && !v->arch.pause); + return ((irq_lines || kvm_irqchip_vcpu_pending_irq(v)) && + !v->arch.power_off && !v->arch.pause); } bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu) diff --git a/arch/arm64/kvm/vgic/vgic-init.c b/arch/arm64/kvm/vgic/vgic-init.c index 24b3ed9bae5d..8bb847045ef9 100644 --- a/arch/arm64/kvm/vgic/vgic-init.c +++ b/arch/arm64/kvm/vgic/vgic-init.c @@ -22,6 +22,7 @@ static struct kvm_irqchip_flow vgic_irqchip_flow = { .irqchip_vcpu_unblocking = kvm_vgic_vcpu_unblocking, .irqchip_vcpu_load = kvm_vgic_load, .irqchip_vcpu_put = kvm_vgic_put, + .irqchip_vcpu_pending_irq = kvm_vgic_vcpu_pending_irq, }; /* diff --git a/arch/arm64/kvm/vgic/vgic.h b/arch/arm64/kvm/vgic/vgic.h index 190737402365..c5511823eec5 100644 --- a/arch/arm64/kvm/vgic/vgic.h +++ b/arch/arm64/kvm/vgic/vgic.h @@ -321,7 +321,13 @@ int vgic_v4_init(struct kvm *kvm); void vgic_v4_teardown(struct kvm *kvm); void vgic_v4_configure_vsgis(struct kvm *kvm); +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); +void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu); +void kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu); + + #endif diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index a06d9483e3a6..b2adf9cca334 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h @@ -347,14 +347,11 @@ int kvm_vgic_map_phys_irq(struct kvm_vcpu *vcpu, unsigned int host_irq, int kvm_vgic_unmap_phys_irq(struct kvm_vcpu *vcpu, unsigned int vintid); bool kvm_vgic_map_is_active(struct kvm_vcpu *vcpu, unsigned int vintid); -int kvm_vgic_vcpu_pending_irq(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) && \ ((i) < (k)->arch.vgic.nr_spis + VGIC_NR_PRIVATE_IRQS)) -bool kvm_vcpu_has_pending_irqs(struct kvm_vcpu *vcpu); void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu); void kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu); void kvm_vgic_reset_mapped_irq(struct kvm_vcpu *vcpu, u32 vintid); -- 2.27.0