From: Yang Zhong <yang.zhong@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: yang.zhong@intel.com, seanjc@google.com, kai.huang@intel.com,
qemu-devel@nongnu.org, jarkko@kernel.org, eblake@redhat.com
Subject: Re: [PATCH v3 05/33] vl: Add sgx compound properties to expose SGX EPC sections to guest
Date: Mon, 12 Jul 2021 17:23:31 +0800 [thread overview]
Message-ID: <20210712092331.GB8378@yangzhon-Virtual> (raw)
In-Reply-To: <a14c4d43-f197-a25e-bf53-01489427c792@redhat.com>
On Fri, Jul 09, 2021 at 06:07:13PM +0200, Paolo Bonzini wrote:
> On 09/07/21 13:09, Yang Zhong wrote:
> >+ sgx_epc = g_malloc0(sizeof(*sgx_epc));
> >+ pcms->sgx_epc = sgx_epc;
> >+
>
> No need to malloc this, it's small.
>
Thanks Paolo, i will use g_new0() to replace this malloc, thanks!
Yang
> > }
> >+##
> >+# @SgxEPC:
> >+#
> >+# Sgx EPC cmdline information
> >+#
> >+# @id: device's ID
> >+#
> >+# @memdev: memory backend linked with device
> >+#
> >+# Since: 6.1
> >+##
> >+{ 'struct': 'SgxEPC',
> >+ 'data': { 'id': [ 'str' ],
> >+ 'memdev': [ 'str' ]
> >+ }
> >+}
>
> Is the "id" needed at all? If not, you can make the property just a
> string list.
>
The current "id" is only shown in 'info memory-devices" command in the
monitor.
qemu) info memory-devices
Memory device [sgx-epc]: "epc1"
memaddr: 0x180000000
size: 29360128
memdev: /objects/mem1
Memory device [sgx-epc]: "epc2"
memaddr: 0x181c00000
size: 10485760
memdev: /objects/mem2
If this "id" is not MUST, i can remove this. thanks!
> If not, you should still make the property a list, and SgxEPC can be
> just the id/memdev pair.
>
The SGX EPC will support NUMA function,
-object memory-backend-ram,size=2G,host-nodes=0,policy=bind,id=node0 \
-object memory-backend-epc,id=mem0,size=100M \
-sgx-epc id=epc0,memdev=mem0,node=0 \
-numa node,nodeid=0,cpus=0-1,memdev=node0 \
Sorry this is older command style, i will change this to compound
property in the NUMA patchset.
So, the SgxEPC struct still needed even i removed 'id'.
> Also please place the compound property in PCMachineState, not in
> MachineState. You can call the field something else than sgx_epc to
> avoid conflicts with the SGXEPCState, for example sgx_epc_memdevs or
> sgx_epc_backends. Later it can be moved to X86MachineState if
> needed, but in any case it should not be in common
> target-independent code.
>
Yes, i will directly move compound property get/set from MachineState
to X86MachineState and change the sgx_epc to sgx_epc_backends to avoid
conflicts(In fact, i have done this and it works well). Thanks!
Yang
> Paolo
next prev parent reply other threads:[~2021-07-12 9:37 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-09 11:09 [PATCH v3 00/33] Qemu SGX virtualization Yang Zhong
2021-07-09 11:09 ` [PATCH v3 01/33] memory: Add RAM_PROTECTED flag to skip IOMMU mappings Yang Zhong
2021-07-09 11:09 ` [PATCH v3 02/33] hostmem: Add hostmem-epc as a backend for SGX EPC Yang Zhong
2021-07-09 11:09 ` [PATCH v3 03/33] qom: Add memory-backend-epc ObjectOptions support Yang Zhong
2021-07-09 11:09 ` [PATCH v3 04/33] i386: Add 'sgx-epc' device to expose EPC sections to guest Yang Zhong
2021-07-09 11:09 ` [PATCH v3 05/33] vl: Add sgx compound properties to expose SGX " Yang Zhong
2021-07-09 16:07 ` Paolo Bonzini
2021-07-12 9:23 ` Yang Zhong [this message]
2021-07-09 11:09 ` [PATCH v3 06/33] i386: Add primary SGX CPUID and MSR defines Yang Zhong
2021-07-09 11:09 ` [PATCH v3 07/33] i386: Add SGX CPUID leaf FEAT_SGX_12_0_EAX Yang Zhong
2021-07-09 11:09 ` [PATCH v3 08/33] i386: Add SGX CPUID leaf FEAT_SGX_12_0_EBX Yang Zhong
2021-07-09 11:09 ` [PATCH v3 09/33] i386: Add SGX CPUID leaf FEAT_SGX_12_1_EAX Yang Zhong
2021-07-09 11:09 ` [PATCH v3 10/33] i386: Add get/set/migrate support for SGX_LEPUBKEYHASH MSRs Yang Zhong
2021-07-09 11:09 ` [PATCH v3 11/33] i386: Add feature control MSR dependency when SGX is enabled Yang Zhong
2021-07-09 11:09 ` [PATCH v3 12/33] i386: Update SGX CPUID info according to hardware/KVM/user input Yang Zhong
2021-07-09 11:09 ` [PATCH v3 13/33] i386: kvm: Add support for exposing PROVISIONKEY to guest Yang Zhong
2021-07-09 11:09 ` [PATCH v3 14/33] i386: Propagate SGX CPUID sub-leafs to KVM Yang Zhong
2021-07-09 11:09 ` [PATCH v3 15/33] Adjust min CPUID level to 0x12 when SGX is enabled Yang Zhong
2021-07-09 11:09 ` [PATCH v3 16/33] hw/i386/fw_cfg: Set SGX bits in feature control fw_cfg accordingly Yang Zhong
2021-07-09 11:09 ` [PATCH v3 17/33] hw/i386/pc: Account for SGX EPC sections when calculating device memory Yang Zhong
2021-07-09 11:09 ` [PATCH v3 18/33] i386/pc: Add e820 entry for SGX EPC section(s) Yang Zhong
2021-07-09 11:09 ` [PATCH v3 19/33] i386: acpi: Add SGX EPC entry to ACPI tables Yang Zhong
2021-07-09 11:09 ` [PATCH v3 20/33] q35: Add support for SGX EPC Yang Zhong
2021-07-09 11:09 ` [PATCH v3 21/33] i440fx: " Yang Zhong
2021-07-09 11:09 ` [PATCH v3 22/33] hostmem-epc: Add the reset interface for EPC backend reset Yang Zhong
2021-07-09 11:09 ` [PATCH v3 23/33] sgx-epc: Add the reset interface for sgx-epc virt device Yang Zhong
2021-07-09 11:09 ` [PATCH v3 24/33] sgx-epc: Avoid bios reset during sgx epc initialization Yang Zhong
2021-07-09 11:09 ` [PATCH v3 25/33] hostmem-epc: Make prealloc consistent with qemu cmdline during reset Yang Zhong
2021-07-09 11:09 ` [PATCH v3 26/33] qmp: Add query-sgx command Yang Zhong
2021-07-09 11:09 ` [PATCH v3 27/33] hmp: Add 'info sgx' command Yang Zhong
2021-07-09 11:09 ` [PATCH v3 28/33] i386: Add sgx_get_info() interface Yang Zhong
2021-07-09 11:09 ` [PATCH v3 29/33] bitops: Support 32 and 64 bit mask macro Yang Zhong
2021-07-09 11:09 ` [PATCH v3 30/33] qmp: Add the qmp_query_sgx_capabilities() Yang Zhong
2021-07-09 11:09 ` [PATCH v3 31/33] Kconfig: Add CONFIG_SGX support Yang Zhong
2021-07-09 11:09 ` [PATCH v3 32/33] sgx-epc: Add the fill_device_info() callback support Yang Zhong
2021-07-09 11:09 ` [PATCH v3 33/33] doc: Add the SGX doc Yang Zhong
2021-07-09 17:48 ` [PATCH v3 00/33] Qemu SGX virtualization Jarkko Sakkinen
2021-07-12 6:57 ` Yang Zhong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210712092331.GB8378@yangzhon-Virtual \
--to=yang.zhong@intel.com \
--cc=eblake@redhat.com \
--cc=jarkko@kernel.org \
--cc=kai.huang@intel.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=seanjc@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).