2021-07-19 19:21:15 +08:00
|
|
|
#include "qemu/osdep.h"
|
2021-10-08 01:56:12 +08:00
|
|
|
#include "monitor/monitor.h"
|
|
|
|
#include "monitor/hmp-target.h"
|
2021-07-19 19:21:15 +08:00
|
|
|
#include "hw/i386/pc.h"
|
|
|
|
#include "hw/i386/sgx-epc.h"
|
2021-10-08 01:56:11 +08:00
|
|
|
#include "qapi/error.h"
|
|
|
|
#include "qapi/qapi-commands-misc-target.h"
|
2021-09-10 18:22:56 +08:00
|
|
|
|
numa: Enable numa for SGX EPC sections
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>
2021-11-02 00:20:05 +08:00
|
|
|
void sgx_epc_build_srat(GArray *table_data)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-10-08 01:56:12 +08:00
|
|
|
SGXInfo *qmp_query_sgx(Error **errp)
|
2021-09-10 18:22:56 +08:00
|
|
|
{
|
|
|
|
error_setg(errp, "SGX support is not compiled in");
|
|
|
|
return NULL;
|
|
|
|
}
|
2021-07-19 19:21:15 +08:00
|
|
|
|
2021-10-08 01:56:11 +08:00
|
|
|
SGXInfo *qmp_query_sgx_capabilities(Error **errp)
|
2021-09-10 18:22:57 +08:00
|
|
|
{
|
|
|
|
error_setg(errp, "SGX support is not compiled in");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2021-10-08 01:56:12 +08:00
|
|
|
void hmp_info_sgx(Monitor *mon, const QDict *qdict)
|
|
|
|
{
|
|
|
|
monitor_printf(mon, "SGX is not available in this QEMU\n");
|
|
|
|
}
|
|
|
|
|
2021-07-19 19:21:15 +08:00
|
|
|
void pc_machine_init_sgx_epc(PCMachineState *pcms)
|
|
|
|
{
|
|
|
|
memset(&pcms->sgx_epc, 0, sizeof(SGXEPCState));
|
|
|
|
}
|
|
|
|
|
2021-10-08 01:56:10 +08:00
|
|
|
bool sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size)
|
2021-07-19 19:21:15 +08:00
|
|
|
{
|
|
|
|
g_assert_not_reached();
|
|
|
|
}
|