[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABgObfaeYdKeYQb+6j6j6u5ytasgb=t2z03cQvkG2c+owfOCgg@mail.gmail.com>
Date: Fri, 20 Jun 2025 14:03:49 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Xiaoyao Li <xiaoyao.li@...el.com>
Cc: "Kernel Mailing List, Linux" <linux-kernel@...r.kernel.org>, kvm <kvm@...r.kernel.org>,
Sean Christopherson <seanjc@...gle.com>, Rick Edgecombe <rick.p.edgecombe@...el.com>,
"Huang, Kai" <kai.huang@...el.com>, Adrian Hunter <adrian.hunter@...el.com>, reinette.chatre@...el.com,
"Lindgren, Tony" <tony.lindgren@...el.com>, "Yamahata, Isaku" <isaku.yamahata@...el.com>,
Yan Zhao <yan.y.zhao@...el.com>, mikko.ylinen@...ux.intel.com,
"Shutemov, Kirill" <kirill.shutemov@...el.com>, "Yao, Jiewen" <jiewen.yao@...el.com>,
Binbin Wu <binbin.wu@...ux.intel.com>
Subject: Re: [PATCH 3/3] KVM: TDX: Exit to userspace for GetTdVmCallInfo
Il ven 20 giu 2025, 03:21 Xiaoyao Li <xiaoyao.li@...el.com> ha scritto:
>
> > tdx->vp_enter_args.r11 = 0;
> > + tdx->vp_enter_args.r12 = 0;
> > tdx->vp_enter_args.r13 = 0;
> > tdx->vp_enter_args.r14 = 0;
> > + return 1;
>
> Though it looks OK to return all-0 for r12 == 0 and undefined case of
> r12 > 1, I prefer returning TDVMCALL_STATUS_INVALID_OPERAND for
> undefined case.
>From the GHCI I wasn't sure that TDVMCALL_STATUS_INVALID_OPERAND is a
valid result at all.
Paolo
>
> So please make above "case 0:", and make the "default:" return
> TDVMCALL_STATUS_INVALID_OPERAND
>
> > }
> > - return 1;
> > }
> >
> > static int tdx_complete_simple(struct kvm_vcpu *vcpu)
> > diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
> > index 6708bc88ae69..fb3b4cd8d662 100644
> > --- a/include/uapi/linux/kvm.h
> > +++ b/include/uapi/linux/kvm.h
> > @@ -461,6 +461,11 @@ struct kvm_run {
> > __u64 gpa;
> > __u64 size;
> > } get_quote;
> > + struct {
> > + __u64 ret;
> > + __u64 leaf;
> > + __u64 r11, r12, r13, r14;
> > + } get_tdvmcall_info;
> > };
> > } tdx;
> > /* Fix the size of the union. */
>
Powered by blists - more mailing lists