diff options
author | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2004-04-13 14:36:00 +0000 |
---|---|---|
committer | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2004-04-13 14:36:00 +0000 |
commit | 6e25afa16902e18cb4bc8549aad5b58a12551136 (patch) | |
tree | 23804a602ac1bc0c1dd1bf1cc099561ff6704859 | |
parent | 15c5cad57f32a9012541ef00d08f0f10447a1f8c (diff) | |
download | xen-6e25afa16902e18cb4bc8549aad5b58a12551136.tar.gz xen-6e25afa16902e18cb4bc8549aad5b58a12551136.tar.bz2 xen-6e25afa16902e18cb4bc8549aad5b58a12551136.zip |
bitkeeper revision 1.862 (407bfad05PmdmZtBnhfJMLp1dqPBYQ)
Various cleanups. Also fix a bug in Xenolinux timer interrupt.
-rw-r--r-- | xen/common/schedule.c | 2 | ||||
-rw-r--r-- | xen/include/xen/event.h | 2 | ||||
-rw-r--r-- | xenolinux-2.4.25-sparse/arch/xen/kernel/entry.S | 26 | ||||
-rw-r--r-- | xenolinux-2.4.25-sparse/arch/xen/kernel/time.c | 3 | ||||
-rw-r--r-- | xenolinux-2.4.25-sparse/include/asm-xen/system.h | 8 |
5 files changed, 21 insertions, 20 deletions
diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 2655b08c28..dfacb65bd0 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -558,8 +558,6 @@ static void t_timer_fn(unsigned long unused) TRACE_0D(TRC_SCHED_T_TIMER_FN); - TRACE_0D(TRC_SCHED_T_TIMER_FN); - if ( !is_idle_task(p) ) send_guest_virq(p, VIRQ_TIMER); diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h index 542cd3c6ef..320a265a4c 100644 --- a/xen/include/xen/event.h +++ b/xen/include/xen/event.h @@ -56,7 +56,7 @@ static inline void evtchn_set_pending(struct task_struct *p, int port) !test_and_set_bit(port>>5, &s->evtchn_pending_sel) ) { /* The VCPU pending flag must be set /after/ update to evtchn-pend. */ - p->shared_info->vcpu_data[0].evtchn_upcall_pending = 1; + s->vcpu_data[0].evtchn_upcall_pending = 1; guest_schedule_to_run(p); } } diff --git a/xenolinux-2.4.25-sparse/arch/xen/kernel/entry.S b/xenolinux-2.4.25-sparse/arch/xen/kernel/entry.S index b78c74fd9c..305bd42c70 100644 --- a/xenolinux-2.4.25-sparse/arch/xen/kernel/entry.S +++ b/xenolinux-2.4.25-sparse/arch/xen/kernel/entry.S @@ -15,7 +15,7 @@ * I changed all the .align's to 4 (16 byte alignment), as that's faster * on a 486. * - * Stack layout in 'ret_from_system_call': + * Stack layout in 'ret_to_user': * ptrace needs to have all regs on the stack. * if the order here is changed, it needs to be * updated in fork.c:copy_process, signal.c:do_signal, @@ -157,7 +157,7 @@ ENTRY(lcall7) call *%edx addl $4, %esp popl %eax - jmp ret_from_sys_call + jmp ret_to_user ENTRY(lcall27) pushfl # We get a different stack layout with call @@ -181,7 +181,7 @@ ENTRY(lcall27) call *%edx addl $4, %esp popl %eax - jmp ret_from_sys_call + jmp ret_to_user ENTRY(ret_from_fork) pushl %ebx @@ -190,7 +190,7 @@ ENTRY(ret_from_fork) GET_CURRENT(%ebx) testb $0x02,tsk_ptrace(%ebx) # PT_TRACESYS jne tracesys_exit - jmp ret_from_sys_call + jmp ret_to_user /* * Return to user mode is not as complex as all this looks, @@ -208,15 +208,15 @@ ENTRY(system_call) jae badsys call *SYMBOL_NAME(sys_call_table)(,%eax,4) movl %eax,EAX(%esp) # save the return value -ENTRY(ret_from_sys_call) +ret_to_user: movl SYMBOL_NAME(HYPERVISOR_shared_info),%esi movb $1,evtchn_upcall_mask(%esi) # make tests atomic -ret_syscall_tests: +ret_to_user_nocli: cmpl $0,need_resched(%ebx) - jne reschedule + jne reschedule cmpl $0,sigpending(%ebx) je safesti # ensure need_resched updates are seen -signal_return: +/*signal_return:*/ movb $0,evtchn_upcall_mask(%esi) # reenable event callbacks movl %esp,%eax xorl %edx,%edx @@ -238,10 +238,10 @@ tracesys: movl %eax,EAX(%esp) # save the return value tracesys_exit: call SYMBOL_NAME(syscall_trace) - jmp ret_from_sys_call + jmp ret_to_user badsys: movl $-ENOSYS,EAX(%esp) - jmp ret_from_sys_call + jmp ret_to_user ALIGN ENTRY(ret_from_intr) @@ -249,14 +249,14 @@ ENTRY(ret_from_intr) ret_from_exception: movb CS(%esp),%al testl $2,%eax - jne ret_from_sys_call + jne ret_to_user jmp restore_all ALIGN reschedule: movb $0,evtchn_upcall_mask(%esi) # reenable event callbacks call SYMBOL_NAME(schedule) # test - jmp ret_from_sys_call + jmp ret_to_user ENTRY(divide_error) pushl $0 # no error code @@ -316,7 +316,7 @@ ENTRY(hypervisor_callback) movl SYMBOL_NAME(HYPERVISOR_shared_info),%esi movb CS(%esp),%cl test $2,%cl # slow return to ring 2 or 3 - jne ret_syscall_tests + jne ret_to_user_nocli safesti:movb $0,evtchn_upcall_mask(%esi) # reenable event callbacks scrit: /**** START OF CRITICAL REGION ****/ testb $0xFF,evtchn_upcall_pending(%esi) diff --git a/xenolinux-2.4.25-sparse/arch/xen/kernel/time.c b/xenolinux-2.4.25-sparse/arch/xen/kernel/time.c index 3674aef2ef..52920cd0fc 100644 --- a/xenolinux-2.4.25-sparse/arch/xen/kernel/time.c +++ b/xenolinux-2.4.25-sparse/arch/xen/kernel/time.c @@ -492,8 +492,7 @@ static inline void do_timer_interrupt(int irq, void *dev_id, static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { write_lock(&xtime_lock); - while ( !TIME_VALUES_UP_TO_DATE ) - do_timer_interrupt(irq, NULL, regs); + do_timer_interrupt(irq, NULL, regs); write_unlock(&xtime_lock); } diff --git a/xenolinux-2.4.25-sparse/include/asm-xen/system.h b/xenolinux-2.4.25-sparse/include/asm-xen/system.h index 40e11d3e68..6a8e352ac5 100644 --- a/xenolinux-2.4.25-sparse/include/asm-xen/system.h +++ b/xenolinux-2.4.25-sparse/include/asm-xen/system.h @@ -351,9 +351,13 @@ do { \ #define __save_and_sti(x) \ do { \ + shared_info_t *_shared = HYPERVISOR_shared_info; \ barrier(); \ - (x) = HYPERVISOR_shared_info->vcpu_data[0].evtchn_upcall_mask; \ - HYPERVISOR_shared_info->vcpu_data[0].evtchn_upcall_mask = 0; \ + (x) = _shared->vcpu_data[0].evtchn_upcall_mask; \ + _shared->vcpu_data[0].evtchn_upcall_mask = 0; \ + barrier(); /* unmask then check (avoid races) */ \ + if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) ) \ + evtchn_do_upcall(NULL); \ } while (0) #define local_irq_save(x) __save_and_cli(x) |