linux-stable/arch/x86
Paolo Bonzini 70eae03087 KVM: x86/xen: Fix SRCU/RCU usage in readers of evtchn_ports
The evtchnfd structure itself must be protected by either kvm->lock or
SRCU. Use the former in kvm_xen_eventfd_update(), since the lock is
being taken anyway; kvm_xen_hcall_evtchn_send() instead is a reader and
does not need kvm->lock, and is called in SRCU critical section from the
kvm_x86_handle_exit function.

It is also important to use rcu_read_{lock,unlock}() in
kvm_xen_hcall_evtchn_send(), because idr_remove() will *not*
use synchronize_srcu() to wait for readers to complete.

Remove a superfluous if (kvm) check before calling synchronize_srcu()
in kvm_xen_eventfd_deassign() where kvm has been dereferenced already.

Co-developed-by: Michal Luczaj <mhal@rbox.co>
Signed-off-by: Michal Luczaj <mhal@rbox.co>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Message-Id: <20221226120320.1125390-3-dwmw2@infradead.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-12-27 06:01:49 -05:00
..
boot - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
coco x86/tdx: Panic on bad configs that #VE on "private" memory access 2022-11-01 16:02:40 -07:00
configs x86/defconfig: Enable CONFIG_DEBUG_WX=y 2022-09-02 10:41:42 +02:00
crypto crypto: x86/polyval - Fix crashes when keys are not 16-byte aligned 2022-10-21 19:05:05 +08:00
entry treewide: use prandom_u32_max() when possible, part 1 2022-10-11 17:42:55 -06:00
events perf/x86/core: Zero @lbr instead of returning -1 in x86_perf_get_lbr() stub 2022-11-09 12:31:11 -05:00
hyperv x86/hyperv: Replace kmap() with kmap_local_page() 2022-10-03 08:49:48 +00:00
ia32
include Merge remote-tracking branch 'kvm/queue' into HEAD 2022-12-12 15:54:07 -05:00
kernel x86/kvm: Remove unused virt to phys translation in kvm_guest_cpu_init() 2022-11-09 12:31:15 -05:00
kvm KVM: x86/xen: Fix SRCU/RCU usage in readers of evtchn_ports 2022-12-27 06:01:49 -05:00
lib - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
math-emu
mm x86/mm: Do not verify W^X at boot up 2022-10-24 18:05:27 -07:00
net bpf: Fix dispatcher patchable function entry to 5 bytes nop 2022-10-20 18:57:51 -07:00
pci x86/PCI: Revert "x86/PCI: Clip only host bridge windows for E820 regions" 2022-06-17 14:24:14 -05:00
platform EFI updates for v6.1 2022-10-09 08:56:54 -07:00
power
purgatory x86/purgatory: disable KMSAN instrumentation 2022-10-28 13:37:23 -07:00
ras
realmode x86: kmsan: disable instrumentation of unsupported code 2022-10-03 14:03:24 -07:00
tools x86/tools/relocs: Ignore __kcfi_typeid_ relocations 2022-09-26 10:13:15 -07:00
um arch: um: Mark the stack non-executable to fix a binutils warning 2022-09-21 09:11:42 +02:00
video
virt/vmx/tdx
xen xen: branch for v6.1-rc4 2022-11-06 10:42:29 -08:00
.gitignore x86/purgatory: Omit use of bin2c 2022-07-25 10:32:32 +02:00
Kbuild
Kconfig x86/Kconfig: Drop check for -mabi=ms for CONFIG_EFI_STUB 2022-10-17 19:11:16 +02:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug arch: make TRACE_IRQFLAGS_NMI_SUPPORT generic 2022-06-23 15:39:21 +01:00
Makefile Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Makefile.um
Makefile_32.cpu