All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/MSI: adjust permitted vector range
@ 2025-11-12 15:45 Jan Beulich
  2026-02-02 15:54 ` Roger Pau Monné
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2025-11-12 15:45 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org; +Cc: Andrew Cooper, Roger Pau Monné

It's really FIRST_IRQ_VECTOR vector which is meant here, i.e. effectively
there is a form of open-coding in use right now.

No change in practice, due to the present aliasing.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
While doing the HPET work I had to fiddle with this, even if in the end
no vector below FIRST_DYNAMIC_VECTOR is being used there (for now at
least).

--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -158,7 +158,7 @@ void msi_compose_msg(unsigned vector, co
 {
     memset(msg, 0, sizeof(*msg));
 
-    if ( vector < FIRST_DYNAMIC_VECTOR )
+    if ( vector < FIRST_IRQ_VECTOR )
         return;
 
     if ( cpu_mask )


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

* Re: [PATCH] x86/MSI: adjust permitted vector range
  2025-11-12 15:45 [PATCH] x86/MSI: adjust permitted vector range Jan Beulich
@ 2026-02-02 15:54 ` Roger Pau Monné
  2026-02-02 16:12   ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Roger Pau Monné @ 2026-02-02 15:54 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel@lists.xenproject.org, Andrew Cooper

On Wed, Nov 12, 2025 at 04:45:05PM +0100, Jan Beulich wrote:
> It's really FIRST_IRQ_VECTOR vector which is meant here, i.e. effectively
> there is a form of open-coding in use right now.
> 
> No change in practice, due to the present aliasing.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> While doing the HPET work I had to fiddle with this, even if in the end
> no vector below FIRST_DYNAMIC_VECTOR is being used there (for now at
> least).
> 
> --- a/xen/arch/x86/msi.c
> +++ b/xen/arch/x86/msi.c
> @@ -158,7 +158,7 @@ void msi_compose_msg(unsigned vector, co
>  {
>      memset(msg, 0, sizeof(*msg));
>  
> -    if ( vector < FIRST_DYNAMIC_VECTOR )
> +    if ( vector < FIRST_IRQ_VECTOR )

Should vector also be rejected if it's > LAST_IRQ_VECTOR?

Thanks, Roger.


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

* Re: [PATCH] x86/MSI: adjust permitted vector range
  2026-02-02 15:54 ` Roger Pau Monné
@ 2026-02-02 16:12   ` Jan Beulich
  2026-02-02 17:47     ` Roger Pau Monné
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2026-02-02 16:12 UTC (permalink / raw)
  To: Roger Pau Monné; +Cc: xen-devel@lists.xenproject.org, Andrew Cooper

On 02.02.2026 16:54, Roger Pau Monné wrote:
> On Wed, Nov 12, 2025 at 04:45:05PM +0100, Jan Beulich wrote:
>> It's really FIRST_IRQ_VECTOR vector which is meant here, i.e. effectively
>> there is a form of open-coding in use right now.
>>
>> No change in practice, due to the present aliasing.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> While doing the HPET work I had to fiddle with this, even if in the end
>> no vector below FIRST_DYNAMIC_VECTOR is being used there (for now at
>> least).
>>
>> --- a/xen/arch/x86/msi.c
>> +++ b/xen/arch/x86/msi.c
>> @@ -158,7 +158,7 @@ void msi_compose_msg(unsigned vector, co
>>  {
>>      memset(msg, 0, sizeof(*msg));
>>  
>> -    if ( vector < FIRST_DYNAMIC_VECTOR )
>> +    if ( vector < FIRST_IRQ_VECTOR )
> 
> Should vector also be rejected if it's > LAST_IRQ_VECTOR?

That's a good question for which I don't have a good answer. I can't exclude
that composing an MSI message (for purposes other than using in an MSI
capability) might make sense with a vector above LAST_IRQ_VECTOR. Originally
(as hinted at in the post-commit-message remark) this change was part of the
HPET work, where it was an actual functional change as in an early version I
needed to move FIRST_IRQ_VECTOR down (i.e. decouple it from
FIRST_DYNAMIC_VECTOR). There the "composed" message was used to fill
HPET_T<n>_ROUTE. Something similar might be wanted elsewhere, and it's not
quite clear to me whether in such a situation LAST_IRQ_VECTOR would then
also need moving (likely it would).

Right here I'm really only after the semantic, but non-functional change. If
we can settle on also enforcing an upper bound, I think that would then want
to be another change on top.

Jan


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

* Re: [PATCH] x86/MSI: adjust permitted vector range
  2026-02-02 16:12   ` Jan Beulich
@ 2026-02-02 17:47     ` Roger Pau Monné
  0 siblings, 0 replies; 4+ messages in thread
From: Roger Pau Monné @ 2026-02-02 17:47 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel@lists.xenproject.org, Andrew Cooper

On Mon, Feb 02, 2026 at 05:12:40PM +0100, Jan Beulich wrote:
> On 02.02.2026 16:54, Roger Pau Monné wrote:
> > On Wed, Nov 12, 2025 at 04:45:05PM +0100, Jan Beulich wrote:
> >> It's really FIRST_IRQ_VECTOR vector which is meant here, i.e. effectively
> >> there is a form of open-coding in use right now.
> >>
> >> No change in practice, due to the present aliasing.
> >>
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >> ---
> >> While doing the HPET work I had to fiddle with this, even if in the end
> >> no vector below FIRST_DYNAMIC_VECTOR is being used there (for now at
> >> least).
> >>
> >> --- a/xen/arch/x86/msi.c
> >> +++ b/xen/arch/x86/msi.c
> >> @@ -158,7 +158,7 @@ void msi_compose_msg(unsigned vector, co
> >>  {
> >>      memset(msg, 0, sizeof(*msg));
> >>  
> >> -    if ( vector < FIRST_DYNAMIC_VECTOR )
> >> +    if ( vector < FIRST_IRQ_VECTOR )
> > 
> > Should vector also be rejected if it's > LAST_IRQ_VECTOR?
> 
> That's a good question for which I don't have a good answer. I can't exclude
> that composing an MSI message (for purposes other than using in an MSI
> capability) might make sense with a vector above LAST_IRQ_VECTOR. Originally
> (as hinted at in the post-commit-message remark) this change was part of the
> HPET work, where it was an actual functional change as in an early version I
> needed to move FIRST_IRQ_VECTOR down (i.e. decouple it from
> FIRST_DYNAMIC_VECTOR). There the "composed" message was used to fill
> HPET_T<n>_ROUTE. Something similar might be wanted elsewhere, and it's not
> quite clear to me whether in such a situation LAST_IRQ_VECTOR would then
> also need moving (likely it would).

It's possible that we could add a range between FIRST_IRQ_VECTOR and
FIRST_DYNAMIC_VECTOR that could be used for fixed low priority
vectors.

> Right here I'm really only after the semantic, but non-functional change. If
> we can settle on also enforcing an upper bound, I think that would then want
> to be another change on top.

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks, Roger.


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

end of thread, other threads:[~2026-02-02 17:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-12 15:45 [PATCH] x86/MSI: adjust permitted vector range Jan Beulich
2026-02-02 15:54 ` Roger Pau Monné
2026-02-02 16:12   ` Jan Beulich
2026-02-02 17:47     ` Roger Pau Monné

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.