linux/arch/x86/kvm
Alejandro Jimenez 6982b34c21 KVM: x86: Only set APICV_INHIBIT_REASON_ABSENT if APICv is enabled
Use the APICv enablement status to determine if APICV_INHIBIT_REASON_ABSENT
needs to be set, instead of unconditionally setting the reason during
initialization.

Specifically, in cases where AVIC is disabled via module parameter or lack
of hardware support, unconditionally setting an inhibit reason due to the
absence of an in-kernel local APIC can lead to a scenario where the reason
incorrectly remains set after a local APIC has been created by either
KVM_CREATE_IRQCHIP or the enabling of KVM_CAP_IRQCHIP_SPLIT. This is
because the helpers in charge of removing the inhibit return early if
enable_apicv is not true, and therefore the bit remains set.

This leads to confusion as to the cause why APICv is not active, since an
incorrect reason will be reported by tracepoints and/or a debugging tool
that examines the currently set inhibit reasons.

Fixes: ef8b4b7203 ("KVM: ensure APICv is considered inactive if there is no APIC")
Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Link: https://lore.kernel.org/r/20240418021823.1275276-2-alejandro.j.jimenez@oracle.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
2024-05-02 07:53:46 -07:00
..
mmu KVM: Use vfree for memory allocated by vcalloc()/__vcalloc() 2024-04-09 12:18:38 -07:00
svm Merge branch 'linus' into x86/urgent, to pick up dependent commit 2024-04-06 13:00:32 +02:00
vmx S390: 2024-03-15 13:03:13 -07:00
.gitignore KVM: x86: use a separate asm-offsets.c file 2022-11-09 12:10:17 -05:00
cpuid.c KVM: x86: Advertise max mappable GPA in CPUID.0x80000008.GuestPhysBits 2024-04-09 12:18:37 -07:00
cpuid.h KVM: x86: Use KVM-governed feature framework to track "LAM enabled" 2023-11-28 17:54:09 -08:00
debugfs.c KVM: Get rid of return value from kvm_arch_create_vm_debugfs() 2024-02-23 21:44:58 +00:00
emulate.c KVM x86 PMU changes for 6.9: 2024-03-11 10:41:09 -04:00
fpu.h KVM: x86: Move FPU register accessors into fpu.h 2021-06-17 13:09:24 -04:00
governed_features.h KVM: x86: Use KVM-governed feature framework to track "LAM enabled" 2023-11-28 17:54:09 -08:00
hyperv.c KVM: x86: Give a hint when Win2016 might fail to boot due to XSAVES erratum 2024-01-31 16:21:00 -05:00
hyperv.h KVM: x86: Give a hint when Win2016 might fail to boot due to XSAVES erratum 2024-01-31 16:21:00 -05:00
i8254.c KVM: x86: Unify pr_fmt to use module name for all KVM modules 2022-12-29 15:47:35 -05:00
i8254.h KVM: x86: PIT: Preserve state of speaker port data bit 2022-06-08 13:06:20 -04:00
i8259.c KVM: x86: Fix poll command 2023-06-01 13:44:13 -07:00
ioapic.c KVM: x86/ioapic: Resample the pending state of an IRQ when unmasking 2023-03-27 10:13:28 -04:00
ioapic.h x86/kvm: remove unused ack_notifier callbacks 2021-11-18 07:05:57 -05:00
irq_comm.c KVM: x86: Make Hyper-V emulation optional 2023-12-07 09:34:57 -08:00
irq.c KVM: x86/xen: Remove unneeded xen context from kvm_arch when !CONFIG_KVM_XEN 2023-12-07 09:33:42 -08:00
irq.h x86/kvm: remove unused ack_notifier callbacks 2021-11-18 07:05:57 -05:00
Kconfig x86/kvm/Kconfig: Have KVM_AMD_SEV select ARCH_HAS_CC_PLATFORM 2024-04-04 10:40:23 +02:00
kvm_cache_regs.h KVM: x86: Add helpers to query individual CR0/CR4 bits 2023-03-22 10:10:53 -07:00
kvm_emulate.h KVM x86 PMU changes for 6.9: 2024-03-11 10:41:09 -04:00
kvm_onhyperv.c KVM: x86/mmu: Move filling of Hyper-V's TLB range struct into Hyper-V code 2023-04-10 15:17:29 -07:00
kvm_onhyperv.h KVM: x86: Move Hyper-V partition assist page out of Hyper-V emulation context 2023-12-07 09:34:01 -08:00
kvm-asm-offsets.c KVM: SVM: move MSR_IA32_SPEC_CTRL save/restore to assembly 2022-11-09 12:25:53 -05:00
lapic.c S390: 2024-03-15 13:03:13 -07:00
lapic.h KVM: x86: Split out logic to generate "readable" APIC regs mask to helper 2023-01-24 10:04:35 -08:00
Makefile kbuild: change tool coverage variables to take the path relative to $(obj) 2024-02-23 21:06:21 +09:00
mmu.h KVM: x86: Advertise max mappable GPA in CPUID.0x80000008.GuestPhysBits 2024-04-09 12:18:37 -07:00
mtrr.c KVM: x86/mmu: Zap SPTEs on MTRR update iff guest MTRRs are honored 2023-10-09 14:35:14 -07:00
pmu.c KVM: x86/pmu: Avoid CPL lookup if PMC enabline for USER and KERNEL is the same 2024-02-01 09:35:48 -08:00
pmu.h KVM: x86/pmu: Snapshot event selectors that KVM emulates in software 2024-02-01 09:35:48 -08:00
reverse_cpuid.h x86/cpufeatures: Add CPUID_LNX_5 to track recently added Linux-defined word 2024-04-04 17:42:19 -07:00
smm.c KVM: x86: Open code all direct reads to guest DR6 and DR7 2024-02-22 16:14:47 -08:00
smm.h KVM: x86: smm: preserve interrupt shadow in SMRAM 2022-11-09 12:31:26 -05:00
trace.h KVM SVM changes for 6.9: 2024-03-18 19:03:26 -04:00
tss.h
x86.c KVM: x86: Only set APICV_INHIBIT_REASON_ABSENT if APICv is enabled 2024-05-02 07:53:46 -07:00
x86.h KVM Xen and pfncache changes for 6.9: 2024-03-11 10:42:55 -04:00
xen.c KVM: x86/xen: fix recursive deadlock in timer injection 2024-03-04 16:22:39 -08:00
xen.h KVM: x86/xen: inject vCPU upcall vector when local APIC is enabled 2024-03-04 16:22:36 -08:00