From: "Jan Beulich" Subject: Re: [PATCH v9 07/20] x86/VPMU: Handle APIC_LVTPC accesses Date: Mon, 11 Aug 2014 14:49:51 +0100 Message-ID: <53E8E61F020000780002B33D@mail.emea.novell.com> References: <1407516946-17833-1-git-send-email-boris.ostrovsky@oracle.com> <1407516946-17833-8-git-send-email-boris.ostrovsky@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1407516946-17833-8-git-send-email-boris.ostrovsky@oracle.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Boris Ostrovsky Cc: kevin.tian@intel.com, keir@xen.org, suravee.suthikulpanit@amd.com, andrew.cooper3@citrix.com, tim@xen.org, xen-devel@lists.xen.org, jun.nakajima@intel.com List-Id: xen-devel@lists.xenproject.org >>> On 08.08.14 at 18:55, wrote: > @@ -734,8 +735,10 @@ static int vlapic_reg_write(struct vcpu *v, > vlapic_adjust_i8259_target(v->domain); > pt_may_unmask_irq(v->domain, NULL); > } > - if ( (offset == APIC_LVTT) && !(val & APIC_LVT_MASKED) ) > + else if ( (offset == APIC_LVTT) && !(val & APIC_LVT_MASKED) ) > pt_may_unmask_irq(NULL, &vlapic->pt); > + else if ( offset == APIC_LVTPC ) > + vpmu_lvtpc_update(val); Each time I review a version of this series I find myself verifying that the introduction of the "else" that wasn't previously there is benign. It is, yes, but the patch also doesn't win anything from that change. Hence please either drop _both_ "else"-s, or convert the whole construct to a small switch(). Jan