From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: [PATCH] minios: fix and enforce block_domain atomicity Date: Thu, 8 May 2008 11:56:33 +0100 Message-ID: <20080508105633.GG4365@implementation.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org minios: fix and enforce block_domain atomicity To ensure that the timer event is not lost, block_domain requires that event delivery is disabled. SCHEDOP_block re-enables them, so for coherency (and fixing a bug actually), we should re-disable them after. Also, make sure that the caller disabled them. Signed-off-by: Samuel Thibault diff -r 4965e711fee8 extras/mini-os/arch/x86/time.c --- a/extras/mini-os/arch/x86/time.c Wed May 07 15:36:32 2008 +0100 +++ b/extras/mini-os/arch/x86/time.c Thu May 08 11:40:05 2008 +0100 @@ -201,10 +201,12 @@ void block_domain(s_time_t until) { struct timeval tv; gettimeofday(&tv, NULL); + ASSERT(irqs_disabled()); if(monotonic_clock() < until) { HYPERVISOR_set_timer_op(until); HYPERVISOR_sched_op(SCHEDOP_block, 0); + local_irq_disable(); } }