kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Roman Pen <roman.penyaev@profitbricks.com>
Cc: "Mikhail Sennikovskii" <mikhail.sennikovskii@profitbricks.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] KVM: SVM: do not zero out segment attributes if segment is unusable or not present
Date: Thu, 1 Jun 2017 11:22:00 +0200	[thread overview]
Message-ID: <16c1d0ed-2c05-d5e1-4540-b862aed660ab@redhat.com> (raw)
In-Reply-To: <20170601085503.12852-1-roman.penyaev@profitbricks.com>



On 01/06/2017 10:55, Roman Pen wrote:
> This is a fix for the problem [1], where VMCB.CPL was set to 0 and interrupt
> was taken on userspace stack.  The root cause lies in the specific AMD CPU
> behaviour which manifests itself as unusable segment attributes on SYSRET.
> The corresponding work around for the kernel is the following:
> 
> 61f01dd941ba ("x86_64, asm: Work around AMD SYSRET SS descriptor attribute issue")
> 
> In other turn virtualization side treated unusable segment incorrectly and
> restored CPL from SS attributes, which were zeroed out few lines above.
> 
> In current patch it is assured only that P bit is cleared in VMCB.save state
> and segment attributes are not zeroed out if segment is not presented or is
> unusable, therefore CPL can be safely restored from DPL field.
> 
> This is only one part of the fix, since QEMU side should be fixed accordingly
> not to zero out attributes on its side.  Corresponding patch will follow.
> 
> [1] Message id: CAJrWOzD6Xq==b-zYCDdFLgSRMPM-NkNuTSDFEtX=7MreT45i7Q@mail.gmail.com
> 
> Signed-off-by: Roman Pen <roman.penyaev@profitbricks.com>
> Signed-off-by: Mikhail Sennikovskii <mikhail.sennikovskii@profitbricks.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Radim Krčmář <rkrcmar@redhat.com>
> Cc: kvm@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  arch/x86/kvm/svm.c | 24 +++++++++++-------------
>  1 file changed, 11 insertions(+), 13 deletions(-)

Queued, thanks!

Paolo

      reply	other threads:[~2017-06-01  9:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-01  8:55 [PATCH 1/1] KVM: SVM: do not zero out segment attributes if segment is unusable or not present Roman Pen
2017-06-01  9:22 ` Paolo Bonzini [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=16c1d0ed-2c05-d5e1-4540-b862aed660ab@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikhail.sennikovskii@profitbricks.com \
    --cc=rkrcmar@redhat.com \
    --cc=roman.penyaev@profitbricks.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).