KVM: arm64, x86: make kvm_arch_has_irq_bypass() inline

kvm_arch_has_irq_bypass() is a small function and even though it does
not appear in any *really* hot paths, it's also not entirely rare.
Make it inline---it also works out nicely in preparation for using it in
kvm-intel.ko and kvm-amd.ko, since the function is not currently exported.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

+11 -10
+5
arch/arm64/include/asm/kvm_host.h
··· 1588 1588 #define kvm_has_s1poe(k) \ 1589 1589 (kvm_has_feat((k), ID_AA64MMFR3_EL1, S1POE, IMP)) 1590 1590 1591 + static inline bool kvm_arch_has_irq_bypass(void) 1592 + { 1593 + return true; 1594 + } 1595 + 1591 1596 #endif /* __ARM64_KVM_HOST_H__ */
-5
arch/arm64/kvm/arm.c
··· 2743 2743 return irqchip_in_kernel(kvm); 2744 2744 } 2745 2745 2746 - bool kvm_arch_has_irq_bypass(void) 2747 - { 2748 - return true; 2749 - } 2750 - 2751 2746 int kvm_arch_irq_bypass_add_producer(struct irq_bypass_consumer *cons, 2752 2747 struct irq_bypass_producer *prod) 2753 2748 {
+6
arch/x86/include/asm/kvm_host.h
··· 35 35 #include <asm/mtrr.h> 36 36 #include <asm/msr-index.h> 37 37 #include <asm/asm.h> 38 + #include <asm/irq_remapping.h> 38 39 #include <asm/kvm_page_track.h> 39 40 #include <asm/kvm_vcpu_regs.h> 40 41 #include <asm/reboot.h> ··· 2423 2422 * remaining 31 lower bits must be 0 to preserve ABI. 2424 2423 */ 2425 2424 #define KVM_EXIT_HYPERCALL_MBZ GENMASK_ULL(31, 1) 2425 + 2426 + static inline bool kvm_arch_has_irq_bypass(void) 2427 + { 2428 + return enable_apicv && irq_remapping_cap(IRQ_POSTING_CAP); 2429 + } 2426 2430 2427 2431 #endif /* _ASM_X86_KVM_HOST_H */
-5
arch/x86/kvm/x86.c
··· 13556 13556 } 13557 13557 EXPORT_SYMBOL_GPL(kvm_arch_has_noncoherent_dma); 13558 13558 13559 - bool kvm_arch_has_irq_bypass(void) 13560 - { 13561 - return enable_apicv && irq_remapping_cap(IRQ_POSTING_CAP); 13562 - } 13563 - 13564 13559 int kvm_arch_irq_bypass_add_producer(struct irq_bypass_consumer *cons, 13565 13560 struct irq_bypass_producer *prod) 13566 13561 {