aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/x86_64/traps.c
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-07-03 11:41:25 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-07-03 11:41:25 +0100
commit0b630aa340ecbedd844f6ee388f429c3285ad5a5 (patch)
tree82c4ecd8a9e554eb7035d1699ff460dd29410991 /xen/arch/x86/x86_64/traps.c
parent4b0eaf5d1025ff16f6e90f6dac9f136ad9a54ca0 (diff)
downloadxen-0b630aa340ecbedd844f6ee388f429c3285ad5a5.tar.gz
xen-0b630aa340ecbedd844f6ee388f429c3285ad5a5.tar.bz2
xen-0b630aa340ecbedd844f6ee388f429c3285ad5a5.zip
x86-64: bump STACK_SIZE to 32 so that trampoline and IST stacks fit
without undue squeezing. Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/arch/x86/x86_64/traps.c')
-rw-r--r--xen/arch/x86/x86_64/traps.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index cd45d756cf..7a9c2c11bf 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -292,11 +292,11 @@ void __init percpu_traps_init(void)
if ( cpu == 0 )
{
- /* Specify dedicated interrupt stacks for NMIs and double faults. */
+ /* Specify dedicated interrupt stacks for NMI, #DF, and #MC. */
set_intr_gate(TRAP_double_fault, &double_fault);
- idt_table[TRAP_double_fault].a |= 1UL << 32; /* IST1 */
- idt_table[TRAP_nmi].a |= 2UL << 32; /* IST2 */
- idt_table[TRAP_machine_check].a |= 3UL << 32; /* IST3 */
+ idt_table[TRAP_double_fault].a |= IST_DF << 32;
+ idt_table[TRAP_nmi].a |= IST_NMI << 32;
+ idt_table[TRAP_machine_check].a |= IST_MCE << 32;
/*
* The 32-on-64 hypercall entry vector is only accessible from ring 1.
@@ -311,17 +311,20 @@ void __init percpu_traps_init(void)
stack_bottom = (char *)get_stack_bottom();
stack = (char *)((unsigned long)stack_bottom & ~(STACK_SIZE - 1));
- /* Machine Check handler has its own per-CPU 1kB stack. */
- init_tss[cpu].ist[2] = (unsigned long)&stack[1024];
+ /* IST_MAX IST pages + 1 syscall page + 1 guard page + primary stack. */
+ BUILD_BUG_ON((IST_MAX + 2) * PAGE_SIZE + PRIMARY_STACK_SIZE > STACK_SIZE);
- /* Double-fault handler has its own per-CPU 1kB stack. */
- init_tss[cpu].ist[0] = (unsigned long)&stack[2048];
+ /* Machine Check handler has its own per-CPU 4kB stack. */
+ init_tss[cpu].ist[IST_MCE] = (unsigned long)&stack[IST_MCE * PAGE_SIZE];
- /* NMI handler has its own per-CPU 1kB stack. */
- init_tss[cpu].ist[1] = (unsigned long)&stack[3072];
+ /* Double-fault handler has its own per-CPU 4kB stack. */
+ init_tss[cpu].ist[IST_DF] = (unsigned long)&stack[IST_DF * PAGE_SIZE];
+
+ /* NMI handler has its own per-CPU 4kB stack. */
+ init_tss[cpu].ist[IST_NMI] = (unsigned long)&stack[IST_NMI * PAGE_SIZE];
/* Trampoline for SYSCALL entry from long mode. */
- stack = &stack[3072]; /* Skip the NMI and DF stacks. */
+ stack = &stack[IST_MAX * PAGE_SIZE]; /* Skip the IST stacks. */
wrmsr(MSR_LSTAR, (unsigned long)stack, ((unsigned long)stack>>32));
stack += write_stack_trampoline(stack, stack_bottom, FLAT_KERNEL_CS64);