[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZMp3sAQqRlNYqfwr@google.com>
Date: Wed, 2 Aug 2023 08:35:12 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Tom Lendacky <thomas.lendacky@....com>
Cc: Wu Zongyo <wuzongyo@...l.ustc.edu.cn>,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org, x86@...nel.org,
linux-coco@...ts.linux.dev
Subject: Re: [Question] int3 instruction generates a #UD in SEV VM
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.
Powered by blists - more mailing lists