From: Yang Zhong <yang.zhong@intel.com>
To: "Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: "Eduardo Habkost" <eduardo@habkost.net>,
yang.zhong@intel.com, "Michael S. Tsirkin" <mst@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
qemu-devel@nongnu.org
Subject: Re: [RFC PATCH 2/2] hw/i386/sgx: Attach SGX-EPC to its memory backend
Date: Tue, 18 Jan 2022 10:33:12 +0800 [thread overview]
Message-ID: <20220118023312.GA22498@yangzhon-Virtual> (raw)
In-Reply-To: <c1a8eba5-b1a1-bbcf-c237-23e16ce88475@redhat.com>
On Mon, Jan 17, 2022 at 12:48:10PM +0100, Paolo Bonzini wrote:
> On 1/17/22 00:53, Philippe Mathieu-Daudé via wrote:
> >We have one SGX-EPC address/size/node per memory backend,
> >make it child of the backend in the QOM composition tree.
> >
> >Cc: Yang Zhong <yang.zhong@intel.com>
> >Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> >---
> > hw/i386/sgx.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> >diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c
> >index 5de5dd08936..6362e5e9d02 100644
> >--- a/hw/i386/sgx.c
> >+++ b/hw/i386/sgx.c
> >@@ -300,6 +300,9 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms)
> > /* set the memdev link with memory backend */
> > object_property_parse(obj, SGX_EPC_MEMDEV_PROP, list->value->memdev,
> > &error_fatal);
> >+ object_property_add_child(OBJECT(list->value->memdev), "sgx-epc",
> >+ OBJECT(obj));
> >+
> > /* set the numa node property for sgx epc object */
> > object_property_set_uint(obj, SGX_EPC_NUMA_NODE_PROP, list->value->node,
> > &error_fatal);
>
> I don't think this is a good idea; only list->value->memdev should
> add something below itself in the tree.
>
> However, I think obj can be added under the machine itself as
> /machine/sgx-epc-device[*].
>
Thanks Philippe, calling object_property_add_child() in the hw/i386/sgx.c is more
reasonable than in device_set_realized(), thanks!
Yang
> Paolo
next prev parent reply other threads:[~2022-01-18 2:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-16 23:53 [PATCH 0/2] hw/i386: QOM-attach CPUs/SGX-EPC objects to their parents Philippe Mathieu-Daudé via
2022-01-16 23:53 ` [PATCH 1/2] hw/i386/x86: Attach CPUs to machine Philippe Mathieu-Daudé via
2022-01-17 13:48 ` Daniel P. Berrangé
2022-01-17 14:57 ` Philippe Mathieu-Daudé via
2022-01-18 2:15 ` Yang Zhong
2022-01-16 23:53 ` [RFC PATCH 2/2] hw/i386/sgx: Attach SGX-EPC to its memory backend Philippe Mathieu-Daudé via
2022-01-17 11:48 ` Paolo Bonzini
2022-01-17 12:08 ` Philippe Mathieu-Daudé via
2022-01-18 2:33 ` Yang Zhong [this message]
2022-01-23 12:52 ` Yang Zhong
2022-01-31 23:41 ` Philippe Mathieu-Daudé via
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=20220118023312.GA22498@yangzhon-Virtual \
--to=yang.zhong@intel.com \
--cc=eduardo@habkost.net \
--cc=f4bug@amsat.org \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.