public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Quanfa Fu <quanfafu@gmail.com>
Cc: pbonzini@redhat.com, tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com,
	x86@kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM/x86: fix comment that should be user fault
Date: Thu, 23 Feb 2023 07:52:23 -0800	[thread overview]
Message-ID: <Y/eLt4kqKh0G7kKd@google.com> (raw)
In-Reply-To: <20230223142130.2338972-1-quanfafu@gmail.com>

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
> 
> 

      reply	other threads:[~2023-02-23 15:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y/eLt4kqKh0G7kKd@google.com \
    --to=seanjc@google.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=quanfafu@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox