From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v8 10/13] KVM: Update Posted-Interrupts Descriptor when vCPU is preempted Date: Wed, 16 Sep 2015 11:29:04 +0200 Message-ID: <55F93660.9070803@redhat.com> References: <1442393409-2623-1-git-send-email-feng.wu@intel.com> <1442393409-2623-11-git-send-email-feng.wu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1442393409-2623-11-git-send-email-feng.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Feng Wu , alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org, mtosatti-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, eric.auger-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org List-Id: iommu@lists.linux-foundation.org On 16/09/2015 10:50, Feng Wu wrote: > + > + if (!irq_remapping_cap(IRQ_POSTING_CAP) || > + (!kvm_arch_has_assigned_device(vcpu->kvm))) > + return; > + Better: if (!arch_has_assigned_device(vcpu->kvm)) || !irq_remapping_cap(IRQ_POSTING_CAP)) return; (In the future we might add a static_key here). Paolo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753319AbbIPJ3L (ORCPT ); Wed, 16 Sep 2015 05:29:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43285 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752216AbbIPJ3J (ORCPT ); Wed, 16 Sep 2015 05:29:09 -0400 Subject: Re: [PATCH v8 10/13] KVM: Update Posted-Interrupts Descriptor when vCPU is preempted To: Feng Wu , alex.williamson@redhat.com, joro@8bytes.org, mtosatti@redhat.com References: <1442393409-2623-1-git-send-email-feng.wu@intel.com> <1442393409-2623-11-git-send-email-feng.wu@intel.com> Cc: eric.auger@linaro.org, kvm@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org From: Paolo Bonzini Message-ID: <55F93660.9070803@redhat.com> Date: Wed, 16 Sep 2015 11:29:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1442393409-2623-11-git-send-email-feng.wu@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/09/2015 10:50, Feng Wu wrote: > + > + if (!irq_remapping_cap(IRQ_POSTING_CAP) || > + (!kvm_arch_has_assigned_device(vcpu->kvm))) > + return; > + Better: if (!arch_has_assigned_device(vcpu->kvm)) || !irq_remapping_cap(IRQ_POSTING_CAP)) return; (In the future we might add a static_key here). Paolo