summaryrefslogtreecommitdiff
path: root/lib/memory-notifier-error-inject.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2024-02-10 01:20:46 +0300
committerSean Christopherson <seanjc@google.com>2024-02-23 03:24:09 +0300
commita78d9046696b88079a5696bccec4e4e439a3f2a2 (patch)
treee97fcb2825dacf56674e1b9024632e1ef6fc0857 /lib/memory-notifier-error-inject.c
parent0ec3d6d1f169baa7fc512ae4b78d17e7c94b7763 (diff)
downloadlinux-a78d9046696b88079a5696bccec4e4e439a3f2a2.tar.xz
KVM: x86: Move "KVM no-APIC vCPU" key management into local APIC code
Move incrementing and decrementing of kvm_has_noapic_vcpu into kvm_create_lapic() and kvm_free_lapic() respectively to fix a benign bug where KVM fails to decrement the count if vCPU creation ultimately fails, e.g. due to a memory allocation failing. Note, the bug is benign as kvm_has_noapic_vcpu is used purely to optimize lapic_in_kernel() checks, and that optimization is quite dubious. That, and practically speaking no setup that cares at all about performance runs with a userspace local APIC. Reported-by: Li RongQing <lirongqing@baidu.com> Cc: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Xu Yilun <yilun.xu@linux.intel.com> Link: https://lore.kernel.org/r/20240209222047.394389-2-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions