numa: Support SGX numa in the monitor and Libvirt interfaces
commit4755927ae12547c2e7cb22c5fa1b39038c6c11b1
authorYang Zhong <yang.zhong@intel.com>
Mon, 1 Nov 2021 16:20:07 +0000 (1 12:20 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 10 Dec 2021 08:47:18 +0000 (10 09:47 +0100)
treef56310d88bf335222209ba36a7a369d2a77e7c47
parent1105812382e1126d86dddc16b3700f8c79dc93d1
numa: Support SGX numa in the monitor and Libvirt interfaces

Add the SGXEPCSection list into SGXInfo to show the multiple
SGX EPC sections detailed info, not the total size like before.
This patch can enable numa support for 'info sgx' command and
QMP interfaces. The new interfaces show each EPC section info
in one numa node. Libvirt can use QMP interface to get the
detailed host SGX EPC capabilities to decide how to allocate
host EPC sections to guest.

(qemu) info sgx
 SGX support: enabled
 SGX1 support: enabled
 SGX2 support: enabled
 FLC support: enabled
 NUMA node #0: size=67108864
 NUMA node #1: size=29360128

The QMP interface show:
(QEMU) query-sgx
{"return": {"sgx": true, "sgx2": true, "sgx1": true, "sections": \
[{"node": 0, "size": 67108864}, {"node": 1, "size": 29360128}], "flc": true}}

(QEMU) query-sgx-capabilities
{"return": {"sgx": true, "sgx2": true, "sgx1": true, "sections": \
[{"node": 0, "size": 17070817280}, {"node": 1, "size": 17079205888}], "flc": true}}

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Message-Id: <20211101162009.62161-4-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/i386/sgx.c
qapi/misc-target.json