<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">On 2/22/22, 1:19 AM, "Michal Prívozník" <mprivozn@redhat.com> wrote:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> On 2/16/22 11:25, Michal Prívozník wrote:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> diff --git a/tests/qemuxml2argvdata/sgx-epc.x86_64-6.2.0.args b/tests/qemuxml2argvdata/sgx-epc.x86_64-6.2.0.args<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> new file mode 100644<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> index 0000000000..e1aa274054<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> --- /dev/null<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +++ b/tests/qemuxml2argvdata/sgx-epc.x86_64-6.2.0.args<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> @@ -0,0 +1,38 @@<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +LC_ALL=C \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +PATH=/bin \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +HOME=/tmp/lib/domain--1-QEMUGuest1 \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +USER=test \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +LOGNAME=test \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +/usr/bin/qemu-system-x86_64 \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +-name guest=QEMUGuest1,debug-threads=on \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +-S \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +-machine pc-q35-6.2,usb=off,dump-guest-core=off,memory-backend=pc.ram \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +-accel tcg \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +-cpu qemu64 \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +-m 134 \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":140509184}' \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +-overcommit mem-lock=off \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +-smp 1,sockets=1,cores=1,threads=1 \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +-object '{"qom-type":"memory-backend-epc","id":"memepc0","prealloc":true,"size":67108864}' \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +-object '{"qom-type":"memory-backend-epc","id":"memepc1","prealloc":true,"size":16777216}' \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >> +-M sgx-epc.0.memdev=memepc0,sgx-epc.1.memdev=memepc1 \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > I don't think this is correct. IIUC, this can be passed to -machine<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > directly, e.g.:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > -machine<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > pc-q35-6.2,usb=off,dump-guest-core=off,memory-backend=pc.ram,sgx-epc.0.memdev=memepc0,sgx-epc.1.memdev=memepc1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > And when I try to do that, I get:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> >   qemu-system-x86_64: Parameter 'sgx-epc.0.node' is missing<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > Any idea, what's going on? I would much rather avoid using -M if we can<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > help it.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> One more thing. I've enabled SGX on my machine hoping to test this out,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> but my attempts are failing so far. Firstly, with these patches qemu is<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> unhappy, because .node attribute is missing:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> /home/zippy/work/qemu/qemu.git/build/qemu-system-x86_64 \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> -machine pc-i440fx-4.0,usb=off,dump-guest-core=off \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> -accel kvm \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> -cpu host,migratable=on \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> -m size=4194304k,slots=16,maxmem=1099511627776k \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> -object '{"qom-type":"memory-backend-memfd","id":"memepc0","hugetlb":true,"hugetlbsize":2097152,"prealloc":true,"size":67108864,"host-nodes":[0],"policy":"bind"}' \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> -M sgx-epc.0.memdev=memepc0 \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> qemu-system-x86_64: Parameter 'sgx-epc.0.node' is missing<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Did you use qemu latest master branch here for experiments? NUMA<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">support is added in qemu master branch, which requires 'sgx-epc.0.node'
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">parameter, but not in its latest 6.2.0 release.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">So here I didn’t add 'sgx-epc.0.node' parameter to align with qemu 6.2.0.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">NUMA support could be separate patch after qemu new release. The other<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">options is we add NUMA support at this time. Any suggestions?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> But okay, I can add .node, but that doesn't get me much further:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> /home/zippy/work/qemu/qemu.git/build/qemu-system-x86_64 \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> -machine pc-i440fx-4.0,usb=off,dump-guest-core=off \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> -accel kvm \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> -cpu host,migratable=on \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> -m size=4194304k,slots=16,maxmem=1099511627776k \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> -object '{"qom-type":"memory-backend-memfd","id":"memepc0","hugetlb":true,"hugetlbsize":2097152,"prealloc":true,"size":67108864,"host-nodes":[0],"policy":"bind"}' \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> -M sgx-epc.0.memdev=memepc0,sgx-epc.0.node=0 \<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> qemu-system-x86_64: Invalid parameter type for 'memdev', expected: memory-backend-epc<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I think I fixed this kind of issue by moving memory-backend-epc type check before hugetlb<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">check. Could you pls share your domain xml, so I can reproduce it on my side? Thanks.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Lin.<br>
<br>
<o:p></o:p></span></p>
</div>
</body>
</html>