kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Nicholas Krause <xerofoify@gmail.com>, gleb@kernel.org
Cc: kvm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kvm:x86:Fix incorrect error paths in the function process_smi
Date: Fri, 18 Sep 2015 16:52:01 +0200	[thread overview]
Message-ID: <55FC2511.6080406@redhat.com> (raw)
In-Reply-To: <1442587584-8164-1-git-send-email-xerofoify@gmail.com>



On 18/09/2015 16:46, Nicholas Krause wrote:
> This fixes the incorrect assumation that the function
> kvm_vcpu_write_guest always runs successfully and
> therefore checks if it fails by returning a error code
> and if so return immediately to the caller of the function
> process_smi as we cannot this work's intended work after
> this failed call to kvm_vcpu_write_guest.
> 
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
>  arch/x86/kvm/x86.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index a60bdbc..4743a4b 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -6088,7 +6088,8 @@ static void process_smi(struct kvm_vcpu *vcpu)
>  	else
>  		process_smi_save_state_32(vcpu, buf);
>  
> -	kvm_vcpu_write_guest(vcpu, vcpu->arch.smbase + 0xfe00, buf, sizeof(buf));
> +	if (kvm_vcpu_write_guest(vcpu, vcpu->arch.smbase + 0xfe00, buf, sizeof(buf)))
> +		return;
>  
>  	if (kvm_x86_ops->get_nmi_mask(vcpu))
>  		vcpu->arch.hflags |= HF_SMM_INSIDE_NMI_MASK;
> 

The SMI was requested by the guest.  If the guest failed to set up SMM
correctly, it's the guest's problem.  Aborting the SMI does not match
what a real processor does.

Thanks,

Paolo

           reply	other threads:[~2015-09-18 14:52 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1442587584-8164-1-git-send-email-xerofoify@gmail.com>]

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=55FC2511.6080406@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=gleb@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    --cc=xerofoify@gmail.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).