SUSE / tdx-demo

1 stars 4 forks source link

Kvm Suberror 4 encountered while starting multi-core TDX VM #12

Open DiWangShePi opened 4 months ago

DiWangShePi commented 4 months ago

In the script provided in this repository, the running TDX virtual machine seems to be 1 core. I can start a multi-core virtual machine without TDX protection, but even a two-core TDX virtual machine will encounter the following error:

KVM internal error. Suberror: 4
extra data[0]: 0xc000092000000122
extra data[1]: 0x000000000000001f
EAX=00000000 EBX=00000000 ECX=00000000 EDX=000806f8
ESI=00000000 EDI=00000000 EBP=00000000 ESP=00000000
EIP=0000fff0 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0000 00000000 0000ffff 00009300
CS =f000 ffff0000 0000ffff 00009b00
SS =0000 00000000 0000ffff 00009300
DS =0000 00000000 0000ffff 00009300
FS =0000 00000000 0000ffff 00009300
GS =0000 00000000 0000ffff 00009300
LDT=0000 00000000 0000ffff 00008200
TR =0000 00000000 0000ffff 00008b00
GDT=     00000000 0000ffff
IDT=     00000000 0000ffff
CR0=60000010 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
DR6=00000000ffff0ff0 DR7=0000000000000400
EFER=0000000000000000
Code=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <00> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

I have encountered this error at various stages of the virtual machine, when starting up, running and shutting down. The installation steps I referred to fully follow the relevant instructions in this repository, and the 1-core TDX virtual machine runs well. How should I go about troubleshooting the source of this issue?

RuixiangJiang commented 4 months ago

The CPU resources may not be enough. You can modify the tdx-demo-run.sh in setting smp to 1.

DiWangShePi commented 3 months ago

Sorry for late response.

However, this solution has been checked before I raised this issue. When I try to start a 4-core virtual machine with Intel-TDX protection on a server with 48 CPU cores, I will also encounter the above error. So I think it may not just be a problem of insufficient CPU resources.

RuixiangJiang commented 3 months ago

Well, I also ran it on a server with exactly 48 CPU cores. When I launched a 4-core QEMU, it raised the same error as what you had encountered. However, I tried to set smp to 1, and I succeeded in launching. Perhaps you can just try to set smp to 1? I think it doesn't waste so much time.

DiWangShePi commented 3 months ago

Unfortunately, the experimental environment I conducted required me to use a 4-core virtual machine.

RuixiangJiang commented 3 months ago

In fact, sometimes I used smp=1 as it raised the same error, and sometimes I succeeded. But I always failed using smp=4. I'm not sure the exact reason why you faced the error as you had checked my solution.

RuixiangJiang commented 3 months ago

Oh, I missed some important information you mentioned at the very beginning. Perhaps it doesn't support multi-core VMs?