[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250818103709.GE3289052@noisy.programming.kicks-ass.net>
Date: Mon, 18 Aug 2025 12:37:09 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Sean Christopherson <seanjc@...gle.com>
Cc: x86@...nel.org, kys@...rosoft.com, haiyangz@...rosoft.com,
wei.liu@...nel.org, decui@...rosoft.com, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
hpa@...or.com, pbonzini@...hat.com, ardb@...nel.org,
kees@...nel.org, Arnd Bergmann <arnd@...db.de>,
gregkh@...uxfoundation.org, jpoimboe@...nel.org,
linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, linux-efi@...r.kernel.org,
samitolvanen@...gle.com, ojeda@...nel.org
Subject: Re: [PATCH v3 07/16] x86/kvm/emulate: Introduce EM_ASM_1SRC2
On Wed, Jul 23, 2025 at 05:16:38PM -0700, Sean Christopherson wrote:
> For all of the KVM patches, please use
>
> KVM: x86:
>
> "x86/kvm" is used for guest-side code, and while I hope no one will conflate this
> with guest code, the consistency is helpful.
Sure.
> On Mon, Jul 14, 2025, Peter Zijlstra wrote:
> > Replace the FASTOP1SRC2*() instructions.
> >
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> > ---
> > arch/x86/kvm/emulate.c | 34 ++++++++++++++++++++++++++--------
> > 1 file changed, 26 insertions(+), 8 deletions(-)
> >
> > --- a/arch/x86/kvm/emulate.c
> > +++ b/arch/x86/kvm/emulate.c
> > @@ -317,6 +317,24 @@ static int em_##op(struct x86_emulate_ct
> > ON64(case 8: __EM_ASM_1(op##q, rax); break;) \
> > EM_ASM_END
> >
> > +/* 1-operand, using "c" (src2) */
> > +#define EM_ASM_1SRC2(op, name) \
> > + EM_ASM_START(name) \
> > + case 1: __EM_ASM_1(op##b, cl); break; \
> > + case 2: __EM_ASM_1(op##w, cx); break; \
> > + case 4: __EM_ASM_1(op##l, ecx); break; \
> > + ON64(case 8: __EM_ASM_1(op##q, rcx); break;) \
> > + EM_ASM_END
> > +
> > +/* 1-operand, using "c" (src2) with exception */
> > +#define EM_ASM_1SRC2EX(op, name) \
> > + EM_ASM_START(name) \
> > + case 1: __EM_ASM_1_EX(op##b, cl); break; \
> > + case 2: __EM_ASM_1_EX(op##w, cx); break; \
> > + case 4: __EM_ASM_1_EX(op##l, ecx); break; \
> > + ON64(case 8: __EM_ASM_1(op##q, rcx); break;) \
>
> This needs to be __EM_ASM_1_EX(). Luckily, KVM-Unit-Tests actually has testcase
> for divq (somewhere in the morass of testcases). I also now have an extension to
> the fastops selftest to explicitly test all four flavors of div-by-zero; I'll get
> it posted tomorrow.
>
> (also, don't also me how long it took me to spot the copy+paste typo; I was full
> on debugging the exception fixup code before I realized my local diff looked
> "odd", *sigh*)
Urgh, sorry about that. Typically I use regex for these things, clearly
I messed up here.
Thanks and fixed!
Powered by blists - more mailing lists