# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1200396555 0
# Node ID 973221f4d9c76b3efa3ce42dae97a41b03273737
# Parent 45d16899a21df6a36611e051e71f621a4439b4a7
x86: INT3 and INTO trap gates should have DPL==3.
This was broken by c/s 16667 (gdbstub changes).
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
xen/arch/x86/traps.c | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diff -r 45d16899a21d -r 973221f4d9c7 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c Sun Jan 13 10:50:18 2008 +0000
+++ b/xen/arch/x86/traps.c Tue Jan 15 11:29:15 2008 +0000
@@ -2679,14 +2679,24 @@ asmlinkage void do_spurious_interrupt_bu
{
}
-void set_intr_gate(unsigned int n, void *addr)
+static void __set_intr_gate(unsigned int n, uint32_t dpl, void *addr)
{
int i;
/* Keep secondary tables in sync with IRQ updates. */
for ( i = 1; i < NR_CPUS; i++ )
if ( idt_tables[i] != NULL )
- _set_gate(&idt_tables[i][n], 14, 0, addr);
- _set_gate(&idt_table[n], 14, 0, addr);
+ _set_gate(&idt_tables[i][n], 14, dpl, addr);
+ _set_gate(&idt_table[n], 14, dpl, addr);
+}
+
+static void set_swint_gate(unsigned int n, void *addr)
+{
+ __set_intr_gate(n, 3, addr);
+}
+
+void set_intr_gate(unsigned int n, void *addr)
+{
+ __set_intr_gate(n, 0, addr);
}
void set_tss_desc(unsigned int n, void *addr)
@@ -2753,8 +2763,8 @@ void __init trap_init(void)
set_intr_gate(TRAP_divide_error,÷_error);
set_intr_gate(TRAP_debug,&debug);
set_intr_gate(TRAP_nmi,&nmi);
- set_intr_gate(TRAP_int3,&int3); /* usable from all privileges */
- set_intr_gate(TRAP_overflow,&overflow); /* usable from all privileges */
+ set_swint_gate(TRAP_int3,&int3); /* usable from all privileges */
+ set_swint_gate(TRAP_overflow,&overflow); /* usable from all privileges */
set_intr_gate(TRAP_bounds,&bounds);
set_intr_gate(TRAP_invalid_op,&invalid_op);
set_intr_gate(TRAP_no_device,&device_not_available);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|