linux-stable/arch/x86/kvm
Sean Christopherson 6d3085e4d8 KVM: x86/mmu: Block all page faults during kvm_zap_gfn_range()
When zapping a GFN range, pass 0 => ALL_ONES for the to-be-invalidated
range to effectively block all page faults while the zap is in-progress.
The invalidation helpers take a host virtual address, whereas zapping a
GFN obviously provides a guest physical address and with the wrong unit
of measurement (frame vs. byte).

Alternatively, KVM could walk all memslots to get the associated HVAs,
but thanks to SMM, that would require multiple lookups.  And practically
speaking, kvm_zap_gfn_range() usage is quite rare and not a hot path,
e.g. MTRR and CR0.CD are almost guaranteed to be done only on vCPU0
during boot, and APICv inhibits are similarly infrequent operations.

Fixes: edb298c663 ("KVM: x86/mmu: bump mmu notifier count in kvm_zap_gfn_range")
Reported-by: Chao Peng <chao.p.peng@linux.intel.com>
Cc: stable@vger.kernel.org
Cc: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20221111001841.2412598-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-11-11 07:19:46 -05:00
..
mmu KVM: x86/mmu: Block all page faults during kvm_zap_gfn_range() 2022-11-11 07:19:46 -05:00
svm KVM: x86/pmu: Limit the maximum number of supported AMD GP counters 2022-11-09 12:26:54 -05:00
vmx KVM: x86/pmu: Limit the maximum number of supported Intel GP counters 2022-11-09 12:26:53 -05:00
.gitignore KVM: x86: use a separate asm-offsets.c file 2022-11-09 12:10:17 -05:00
Kconfig KVM: x86: Select CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL 2022-09-29 10:23:08 +01:00
Makefile KVM: SVM: replace regs argument of __svm_vcpu_run() with vcpu_svm 2022-11-09 12:16:34 -05:00
cpuid.c KVM: x86: Fix a typo about the usage of kvcalloc() 2022-11-03 09:39:29 -04:00
cpuid.h KVM: x86: Add dedicated helper to get CPUID entry with significant index 2022-07-14 11:38:32 -04:00
debugfs.c KVM: x86: Reduce refcount if single_open() fails in kvm_mmu_rmaps_stat_open() 2022-10-27 04:41:54 -04:00
emulate.c KVM: x86: smm: number of GPRs in the SMRAM image depends on the image format 2022-10-28 06:10:30 -04:00
fpu.h KVM: x86: Move FPU register accessors into fpu.h 2021-06-17 13:09:24 -04:00
hyperv.c KVM: nVMX: Support PERF_GLOBAL_CTRL with enlightened VMCS 2022-09-26 12:02:47 -04:00
hyperv.h KVM: x86: Report error when setting CPUID if Hyper-V allocation fails 2022-09-26 12:02:39 -04:00
i8254.c KVM: x86: PIT: Preserve state of speaker port data bit 2022-06-08 13:06:20 -04: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/i8259: Remove a dead store of irq in a conditional block 2022-04-02 05:41:19 -04:00
ioapic.c KVM: x86/ioapic: Remove unused "addr" and "length" of ioapic_read_indirect() 2022-02-10 13:47:13 -05:00
ioapic.h x86/kvm: remove unused ack_notifier callbacks 2021-11-18 07:05:57 -05:00
irq.c KVM: x86/xen: handle PV timers oneshot mode 2022-04-02 05:41:16 -04:00
irq.h x86/kvm: remove unused ack_notifier callbacks 2021-11-18 07:05:57 -05:00
irq_comm.c KVM: x86/xen: Make kvm_xen_set_evtchn() reusable from other places 2022-04-02 05:41:14 -04:00
kvm-asm-offsets.c KVM: SVM: move MSR_IA32_SPEC_CTRL save/restore to assembly 2022-11-09 12:25:53 -05:00
kvm_cache_regs.h KVM: X86: Remove kvm_register_clear_available() 2021-12-08 04:25:03 -05:00
kvm_emulate.h KVM: x86: Bug the VM if the emulator accesses a non-existent GPR 2022-06-10 10:01:33 -04:00
kvm_onhyperv.c KVM: x86: Uninline and export hv_track_root_tdp() 2022-02-10 13:47:19 -05:00
kvm_onhyperv.h KVM: x86: Uninline and export hv_track_root_tdp() 2022-02-10 13:47:19 -05:00
lapic.c KVM: x86: Don't snapshot pending INIT/SIPI prior to checking nested events 2022-09-26 12:37:20 -04:00
lapic.h KVM: x86: Rename kvm_apic_has_events() to make it INIT/SIPI specific 2022-09-26 12:37:18 -04:00
mmu.h KVM: SVM: Disable SEV-ES support if MMIO caching is disable 2022-08-10 15:08:25 -04:00
mtrr.c
pmu.c KVM: x86/pmu: Limit the maximum number of supported Intel GP counters 2022-11-09 12:26:53 -05:00
pmu.h Revert "KVM: x86: always allow host-initiated writes to PMU MSRs" 2022-06-20 11:49:46 -04:00
reverse_cpuid.h
trace.h KVM: x86: Print guest pgd in kvm_nested_vmenter() 2022-09-26 12:02:33 -04:00
tss.h
x86.c KVM: x86/pmu: Limit the maximum number of supported AMD GP counters 2022-11-09 12:26:54 -05:00
x86.h KVM: x86: Rename and expose helper to detect if INIT/SIPI are allowed 2022-09-26 12:37:18 -04:00
xen.c KVM: x86/xen: Fix eventfd error handling in kvm_xen_eventfd_assign() 2022-10-28 06:47:26 -04:00
xen.h KVM: x86: do not set st->preempted when going back to user space 2022-06-08 04:21:06 -04:00