Re: [PATCH v4 6/6] KVM: x86: Refactor __kvm_emulate_hypercall() into a macro
From: Sean Christopherson
Date: Tue Dec 10 2024 - 15:10:24 EST
On Tue, Dec 10, 2024, Paolo Bonzini wrote:
> On 11/28/24 01:43, Sean Christopherson wrote:
> > +#define __kvm_emulate_hypercall(_vcpu, nr, a0, a1, a2, a3, op_64_bit, cpl, complete_hypercall) \
> > +({ \
> > + int __ret; \
> > + \
> > + __ret = ____kvm_emulate_hypercall(_vcpu, \
> > + kvm_##nr##_read(_vcpu), kvm_##a0##_read(_vcpu), \
> > + kvm_##a1##_read(_vcpu), kvm_##a2##_read(_vcpu), \
> > + kvm_##a3##_read(_vcpu), op_64_bit, cpl, \
> > + complete_hypercall); \
> > + \
> > + if (__ret > 0) \
> > + complete_hypercall(_vcpu); \
>
> So based on the review of the previous patch this should become
>
> __ret = complete_hypercall(_vcpu);
>
> Applied with this change to kvm-coco-queue, thanks.
I was planning on applying this for 6.14. Should I still do that, or do you want
to take the bulk of the series through kvm/next, or maybe let it set in
kvm-coco-queue? I can't think of any potential conflicts off the top of my head,
and the refactoring is really only useful for TDX.
Patch 1 should go in sooner than later though.