OrangePi_CM5/arch/x86/kvm
Wanpeng Li 43dbc3edad KVM: LAPIC: Enable timer posted-interrupt only when mwait/hlt is advertised
[ Upstream commit 1714a4eb6fb0cb79f182873cd011a8ed60ac65e8 ]

As commit 0c5f81dad4 ("KVM: LAPIC: Inject timer interrupt via posted
interrupt") mentioned that the host admin should well tune the guest
setup, so that vCPUs are placed on isolated pCPUs, and with several pCPUs
surplus for *busy* housekeeping.  In this setup, it is preferrable to
disable mwait/hlt/pause vmexits to keep the vCPUs in non-root mode.

However, if only some guests isolated and others not, they would not
have any benefit from posted timer interrupts, and at the same time lose
VMX preemption timer fast paths because kvm_can_post_timer_interrupt()
returns true and therefore forces kvm_can_use_hv_timer() to false.

By guaranteeing that posted-interrupt timer is only used if MWAIT or
HLT are done without vmexit, KVM can make a better choice and use the
VMX preemption timer and the corresponding fast paths.

Reported-by: Aili Yao <yaoaili@kingsoft.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Cc: Aili Yao <yaoaili@kingsoft.com>
Cc: Sean Christopherson <seanjc@google.com>
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Message-Id: <1643112538-36743-1-git-send-email-wanpengli@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-05-12 12:25:44 +02:00
..
mmu KVM: x86/mmu: avoid NULL-pointer dereference on page freeing bugs 2022-05-12 12:25:44 +02:00
svm KVM: x86/svm: Account for family 17h event renumberings in amd_pmc_perf_hw_id 2022-05-12 12:25:30 +02:00
vmx KVM: x86/pmu: Refactoring find_arch_event() to pmc_perf_hw_id() 2022-02-23 12:01:04 +01:00
Kconfig
…
Makefile
…
cpuid.c kvm: x86/cpuid: Only provide CPUID leaf 0xA if host has architectural PMU 2022-05-12 12:25:43 +02:00
cpuid.h
…
debugfs.c
…
emulate.c KVM: x86/emulator: Emulate RDPID only if it is enabled in guest 2022-04-13 21:00:54 +02:00
hyperv.c KVM: x86: Forbid VMM to set SYNIC/STIMER MSRs when SynIC wasn't activated 2022-04-08 14:40:38 +02:00
hyperv.h
…
i8254.c
…
i8254.h
…
i8259.c
…
ioapic.c Revert "x86/kvm: fix vcpu-id indexed array sizes" 2021-11-12 14:58:32 +01:00
ioapic.h Revert "x86/kvm: fix vcpu-id indexed array sizes" 2021-11-12 14:58:32 +01:00
irq.c
…
irq.h
…
irq_comm.c
…
kvm_cache_regs.h
…
kvm_emulate.h KVM: x86/emulator: Emulate RDPID only if it is enabled in guest 2022-04-13 21:00:54 +02:00
lapic.c KVM: LAPIC: Enable timer posted-interrupt only when mwait/hlt is advertised 2022-05-12 12:25:44 +02:00
lapic.h
…
mmu.h KVM: x86: fix shift out of bounds reported by UBSAN 2021-01-12 20:18:26 +01:00
mtrr.c
…
pmu.c KVM: x86/pmu: Use AMD64_RAW_EVENT_MASK for PERF_TYPE_RAW 2022-02-23 12:01:05 +01:00
pmu.h KVM: x86/pmu: Refactoring find_arch_event() to pmc_perf_hw_id() 2022-02-23 12:01:04 +01:00
trace.h KVM: x86: Ensure liveliness of nested VM-Enter fail tracepoint message 2021-06-16 12:01:46 +02:00
tss.h
…
x86.c KVM: x86/mmu: Resolve nx_huge_pages when kvm.ko is loaded 2022-04-20 09:23:25 +02:00
x86.h KVM: x86: Factor out x86 instruction emulation with decoding 2021-08-26 08:35:34 -04:00