summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mtrr.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2022-12-20 16:42:24 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2022-12-23 18:16:49 +0100
commit057b18756b464729bc787ed4e6b44abb9f5c3a38 (patch)
tree9f7e85ac843dfb58fe3e6a12aea47f86981c1a03 /arch/x86/kvm/mtrr.c
parentKVM: selftests: Zero out valid_bank_mask for "all" case in Hyper-V IPI test (diff)
downloadlinux-057b18756b464729bc787ed4e6b44abb9f5c3a38.tar.xz
linux-057b18756b464729bc787ed4e6b44abb9f5c3a38.zip
KVM: nVMX: Document that ignoring memory failures for VMCLEAR is deliberate
Explicitly drop the result of kvm_vcpu_write_guest() when writing the "launch state" as part of VMCLEAR emulation, and add a comment to call out that KVM's behavior is architecturally valid. Intel's pseudocode effectively says that VMCLEAR is a nop if the target VMCS address isn't in memory, e.g. if the address points at MMIO. Add a FIXME to call out that suppressing failures on __copy_to_user() is wrong, as memory (a memslot) does exist in that case. Punt the issue to the future as open coding kvm_vcpu_write_guest() just to make sure the guest dies with -EFAULT isn't worth the extra complexity. The flaw will need to be addressed if KVM ever does something intelligent on uaccess failures, e.g. to support post-copy demand paging, but in that case KVM will need a more thorough overhaul, i.e. VMCLEAR shouldn't need to open code a core KVM helper. No functional change intended. Reported-by: coverity-bot <keescook+coverity-bot@chromium.org> Addresses-Coverity-ID: 1527765 ("Error handling issues") Fixes: 587d7e72aedc ("kvm: nVMX: VMCLEAR should not cause the vCPU to shut down") Cc: Jim Mattson <jmattson@google.com> Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20221220154224.526568-1-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mtrr.c')
0 files changed, 0 insertions, 0 deletions