diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-12-04 16:01:02 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-12-04 16:01:02 +0300 |
commit | c09c9dd2e9c732658c744a802101d5c34fedde22 (patch) | |
tree | 89f930ede811e66e7a70761aaca079d779fed38a /arch/x86/kvm/irq.h | |
parent | 727ae8be30b428082d3519817f4fb98b712d457d (diff) | |
parent | 06bf403de344a8a0811ebd24992d2a08022c5225 (diff) | |
download | linux-c09c9dd2e9c732658c744a802101d5c34fedde22.tar.xz |
Merge branches 'acpi-pci' and 'pm-pci'
* acpi-pci:
x86/PCI/ACPI: Fix regression caused by commit 4d6b4e69a245
* pm-pci:
PCI / PM: Tune down retryable runtime suspend error messages
Diffstat (limited to 'arch/x86/kvm/irq.h')
-rw-r--r-- | arch/x86/kvm/irq.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/arch/x86/kvm/irq.h b/arch/x86/kvm/irq.h index 3d782a2c336a..ae5c78f2337d 100644 --- a/arch/x86/kvm/irq.h +++ b/arch/x86/kvm/irq.h @@ -83,13 +83,38 @@ static inline struct kvm_pic *pic_irqchip(struct kvm *kvm) return kvm->arch.vpic; } +static inline int pic_in_kernel(struct kvm *kvm) +{ + int ret; + + ret = (pic_irqchip(kvm) != NULL); + return ret; +} + +static inline int irqchip_split(struct kvm *kvm) +{ + return kvm->arch.irqchip_split; +} + static inline int irqchip_in_kernel(struct kvm *kvm) { struct kvm_pic *vpic = pic_irqchip(kvm); + bool ret; + + ret = (vpic != NULL); + ret |= irqchip_split(kvm); /* Read vpic before kvm->irq_routing. */ smp_rmb(); - return vpic != NULL; + return ret; +} + +static inline int lapic_in_kernel(struct kvm_vcpu *vcpu) +{ + /* Same as irqchip_in_kernel(vcpu->kvm), but with less + * pointer chasing and no unnecessary memory barriers. + */ + return vcpu->arch.apic != NULL; } void kvm_pic_reset(struct kvm_kpic_state *s); |