xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/events: fix setting irq affinity
@ 2021-04-12  6:28 Juergen Gross
  2021-04-12  9:32 ` Jan Beulich
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Juergen Gross @ 2021-04-12  6:28 UTC (permalink / raw)
  To: stable; +Cc: Juergen Gross, Boris Ostrovsky, Stefano Stabellini, xen-devel

The backport of upstream patch 25da4618af240fbec61 ("xen/events: don't
unmask an event channel when an eoi is pending") introduced a
regression for stable kernels 5.10 and older: setting IRQ affinity for
IRQs related to interdomain events would no longer work, as moving the
IRQ to its new cpu was not included in the irq_ack callback for those
events.

Fix that by adding the needed call.

Note that kernels 5.11 and later don't need the explicit moving of the
IRQ to the target cpu in the irq_ack callback, due to a rework of the
affinity setting in kernel 5.11.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
This patch should be applied to all stable kernel branches up to
(including) linux-5.10.y, where upstream patch 25da4618af240fbec61 has
been added.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 drivers/xen/events/events_base.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 7bd03f6e0422..ee5269331406 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -1809,7 +1809,7 @@ static void lateeoi_ack_dynirq(struct irq_data *data)
 
 	if (VALID_EVTCHN(evtchn)) {
 		do_mask(info, EVT_MASK_REASON_EOI_PENDING);
-		event_handler_exit(info);
+		ack_dynirq(data);
 	}
 }
 
@@ -1820,7 +1820,7 @@ static void lateeoi_mask_ack_dynirq(struct irq_data *data)
 
 	if (VALID_EVTCHN(evtchn)) {
 		do_mask(info, EVT_MASK_REASON_EXPLICIT);
-		event_handler_exit(info);
+		ack_dynirq(data);
 	}
 }
 
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] xen/events: fix setting irq affinity
  2021-04-12  6:28 [PATCH] xen/events: fix setting irq affinity Juergen Gross
@ 2021-04-12  9:32 ` Jan Beulich
  2021-04-12  9:39   ` Juergen Gross
  2021-04-15 13:57 ` Greg KH
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 11+ messages in thread
From: Jan Beulich @ 2021-04-12  9:32 UTC (permalink / raw)
  To: Juergen Gross; +Cc: Boris Ostrovsky, Stefano Stabellini, xen-devel, stable

On 12.04.2021 08:28, Juergen Gross wrote:
> The backport of upstream patch 25da4618af240fbec61 ("xen/events: don't
> unmask an event channel when an eoi is pending") introduced a
> regression for stable kernels 5.10 and older: setting IRQ affinity for
> IRQs related to interdomain events would no longer work, as moving the
> IRQ to its new cpu was not included in the irq_ack callback for those
> events.
> 
> Fix that by adding the needed call.
> 
> Note that kernels 5.11 and later don't need the explicit moving of the
> IRQ to the target cpu in the irq_ack callback, due to a rework of the
> affinity setting in kernel 5.11.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> This patch should be applied to all stable kernel branches up to
> (including) linux-5.10.y, where upstream patch 25da4618af240fbec61 has
> been added.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

This looks functionally correct to me, so:
Reviewed-by: Jan Beulich <jbeulich@suse.com>

But I have remarks / questions:

> --- a/drivers/xen/events/events_base.c
> +++ b/drivers/xen/events/events_base.c
> @@ -1809,7 +1809,7 @@ static void lateeoi_ack_dynirq(struct irq_data *data)
>  
>  	if (VALID_EVTCHN(evtchn)) {
>  		do_mask(info, EVT_MASK_REASON_EOI_PENDING);
> -		event_handler_exit(info);
> +		ack_dynirq(data);
>  	}
>  }
>  
> @@ -1820,7 +1820,7 @@ static void lateeoi_mask_ack_dynirq(struct irq_data *data)
>  
>  	if (VALID_EVTCHN(evtchn)) {
>  		do_mask(info, EVT_MASK_REASON_EXPLICIT);
> -		event_handler_exit(info);
> +		ack_dynirq(data);
>  	}
>  }
>  

