[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGtprH9n10JgKAR1ims-KJSG0ehOkqYR5EWx7MNZne7MXnAsPg@mail.gmail.com>
Date: Mon, 26 Sep 2022 16:37:26 -0700
From: Vishal Annapurve <vannapurve@...gle.com>
To: David Matlack <dmatlack@...gle.com>
Cc: x86 <x86@...nel.org>, kvm list <kvm@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-kselftest@...r.kernel.org,
Paolo Bonzini <pbonzini@...hat.com>, shuah <shuah@...nel.org>,
Ben Gardon <bgardon@...gle.com>,
Sean Christopherson <seanjc@...gle.com>,
Oliver Upton <oupton@...gle.com>, peterx@...hat.com,
Vitaly Kuznetsov <vkuznets@...hat.com>
Subject: Re: [V2 PATCH 8/8] KVM: selftests: x86: xen: Execute cpu specific
vmcall instruction
On Wed, Sep 21, 2022 at 2:47 PM David Matlack <dmatlack@...gle.com> wrote:
>
> On Thu, Sep 15, 2022 at 12:04:48AM +0000, Vishal Annapurve wrote:
> > Update xen specific hypercall invocation to execute cpu specific vmcall
> > instructions.
> >
> > Suggested-by: Sean Christopherson <seanjc@...gle.com>
> > Signed-off-by: Vishal Annapurve <vannapurve@...gle.com>
> > ---
> > .../selftests/kvm/x86_64/xen_shinfo_test.c | 64 +++++++------------
> > .../selftests/kvm/x86_64/xen_vmcall_test.c | 14 ++--
> > 2 files changed, 34 insertions(+), 44 deletions(-)
> > ...
> > diff --git a/tools/testing/selftests/kvm/x86_64/xen_vmcall_test.c b/tools/testing/selftests/kvm/x86_64/xen_vmcall_test.c
> > index 88914d48c65e..e78f1b5d3af8 100644
> > --- a/tools/testing/selftests/kvm/x86_64/xen_vmcall_test.c
> > +++ b/tools/testing/selftests/kvm/x86_64/xen_vmcall_test.c
> > @@ -37,10 +37,16 @@ static void guest_code(void)
> > register unsigned long r9 __asm__("r9") = ARGVALUE(6);
> >
> > /* First a direct invocation of 'vmcall' */
> > - __asm__ __volatile__("vmcall" :
> > - "=a"(rax) :
> > - "a"(rax), "D"(rdi), "S"(rsi), "d"(rdx),
> > - "r"(r10), "r"(r8), "r"(r9));
> > + if (is_amd_cpu())
> > + __asm__ __volatile__("vmmcall" :
> > + "=a"(rax) :
> > + "a"(rax), "D"(rdi), "S"(rsi), "d"(rdx),
> > + "r"(r10), "r"(r8), "r"(r9));
> > + else
> > + __asm__ __volatile__("vmcall" :
> > + "=a"(rax) :
> > + "a"(rax), "D"(rdi), "S"(rsi), "d"(rdx),
> > + "r"(r10), "r"(r8), "r"(r9));
>
> Can we create common helper functions or macros for doing hypercalls to
> reduce the amount of duplicated inline assembly?
>
Ack, will fix this in the next series.
> > GUEST_ASSERT(rax == RETVALUE);
> >
> > /* Fill in the Xen hypercall page */
> > --
> > 2.37.2.789.g6183377224-goog
> >
Powered by blists - more mailing lists