linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: Sean Christopherson <sean.j.christopherson@intel.com>,
	Alexander Graf <graf@amazon.com>
Subject: Re: [PATCH 1/3] KVM: x86: remove bogus #GP injection
Date: Mon, 14 Dec 2020 14:50:44 -0600	[thread overview]
Message-ID: <22ca8895-31cc-b851-b3ae-f6362bc78978@amd.com> (raw)
In-Reply-To: <20201214183250.1034541-2-pbonzini@redhat.com>

On 12/14/20 12:32 PM, Paolo Bonzini wrote:
> There is no need to inject a #GP from kvm_mtrr_set_msr, kvm_emulate_wrmsr will
> handle it.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>

> ---
>  arch/x86/kvm/mtrr.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/arch/x86/kvm/mtrr.c b/arch/x86/kvm/mtrr.c
> index 7f0059aa30e1..f472fdb6ae7e 100644
> --- a/arch/x86/kvm/mtrr.c
> +++ b/arch/x86/kvm/mtrr.c
> @@ -84,12 +84,8 @@ bool kvm_mtrr_valid(struct kvm_vcpu *vcpu, u32 msr, u64 data)
>  	} else
>  		/* MTRR mask */
>  		mask |= 0x7ff;
> -	if (data & mask) {
> -		kvm_inject_gp(vcpu, 0);
> -		return false;
> -	}
>  
> -	return true;
> +	return (data & mask) == 0;
>  }
>  EXPORT_SYMBOL_GPL(kvm_mtrr_valid);
>  
> 

  reply	other threads:[~2020-12-14 20:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14 18:32 [PATCH 0/3] KVM: x86: MSR completion refactoring for SEV-ES Paolo Bonzini
2020-12-14 18:32 ` [PATCH 1/3] KVM: x86: remove bogus #GP injection Paolo Bonzini
2020-12-14 20:50   ` Tom Lendacky [this message]
2020-12-14 18:32 ` [PATCH 2/3] KVM: x86: use kvm_complete_insn_gp in emulating RDMSR/WRMSR Paolo Bonzini
2020-12-14 20:52   ` Tom Lendacky
2020-12-14 18:32 ` [PATCH 3/3] KVM: x86: introduce complete_emulated_msr callback Paolo Bonzini
2020-12-14 20:55   ` Tom Lendacky
2020-12-15 10:23     ` Paolo Bonzini

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=22ca8895-31cc-b851-b3ae-f6362bc78978@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=graf@amazon.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).