diff options
| author | Yan Zhao <[email protected]> | 2025-01-13 02:11:38 +0000 |
|---|---|---|
| committer | Paolo Bonzini <[email protected]> | 2025-01-15 16:45:26 +0000 |
| commit | 7c54803863002989ac979adc14847fea5c80bf4b (patch) | |
| tree | 460f34d6ce4368c85856eac1b22af58ae5317105 /net/unix/af_unix.c | |
| parent | KVM: x86/mmu: Prevent aliased memslot GFNs (diff) | |
| download | kernel-7c54803863002989ac979adc14847fea5c80bf4b.tar.gz kernel-7c54803863002989ac979adc14847fea5c80bf4b.zip | |
KVM: x86/mmu: Return RET_PF* instead of 1 in kvm_mmu_page_fault()
Return RET_PF* (excluding RET_PF_EMULATE/RET_PF_CONTINUE/RET_PF_INVALID)
instead of 1 in kvm_mmu_page_fault().
The callers of kvm_mmu_page_fault() are KVM page fault handlers (i.e.,
npf_interception(), handle_ept_misconfig(), __vmx_handle_ept_violation(),
kvm_handle_page_fault()). They either check if the return value is > 0 (as
in npf_interception()) or pass it further to vcpu_run() to decide whether
to break out of the kernel loop and return to the user when r <= 0.
Therefore, returning any positive value is equivalent to returning 1.
Warn if r == RET_PF_CONTINUE (which should not be a valid value) to ensure
a positive return value.
This is a preparation to allow TDX's EPT violation handler to check the
RET_PF* value and retry internally for RET_PF_RETRY.
No functional changes are intended.
Signed-off-by: Yan Zhao <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
