Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1238776 > unrolled thread

[PATCH] genirq: Move irq_set_vcpu_affinity out of "#ifdef CONFIG_SMP"

Started byFeng Wu <feng.wu@intel.com>
First post2015-10-03 10:40 +0200
Last post2015-10-03 11:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] genirq: Move irq_set_vcpu_affinity out of "#ifdef CONFIG_SMP" Feng Wu <feng.wu@intel.com> - 2015-10-03 10:40 +0200
    Re: [PATCH] genirq: Move irq_set_vcpu_affinity out of "#ifdef  CONFIG_SMP" Jiang Liu <jiang.liu@linux.intel.com> - 2015-10-03 11:20 +0200

#1238776 — [PATCH] genirq: Move irq_set_vcpu_affinity out of "#ifdef CONFIG_SMP"

FromFeng Wu <feng.wu@intel.com>
Date2015-10-03 10:40 +0200
Subject[PATCH] genirq: Move irq_set_vcpu_affinity out of "#ifdef CONFIG_SMP"
Message-ID<qfqwh-4YI-9@gated-at.bofh.it>
irq_set_vcpu_affinity() is needed when CONFIG_SMP=n, so move the
definition out of "#ifdef CONFIG_SMP"

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Feng Wu <feng.wu@intel.com>
---
 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++)
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1238783 — Re: [PATCH] genirq: Move irq_set_vcpu_affinity out of "#ifdef CONFIG_SMP"

FromJiang Liu <jiang.liu@linux.intel.com>
Date2015-10-03 11:20 +0200
SubjectRe: [PATCH] genirq: Move irq_set_vcpu_affinity out of "#ifdef CONFIG_SMP"
Message-ID<qfr8Z-5WV-9@gated-at.bofh.it>
In reply to#1238776
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 <pbonzini@redhat.com>
> Signed-off-by: Feng Wu <feng.wu@intel.com>

Reviewed-by: Jiang Liu <jiang.liu@linux.intel.com>

> ---
>  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++)
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web