Can EVT_MASK_REASON_EOI_{PENDING,EXPLICIT} be cleared in a way racing
event_handler_exit() and (if it was called directly from here)
irq_move_masked_irq()? If not, the extra do_mask() / do_unmask() pair
(granted living on an "unlikely" path) could be avoided.

Even leaving aside the extra overhead in ack_dynirq()'s unlikely code
path, there's now some extra (redundant) processing. I guess this is
assumed to be within noise?

Possibly related, but first of all seeing the redundancy between
eoi_pirq() and ack_dynirq(): Wouldn't it make sense to break out the
common part into a helper? (Really the former could simply call the
latter as it seems.)

Jan


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] xen/events: fix setting irq affinity
  2021-04-12  9:32 ` Jan Beulich
@ 2021-04-12  9:39   ` Juergen Gross
  2021-04-12  9:45     ` Jan Beulich
  0 siblings, 1 reply; 11+ messages in thread
From: Juergen Gross @ 2021-04-12  9:39 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Boris Ostrovsky, Stefano Stabellini, xen-devel, stable


[-- Attachment #1.1.1: Type: text/plain, Size: 2742 bytes --]

On 12.04.21 11:32, Jan Beulich wrote:
> On 12.04.2021 08:28, Juergen Gross wrote:
>> The backport of upstream patch 25da4618af240fbec61 ("xen/events: don't
>> unmask an event channel when an eoi is pending") introduced a
>> regression for stable kernels 5.10 and older: setting IRQ affinity for
>> IRQs related to interdomain events would no longer work, as moving the
>> IRQ to its new cpu was not included in the irq_ack callback for those
>> events.
>>
>> Fix that by adding the needed call.
>>
>> Note that kernels 5.11 and later don't need the explicit moving of the
>> IRQ to the target cpu in the irq_ack callback, due to a rework of the
>> affinity setting in kernel 5.11.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> ---
>> This patch should be applied to all stable kernel branches up to
>> (including) linux-5.10.y, where upstream patch 25da4618af240fbec61 has
>> been added.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
> 
> This looks functionally correct to me, so:
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> 
> But I have remarks / questions:
> 
>> --- a/drivers/xen/events/events_base.c
>> +++ b/drivers/xen/events/events_base.c
>> @@ -1809,7 +1809,7 @@ static void lateeoi_ack_dynirq(struct irq_data *data)
>>   
>>   	if (VALID_EVTCHN(evtchn)) {
>>   		do_mask(info, EVT_MASK_REASON_EOI_PENDING);
>> -		event_handler_exit(info);
>> +		ack_dynirq(data);
>>   	}
>>   }
>>   
>> @@ -1820,7 +1820,7 @@ static void lateeoi_mask_ack_dynirq(struct irq_data *data)
>>   
>>   	if (VALID_EVTCHN(evtchn)) {
>>   		do_mask(info, EVT_MASK_REASON_EXPLICIT);
>> -		event_handler_exit(info);
>> +		ack_dynirq(data);
>>   	}
>>   }
>>   
> 
> Can EVT_MASK_REASON_EOI_{PENDING,EXPLICIT} be cleared in a way racing
> event_handler_exit() and (if it was called directly from here)
> irq_move_masked_irq()? If not, the extra do_mask() / do_unmask() pair
> (granted living on an "unlikely" path) could be avoided.

No, they can't race. And yes, the path is really unlikely, so I didn't
want to optimize this rare case.

> Even leaving aside the extra overhead in ack_dynirq()'s unlikely code
> path, there's now some extra (redundant) processing. I guess this is
> assumed to be within noise?

Yes. All required data should be in the caches already, and the extra
processing is only a few instructions.

> Possibly related, but first of all seeing the redundancy between
> eoi_pirq() and ack_dynirq(): Wouldn't it make sense to break out the
> common part into a helper? (Really the former could simply call the
> latter as it seems.)

In theory, yes. OTOH this no longer applies to upstream, so i dind't
bother doing that for stable.


Juergen

[-- Attachment #1.1.2: OpenPGP_0xB0DE9DD628BF132F.asc --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] xen/events: fix setting irq affinity
  2021-04-12  9:39   ` Juergen Gross
