From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752016AbbJCJKm (ORCPT ); Sat, 3 Oct 2015 05:10:42 -0400 Received: from mga11.intel.com ([192.55.52.93]:18924 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751792AbbJCJKk (ORCPT ); Sat, 3 Oct 2015 05:10:40 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,627,1437462000"; d="scan'208";a="818490145" Subject: Re: [PATCH] genirq: Move irq_set_vcpu_affinity out of "#ifdef CONFIG_SMP" To: Feng Wu , tglx@linutronix.de, pbonzini@redhat.com References: <1443860438-144926-1-git-send-email-feng.wu@intel.com> Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org From: Jiang Liu Organization: Intel Message-ID: <560F9B8A.6010902@linux.intel.com> Date: Sat, 3 Oct 2015 17:10:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1443860438-144926-1-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 2015/10/3 16:20, Feng Wu wrote: > irq_set_vcpu_affinity() is needed when CONFIG_SMP=n, so move the > definition out of "#ifdef CONFIG_SMP" > > Suggested-by: Paolo Bonzini > Signed-off-by: Feng Wu Reviewed-by: Jiang Liu > --- > kernel/irq/manage.c | 62 ++++++++++++++++++++++++++--------------------------- > 1 file changed, 31 insertions(+), 31 deletions(-) > > diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c > index 1c58655..90b378d 100644 > --- a/kernel/irq/manage.c > +++ b/kernel/irq/manage.c > @@ -258,37 +258,6 @@ int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m) > } > EXPORT_SYMBOL_GPL(irq_set_affinity_hint); > > -/** > - * irq_set_vcpu_affinity - Set vcpu affinity for the interrupt > - * @irq: interrupt number to set affinity > - * @vcpu_info: vCPU specific data > - * > - * This function uses the vCPU specific data to set the vCPU > - * affinity for an irq. The vCPU specific data is passed from > - * outside, such as KVM. One example code path is as below: > - * KVM -> IOMMU -> irq_set_vcpu_affinity(). > - */ > -int irq_set_vcpu_affinity(unsigned int irq, void *vcpu_info) > -{ > - unsigned long flags; > - struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0); > - struct irq_data *data; > - struct irq_chip *chip; > - int ret = -ENOSYS; > - > - if (!desc) > - return -EINVAL; > - > - data = irq_desc_get_irq_data(desc); > - chip = irq_data_get_irq_chip(data); > - if (chip && chip->irq_set_vcpu_affinity) > - ret = chip->irq_set_vcpu_affinity(data, vcpu_info); > - irq_put_desc_unlock(desc, flags); > - > - return ret; > -} > -EXPORT_SYMBOL_GPL(irq_set_vcpu_affinity); > - > static void irq_affinity_notify(struct work_struct *work) > { > struct irq_affinity_notify *notify = > @@ -424,6 +393,37 @@ setup_affinity(struct irq_desc *desc, struct cpumask *mask) > } > #endif > > +/** > + * irq_set_vcpu_affinity - Set vcpu affinity for the interrupt > + * @irq: interrupt number to set affinity > + * @vcpu_info: vCPU specific data > + * > + * This function uses the vCPU specific data to set the vCPU > + * affinity for an irq. The vCPU specific data is passed from > + * outside, such as KVM. One example code path is as below: > + * KVM -> IOMMU -> irq_set_vcpu_affinity(). > + */ > +int irq_set_vcpu_affinity(unsigned int irq, void *vcpu_info) > +{ > + unsigned long flags; > + struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0); > + struct irq_data *data; > + struct irq_chip *chip; > + int ret = -ENOSYS; > + > + if (!desc) > + return -EINVAL; > + > + data = irq_desc_get_irq_data(desc); > + chip = irq_data_get_irq_chip(data); > + if (chip && chip->irq_set_vcpu_affinity) > + ret = chip->irq_set_vcpu_affinity(data, vcpu_info); > + irq_put_desc_unlock(desc, flags); > + > + return ret; > +} > +EXPORT_SYMBOL_GPL(irq_set_vcpu_affinity); > + > void __disable_irq(struct irq_desc *desc) > { > if (!desc->depth++) >