From: Kouya Shimura Subject: Re: [PATCH] x86, hvm: Allow delivery of timer interrupts to VCPUs != 0. Date: Fri, 3 Jul 2009 16:57:18 +0900 Message-ID: <7kzlbmmc69.fsf@pingu.sky.yk.fujitsu.co.jp> References: <7k4otuo0g8.fsf@pingu.sky.yk.fujitsu.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Keir Fraser writes: > This doesn't look too bad, given the current vpt interface we have. My main > comment is regarding vpit_vcpu(), vrtc_vcpu() and vhpet.vcpu. Seems all of > these could unconditionally use i8259_target. I suggest also introducing > vhpet_vcpu(), and then pointing all three *_vcpu() macros at > pt_i8259_target() only. And get rid of the vhpet.vcpu field. > > Would that work okay? Probably no problem, but may I modify vlapic.c as follows? diff -r 80839a223746 xen/arch/x86/hvm/vlapic.c --- a/xen/arch/x86/hvm/vlapic.c Wed Jul 01 20:22:29 2009 +0100 +++ b/xen/arch/x86/hvm/vlapic.c Fri Jul 03 15:59:56 2009 +0900 @@ -809,12 +809,11 @@ void vlapic_adjust_i8259_target(struct d for_each_vcpu ( d, v ) if ( __vlapic_accept_pic_intr(v) ) - goto found; - - v = d->vcpu ? d->vcpu[0] : NULL; - - found: - d->arch.hvm_domain.i8259_target = v; + { + d->arch.hvm_domain.i8259_target = v; + return; + } } The reasons are: - I'm afraid that d->arch.hvm_domain.i8259_target == NULL - if vcpu[0] is halted and all vlapic.LVT0 are masked, timer doesn't work even when vlapic will be unmasked not as ExtINT mode. So, I think that the last __vlapic_accept_pic_intr'ed vcpu should be reserved in d->arch.hvm_domain.i8259_target. Thanks, Kouya