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