Skip to content

Commit 912c70b

Browse files
suncepingmxu9
authored andcommitted
OvmfPkg: Add the Test command in TDX MailBox
Refer to the latest changed in ACPI 6.6, add the command. Signed-off-by: Ceping Sun <[email protected]> reviewed-by: Min Xu <[email protected]> tested-by: Kirill A. Shutemov <[email protected]>
1 parent 542faef commit 912c70b

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

OvmfPkg/Include/IndustryStandard/IntelTdx.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
typedef enum {
2121
MpProtectedModeWakeupCommandNoop = 0,
2222
MpProtectedModeWakeupCommandWakeup = 1,
23-
MpProtectedModeWakeupCommandSleep = 2,
24-
MpProtectedModeWakeupCommandAcceptPages = 3,
23+
MpProtectedModeWakeupCommandTest = 2,
24+
MpProtectedModeWakeupCommandSleep = 3,
25+
MpProtectedModeWakeupCommandAcceptPages = 4,
2526
} MP_CPU_PROTECTED_MODE_WAKEUP_CMD;
2627

2728
#pragma pack(1)

OvmfPkg/Include/TdxCommondefs.inc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ ERROR_INVALID_FALLBACK_PAGE_LEVEL equ 3
4141

4242
MpProtectedModeWakeupCommandNoop equ 0
4343
MpProtectedModeWakeupCommandWakeup equ 1
44-
MpProtectedModeWakeupCommandSleep equ 2
45-
MpProtectedModeWakeupCommandAcceptPages equ 3
44+
MpProtectedModeWakeupCommandTest equ 2
45+
MpProtectedModeWakeupCommandSleep equ 3
46+
MpProtectedModeWakeupCommandAcceptPages equ 4
4647

4748
MailboxApicIdInvalid equ 0xffffffff
4849
MailboxApicidBroadcast equ 0xfffffffe

OvmfPkg/TdxDxe/X64/ApRunLoop.nasm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ MailBoxLoop:
6262
MailBoxProcessCommand:
6363
cmp dword [rbx + CommandOffset], MpProtectedModeWakeupCommandWakeup
6464
je MailBoxWakeUp
65+
cmp dword [rbx + CommandOffset], MpProtectedModeWakeupCommandTest
66+
je MailBoxTest
6567
cmp dword [rbx + CommandOffset], MpProtectedModeWakeupCommandSleep
6668
je MailBoxSleep
6769
; Don't support this command, so ignore
@@ -72,6 +74,9 @@ MailBoxWakeUp:
7274
; the command field back to zero as acknowledgement.
7375
mov qword [rbx + CommandOffset], 0
7476
jmp rax
77+
MailBoxTest:
78+
mov qword [rbx + CommandOffset], 0
79+
jmp MailBoxLoop
7580
MailBoxSleep:
7681
jmp $
7782
Panic:

0 commit comments

Comments
 (0)