aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsmh22@firebug.cl.cam.ac.uk <smh22@firebug.cl.cam.ac.uk>2006-04-06 17:47:37 +0100
committersmh22@firebug.cl.cam.ac.uk <smh22@firebug.cl.cam.ac.uk>2006-04-06 17:47:37 +0100
commitfc4d8fe8b07c06568cea18430f2a6edda1961469 (patch)
tree9e3569356dd00eb8ab04251a49ec9dda7cdc2ab6
parent5e1e26bd96648683705e28b545345ed86380159e (diff)
parent6ff686de51416a4819098761fd1930029708c23b (diff)
downloadxen-fc4d8fe8b07c06568cea18430f2a6edda1961469.tar.gz
xen-fc4d8fe8b07c06568cea18430f2a6edda1961469.tar.bz2
xen-fc4d8fe8b07c06568cea18430f2a6edda1961469.zip
Merge.
-rw-r--r--linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h3
-rw-r--r--linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h4
-rw-r--r--linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h6
-rw-r--r--xen/arch/x86/shutdown.c2
-rw-r--r--xen/arch/x86/traps.c4
-rw-r--r--xen/arch/x86/x86_32/entry.S64
-rw-r--r--xen/arch/x86/x86_32/traps.c12
-rw-r--r--xen/arch/x86/x86_64/entry.S57
-rw-r--r--xen/arch/x86/x86_64/traps.c15
-rw-r--r--xen/drivers/char/console.c1
10 files changed, 80 insertions, 88 deletions
diff --git a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h
index d789fa3ae0..088b182c1c 100644
--- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h
+++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h
@@ -331,8 +331,7 @@ HYPERVISOR_nmi_op(
static inline int
HYPERVISOR_callback_op(
- int cmd,
- void *arg)
+ int cmd, void *arg)
{
return _hypercall2(int, callback_op, cmd, arg);
}
diff --git a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h
index ef697fde73..71d0258b8d 100644
--- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h
+++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h
@@ -25,11 +25,11 @@ extern void nmi(void);
static void __init machine_specific_arch_setup(void)
{
struct xen_platform_parameters pp;
- callback_register_t event = {
+ struct callback_register event = {
.type = CALLBACKTYPE_event,
.address = { __KERNEL_CS, (unsigned long)hypervisor_callback },
};
- callback_register_t failsafe = {
+ struct callback_register failsafe = {
.type = CALLBACKTYPE_failsafe,
.address = { __KERNEL_CS, (unsigned long)failsafe_callback },
};
diff --git a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h
index c48ef6cbb3..f2342b0097 100644
--- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h
+++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h
@@ -14,15 +14,15 @@ extern void nmi(void);
static void __init machine_specific_arch_setup(void)
{
- callback_register_t event = {
+ struct callback_register event = {
.type = CALLBACKTYPE_event,
.address = (unsigned long) hypervisor_callback,
};
- callback_register_t failsafe = {
+ struct callback_register failsafe = {
.type = CALLBACKTYPE_failsafe,
.address = (unsigned long)failsafe_callback,
};
- callback_register_t syscall = {
+ struct callback_register syscall = {
.type = CALLBACKTYPE_syscall,
.address = (unsigned long)system_call,
};
diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c
index e3cd61085a..97b41a94ca 100644
--- a/xen/arch/x86/shutdown.c
+++ b/xen/arch/x86/shutdown.c
@@ -44,7 +44,7 @@ static inline void kb_wait(void)
void __attribute__((noreturn)) __machine_halt(void *unused)
{
for ( ; ; )
- safe_halt();
+ __asm__ __volatile__ ( "hlt" );
}
void machine_halt(void)
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 2856f75a0c..72272f30ca 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -32,6 +32,7 @@
#include <xen/errno.h>
#include <xen/mm.h>
#include <xen/console.h>
+#include <xen/reboot.h>
#include <asm/regs.h>
#include <xen/delay.h>
#include <xen/event.h>
@@ -318,8 +319,7 @@ asmlinkage void fatal_trap(int trapnr, struct cpu_user_regs *regs)
console_force_lock();
/* Wait for manual reset. */
- for ( ; ; )
- __asm__ __volatile__ ( "hlt" );
+ machine_halt();
}
static inline int do_trap(int trapnr, char *str,
diff --git a/xen/arch/x86/x86_32/entry.S b/xen/arch/x86/x86_32/entry.S
index 049dc5ced5..8efd96fc1d 100644
--- a/xen/arch/x86/x86_32/entry.S
+++ b/xen/arch/x86/x86_32/entry.S
@@ -119,7 +119,7 @@ FIX1: SET_XEN_SEGMENTS(a)
movl $DBLFLT1,%eax
pushl %eax # EIP
pushl %esi # error_code/entry_vector
- jmp error_code
+ jmp handle_exception
DBLFLT1:GET_CURRENT(%ebx)
jmp test_all_events
failsafe_callback:
@@ -381,14 +381,6 @@ domain_crash_synchronous:
jmp __domain_crash_synchronous
ALIGN
-process_guest_exception_and_events:
- leal VCPU_trap_bounce(%ebx),%edx
- testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%edx)
- jz test_all_events
- call create_bounce_frame
- jmp test_all_events
-
- ALIGN
ENTRY(ret_from_intr)
GET_CURRENT(%ebx)
movl UREGS_eflags(%esp),%eax
@@ -400,7 +392,7 @@ ENTRY(ret_from_intr)
ENTRY(divide_error)
pushl $TRAP_divide_error<<16
ALIGN
-error_code:
+handle_exception:
FIXUP_RING0_GUEST_STACK
SAVE_ALL_NOSEGREGS(a)
SET_XEN_SEGMENTS(a)
@@ -419,7 +411,11 @@ error_code:
movb UREGS_cs(%esp),%al
testl $(3|X86_EFLAGS_VM),%eax
jz restore_all_xen
- jmp process_guest_exception_and_events
+ leal VCPU_trap_bounce(%ebx),%edx
+ testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%edx)
+ jz test_all_events
+ call create_bounce_frame
+ jmp test_all_events
exception_with_ints_disabled:
movl UREGS_eflags(%esp),%eax
@@ -452,71 +448,71 @@ FATAL_exception_with_ints_disabled:
ENTRY(coprocessor_error)
pushl $TRAP_copro_error<<16
- jmp error_code
+ jmp handle_exception
ENTRY(simd_coprocessor_error)
pushl $TRAP_simd_error<<16
- jmp error_code
+ jmp handle_exception
ENTRY(device_not_available)
pushl $TRAP_no_device<<16
- jmp error_code
+ jmp handle_exception
ENTRY(debug)
pushl $TRAP_debug<<16
- jmp error_code
+ jmp handle_exception
ENTRY(int3)
pushl $TRAP_int3<<16
- jmp error_code
+ jmp handle_exception
ENTRY(overflow)
pushl $TRAP_overflow<<16
- jmp error_code
+ jmp handle_exception
ENTRY(bounds)
pushl $TRAP_bounds<<16
- jmp error_code
+ jmp handle_exception
ENTRY(invalid_op)
pushl $TRAP_invalid_op<<16
- jmp error_code
+ jmp handle_exception
ENTRY(coprocessor_segment_overrun)
pushl $TRAP_copro_seg<<16
- jmp error_code
+ jmp handle_exception
ENTRY(invalid_TSS)
- movw $TRAP_invalid_tss,2(%esp)
- jmp error_code
+ movw $TRAP_invalid_tss,2(%esp)
+ jmp handle_exception
ENTRY(segment_not_present)
- movw $TRAP_no_segment,2(%esp)
- jmp error_code
+ movw $TRAP_no_segment,2(%esp)
+ jmp handle_exception
ENTRY(stack_segment)
- movw $TRAP_stack_error,2(%esp)
- jmp error_code
+ movw $TRAP_stack_error,2(%esp)
+ jmp handle_exception
ENTRY(general_protection)
- movw $TRAP_gp_fault,2(%esp)
- jmp error_code
+ movw $TRAP_gp_fault,2(%esp)
+ jmp handle_exception
ENTRY(alignment_check)
- movw $TRAP_alignment_check,2(%esp)
- jmp error_code
+ movw $TRAP_alignment_check,2(%esp)
+ jmp handle_exception
ENTRY(page_fault)
- movw $TRAP_page_fault,2(%esp)
- jmp error_code
+ movw $TRAP_page_fault,2(%esp)
+ jmp handle_exception
ENTRY(machine_check)
pushl $TRAP_machine_check<<16
- jmp error_code
+ jmp handle_exception
ENTRY(spurious_interrupt_bug)
pushl $TRAP_spurious_int<<16
- jmp error_code
+ jmp handle_exception
ENTRY(nmi)
#ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL
diff --git a/xen/arch/x86/x86_32/traps.c b/xen/arch/x86/x86_32/traps.c
index f0dc661821..085c126153 100644
--- a/xen/arch/x86/x86_32/traps.c
+++ b/xen/arch/x86/x86_32/traps.c
@@ -9,6 +9,7 @@
#include <xen/mm.h>
#include <xen/irq.h>
#include <xen/symbols.h>
+#include <xen/reboot.h>
#include <asm/current.h>
#include <asm/flushtlb.h>
#include <asm/hvm/hvm.h>
@@ -180,8 +181,7 @@ asmlinkage void do_double_fault(void)
console_force_lock();
/* Wait for manual reset. */
- for ( ; ; )
- __asm__ __volatile__ ( "hlt" );
+ machine_halt();
}
unsigned long do_iret(void)
@@ -322,8 +322,7 @@ static long register_guest_callback(struct callback_register *reg)
long ret = 0;
struct vcpu *v = current;
- if ( reg->address.cs )
- fixup_guest_code_selector(reg->address.cs);
+ fixup_guest_code_selector(reg->address.cs);
switch ( reg->type )
{
@@ -355,6 +354,7 @@ static long unregister_guest_callback(struct callback_unregister *unreg)
ret = -EINVAL;
break;
}
+
return ret;
}
@@ -370,7 +370,7 @@ long do_callback_op(int cmd, GUEST_HANDLE(void) arg)
struct callback_register reg;
ret = -EFAULT;
- if ( copy_from_guest( &reg, arg, 1 ) )
+ if ( copy_from_guest(&reg, arg, 1) )
break;
ret = register_guest_callback(&reg);
@@ -382,7 +382,7 @@ long do_callback_op(int cmd, GUEST_HANDLE(void) arg)
struct callback_unregister unreg;
ret = -EFAULT;
- if ( copy_from_guest( &unreg, arg, 1 ) )
+ if ( copy_from_guest(&unreg, arg, 1) )
break;
ret = unregister_guest_callback(&unreg);
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 622ca4d7cc..6af4a0162b 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -68,7 +68,7 @@ FIX1: popq -15*8-8(%rsp) # error_code/entry_vector
leaq DBLFLT1(%rip),%rax
pushq %rax # RIP
pushq %rsi # error_code/entry_vector
- jmp error_code
+ jmp handle_exception
DBLFLT1:GET_CURRENT(%rbx)
jmp test_all_events
failsafe_callback:
@@ -320,15 +320,6 @@ domain_crash_synchronous:
jmp __domain_crash_synchronous
ALIGN
-/* %rbx: struct vcpu */
-process_guest_exception_and_events:
- leaq VCPU_trap_bounce(%rbx),%rdx
- testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%rdx)
- jz test_all_events
- call create_bounce_frame
- jmp test_all_events
-
- ALIGN
/* No special register assumptions. */
ENTRY(ret_from_intr)
GET_CURRENT(%rbx)
@@ -338,7 +329,7 @@ ENTRY(ret_from_intr)
ALIGN
/* No special register assumptions. */
-error_code:
+handle_exception:
SAVE_ALL
testb $X86_EFLAGS_IF>>8,UREGS_eflags+1(%rsp)
jz exception_with_ints_disabled
@@ -351,7 +342,11 @@ error_code:
callq *(%rdx,%rax,8)
testb $3,UREGS_cs(%rsp)
jz restore_all_xen
- jmp process_guest_exception_and_events
+ leaq VCPU_trap_bounce(%rbx),%rdx
+ testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%rdx)
+ jz test_all_events
+ call create_bounce_frame
+ jmp test_all_events
/* No special register assumptions. */
exception_with_ints_disabled:
@@ -384,90 +379,90 @@ FATAL_exception_with_ints_disabled:
ENTRY(divide_error)
pushq $0
movl $TRAP_divide_error,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(coprocessor_error)
pushq $0
movl $TRAP_copro_error,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(simd_coprocessor_error)
pushq $0
movl $TRAP_simd_error,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(device_not_available)
pushq $0
movl $TRAP_no_device,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(debug)
pushq $0
movl $TRAP_debug,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(int3)
pushq $0
movl $TRAP_int3,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(overflow)
pushq $0
movl $TRAP_overflow,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(bounds)
pushq $0
movl $TRAP_bounds,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(invalid_op)
pushq $0
movl $TRAP_invalid_op,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(coprocessor_segment_overrun)
pushq $0
movl $TRAP_copro_seg,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(invalid_TSS)
movl $TRAP_invalid_tss,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(segment_not_present)
movl $TRAP_no_segment,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(stack_segment)
movl $TRAP_stack_error,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(general_protection)
movl $TRAP_gp_fault,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(alignment_check)
movl $TRAP_alignment_check,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(page_fault)
movl $TRAP_page_fault,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(machine_check)
pushq $0
movl $TRAP_machine_check,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(spurious_interrupt_bug)
pushq $0
movl $TRAP_spurious_int,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(double_fault)
movl $TRAP_double_fault,4(%rsp)
- jmp error_code
+ jmp handle_exception
ENTRY(nmi)
pushq $0
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index fcc188364b..4f5ff5ba11 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -10,6 +10,7 @@
#include <xen/symbols.h>
#include <xen/console.h>
#include <xen/sched.h>
+#include <xen/reboot.h>
#include <asm/current.h>
#include <asm/flushtlb.h>
#include <asm/msr.h>
@@ -166,8 +167,7 @@ asmlinkage void do_double_fault(struct cpu_user_regs *regs)
console_force_lock();
/* Wait for manual reset. */
- for ( ; ; )
- __asm__ __volatile__ ( "hlt" );
+ machine_halt();
}
void toggle_guest_mode(struct vcpu *v)
@@ -357,6 +357,7 @@ static long unregister_guest_callback(struct callback_unregister *unreg)
ret = -EINVAL;
break;
}
+
return ret;
}
@@ -372,7 +373,7 @@ long do_callback_op(int cmd, GUEST_HANDLE(void) arg)
struct callback_register reg;
ret = -EFAULT;
- if ( copy_from_guest( &reg, arg, 1 ) )
+ if ( copy_from_guest(&reg, arg, 1) )
break;
ret = register_guest_callback(&reg);
@@ -384,7 +385,7 @@ long do_callback_op(int cmd, GUEST_HANDLE(void) arg)
struct callback_unregister unreg;
ret = -EFAULT;
- if ( copy_from_guest( &unreg, arg, 1 ) )
+ if ( copy_from_guest(&unreg, arg, 1) )
break;
ret = unregister_guest_callback(&unreg);
@@ -403,15 +404,15 @@ long do_set_callbacks(unsigned long event_address,
unsigned long failsafe_address,
unsigned long syscall_address)
{
- callback_register_t event = {
+ struct callback_register event = {
.type = CALLBACKTYPE_event,
.address = event_address,
};
- callback_register_t failsafe = {
+ struct callback_register failsafe = {
.type = CALLBACKTYPE_failsafe,
.address = failsafe_address,
};
- callback_register_t syscall = {
+ struct callback_register syscall = {
.type = CALLBACKTYPE_syscall,
.address = syscall_address,
};
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index df4706bcb2..948000c743 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -520,6 +520,7 @@ void console_force_unlock(void)
{
console_lock = SPIN_LOCK_UNLOCKED;
serial_force_unlock(sercon_handle);
+ console_start_sync();
}
void console_force_lock(void)