@ 2021-04-12  9:45     ` Jan Beulich
  0 siblings, 0 replies; 11+ messages in thread
From: Jan Beulich @ 2021-04-12  9:45 UTC (permalink / raw)
  To: Juergen Gross; +Cc: Boris Ostrovsky, Stefano Stabellini, xen-devel, stable

On 12.04.2021 11:39, Juergen Gross wrote:
> On 12.04.21 11:32, Jan Beulich wrote:
>> Possibly related, but first of all seeing the redundancy between
>> eoi_pirq() and ack_dynirq(): Wouldn't it make sense to break out the
>> common part into a helper? (Really the former could simply call the
>> latter as it seems.)
> 
> In theory, yes. OTOH this no longer applies to upstream, so i dind't
> bother doing that for stable.

Oh, I guess I should have check the tip of the tree first...

Jan


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] xen/events: fix setting irq affinity
  2021-04-12  6:28 [PATCH] xen/events: fix setting irq affinity Juergen Gross
  2021-04-12  9:32 ` Jan Beulich
@ 2021-04-15 13:57 ` Greg KH
  2021-04-15 14:03 ` Patch "xen/events: fix setting irq affinity" has been added to the 4.4-stable tree gregkh
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Greg KH @ 2021-04-15 13:57 UTC (permalink / raw)
  To: Juergen Gross; +Cc: stable, Boris Ostrovsky, Stefano Stabellini, xen-devel

