linux-stable/arch
Wanpeng Li 76456dfb36 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:32:42 +02:00
..
alpha bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
arc ARC: entry: fix syscall_trace_exit argument 2022-04-27 14:41:15 +02:00
arm ARM: dts: at91: sama7g5ek: enable pull-up on flexcom3 console lines 2022-05-09 09:16:31 +02:00
arm64 ARM: dts: imx8mm-venice-gw{71xx,72xx,73xx}: fix OTG controller OC mode 2022-05-09 09:16:31 +02:00
csky uaccess: fix type mismatch warnings from access_ok() 2022-04-08 13:58:44 +02:00
h8300 bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
hexagon uaccess: fix integer overflow on access_ok() 2022-03-28 10:03:21 +02:00
ia64 ia64: make IA64_MCA_RECOVERY bool instead of tristate 2022-01-30 09:56:58 +02:00
m68k m68k: coldfire/device.c: only build for MCF_EDMA when h/w macros are defined 2022-04-08 13:57:51 +02:00
microblaze uaccess: fix nios2 and microblaze get_user_8() 2022-04-08 13:57:49 +02:00
mips MIPS: Fix CP0 counter erratum detection for R4k CPUs 2022-05-12 12:32:15 +02:00
nds32 nds32: fix access_ok() checks in get/put_user 2022-03-28 10:03:22 +02:00
nios2 uaccess: fix type mismatch warnings from access_ok() 2022-04-08 13:58:44 +02:00
openrisc bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
parisc parisc: Mark cr16 clock unstable on all SMP machines 2022-05-12 12:32:39 +02:00
powerpc powerpc/64: Add UADDR64 relocation support 2022-05-09 09:16:33 +02:00
riscv RISC-V: relocate DTB if it's outside memory region 2022-05-12 12:32:18 +02:00
s390 KVM: s390x: fix SCK locking 2022-04-08 13:57:30 +02:00
sh bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
sparc uaccess: fix type mismatch warnings from access_ok() 2022-04-08 13:58:44 +02:00
um um: fix and optimize xor select template for CONFIG64 and timetravel mode 2022-04-13 19:27:06 +02:00
x86 KVM: LAPIC: Enable timer posted-interrupt only when mwait/hlt is advertised 2022-05-12 12:32:42 +02:00
xtensa arch: xtensa: platforms: Fix deadlock in rs_close() 2022-05-09 09:16:27 +02:00
.gitignore
Kconfig stack: Constrain and fix stack offset randomization with Clang builds 2022-04-08 13:57:34 +02:00