* [PATCH] VT-d: avoid multi-message-MSI check for HPET
@ 2026-04-01 12:47 Jan Beulich
2026-04-09 17:36 ` Roger Pau Monné
0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2026-04-01 12:47 UTC (permalink / raw)
To: xen-devel@lists.xenproject.org; +Cc: Andrew Cooper, Roger Pau Monné
Having this immediately below a PCI-dev vs HPET conditional is (mildly)
confusing. Move that if() into the body of the earlier one.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -513,13 +513,13 @@ static int msi_msg_to_remap_entry(
if ( rc )
return rc;
+
+ if ( msi_desc->msi_attrib.type == PCI_CAP_ID_MSI )
+ nr = msi_desc->msi.nvec;
}
else
set_hpet_source_id(msi_desc->hpet_id, &new_ire);
- if ( msi_desc->msi_attrib.type == PCI_CAP_ID_MSI )
- nr = msi_desc->msi.nvec;
-
spin_lock_irqsave(&iommu->intremap.lock, flags);
if ( msg == NULL )
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] VT-d: avoid multi-message-MSI check for HPET
2026-04-01 12:47 [PATCH] VT-d: avoid multi-message-MSI check for HPET Jan Beulich
@ 2026-04-09 17:36 ` Roger Pau Monné
2026-04-10 5:51 ` Jan Beulich
0 siblings, 1 reply; 4+ messages in thread
From: Roger Pau Monné @ 2026-04-09 17:36 UTC (permalink / raw)
To: Jan Beulich; +Cc: xen-devel@lists.xenproject.org, Andrew Cooper
On Wed, Apr 01, 2026 at 02:47:48PM +0200, Jan Beulich wrote:
> Having this immediately below a PCI-dev vs HPET conditional is (mildly)
> confusing. Move that if() into the body of the earlier one.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/drivers/passthrough/vtd/intremap.c
> +++ b/xen/drivers/passthrough/vtd/intremap.c
> @@ -513,13 +513,13 @@ static int msi_msg_to_remap_entry(
>
> if ( rc )
> return rc;
> +
> + if ( msi_desc->msi_attrib.type == PCI_CAP_ID_MSI )
> + nr = msi_desc->msi.nvec;
> }
> else
> set_hpet_source_id(msi_desc->hpet_id, &new_ire);
>
> - if ( msi_desc->msi_attrib.type == PCI_CAP_ID_MSI )
> - nr = msi_desc->msi.nvec;
> -
I'm not fully opposed to this, but maybe it would be good to add a
small comment to note that HPET never use multi-vector MSI?
Thanks, Roger.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] VT-d: avoid multi-message-MSI check for HPET
2026-04-09 17:36 ` Roger Pau Monné
@ 2026-04-10 5:51 ` Jan Beulich
2026-04-10 12:34 ` Roger Pau Monné
0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2026-04-10 5:51 UTC (permalink / raw)
To: Roger Pau Monné; +Cc: xen-devel@lists.xenproject.org, Andrew Cooper
On 09.04.2026 19:36, Roger Pau Monné wrote:
> On Wed, Apr 01, 2026 at 02:47:48PM +0200, Jan Beulich wrote:
>> Having this immediately below a PCI-dev vs HPET conditional is (mildly)
>> confusing. Move that if() into the body of the earlier one.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>
>> --- a/xen/drivers/passthrough/vtd/intremap.c
>> +++ b/xen/drivers/passthrough/vtd/intremap.c
>> @@ -513,13 +513,13 @@ static int msi_msg_to_remap_entry(
>>
>> if ( rc )
>> return rc;
>> +
>> + if ( msi_desc->msi_attrib.type == PCI_CAP_ID_MSI )
>> + nr = msi_desc->msi.nvec;
>> }
>> else
>> set_hpet_source_id(msi_desc->hpet_id, &new_ire);
>>
>> - if ( msi_desc->msi_attrib.type == PCI_CAP_ID_MSI )
>> - nr = msi_desc->msi.nvec;
>> -
>
> I'm not fully opposed to this, but maybe it would be good to add a
> small comment to note that HPET never use multi-vector MSI?
That aspect doesn't change - HPET code simply doesn't (and never should)
set .type to PCI_CAP_ID_MSI. That field should reflect reality (and HPET,
iirc, simply leaves it at 0).
Jan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] VT-d: avoid multi-message-MSI check for HPET
2026-04-10 5:51 ` Jan Beulich
@ 2026-04-10 12:34 ` Roger Pau Monné
0 siblings, 0 replies; 4+ messages in thread
From: Roger Pau Monné @ 2026-04-10 12:34 UTC (permalink / raw)
To: Jan Beulich; +Cc: xen-devel@lists.xenproject.org, Andrew Cooper
On Fri, Apr 10, 2026 at 07:51:45AM +0200, Jan Beulich wrote:
> On 09.04.2026 19:36, Roger Pau Monné wrote:
> > On Wed, Apr 01, 2026 at 02:47:48PM +0200, Jan Beulich wrote:
> >> Having this immediately below a PCI-dev vs HPET conditional is (mildly)
> >> confusing. Move that if() into the body of the earlier one.
> >>
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >>
> >> --- a/xen/drivers/passthrough/vtd/intremap.c
> >> +++ b/xen/drivers/passthrough/vtd/intremap.c
> >> @@ -513,13 +513,13 @@ static int msi_msg_to_remap_entry(
> >>
> >> if ( rc )
> >> return rc;
> >> +
> >> + if ( msi_desc->msi_attrib.type == PCI_CAP_ID_MSI )
> >> + nr = msi_desc->msi.nvec;
> >> }
> >> else
> >> set_hpet_source_id(msi_desc->hpet_id, &new_ire);
> >>
> >> - if ( msi_desc->msi_attrib.type == PCI_CAP_ID_MSI )
> >> - nr = msi_desc->msi.nvec;
> >> -
> >
> > I'm not fully opposed to this, but maybe it would be good to add a
> > small comment to note that HPET never use multi-vector MSI?
>
> That aspect doesn't change - HPET code simply doesn't (and never should)
> set .type to PCI_CAP_ID_MSI. That field should reflect reality (and HPET,
> iirc, simply leaves it at 0).
Hm, I see, HPET is a very special case which have been "adjusted" to
fit the MSI generation logic.
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-04-10 12:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-01 12:47 [PATCH] VT-d: avoid multi-message-MSI check for HPET Jan Beulich
2026-04-09 17:36 ` Roger Pau Monné
2026-04-10 5:51 ` Jan Beulich
2026-04-10 12:34 ` 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.