[V1 PATCH 1/1] OvmfPkg: Add INVD case in #VE handler #ve


Ryan Afranji
 

According to the Intel GHCI specification document section 2.4.1, the
goal for instructions that do not have a corresponding TDCALL is for the
handler to treat the instruction as a NOP.

INVD does not have a corresponding TDCALL. This patch makes the #VE
handler treat INVD as a NOP.

Signed-off-by: Ryan Afranji <afranji@...>
---
OvmfPkg/Library/CcExitLib/CcExitVeHandler.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c b/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c
index c35f65a649..3798c2bb13 100644
--- a/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c
+++ b/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c
@@ -541,6 +541,7 @@ CcExitHandleVe (
case EXIT_REASON_MONITOR_INSTRUCTION:
case EXIT_REASON_WBINVD:
case EXIT_REASON_RDPMC:
+ case EXIT_REASON_INVD:
/* Handle as nops. */
break;

--
2.39.0.rc1.256.g54fd8350bd-goog


Yao, Jiewen
 

Reviewed-by: Jiewen Yao <Jiewen.yao@...>

-----Original Message-----
From: Ryan Afranji <afranji@...>
Sent: Thursday, December 8, 2022 8:51 AM
To: devel@edk2.groups.io
Cc: Nakajima, Jun <jun.nakajima@...>; Xu, Min M
<min.m.xu@...>; Yao, Jiewen <jiewen.yao@...>; Aktas, Erdem
<erdemaktas@...>; vannapurve@...; Ryan Afranji
<afranji@...>
Subject: [V1 PATCH 1/1] OvmfPkg: Add INVD case in #VE handler

According to the Intel GHCI specification document section 2.4.1, the
goal for instructions that do not have a corresponding TDCALL is for the
handler to treat the instruction as a NOP.

INVD does not have a corresponding TDCALL. This patch makes the #VE
handler treat INVD as a NOP.

Signed-off-by: Ryan Afranji <afranji@...>
---
OvmfPkg/Library/CcExitLib/CcExitVeHandler.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c
b/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c
index c35f65a649..3798c2bb13 100644
--- a/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c
+++ b/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c
@@ -541,6 +541,7 @@ CcExitHandleVe (
case EXIT_REASON_MONITOR_INSTRUCTION:
case EXIT_REASON_WBINVD:
case EXIT_REASON_RDPMC:
+ case EXIT_REASON_INVD:
/* Handle as nops. */
break;

--
2.39.0.rc1.256.g54fd8350bd-goog


Yao, Jiewen
 

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yao,
Jiewen
Sent: Friday, December 9, 2022 2:50 PM
To: Ryan Afranji <afranji@...>; devel@edk2.groups.io
Cc: Nakajima, Jun <jun.nakajima@...>; Xu, Min M
<min.m.xu@...>; Aktas, Erdem <erdemaktas@...>;
vannapurve@...
Subject: Re: [edk2-devel] [V1 PATCH 1/1] OvmfPkg: Add INVD case in #VE
handler

Reviewed-by: Jiewen Yao <Jiewen.yao@...>

-----Original Message-----
From: Ryan Afranji <afranji@...>
Sent: Thursday, December 8, 2022 8:51 AM
To: devel@edk2.groups.io
Cc: Nakajima, Jun <jun.nakajima@...>; Xu, Min M
<min.m.xu@...>; Yao, Jiewen <jiewen.yao@...>; Aktas,
Erdem
<erdemaktas@...>; vannapurve@...; Ryan Afranji
<afranji@...>
Subject: [V1 PATCH 1/1] OvmfPkg: Add INVD case in #VE handler

According to the Intel GHCI specification document section 2.4.1, the
goal for instructions that do not have a corresponding TDCALL is for the
handler to treat the instruction as a NOP.

INVD does not have a corresponding TDCALL. This patch makes the #VE
handler treat INVD as a NOP.

Signed-off-by: Ryan Afranji <afranji@...>
---
OvmfPkg/Library/CcExitLib/CcExitVeHandler.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c
b/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c
index c35f65a649..3798c2bb13 100644
--- a/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c
+++ b/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c
@@ -541,6 +541,7 @@ CcExitHandleVe (
case EXIT_REASON_MONITOR_INSTRUCTION:
case EXIT_REASON_WBINVD:
case EXIT_REASON_RDPMC:
+ case EXIT_REASON_INVD:
/* Handle as nops. */
break;

--
2.39.0.rc1.256.g54fd8350bd-goog