* [PATCH] genirq: Move irq_set_vcpu_affinity out of "#ifdef CONFIG_SMP"
@ 2015-10-03 8:20 Feng Wu
2015-10-03 9:10 ` Jiang Liu
2015-10-09 20:54 ` [tip:irq/core] genirq: Make irq_set_vcpu_affinity available for CONFIG_SMP=n tip-bot for Feng Wu
0 siblings, 2 replies; 5+ messages in thread
From: Feng Wu @ 2015-10-03 8:20 UTC (permalink / raw)
To: tglx, pbonzini; +Cc: kvm, linux-kernel, jiang.liu, Feng Wu
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] genirq: Move irq_set_vcpu_affinity out of "#ifdef CONFIG_SMP"
2015-10-03 8:20 [PATCH] genirq: Move irq_set_vcpu_affinity out of "#ifdef CONFIG_SMP" Feng Wu
@ 2015-10-03 9:10 ` Jiang Liu
2015-10-08 4:43 ` Wu, Feng
2015-10-09 20:54 ` [tip:irq/core] genirq: Make irq_set_vcpu_affinity available for CONFIG_SMP=n tip-bot for Feng Wu
1 sibling, 1 reply; 5+ messages in thread
From: Jiang Liu @ 2015-10-03 9:10 UTC (permalink / raw)
To: Feng Wu, tglx, pbonzini; +Cc: kvm, linux-kernel
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++)
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] genirq: Move irq_set_vcpu_affinity out of "#ifdef CONFIG_SMP"
2015-10-03 9:10 ` Jiang Liu
@ 2015-10-08 4:43 ` Wu, Feng
2015-10-09 11:18 ` Paolo Bonzini
0 siblings, 1 reply; 5+ messages in thread
From: Wu, Feng @ 2015-10-08 4:43 UTC (permalink / raw)
To: tglx, pbonzini; +Cc: kvm, linux-kernel, Jiang Liu, Wu, Feng
Hi Thomas & Paolo,
> -----Original Message-----
> From: Jiang Liu [mailto:jiang.liu@linux.intel.com]
> Sent: Saturday, October 03, 2015 5:11 PM
> To: Wu, Feng; tglx@linutronix.de; pbonzini@redhat.com
> Cc: kvm@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] genirq: Move irq_set_vcpu_affinity out of "#ifdef
> CONFIG_SMP"
>
> 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"
What is your option about this patch, Thanks a lot!
Thanks,
Feng
> >
> > 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++)
> >
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] genirq: Move irq_set_vcpu_affinity out of "#ifdef CONFIG_SMP"
2015-10-08 4:43 ` Wu, Feng
@ 2015-10-09 11:18 ` Paolo Bonzini
0 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2015-10-09 11:18 UTC (permalink / raw)
To: Wu, Feng, tglx; +Cc: kvm, linux-kernel, Jiang Liu
On 08/10/2015 06:43, Wu, Feng wrote:
> Hi Thomas & Paolo,
>
> What is your option about this patch, Thanks a lot!
>
> Thanks,
> Feng
>
>>> 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++)
>>>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo
^ permalink raw reply [flat|nested] 5+ messages in thread
* [tip:irq/core] genirq: Make irq_set_vcpu_affinity available for CONFIG_SMP=n
2015-10-03 8:20 [PATCH] genirq: Move irq_set_vcpu_affinity out of "#ifdef CONFIG_SMP" Feng Wu
2015-10-03 9:10 ` Jiang Liu
@ 2015-10-09 20:54 ` tip-bot for Feng Wu
1 sibling, 0 replies; 5+ messages in thread
From: tip-bot for Feng Wu @ 2015-10-09 20:54 UTC (permalink / raw)
To: linux-tip-commits; +Cc: hpa, tglx, pbonzini, feng.wu, linux-kernel, mingo
Commit-ID: fcf1ae2f7a044cda9956ec7afb487296afff058e
Gitweb: http://git.kernel.org/tip/fcf1ae2f7a044cda9956ec7afb487296afff058e
Author: Feng Wu <feng.wu@intel.com>
AuthorDate: Sat, 3 Oct 2015 16:20:38 +0800
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 9 Oct 2015 22:47:27 +0200
genirq: Make irq_set_vcpu_affinity available for CONFIG_SMP=n
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>
Cc: jiang.liu@linux.intel.com
Cc: pbonzini@redhat.com
Link: http://lkml.kernel.org/r/1443860438-144926-1-git-send-email-feng.wu@intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
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 0a63c2b..312f9cb 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++)
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-10-09 20:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-03 8:20 [PATCH] genirq: Move irq_set_vcpu_affinity out of "#ifdef CONFIG_SMP" Feng Wu
2015-10-03 9:10 ` Jiang Liu
2015-10-08 4:43 ` Wu, Feng
2015-10-09 11:18 ` Paolo Bonzini
2015-10-09 20:54 ` [tip:irq/core] genirq: Make irq_set_vcpu_affinity available for CONFIG_SMP=n tip-bot for Feng Wu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).