On Mon, Apr 12, 2021 at 08:28:45AM +0200, Juergen Gross wrote:
> The backport of upstream patch 25da4618af240fbec61 ("xen/events: don't
> unmask an event channel when an eoi is pending") introduced a
> regression for stable kernels 5.10 and older: setting IRQ affinity for
> IRQs related to interdomain events would no longer work, as moving the
> IRQ to its new cpu was not included in the irq_ack callback for those
> events.
> 
> Fix that by adding the needed call.
> 
> Note that kernels 5.11 and later don't need the explicit moving of the
> IRQ to the target cpu in the irq_ack callback, due to a rework of the
> affinity setting in kernel 5.11.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> This patch should be applied to all stable kernel branches up to
> (including) linux-5.10.y, where upstream patch 25da4618af240fbec61 has
> been added.

Now queued up, thanks.

greg k-h


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Patch "xen/events: fix setting irq affinity" has been added to the 4.4-stable tree
  2021-04-12  6:28 [PATCH] xen/events: fix setting irq affinity Juergen Gross
  2021-04-12  9:32 ` Jan Beulich
  2021-04-15 13:57 ` Greg KH
@ 2021-04-15 14:03 ` gregkh
  2021-04-15 14:03 ` Patch "xen/events: fix setting irq affinity" has been added to the 4.9-stable tree gregkh
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: gregkh @ 2021-04-15 14:03 UTC (permalink / raw)
  To: boris.ostrovsky, gregkh, jgross, sstabellini, xen-devel; +Cc: stable-commits


This is a note to let you know that I've just added the patch titled

    xen/events: fix setting irq affinity

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     xen-events-fix-setting-irq-affinity.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From jgross@suse.com  Thu Apr 15 15:56:08 2021
From: Juergen Gross <jgross@suse.com>
Date: Mon, 12 Apr 2021 08:28:45 +0200
Subject: xen/events: fix setting irq affinity
To: stable@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Message-ID: <20210412062845.13946-1-jgross@suse.com>

From: Juergen Gross <jgross@suse.com>

The backport of upstream patch 25da4618af240fbec61 ("xen/events: don't
unmask an event channel when an eoi is pending") introduced a
regression for stable kernels 5.10 and older: setting IRQ affinity for
IRQs related to interdomain events would no longer work, as moving the
IRQ to its new cpu was not included in the irq_ack callback for those
events.

Fix that by adding the needed call.

Note that kernels 5.11 and later don't need the explicit moving of the
IRQ to the target cpu in the irq_ack callback, due to a rework of the
affinity setting in kernel 5.11.

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/xen/events/events_base.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -1779,7 +1779,7 @@ static void lateeoi_ack_dynirq(struct ir
 
 	if (VALID_EVTCHN(evtchn)) {
 		do_mask(info, EVT_MASK_REASON_EOI_PENDING);
-		event_handler_exit(info);
+		ack_dynirq(data);
 	}
 }
 
@@ -1790,7 +1790,7 @@ static void lateeoi_mask_ack_dynirq(stru
 
 	if (VALID_EVTCHN(evtchn)) {
 		do_mask(info, EVT_MASK_REASON_EXPLICIT);
-		event_handler_exit(info);
+		ack_dynirq(data);
 	}
 }
 


Patches currently in stable-queue which might be from jgross@suse.com are

queue-4.4/xen-events-fix-setting-irq-affinity.patch


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Patch "xen/events: fix setting irq affinity" has been added to the 4.9-stable tree
  2021-04-12  6:28 [PATCH] xen/events: fix setting irq affinity Juergen Gross
                   ` (2 preceding siblings ...)
  2021-04-15 14:03 ` Patch "xen/events: fix setting irq affinity" has been added to the 4.4-stable tree gregkh
@ 2021-04-15 14:03 ` gregkh
  2021-04-15 14:03 ` Patch "xen/events: fix setting irq affinity" has been added to the 4.14-stable tree gregkh
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: gregkh @ 2021-04-15 14:03 UTC (permalink / raw)
  To: boris.ostrovsky, gregkh, jgross, sstabellini, xen-devel; +Cc: stable-commits


This is a note to let you know that I've just added the patch titled

    xen/events: fix setting irq affinity

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     xen-events-fix-setting-irq-affinity.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From jgross@suse.com  Thu Apr 15 15:56:08 2021
From: Juergen Gross <jgross@suse.com>
Date: Mon, 12 Apr 2021 08:28:45 +0200
Subject: xen/events: fix setting irq affinity
To: stable@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Message-ID: <20210412062845.13946-1-jgross@suse.com>

From: Juergen Gross <jgross@suse.com>

The backport of upstream patch 25da4618af240fbec61 ("xen/events: don't
unmask an event channel when an eoi is pending") introduced a
regression for stable kernels 5.10 and older: setting IRQ affinity for
IRQs related to interdomain events would no longer work, as moving the
IRQ to its new cpu was not included in the irq_ack callback for those
events.

Fix that by adding the needed call.

Note that kernels 5.11 and later don't need the explicit moving of the
IRQ to the target cpu in the irq_ack callback, due to a rework of the
affinity setting in kernel 5.11.

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/xen/events/events_base.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -1780,7 +1780,7 @@ static void lateeoi_ack_dynirq(struct ir
 
 	if (VALID_EVTCHN(evtchn)) {
 		do_mask(info, EVT_MASK_REASON_EOI_PENDING);
-		event_handler_exit(info);
+		ack_dynirq(data);
 	}
 }
 
@@ -1791,7 +1791,7 @@ static void lateeoi_mask_ack_dynirq(stru
 
 	if (VALID_EVTCHN(evtchn)) {
 		do_mask(info, EVT_MASK_REASON_EXPLICIT);
-		event_handler_exit(info);
+		ack_dynirq(data);
 	}
 }
 


Patches currently in stable-queue which might be from jgross@suse.com are

queue-4.9/xen-events-fix-setting-irq-affinity.patch


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Patch "xen/events: fix setting irq affinity" has been added to the 4.14-stable tree
  2021-04-12  6:28 [PATCH] xen/events: fix setting irq affinity Juergen Gross
                   ` (3 preceding siblings ...)
  2021-04-15 14:03 ` Patch "xen/events: fix setting irq affinity" has been added to the 4.9-stable tree gregkh
@ 2021-04-15 14:03 ` gregkh
  2021-04-15 14:04 ` Patch "xen/events: fix setting irq affinity" has been added to the 4.19-stable tree gregkh
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: gregkh @ 2021-04-15 14:03 UTC (permalink / raw)
  To: boris.ostrovsky, gregkh, jgross, sstabellini, xen-devel; +Cc: stable-commits


This is a note to let you know that I've just added the patch titled

    xen/events: fix setting irq affinity

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     xen-events-fix-setting-irq-affinity.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From jgross@suse.com  Thu Apr 15 15:56:08 2021
From: Juergen Gross <jgross@suse.com>
Date: Mon, 12 Apr 2021 08:28:45 +0200
Subject: xen/events: fix setting irq affinity
To: stable@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Message-ID: <20210412062845.13946-1-jgross@suse.com>

From: Juergen Gross <jgross@suse.com>

The backport of upstream patch 25da4618af240fbec61 ("xen/events: don't
unmask an event channel when an eoi is pending") introduced a
regression for stable kernels 5.10 and older: setting IRQ affinity for
IRQs related to interdomain events would no longer work, as moving the
IRQ to its new cpu was not included in the irq_ack callback for those
events.

Fix that by adding the needed call.

Note that kernels 5.11 and later don't need the explicit moving of the
IRQ to the target cpu in the irq_ack callback, due to a rework of the
affinity setting in kernel 5.11.

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/xen/events/events_base.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -1782,7 +1782,7 @@ static void lateeoi_ack_dynirq(struct ir
 
 	if (VALID_EVTCHN(evtchn)) {
 		do_mask(info, EVT_MASK_REASON_EOI_PENDING);
-		event_handler_exit(info);
+		ack_dynirq(data);
 	}
 }
 
@@ -1793,7 +1793,7 @@ static void lateeoi_mask_ack_dynirq(stru
 
 	if (VALID_EVTCHN(evtchn)) {
 		do_mask(info, EVT_MASK_REASON_EXPLICIT);
-		event_handler_exit(info);
+		ack_dynirq(data);
 	}
 }
 


Patches currently in stable-queue which might be from jgross@suse.com are

queue-4.14/xen-events-fix-setting-irq-affinity.patch


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Patch "xen/events: fix setting irq affinity" has been added to the 4.19-stable tree
  2021-04-12  6:28 [PATCH] xen/events: fix setting irq affinity Juergen Gross
                   ` (4 preceding siblings ...)
  2021-04-15 14:03 ` Patch "xen/events: fix setting irq affinity" has been added to the 4.14-stable tree gregkh
@ 2021-04-15 14:04 ` gregkh
  2021-04-15 14:04 ` Patch "xen/events: fix setting irq affinity" has been added to the 5.4-stable tree gregkh
  2021-04-15 14:04 ` Patch "xen/events: fix setting irq affinity" has been added to the 5.10-stable tree gregkh
  7 siblings, 0 replies; 11+ messages in thread
From: gregkh @ 2021-04-15 14:04 UTC (permalink / raw)
  To: boris.ostrovsky, gregkh, jgross, sstabellini, xen-devel; +Cc: stable-commits


This is a note to let you know that I've just added the patch titled

    xen/events: fix setting irq affinity

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     xen-events-fix-setting-irq-affinity.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From jgross@suse.com  Thu Apr 15 15:56:08 2021
From: Juergen Gross <jgross@suse.com>
Date: Mon, 12 Apr 2021 08:28:45 +0200
Subject: xen/events: fix setting irq affinity
To: stable@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Message-ID: <20210412062845.13946-1-jgross@suse.com>

From: Juergen Gross <jgross@suse.com>

The backport of upstream patch 25da4618af240fbec61 ("xen/events: don't
unmask an event channel when an eoi is pending") introduced a
regression for stable kernels 5.10 and older: setting IRQ affinity for
IRQs related to interdomain events would no longer work, as moving the
IRQ to its new cpu was not included in the irq_ack callback for those
events.

Fix that by adding the needed call.

Note that kernels 5.11 and later don't need the explicit moving of the
IRQ to the target cpu in the irq_ack callback, due to a rework of the
affinity setting in kernel 5.11.

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/xen/events/events_base.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -1782,7 +1782,7 @@ static void lateeoi_ack_dynirq(struct ir
 
 	if (VALID_EVTCHN(evtchn)) {
 		do_mask(info, EVT_MASK_REASON_EOI_PENDING);
-		event_handler_exit(info);
+		ack_dynirq(data);
 	}
 }
 
@@ -1793,7 +1793,7 @@ static void lateeoi_mask_ack_dynirq(stru
 
 	if (VALID_EVTCHN(evtchn)) {
 		do_mask(info, EVT_MASK_REASON_EXPLICIT);
-		event_handler_exit(info);
+		ack_dynirq(data);
 	}
 }
 


Patches currently in stable-queue which might be from jgross@suse.com are

queue-4.19/xen-events-fix-setting-irq-affinity.patch


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Patch "xen/events: fix setting irq affinity" has been added to the 5.4-stable tree
  2021-04-12  6:28 [PATCH] xen/events: fix setting irq affinity Juergen Gross
                   ` (5 preceding siblings ...)
  2021-04-15 14:04 ` Patch "xen/events: fix setting irq affinity" has been added to the 4.19-stable tree gregkh
@ 2021-04-15 14:04 ` gregkh
  2021-04-15 14:04 ` Patch "xen/events: fix setting irq affinity" has been added to the 5.10-stable tree gregkh
  7 siblings, 0 replies; 11+ messages in thread
From: gregkh @ 2021-04-15 14:04 UTC (permalink / raw)
  To: boris.ostrovsky, gregkh, jgross, sstabellini, xen-devel; +Cc: stable-commits


This is a note to let you know that I've just added the patch titled

    xen/events: fix setting irq affinity

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     xen-events-fix-setting-irq-affinity.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From jgross@suse.com  Thu Apr 15 15:56:08 2021
From: Juergen Gross <jgross@suse.com>
Date: Mon, 12 Apr 2021 08:28:45 +0200
Subject: xen/events: fix setting irq affinity
To: stable@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Message-ID: <20210412062845.13946-1-jgross@suse.com>

From: Juergen Gross <jgross@suse.com>

The backport of upstream patch 25da4618af240fbec61 ("xen/events: don't
unmask an event channel when an eoi is pending") introduced a
regression for stable kernels 5.10 and older: setting IRQ affinity for
IRQs related to interdomain events would no longer work, as moving the
IRQ to its new cpu was not included in the irq_ack callback for those
events.

Fix that by adding the needed call.

Note that kernels 5.11 and later don't need the explicit moving of the
IRQ to the target cpu in the irq_ack callback, due to a rework of the
affinity setting in kernel 5.11.

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/xen/events/events_base.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -1783,7 +1783,7 @@ static void lateeoi_ack_dynirq(struct ir
 
 	if (VALID_EVTCHN(evtchn)) {
 		do_mask(info, EVT_MASK_REASON_EOI_PENDING);
-		event_handler_exit(info);
+		ack_dynirq(data);
 	}
 }
 
@@ -1794,7 +1794,7 @@ static void lateeoi_mask_ack_dynirq(stru
 
 	if (VALID_EVTCHN(evtchn)) {
 		do_mask(info, EVT_MASK_REASON_EXPLICIT);
-		event_handler_exit(info);
+		ack_dynirq(data);
 	}
 }
 


Patches currently in stable-queue which might be from jgross@suse.com are

queue-5.4/xen-events-fix-setting-irq-affinity.patch


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Patch "xen/events: fix setting irq affinity" has been added to the 5.10-stable tree
  2021-04-12  6:28 [PATCH] xen/events: fix setting irq affinity Juergen Gross
                   ` (6 preceding siblings ...)
  2021-04-15 14:04 ` Patch "xen/events: fix setting irq affinity" has been added to the 5.4-stable tree gregkh
@ 2021-04-15 14:04 ` gregkh
  7 siblings, 0 replies; 11+ messages in thread
From: gregkh @ 2021-04-15 14:04 UTC (permalink / raw)
  To: boris.ostrovsky, gregkh, jgross, sstabellini, xen-devel; +Cc: stable-commits


This is a note to let you know that I've just added the patch titled

    xen/events: fix setting irq affinity

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     xen-events-fix-setting-irq-affinity.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From jgross@suse.com  Thu Apr 15 15:56:08 2021
From: Juergen Gross <jgross@suse.com>
Date: Mon, 12 Apr 2021 08:28:45 +0200
Subject: xen/events: fix setting irq affinity
To: stable@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Message-ID: <20210412062845.13946-1-jgross@suse.com>

From: Juergen Gross <jgross@suse.com>

The backport of upstream patch 25da4618af240fbec61 ("xen/events: don't
unmask an event channel when an eoi is pending") introduced a
regression for stable kernels 5.10 and older: setting IRQ affinity for
IRQs related to interdomain events would no longer work, as moving the
IRQ to its new cpu was not included in the irq_ack callback for those
events.

Fix that by adding the needed call.

Note that kernels 5.11 and later don't need the explicit moving of the
IRQ to the target cpu in the irq_ack callback, due to a rework of the
affinity setting in kernel 5.11.

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/xen/events/events_base.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -1809,7 +1809,7 @@ static void lateeoi_ack_dynirq(struct ir
 
 	if (VALID_EVTCHN(evtchn)) {
 		do_mask(info, EVT_MASK_REASON_EOI_PENDING);
-		event_handler_exit(info);
+		ack_dynirq(data);
 	}
 }
 
@@ -1820,7 +1820,7 @@ static void lateeoi_mask_ack_dynirq(stru
 
 	if (VALID_EVTCHN(evtchn)) {
 		do_mask(info, EVT_MASK_REASON_EXPLICIT);
-		event_handler_exit(info);
+		ack_dynirq(data);
 	}
 }
 


Patches currently in stable-queue which might be from jgross@suse.com are

queue-5.10/xen-events-fix-setting-irq-affinity.patch


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-04-15 14:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12  6:28 [PATCH] xen/events: fix setting irq affinity Juergen Gross
2021-04-12  9:32 ` Jan Beulich
2021-04-12  9:39   ` Juergen Gross
2021-04-12  9:45     ` Jan Beulich
2021-04-15 13:57 ` Greg KH
2021-04-15 14:03 ` Patch "xen/events: fix setting irq affinity" has been added to the 4.4-stable tree gregkh
2021-04-15 14:03 ` Patch "xen/events: fix setting irq affinity" has been added to the 4.9-stable tree gregkh
2021-04-15 14:03 ` Patch "xen/events: fix setting irq affinity" has been added to the 4.14-stable tree gregkh
2021-04-15 14:04 ` Patch "xen/events: fix setting irq affinity" has been added to the 4.19-stable tree gregkh
2021-04-15 14:04 ` Patch "xen/events: fix setting irq affinity" has been added to the 5.4-stable tree gregkh
2021-04-15 14:04 ` Patch "xen/events: fix setting irq affinity" has been added to the 5.10-stable tree gregkh

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).