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

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
..
boot x86/boot/compressed: Move CLANG_FLAGS to beginning of KBUILD_CFLAGS 2022-01-27 10:54:00 +01:00
configs x86/kbuild: Enable CONFIG_KALLSYMS_ALL=y in the defconfigs 2022-01-27 10:54:21 +01:00
crypto crypto: x86/curve25519 - fix cpu feature checking logic in mod_exit 2021-07-14 16:56:06 +02:00
entry x86/entry: Add a fence for kernel entry SWAPGS in paranoid_entry() 2021-12-08 09:03:27 +01:00
events perf/x86/intel/pt: Fix address filter config for 32-bit kernel 2022-04-08 14:40:04 +02:00
hyperv x86/hyperv: Fix NULL deref in set_hv_tscchange_cb() if Hyper-V setup fails 2021-11-26 10:39:19 +01:00
ia32
include x86/cpu: Load microcode during restore_processor_state() 2022-05-09 09:05:07 +02:00
kernel x86/kvm: Preserve BSP MSR_KVM_POLL_CONTROL across suspend/resume 2022-05-12 12:25:44 +02:00
kvm KVM: LAPIC: Enable timer posted-interrupt only when mwait/hlt is advertised 2022-05-12 12:25:44 +02:00
lib x86: __memcpy_flushcache: fix wrong alignment if size > 2^32 2022-05-09 09:05:06 +02:00
math-emu
mm x86/boot: Add setup_indirect support in early_memremap_is_setup_data() 2022-03-16 14:16:02 +01:00
net bpf: Handle return value of BPF_PROG_TYPE_STRUCT_OPS prog 2021-10-06 15:55:50 +02:00
oprofile
pci x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests 2022-05-09 09:05:00 +02:00
platform x86/sme: Explicitly map new EFI memmap table as encrypted 2021-12-14 11:32:35 +01:00
power x86/cpu: Load microcode during restore_processor_state() 2022-05-09 09:05:07 +02:00
purgatory
ras
realmode x86/mm: Flush global TLB when switching to trampoline page-table 2022-01-27 10:54:14 +01:00
tools x86/tools: Fix objdump version check again 2021-08-18 08:59:15 +02:00
um um: registers: Rename function names to avoid conflicts and build problems 2022-01-27 10:54:18 +01:00
video
xen xen: delay xen_hvm_init_time_ops() if kdump is boot on vcpu>=32 2022-04-13 21:01:01 +02:00
.gitignore
Kbuild
Kconfig x86/Kconfig: Do not allow CONFIG_X86_X32_ABI=y with llvm-objcopy 2022-04-13 21:01:02 +02:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug
Makefile x86/build: Propagate $(CLANG_FLAGS) to $(REALMODE_FLAGS) 2021-05-11 14:47:18 +02:00
Makefile_32.cpu
Makefile.um