acrn-kernel/arch/x86/kvm
Sean Christopherson 8c737d950c KVM: x86/mmu: Add "never" option to allow sticky disabling of nx_huge_pages
commit 0b210faf33 upstream.

Add a "never" option to the nx_huge_pages module param to allow userspace
to do a one-way hard disabling of the mitigation, and don't create the
per-VM recovery threads when the mitigation is hard disabled.  Letting
userspace pinky swear that userspace doesn't want to enable NX mitigation
(without reloading KVM) allows certain use cases to avoid the latency
problems associated with spawning a kthread for each VM.

E.g. in FaaS use cases, the guest kernel is trusted and the host may
create 100+ VMs per logical CPU, which can result in 100ms+ latencies when
a burst of VMs is created.

Reported-by: Li RongQing <lirongqing@baidu.com>
Closes: https://lore.kernel.org/all/1679555884-32544-1-git-send-email-lirongqing@baidu.com
Cc: Yong He <zhuangel570@gmail.com>
Cc: Robert Hoo <robert.hoo.linux@gmail.com>
Cc: Kai Huang <kai.huang@intel.com>
Reviewed-by: Robert Hoo <robert.hoo.linux@gmail.com>
Acked-by: Kai Huang <kai.huang@intel.com>
Tested-by: Luiz Capitulino <luizcap@amazon.com>
Reviewed-by: Li RongQing <lirongqing@baidu.com>
Link: https://lore.kernel.org/r/20230602005859.784190-1-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
[ Resolved a small conflict in arch/x86/kvm/mmu/mmu.c::kvm_mmu_post_init_vm()
  which is due kvm_nx_lpage_recovery_worker() being renamed in upstream
  commit 55c510e26a ]
Signed-off-by: Luiz Capitulino <luizcap@amazon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-13 09:42:26 +02:00
..
mmu KVM: x86/mmu: Add "never" option to allow sticky disabling of nx_huge_pages 2023-09-13 09:42:26 +02:00
svm x86/CPU/AMD: Fix the DIV(0) initial fix attempt 2023-08-26 13:27:00 +02:00
vmx
.gitignore
Kconfig
Makefile
cpuid.c x86/srso: Add SRSO_NO support 2023-08-08 20:03:50 +02:00
cpuid.h
debugfs.c
emulate.c
fpu.h
hyperv.c
hyperv.h
i8254.c
i8254.h
i8259.c
ioapic.c
ioapic.h
irq.c
irq.h
irq_comm.c
kvm-asm-offsets.c
kvm_cache_regs.h
kvm_emulate.h
kvm_onhyperv.c
kvm_onhyperv.h
lapic.c
lapic.h
mmu.h
mtrr.c
pmu.c
pmu.h
reverse_cpuid.h x86/cpu, kvm: Add support for CPUID_80000021_EAX 2023-08-08 20:03:50 +02:00
trace.h
tss.h
x86.c x86: Move gds_ucode_mitigated() declaration to header 2023-08-16 18:27:25 +02:00
x86.h
xen.c
xen.h