All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Peter Krempa <pkrempa@redhat.com>
Cc: Yang Zhong <yang.zhong@intel.com>, qemu-devel@nongnu.org
Subject: Re: [PULL 10/13] numa: Enable numa for SGX EPC sections
Date: Thu, 13 Jan 2022 16:16:35 +0000	[thread overview]
Message-ID: <YeBQYy0P9y6ipDVY@redhat.com> (raw)
In-Reply-To: <20211215202515.91586-11-pbonzini@redhat.com>

On Wed, Dec 15, 2021 at 09:25:12PM +0100, Paolo Bonzini wrote:
> From: Yang Zhong <yang.zhong@intel.com>
> 
> The basic SGX did not enable numa for SGX EPC sections, which
> result in all EPC sections located in numa node 0. This patch
> enable SGX numa function in the guest and the EPC section can
> work with RAM as one numa node.
> 
> The Guest kernel related log:
> [    0.009981] ACPI: SRAT: Node 0 PXM 0 [mem 0x180000000-0x183ffffff]
> [    0.009982] ACPI: SRAT: Node 1 PXM 1 [mem 0x184000000-0x185bfffff]
> The SRAT table can normally show SGX EPC sections menory info in different
> numa nodes.
> 
> The SGX EPC numa related command:
>  ......
>  -m 4G,maxmem=20G \
>  -smp sockets=2,cores=2 \
>  -cpu host,+sgx-provisionkey \
>  -object memory-backend-ram,size=2G,host-nodes=0,policy=bind,id=node0 \
>  -object memory-backend-epc,id=mem0,size=64M,prealloc=on,host-nodes=0,policy=bind \
>  -numa node,nodeid=0,cpus=0-1,memdev=node0 \
>  -object memory-backend-ram,size=2G,host-nodes=1,policy=bind,id=node1 \
>  -object memory-backend-epc,id=mem1,size=28M,prealloc=on,host-nodes=1,policy=bind \
>  -numa node,nodeid=1,cpus=2-3,memdev=node1 \
>  -M sgx-epc.0.memdev=mem0,sgx-epc.0.node=0,sgx-epc.1.memdev=mem1,sgx-epc.1.node=1 \
>  ......
> 
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> Message-Id: <20211101162009.62161-2-yang.zhong@intel.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/core/numa.c            |  5 ++---
>  hw/i386/acpi-build.c      |  2 ++
>  hw/i386/sgx-epc.c         |  3 +++
>  hw/i386/sgx-stub.c        |  4 ++++
>  hw/i386/sgx.c             | 44 +++++++++++++++++++++++++++++++++++++++
>  include/hw/i386/sgx-epc.h |  3 +++
>  monitor/hmp-cmds.c        |  1 +
>  qapi/machine.json         | 10 ++++++++-
>  qemu-options.hx           |  4 ++--
>  9 files changed, 70 insertions(+), 6 deletions(-)

> diff --git a/qapi/machine.json b/qapi/machine.json
> index f1839acf20..edeab6084b 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -1207,12 +1207,15 @@
>  #
>  # @memdev: memory backend linked with device
>  #
> +# @node: the numa node

This needs a "(Since: 7.0)" annotation

> +#
>  # Since: 6.2
>  ##
>  { 'struct': 'SgxEPCDeviceInfo',
>    'data': { '*id': 'str',
>              'memaddr': 'size',
>              'size': 'size',
> +            'node': 'int',
>              'memdev': 'str'
>            }
>  }
> @@ -1285,10 +1288,15 @@
>  #
>  # @memdev: memory backend linked with device
>  #
> +# @node: the numa node

Likewise

> +#
>  # Since: 6.2
>  ##
>  { 'struct': 'SgxEPC',
> -  'data': { 'memdev': 'str' } }
> +  'data': { 'memdev': 'str',
> +            'node': 'int'
> +          }
> +}
>  

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2022-01-13 16:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15 20:25 [PULL 00/13] Misc patches for 2021-12-15 Paolo Bonzini
2021-12-15 20:25 ` [PULL 01/13] hw/scsi/lsi53c895a: Do not abort when DMA requested and no data queued Paolo Bonzini
2021-12-15 20:25 ` [PULL 02/13] tests/qtest: Add fuzz-lsi53c895a-test Paolo Bonzini
2021-12-15 20:25 ` [PULL 03/13] qapi/machine.json: Fix incorrect description for die-id Paolo Bonzini
2021-12-15 20:25 ` [PULL 04/13] scripts/entitlement.sh: Use backward-compatible cp flags Paolo Bonzini
2021-12-15 20:25 ` [PULL 05/13] virtio-gpu: do not byteswap padding Paolo Bonzini
2021-12-15 20:25 ` [PULL 06/13] linux-headers: update to 5.16-rc1 Paolo Bonzini
2021-12-15 20:25 ` [PULL 07/13] gdbstub: reject unsupported flags in handle_set_qemu_sstep Paolo Bonzini
2021-12-15 20:25 ` [PULL 08/13] gdbstub, kvm: let KVM report supported singlestep flags Paolo Bonzini
2021-12-15 20:25 ` [PULL 09/13] kvm: add support for KVM_GUESTDBG_BLOCKIRQ Paolo Bonzini
2021-12-15 20:25 ` [PULL 10/13] numa: Enable numa for SGX EPC sections Paolo Bonzini
2022-01-13 16:16   ` Daniel P. Berrangé [this message]
2021-12-15 20:25 ` [PULL 11/13] numa: Support SGX numa in the monitor and Libvirt interfaces Paolo Bonzini
2022-01-13 16:15   ` Daniel P. Berrangé
2022-01-17 10:37     ` Yang Zhong
2022-01-19  9:19       ` Daniel P. Berrangé
2021-12-15 20:25 ` [PULL 12/13] doc: Add the SGX numa description Paolo Bonzini
2021-12-15 20:25 ` [PULL 13/13] configure: remove dead variables Paolo Bonzini
2021-12-16 18:19 ` [PULL 00/13] Misc patches for 2021-12-15 Richard Henderson

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=YeBQYy0P9y6ipDVY@redhat.com \
    --to=berrange@redhat.com \
    --cc=armbru@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pkrempa@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yang.zhong@intel.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 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.