Skip to content

Commit

Permalink
x86: Add vendor specific exception vectors
Browse files Browse the repository at this point in the history
Intel and AMD have some vendor specific exception vectors, namely:
- Intel only: #VE (20),
- AMD only: #HV (28), #VC (29) and #SX (30).

Also Intel's #XM (19) is called #XF for AMD.

Add definitions for all of these and add comments stating they're vendor
specific.

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Link: https://lore.kernel.org/r/20230413184219.36404-4-minipli@grsecurity.net
Signed-off-by: Sean Christopherson <seanjc@google.com>
  • Loading branch information
minipli-oss authored and sean-jc committed Jun 12, 2023
1 parent 8cfb268 commit f224dba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/x86/desc.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ const char* exception_mnemonic(int vector)
VEC(AC);
VEC(MC);
VEC(XM);
VEC(VE);
VEC(CP);
VEC(HV);
VEC(VC);
VEC(SX);
default: return "#??";
#undef VEC
}
Expand Down
5 changes: 5 additions & 0 deletions lib/x86/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@
#define AC_VECTOR 17
#define MC_VECTOR 18
#define XM_VECTOR 19
#define XF_VECTOR XM_VECTOR /* AMD */
#define VE_VECTOR 20 /* Intel only */
#define CP_VECTOR 21
#define HV_VECTOR 28 /* AMD only */
#define VC_VECTOR 29 /* AMD only */
#define SX_VECTOR 30 /* AMD only */

#define X86_CR0_PE_BIT (0)
#define X86_CR0_PE BIT(X86_CR0_PE_BIT)
Expand Down

0 comments on commit f224dba

Please sign in to comment.