Skip to content

Commit 0c2fd2e

Browse files
tlendackysuryasaimadhu
authored andcommitted
x86/sev-es: Handle MONITOR/MONITORX Events
Implement a handler for #VC exceptions caused by MONITOR and MONITORX instructions. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> [ jroedel@suse.de: Adapt to #VC handling infrastructure ] Co-developed-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20200907131613.12703-58-joro@8bytes.org
1 parent 8b4ce83 commit 0c2fd2e

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

arch/x86/kernel/sev-es.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,16 @@ static enum es_result vc_handle_rdpmc(struct ghcb *ghcb, struct es_em_ctxt *ctxt
872872
return ES_OK;
873873
}
874874

875+
static enum es_result vc_handle_monitor(struct ghcb *ghcb,
876+
struct es_em_ctxt *ctxt)
877+
{
878+
/*
879+
* Treat it as a NOP and do not leak a physical address to the
880+
* hypervisor.
881+
*/
882+
return ES_OK;
883+
}
884+
875885
static enum es_result vc_handle_exitcode(struct es_em_ctxt *ctxt,
876886
struct ghcb *ghcb,
877887
unsigned long exit_code)
@@ -908,6 +918,9 @@ static enum es_result vc_handle_exitcode(struct es_em_ctxt *ctxt,
908918
case SVM_EXIT_WBINVD:
909919
result = vc_handle_wbinvd(ghcb, ctxt);
910920
break;
921+
case SVM_EXIT_MONITOR:
922+
result = vc_handle_monitor(ghcb, ctxt);
923+
break;
911924
case SVM_EXIT_NPF:
912925
result = vc_handle_mmio(ghcb, ctxt);
913926
break;

0 commit comments

Comments
 (0)