* [PATCH] KVM/x86: fix comment that should be user fault
@ 2023-02-23 14:21 Quanfa Fu
2023-02-23 15:52 ` Sean Christopherson
0 siblings, 1 reply; 2+ messages in thread
From: Quanfa Fu @ 2023-02-23 14:21 UTC (permalink / raw)
To: seanjc, pbonzini, tglx, mingo, bp, dave.hansen, hpa
Cc: x86, kvm, linux-kernel, Quanfa Fu
The content of comment should be user fault not read. In order to avoid
confusion, fix the comment.
Signed-off-by: Quanfa Fu <quanfafu@gmail.com>
---
arch/x86/kvm/vmx/vmx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 7eec0226d56a..3c1012039517 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -5668,7 +5668,7 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu)
gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS);
trace_kvm_page_fault(vcpu, gpa, exit_qualification);
- /* Is it a read fault? */
+ /* Is it a user fault? */
error_code = (exit_qualification & EPT_VIOLATION_ACC_READ)
? PFERR_USER_MASK : 0;
/* Is it a write fault? */
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM/x86: fix comment that should be user fault
2023-02-23 14:21 [PATCH] KVM/x86: fix comment that should be user fault Quanfa Fu
@ 2023-02-23 15:52 ` Sean Christopherson
0 siblings, 0 replies; 2+ messages in thread
From: Sean Christopherson @ 2023-02-23 15:52 UTC (permalink / raw)
To: Quanfa Fu
Cc: pbonzini, tglx, mingo, bp, dave.hansen, hpa, x86, kvm,
linux-kernel
On Thu, Feb 23, 2023, Quanfa Fu wrote:
> The content of comment should be user fault not read. In order to avoid
> confusion, fix the comment.
No, the existing comment is correct. Ignoring optional extensions, EPT doesn't
differntiate between Supervisor and User, but does support !READABLE mappings.
And so KVM piggybacks PFERR_USER_MASK to track whether or not an EPT fault occurred
on a read access.
>
> Signed-off-by: Quanfa Fu <quanfafu@gmail.com>
> ---
> arch/x86/kvm/vmx/vmx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index 7eec0226d56a..3c1012039517 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -5668,7 +5668,7 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu)
> gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS);
> trace_kvm_page_fault(vcpu, gpa, exit_qualification);
>
> - /* Is it a read fault? */
> + /* Is it a user fault? */
> error_code = (exit_qualification & EPT_VIOLATION_ACC_READ)
> ? PFERR_USER_MASK : 0;
> /* Is it a write fault? */
> --
> 2.31.1
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-23 15:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-23 14:21 [PATCH] KVM/x86: fix comment that should be user fault Quanfa Fu
2023-02-23 15:52 ` Sean Christopherson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).