495e37
From eb88a12ab1ecfe77bcc0d0067c96fce27a3bde01 Mon Sep 17 00:00:00 2001
495e37
From: Yang Zhong <yang.zhong@intel.com>
495e37
Date: Mon, 1 Nov 2021 12:20:08 -0400
495e37
Subject: [PATCH 03/12] doc: Add the SGX numa description
495e37
495e37
RH-Author: Paul Lai <plai@redhat.com>
495e37
RH-MergeRequest: 65: Enable SGX and add SGX Numa support
495e37
RH-Commit: [3/5] c27b3f6976cbe92cc3c0e1dab0191cdd25de596a
495e37
RH-Bugzilla: 2033708
495e37
RH-Acked-by: Paolo Bonzini <None>
495e37
RH-Acked-by: Bandan Das <None>
495e37
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
495e37
495e37
Add the SGX numa reference command and how to check if
495e37
SGX numa is support or not with multiple EPC sections.
495e37
495e37
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
495e37
Message-Id: <20211101162009.62161-5-yang.zhong@intel.com>
495e37
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
495e37
(cherry picked from commit d1889b36098c79e2e6ac90faf3d0dc5ec0057677)
495e37
Signed-off-by: Paul Lai <plai@redhat.com>
495e37
---
495e37
 docs/system/i386/sgx.rst | 31 +++++++++++++++++++++++++++----
495e37
 1 file changed, 27 insertions(+), 4 deletions(-)
495e37
495e37
diff --git a/docs/system/i386/sgx.rst b/docs/system/i386/sgx.rst
495e37
index f8fade5ac2..0f0a73f758 100644
495e37
--- a/docs/system/i386/sgx.rst
495e37
+++ b/docs/system/i386/sgx.rst
495e37
@@ -141,8 +141,7 @@ To launch a SGX guest:
495e37
   |qemu_system_x86| \\
495e37
    -cpu host,+sgx-provisionkey \\
495e37
    -object memory-backend-epc,id=mem1,size=64M,prealloc=on \\
495e37
-   -object memory-backend-epc,id=mem2,size=28M \\
495e37
-   -M sgx-epc.0.memdev=mem1,sgx-epc.1.memdev=mem2
495e37
+   -M sgx-epc.0.memdev=mem1,sgx-epc.0.node=0
495e37
 
495e37
 Utilizing SGX in the guest requires a kernel/OS with SGX support.
495e37
 The support can be determined in guest by::
495e37
@@ -152,8 +151,32 @@ The support can be determined in guest by::
495e37
 and SGX epc info by::
495e37
 
495e37
   $ dmesg | grep sgx
495e37
-  [    1.242142] sgx: EPC section 0x180000000-0x181bfffff
495e37
-  [    1.242319] sgx: EPC section 0x181c00000-0x1837fffff
495e37
+  [    0.182807] sgx: EPC section 0x140000000-0x143ffffff
495e37
+  [    0.183695] sgx: [Firmware Bug]: Unable to map EPC section to online node. Fallback to the NUMA node 0.
495e37
+
495e37
+To launch a SGX numa guest:
495e37
+
495e37
+.. parsed-literal::
495e37
+
495e37
+  |qemu_system_x86| \\
495e37
+   -cpu host,+sgx-provisionkey \\
495e37
+   -object memory-backend-ram,size=2G,host-nodes=0,policy=bind,id=node0 \\
495e37
+   -object memory-backend-epc,id=mem0,size=64M,prealloc=on,host-nodes=0,policy=bind \\
495e37
+   -numa node,nodeid=0,cpus=0-1,memdev=node0 \\
495e37
+   -object memory-backend-ram,size=2G,host-nodes=1,policy=bind,id=node1 \\
495e37
+   -object memory-backend-epc,id=mem1,size=28M,prealloc=on,host-nodes=1,policy=bind \\
495e37
+   -numa node,nodeid=1,cpus=2-3,memdev=node1 \\
495e37
+   -M sgx-epc.0.memdev=mem0,sgx-epc.0.node=0,sgx-epc.1.memdev=mem1,sgx-epc.1.node=1
495e37
+
495e37
+and SGX epc numa info by::
495e37
+
495e37
+  $ dmesg | grep sgx
495e37
+  [    0.369937] sgx: EPC section 0x180000000-0x183ffffff
495e37
+  [    0.370259] sgx: EPC section 0x184000000-0x185bfffff
495e37
+
495e37
+  $ dmesg | grep SRAT
495e37
+  [    0.009981] ACPI: SRAT: Node 0 PXM 0 [mem 0x180000000-0x183ffffff]
495e37
+  [    0.009982] ACPI: SRAT: Node 1 PXM 1 [mem 0x184000000-0x185bfffff]
495e37
 
495e37
 References
495e37
 ----------
495e37
-- 
495e37
2.27.0
495e37