[libvirt][PATCH v4 3/4] qemu: Add command-line to enable SGX

Huang, Haibin haibin.huang at intel.com
Fri Jul 9 00:34:47 UTC 2021



> -----Original Message-----
> From: Tim Wiederhake <twiederh at redhat.com>
> Sent: Monday, July 5, 2021 7:32 PM
> To: Huang, Haibin <haibin.huang at intel.com>
> Cc: libvir-list at redhat.com; Ding, Jian-feng <jian-feng.ding at intel.com>; Yang,
> Lin A <lin.a.yang at intel.com>; Lu, Lianhao <lianhao.lu at intel.com>
> Subject: Re: [libvirt][PATCH v4 3/4] qemu: Add command-line to enable SGX
> 
> On Thu, 2021-07-01 at 20:10 +0800, Haibin Huang wrote:
> > From: Lin Yang <lin.a.yang at intel.com>
> >
> > If SGX is defined in domain, add the argument to enable SGX in -cpu
> > <model>:
[Haibin] we will delete those fixed cpu feature, let user to use <feature> in domain definition to control it.
> >
> >     -cpu <model>,+sgx,+sgx-debug,+sgx1,+sgx-encls-c,
> >     +sgx-enclv,+sgx-exinfo,+sgx-kss,+sgx-mode64,
> >     +sgx-provisionkey,+sgx-tokenkey,+sgx2,+sgxlc
> > ---
> >  src/qemu/qemu_command.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index
> > 2c3785886c..fb05acbc94 100644
> > --- a/src/qemu/qemu_command.c
> > +++ b/src/qemu/qemu_command.c
> > @@ -6405,6 +6405,12 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr
> > driver,
> >
> >      case VIR_CPU_MODE_CUSTOM:
> >          virBufferAdd(buf, cpu->model, -1);
> > +        if(def->sgx)
> 
> Space between "if" and "(".
[Haibin] ok
> 
> Regards,
> Tim
> 
> > +            virBufferAdd(buf,
> > +                         ",+sgx,+sgx-debug,+sgx1,+sgx-encls-c,+sgx-
> > enclv,+sgx-exinfo,"
> > +                         "+sgx-kss,+sgx-mode64,+sgx-
> > provisionkey,+sgx-tokenkey,+sgx2,"
> > +                         "+sgxlc",
> > +                         -1);
> >          break;
> >
> >      case VIR_CPU_MODE_LAST:
> 





More information about the libvir-list mailing list