summaryrefslogtreecommitdiff
path: root/usr/src/uts/intel/os/desctbls.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/intel/os/desctbls.c')
-rw-r--r--usr/src/uts/intel/os/desctbls.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/usr/src/uts/intel/os/desctbls.c b/usr/src/uts/intel/os/desctbls.c
index c54efdb75f..0307aa56c6 100644
--- a/usr/src/uts/intel/os/desctbls.c
+++ b/usr/src/uts/intel/os/desctbls.c
@@ -158,7 +158,7 @@ struct interposing_handler {
* The brand infrastructure interposes on two handlers, and we use one as a
* NULL signpost.
*/
-static struct interposing_handler brand_tbl[2];
+static struct interposing_handler brand_tbl[3];
/*
* software prototypes for default local descriptor table
@@ -774,6 +774,13 @@ init_idt_common(gate_desc_t *idt)
KCS_SEL, SDT_SYSIGT, TRP_KPL, idt_vector_to_ist(T_SIMDFPE));
/*
+ * install "int80" handler at, well, 0x80.
+ */
+ set_gatesegd(&idt0[T_INT80],
+ (kpti_enable == 1) ? &tr_sys_int80 : &sys_int80,
+ KCS_SEL, SDT_SYSIGT, TRP_UPL, idt_vector_to_ist(T_INT80));
+
+ /*
* install fast trap handler at 210.
*/
set_gatesegd(&idt[T_FASTTRAP],
@@ -795,18 +802,25 @@ init_idt_common(gate_desc_t *idt)
KCS_SEL, SDT_SYSIGT, TRP_UPL, idt_vector_to_ist(T_DTRACE_RET));
/*
- * Prepare interposing descriptor for the syscall handler
- * and cache copy of the default descriptor.
+ * Prepare interposing descriptors for the branded "int80"
+ * and syscall handlers and cache copies of the default
+ * descriptors.
*/
- brand_tbl[0].ih_inum = T_SYSCALLINT;
- brand_tbl[0].ih_default_desc = idt0[T_SYSCALLINT];
-
+ brand_tbl[0].ih_inum = T_INT80;
+ brand_tbl[0].ih_default_desc = idt0[T_INT80];
set_gatesegd(&(brand_tbl[0].ih_interp_desc),
+ (kpti_enable == 1) ? &tr_brand_sys_int80 : &brand_sys_int80,
+ KCS_SEL, SDT_SYSIGT, TRP_UPL, idt_vector_to_ist(T_INT80));
+
+ brand_tbl[1].ih_inum = T_SYSCALLINT;
+ brand_tbl[1].ih_default_desc = idt0[T_SYSCALLINT];
+
+ set_gatesegd(&(brand_tbl[1].ih_interp_desc),
(kpti_enable == 1) ? &tr_brand_sys_syscall_int :
&brand_sys_syscall_int, KCS_SEL, SDT_SYSIGT, TRP_UPL,
idt_vector_to_ist(T_SYSCALLINT));
- brand_tbl[1].ih_inum = 0;
+ brand_tbl[2].ih_inum = 0;
}
#if defined(__xpv)