From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [V8 PATCH 7/8] pvh dom0: add check for pvh in vioapic_range Date: Fri, 4 Apr 2014 18:00:49 -0700 Message-ID: <20140404180049.77637164@mantra.us.oracle.com> References: <1395452357-1598-1-git-send-email-mukesh.rathor@oracle.com> <1395452357-1598-8-git-send-email-mukesh.rathor@oracle.com> <53300A4102000078000013D1@nat28.tlf.novell.com> <533ACFDD.8010504@eu.citrix.com> <533AF2BB0200007800004407@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WWEyi-0001KK-Br for xen-devel@lists.xenproject.org; Sat, 05 Apr 2014 01:01:00 +0000 In-Reply-To: <533AF2BB0200007800004407@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: George Dunlap , tim@xen.org, eddie.dong@intel.com, keir.xen@gmail.com, jun.nakajima@intel.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Tue, 01 Apr 2014 16:09:15 +0100 "Jan Beulich" wrote: > >>> On 01.04.14 at 16:40, wrote: > > On 03/24/2014 09:34 AM, Jan Beulich wrote: > >>>>> On 22.03.14 at 02:39, wrote: > >>> --- a/xen/arch/x86/hvm/vioapic.c > >>> +++ b/xen/arch/x86/hvm/vioapic.c > >>> @@ -238,8 +238,13 @@ static int vioapic_write( > >>> > >>> static int vioapic_range(struct vcpu *v, unsigned long addr) > >>> { > >>> - struct hvm_hw_vioapic *vioapic = domain_vioapic(v->domain); > >>> + struct hvm_hw_vioapic *vioapic; > >>> + > >>> + /* pvh uses event channel callback */ > >>> + if ( is_pvh_vcpu(v) ) > >>> + return 0; > >>> > >>> + vioapic = domain_vioapic(v->domain); > >> > >> I can see why the extra check is needed, but I can't see why you > >> convert the initializer to an assignment: Afaict domain_vioapic() > >> is safe even if d->arch.hvm_domain.vioapic == NULL. > > > > Or better yet, just make it something like: > > > > return vioapic && ((addr >= [...original range check])) > > > > That way we don't have to have a PVH-specific hook at all. If a > > domain doesn't have a vioapic for any reason, return 0. > > No, vioapic isn't going to be NULL for PVH: > > #define domain_vioapic(d) > (&(d)->arch.hvm_domain.vioapic->hvm_hw_vioapic) No, viopaic is NULL for PVH, hence the patch. So, can prob just check for the ptr like George suggests and remove the pvh check. thanks mukesh