linux-coco.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Wu Zongyo <wuzongyo@mail.ustc.edu.cn>,
	linux-kernel@vger.kernel.org,  kvm@vger.kernel.org,
	x86@kernel.org, linux-coco@lists.linux.dev
Subject: Re: [Question] int3 instruction generates a #UD in SEV VM
Date: Wed, 2 Aug 2023 08:35:12 -0700	[thread overview]
Message-ID: <ZMp3sAQqRlNYqfwr@google.com> (raw)
In-Reply-To: <7b4d5df0-f554-2fc0-5c19-021f8eb3f6aa@amd.com>

On Wed, Aug 02, 2023, Tom Lendacky wrote:
> On 8/2/23 10:04, Sean Christopherson wrote:
> > Side topic, KVM should require nrips for SEV and beyond, I don't see how SEV can
> > possibly work if KVM doesn't utilize nrips.  E.g. this
> > 
> > diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> > index 2eace114a934..43e500503d48 100644
> > --- a/arch/x86/kvm/svm/svm.c
> > +++ b/arch/x86/kvm/svm/svm.c
> > @@ -5111,9 +5111,11 @@ static __init int svm_hardware_setup(void)
> >          svm_adjust_mmio_mask();
> > +       nrips = nrips && boot_cpu_has(X86_FEATURE_NRIPS);
> > +
> >          /*
> >           * Note, SEV setup consumes npt_enabled and enable_mmio_caching (which
> > -        * may be modified by svm_adjust_mmio_mask()).
> > +        * may be modified by svm_adjust_mmio_mask()), as well as nrips.
> >           */
> >          sev_hardware_setup();
> 
> You moved the setting of nrips up, I'm assuming you then want to add a check
> in sev_hardware_setup() for nrips?

Doh.  I like to think I would have noticed that I forgot to add that check before
postinga patch, but I give myself 50/50 odds at best.

  reply	other threads:[~2023-08-02 15:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-29  3:15 [Question] int3 instruction generates a #UD in SEV VM wuzongyong
2023-07-31 14:30 ` Sean Christopherson
2023-07-31 15:03   ` Tom Lendacky
2023-07-31 15:45     ` wuzongyong
2023-08-02 11:56       ` Wu Zongyo
2023-08-02 14:01         ` Sean Christopherson
2023-08-02 14:25           ` Tom Lendacky
2023-08-02 14:33             ` Tom Lendacky
2023-08-02 15:04               ` Sean Christopherson
2023-08-02 15:26                 ` Tom Lendacky
2023-08-02 15:35                   ` Sean Christopherson [this message]
2023-08-02 20:03               ` Tom Lendacky
2023-08-03  3:27                 ` Wu Zongyo
2023-08-03  8:44                   ` Wu Zongyo
2023-08-03 14:34                     ` Sean Christopherson
2023-08-04  2:33                       ` Wu Zongyo

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=ZMp3sAQqRlNYqfwr@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas.lendacky@amd.com \
    --cc=wuzongyo@mail.ustc.edu.cn \
    --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;
as well as URLs for NNTP newsgroup(s).