diff mbox series

[V2,23/46] irqdomain/msi: Provide DOMAIN_BUS_VMD_MSI

Message ID 20200826112332.954409970@linutronix.de (mailing list archive)
State New, archived
Headers show
Series x86, PCI, XEN, genirq ...: Prepare for device MSI | expand

Commit Message

Thomas Gleixner Aug. 26, 2020, 11:16 a.m. UTC
From: Thomas Gleixner <tglx@linutronix.de>

PCI devices behind a VMD bus are not subject to interrupt remapping, but
the irq domain for VMD MSI cannot be distinguished from a regular PCI/MSI
irq domain.

Add a new domain bus token and allow it in the bus token check in
msi_check_reservation_mode() to keep the functionality the same once VMD
uses this token.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 include/linux/irqdomain.h |    1 +
 kernel/irq/msi.c          |    7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

Comments

Marc Zyngier Aug. 26, 2020, 8:42 p.m. UTC | #1
On Wed, 26 Aug 2020 12:16:51 +0100,
Thomas Gleixner <tglx@linutronix.de> wrote:
> 
> From: Thomas Gleixner <tglx@linutronix.de>
> 
> PCI devices behind a VMD bus are not subject to interrupt remapping, but
> the irq domain for VMD MSI cannot be distinguished from a regular PCI/MSI
> irq domain.
> 
> Add a new domain bus token and allow it in the bus token check in
> msi_check_reservation_mode() to keep the functionality the same once VMD
> uses this token.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> 
> ---
>  include/linux/irqdomain.h |    1 +
>  kernel/irq/msi.c          |    7 ++++++-
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> --- a/include/linux/irqdomain.h
> +++ b/include/linux/irqdomain.h
> @@ -84,6 +84,7 @@ enum irq_domain_bus_token {
>  	DOMAIN_BUS_FSL_MC_MSI,
>  	DOMAIN_BUS_TI_SCI_INTA_MSI,
>  	DOMAIN_BUS_WAKEUP,
> +	DOMAIN_BUS_VMD_MSI,
>  };
>  
>  /**
> --- a/kernel/irq/msi.c
> +++ b/kernel/irq/msi.c
> @@ -370,8 +370,13 @@ static bool msi_check_reservation_mode(s
>  {
>  	struct msi_desc *desc;
>  
> -	if (domain->bus_token != DOMAIN_BUS_PCI_MSI)
> +	switch(domain->bus_token) {
> +	case DOMAIN_BUS_PCI_MSI:
> +	case DOMAIN_BUS_VMD_MSI:
> +		break;
> +	default:
>  		return false;
> +	}
>  
>  	if (!(info->flags & MSI_FLAG_MUST_REACTIVATE))
>  		return false;

Acked-by: Marc Zyngier <maz@kernel.org>

	M.
Jon Derrick Aug. 26, 2020, 8:57 p.m. UTC | #2
On Wed, 2020-08-26 at 21:42 +0100, Marc Zyngier wrote:
> On Wed, 26 Aug 2020 12:16:51 +0100,
> Thomas Gleixner <tglx@linutronix.de> wrote:
> > From: Thomas Gleixner <tglx@linutronix.de>
> > 
> > PCI devices behind a VMD bus are not subject to interrupt remapping, but
> > the irq domain for VMD MSI cannot be distinguished from a regular PCI/MSI
> > irq domain.
> > 
> > Add a new domain bus token and allow it in the bus token check in
> > msi_check_reservation_mode() to keep the functionality the same once VMD
> > uses this token.
> > 
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > 
> > ---
> >  include/linux/irqdomain.h |    1 +
> >  kernel/irq/msi.c          |    7 ++++++-
> >  2 files changed, 7 insertions(+), 1 deletion(-)
> > 
> > --- a/include/linux/irqdomain.h
> > +++ b/include/linux/irqdomain.h
> > @@ -84,6 +84,7 @@ enum irq_domain_bus_token {
> >  	DOMAIN_BUS_FSL_MC_MSI,
> >  	DOMAIN_BUS_TI_SCI_INTA_MSI,
> >  	DOMAIN_BUS_WAKEUP,
> > +	DOMAIN_BUS_VMD_MSI,
> >  };
> >  
> >  /**
> > --- a/kernel/irq/msi.c
> > +++ b/kernel/irq/msi.c
> > @@ -370,8 +370,13 @@ static bool msi_check_reservation_mode(s
> >  {
> >  	struct msi_desc *desc;
> >  
> > -	if (domain->bus_token != DOMAIN_BUS_PCI_MSI)
> > +	switch(domain->bus_token) {
> > +	case DOMAIN_BUS_PCI_MSI:
> > +	case DOMAIN_BUS_VMD_MSI:
> > +		break;
> > +	default:
> >  		return false;
> > +	}
> >  
> >  	if (!(info->flags & MSI_FLAG_MUST_REACTIVATE))
> >  		return false;
> 
> Acked-by: Marc Zyngier <maz@kernel.org>
> 
> 	M.
> 

Acked-by: Jon Derrick <jonathan.derrick@intel.com>
diff mbox series

Patch

--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -84,6 +84,7 @@  enum irq_domain_bus_token {
 	DOMAIN_BUS_FSL_MC_MSI,
 	DOMAIN_BUS_TI_SCI_INTA_MSI,
 	DOMAIN_BUS_WAKEUP,
+	DOMAIN_BUS_VMD_MSI,
 };
 
 /**
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -370,8 +370,13 @@  static bool msi_check_reservation_mode(s
 {
 	struct msi_desc *desc;
 
-	if (domain->bus_token != DOMAIN_BUS_PCI_MSI)
+	switch(domain->bus_token) {
+	case DOMAIN_BUS_PCI_MSI:
+	case DOMAIN_BUS_VMD_MSI:
+		break;
+	default:
 		return false;
+	}
 
 	if (!(info->flags & MSI_FLAG_MUST_REACTIVATE))
 		return false;