[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/7] i386: Add sgx_get_info() interface
From: |
Yang Zhong |
Subject: |
Re: [PATCH 3/7] i386: Add sgx_get_info() interface |
Date: |
Thu, 9 Sep 2021 15:05:03 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Sep 08, 2021 at 10:55:13AM +0200, Paolo Bonzini wrote:
> On 08/09/21 10:19, Yang Zhong wrote:
> >+ if (x86ms->sgx_epc_list) {
> >+ PCMachineState *pcms = PC_MACHINE(ms);
> >+ SGXEPCState *sgx_epc = &pcms->sgx_epc;
> >+ info = g_new0(SGXInfo, 1);
> >+
> >+ info->sgx = true;
> >+ info->sgx1 = true;
> >+ info->sgx2 = true;
> >+ info->flc = true;
>
> Since this is querying the actual machine, it should check the CPUID
> bits of the first CPU, instead of just returning true.
>
Paolo, this interface is only for checking SGX info from VM side by
motinor or QMP tools, the SGXInfo *sgx_get_capabilities(Error **errp)
in the patch5 check the host cpuid info to get the SGX related CPU bit
info, like sgx,flc,sgx1,and sgx2 bit info. so here, if x86ms->sgx_epc_list
is setting, those bits info in the VM side are all ture. thanks!
Yang
> Paolo
- [PATCH 0/7] The HMP/QMP interfaces in Qemu SGX, Yang Zhong, 2021/09/08
- [PATCH 2/7] hmp: Add 'info sgx' command, Yang Zhong, 2021/09/08
- [PATCH 3/7] i386: Add sgx_get_info() interface, Yang Zhong, 2021/09/08
- [PATCH 1/7] qmp: Add query-sgx command, Yang Zhong, 2021/09/08
- [PATCH 4/7] bitops: Support 32 and 64 bit mask macro, Yang Zhong, 2021/09/08
- [PATCH 5/7] qmp: Add the qmp_query_sgx_capabilities(), Yang Zhong, 2021/09/08