All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] IR: Fix kernel hang if interrupt remapping disable in  BIOS
  2009-09-09 16:05 [PATCH] IR: Fix kernel hang if interrupt remapping disable in BIOS Youquan Song
@ 2009-09-09  8:42 ` Cyrill Gorcunov
  2009-09-09 21:38 ` Suresh Siddha
  1 sibling, 0 replies; 7+ messages in thread
From: Cyrill Gorcunov @ 2009-09-09  8:42 UTC (permalink / raw)
  To: Youquan Song; +Cc: mingo, hpa, tglx, linux-kernel, dwmw2, Suresh Siddha

On 9/9/09, Youquan Song <youquan.song@intel.com> wrote:
> BIOS clear DMAR table INTR_REMAP flag to disable interrupt remapping.
> Current
> kernel only check interrupt remapping(IR) flag in DRHD's extended capability
> register to decide interrupt remapping support or not. But IR flag will not
> change when BIOS disable/enable interrupt remapping.
>
> When user disable interrupt remapping in BIOS or BIOS often defaultly
> disable
> interrupt remapping feature when BIOS is not mature.Though BIOS disable
> interrupt remapping but intr_remapping_supported function will always report
> to OS support interrupt remapping if VT-d2 chipset populated. On this
> cases, kernel will continue enable interrupt remapping and result kernel
> panic.
> This bug exist on almost all platforms with interrupt remapping support.
>
>
> This patch add DMAR table INTR_REMAP flag check before enable interrup
> remapping
>
> Signed-off-by: Youquan Song <youquan.song@intel.com>
> ---
>

thanks, Youquan!

> diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
> index a8a4383..d943e95 100644
> --- a/drivers/pci/dmar.c
> +++ b/drivers/pci/dmar.c
> @@ -1302,3 +1302,13 @@ int dmar_reenable_qi(struct intel_iommu *iommu)
>
>  	return 0;
>  }
> +
> +/*
> + * Check interrupt remapping support in DMAR table description.
> + */
> +int dmar_ir_support(void)
> +{
> +	struct acpi_table_dmar *dmar;
> +	dmar = (struct acpi_table_dmar *)dmar_tbl;
> +	return dmar->flags & 0x1;
> +}
> diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
> index ebfa47b..ac06514 100644
> --- a/drivers/pci/intr_remapping.c
> +++ b/drivers/pci/intr_remapping.c
> @@ -611,6 +611,9 @@ int __init intr_remapping_supported(void)
>  	if (disable_intremap)
>  		return 0;
>
> +	if (!dmar_ir_support())
> +		return 0;
> +
>  	for_each_drhd_unit(drhd) {
>  		struct intel_iommu *iommu = drhd->iommu;
>
> diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
> index 482dc91..4f0a72a 100644
> --- a/include/linux/intel-iommu.h
> +++ b/include/linux/intel-iommu.h
> @@ -360,4 +360,6 @@ extern void qi_flush_dev_iotlb(struct intel_iommu
> *iommu, u16 sid, u16 qdep,
>
>  extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);
>
> +extern int dmar_ir_support(void);
> +
>  #endif
>

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

* [PATCH] IR: Fix kernel hang if interrupt remapping disable in BIOS
@ 2009-09-09 16:05 Youquan Song
  2009-09-09  8:42 ` Cyrill Gorcunov
  2009-09-09 21:38 ` Suresh Siddha
  0 siblings, 2 replies; 7+ messages in thread
From: Youquan Song @ 2009-09-09 16:05 UTC (permalink / raw)
  To: mingo, hpa, tglx
  Cc: linux-kernel, dwmw2, gorcunov, Suresh Siddha, Youquan Song

BIOS clear DMAR table INTR_REMAP flag to disable interrupt remapping. Current
kernel only check interrupt remapping(IR) flag in DRHD's extended capability 
register to decide interrupt remapping support or not. But IR flag will not 
change when BIOS disable/enable interrupt remapping. 

When user disable interrupt remapping in BIOS or BIOS often defaultly disable 
interrupt remapping feature when BIOS is not mature.Though BIOS disable
interrupt remapping but intr_remapping_supported function will always report 
to OS support interrupt remapping if VT-d2 chipset populated. On this 
cases, kernel will continue enable interrupt remapping and result kernel panic. 
This bug exist on almost all platforms with interrupt remapping support.      

This patch add DMAR table INTR_REMAP flag check before enable interrup remapping

Signed-off-by: Youquan Song <youquan.song@intel.com>
---

diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
index a8a4383..d943e95 100644
--- a/drivers/pci/dmar.c
+++ b/drivers/pci/dmar.c
@@ -1302,3 +1302,13 @@ int dmar_reenable_qi(struct intel_iommu *iommu)
 
 	return 0;
 }
+
+/*
+ * Check interrupt remapping support in DMAR table description.
+ */
+int dmar_ir_support(void)
+{
+	struct acpi_table_dmar *dmar;
+	dmar = (struct acpi_table_dmar *)dmar_tbl;
+	return dmar->flags & 0x1;
+}
diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
index ebfa47b..ac06514 100644
--- a/drivers/pci/intr_remapping.c
+++ b/drivers/pci/intr_remapping.c
@@ -611,6 +611,9 @@ int __init intr_remapping_supported(void)
 	if (disable_intremap)
 		return 0;
 
+	if (!dmar_ir_support())
+		return 0;
+
 	for_each_drhd_unit(drhd) {
 		struct intel_iommu *iommu = drhd->iommu;
 
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index 482dc91..4f0a72a 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -360,4 +360,6 @@ extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep,
 
 extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);
 
+extern int dmar_ir_support(void);
+
 #endif

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

* Re: [PATCH] IR: Fix kernel hang if interrupt remapping disable in BIOS
  2009-09-09 16:05 [PATCH] IR: Fix kernel hang if interrupt remapping disable in BIOS Youquan Song
  2009-09-09  8:42 ` Cyrill Gorcunov
@ 2009-09-09 21:38 ` Suresh Siddha
  2009-09-20  0:29   ` Youquan,Song
  1 sibling, 1 reply; 7+ messages in thread
From: Suresh Siddha @ 2009-09-09 21:38 UTC (permalink / raw)
  To: Song, Youquan
  Cc: mingo@elte.hu, hpa@zytor.com, tglx@linutronix.de,
	linux-kernel@vger.kernel.org, dwmw2@infradead.org,
	gorcunov@gmail.com

On Wed, 2009-09-09 at 09:05 -0700, Song, Youquan wrote:
> BIOS clear DMAR table INTR_REMAP flag to disable interrupt remapping. Current
> kernel only check interrupt remapping(IR) flag in DRHD's extended capability 
> register to decide interrupt remapping support or not. But IR flag will not 
> change when BIOS disable/enable interrupt remapping. 
> 
> When user disable interrupt remapping in BIOS or BIOS often defaultly disable 
> interrupt remapping feature when BIOS is not mature.Though BIOS disable
> interrupt remapping but intr_remapping_supported function will always report 
> to OS support interrupt remapping if VT-d2 chipset populated. On this 
> cases, kernel will continue enable interrupt remapping and result kernel panic. 
> This bug exist on almost all platforms with interrupt remapping support.

I haven't encountered this before probably because bios was turning off
the interrupt-remapping support in extended capability aswell. but I do
agree that this fix is needed.

>      
> 
> This patch add DMAR table INTR_REMAP flag check before enable interrup remapping
> 
> Signed-off-by: Youquan Song <youquan.song@intel.com>

Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>

David, Can you please pick this up?

thanks.

> ---
> 
> diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
> index a8a4383..d943e95 100644
> --- a/drivers/pci/dmar.c
> +++ b/drivers/pci/dmar.c
> @@ -1302,3 +1302,13 @@ int dmar_reenable_qi(struct intel_iommu *iommu)
>  
>  	return 0;
>  }
> +
> +/*
> + * Check interrupt remapping support in DMAR table description.
> + */
> +int dmar_ir_support(void)
> +{
> +	struct acpi_table_dmar *dmar;
> +	dmar = (struct acpi_table_dmar *)dmar_tbl;
> +	return dmar->flags & 0x1;
> +}
> diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
> index ebfa47b..ac06514 100644
> --- a/drivers/pci/intr_remapping.c
> +++ b/drivers/pci/intr_remapping.c
> @@ -611,6 +611,9 @@ int __init intr_remapping_supported(void)
>  	if (disable_intremap)
>  		return 0;
>  
> +	if (!dmar_ir_support())
> +		return 0;
> +
>  	for_each_drhd_unit(drhd) {
>  		struct intel_iommu *iommu = drhd->iommu;
>  
> diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
> index 482dc91..4f0a72a 100644
> --- a/include/linux/intel-iommu.h
> +++ b/include/linux/intel-iommu.h
> @@ -360,4 +360,6 @@ extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep,
>  
>  extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);
>  
> +extern int dmar_ir_support(void);
> +
>  #endif


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

* Re: [PATCH] IR: Fix kernel hang if interrupt remapping disable in BIOS
  2009-09-20  0:29   ` Youquan,Song
@ 2009-09-19 16:59     ` David Woodhouse
  2009-09-20  0:45       ` Youquan,Song
  0 siblings, 1 reply; 7+ messages in thread
From: David Woodhouse @ 2009-09-19 16:59 UTC (permalink / raw)
  To: Youquan,Song
  Cc: Suresh Siddha, Song, Youquan, mingo@elte.hu, hpa@zytor.com,
	tglx@linutronix.de, linux-kernel@vger.kernel.org,
	gorcunov@gmail.com

On Sat, 2009-09-19 at 20:29 -0400, Youquan,Song wrote:
> 
> David,  Can you please pick this up? We want the bug fixed at 2.6.32.
> Thanks.

It's in my tree and in linux-next; will go to Linus shortly. I'm just
doing some final testing -- and having just merged the integer overflow
fixes that Ben pointed out, I think I may leave it another day or so
before I ask Linus to pull.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation


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

* Re: [PATCH] IR: Fix kernel hang if interrupt remapping disable in BIOS
  2009-09-20  0:45       ` Youquan,Song
@ 2009-09-19 17:09         ` David Woodhouse
  0 siblings, 0 replies; 7+ messages in thread
From: David Woodhouse @ 2009-09-19 17:09 UTC (permalink / raw)
  To: Youquan,Song
  Cc: Suresh Siddha, Song, Youquan, mingo@elte.hu, hpa@zytor.com,
	tglx@linutronix.de, linux-kernel@vger.kernel.org,
	gorcunov@gmail.com

On Sat, 2009-09-19 at 20:45 -0400, Youquan,Song wrote:
> On Sat, Sep 19, 2009 at 09:59:10AM -0700, David Woodhouse wrote:
> > On Sat, 2009-09-19 at 20:29 -0400, Youquan,Song wrote:
> > > 
> > > David,  Can you please pick this up? We want the bug fixed at 2.6.32.
> > > Thanks.
> > 
> > It's in my tree and in linux-next; will go to Linus shortly. I'm just
> > doing some final testing -- and having just merged the integer overflow
> > fixes that Ben pointed out, I think I may leave it another day or so
> > before I ask Linus to pull.
> 
> Fine. thanks. sorry for the noise.

No problem. It's helpful for you to remind me, sometimes -- it's much
better for you to ask and for me to tell you that it's already merged,
than for you _not_ to ask and then it misses the merge window.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation


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

* Re: [PATCH] IR: Fix kernel hang if interrupt remapping disable in BIOS
  2009-09-09 21:38 ` Suresh Siddha
@ 2009-09-20  0:29   ` Youquan,Song
  2009-09-19 16:59     ` David Woodhouse
  0 siblings, 1 reply; 7+ messages in thread
From: Youquan,Song @ 2009-09-20  0:29 UTC (permalink / raw)
  To: dwmw2, Suresh Siddha
  Cc: Song, Youquan, mingo@elte.hu, hpa@zytor.com, tglx@linutronix.de,
	linux-kernel@vger.kernel.org, dwmw2@infradead.org,
	gorcunov@gmail.com

On Wed, Sep 09, 2009 at 02:38:08PM -0700, Suresh Siddha wrote:
> On Wed, 2009-09-09 at 09:05 -0700, Song, Youquan wrote:
> > BIOS clear DMAR table INTR_REMAP flag to disable interrupt remapping. Current
> > kernel only check interrupt remapping(IR) flag in DRHD's extended capability 
> > register to decide interrupt remapping support or not. But IR flag will not 
> > change when BIOS disable/enable interrupt remapping. 
> > 
> > When user disable interrupt remapping in BIOS or BIOS often defaultly disable 
> > interrupt remapping feature when BIOS is not mature.Though BIOS disable
> > interrupt remapping but intr_remapping_supported function will always report 
> > to OS support interrupt remapping if VT-d2 chipset populated. On this 
> > cases, kernel will continue enable interrupt remapping and result kernel panic. 
> > This bug exist on almost all platforms with interrupt remapping support.
> 
> I haven't encountered this before probably because bios was turning off
> the interrupt-remapping support in extended capability aswell. but I do
> agree that this fix is needed.
> 
> >      
> > 
> > This patch add DMAR table INTR_REMAP flag check before enable interrup remapping
> > 
> > Signed-off-by: Youquan Song <youquan.song@intel.com>
> 
> Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
> 
> David, Can you please pick this up?
> 
> thanks.

David,  Can you please pick this up? We want the bug fixed at 2.6.32.
Thanks.

> 
> > ---
> > 
> > diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
> > index a8a4383..d943e95 100644
> > --- a/drivers/pci/dmar.c
> > +++ b/drivers/pci/dmar.c
> > @@ -1302,3 +1302,13 @@ int dmar_reenable_qi(struct intel_iommu *iommu)
> >  
> >  	return 0;
> >  }
> > +
> > +/*
> > + * Check interrupt remapping support in DMAR table description.
> > + */
> > +int dmar_ir_support(void)
> > +{
> > +	struct acpi_table_dmar *dmar;
> > +	dmar = (struct acpi_table_dmar *)dmar_tbl;
> > +	return dmar->flags & 0x1;
> > +}
> > diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
> > index ebfa47b..ac06514 100644
> > --- a/drivers/pci/intr_remapping.c
> > +++ b/drivers/pci/intr_remapping.c
> > @@ -611,6 +611,9 @@ int __init intr_remapping_supported(void)
> >  	if (disable_intremap)
> >  		return 0;
> >  
> > +	if (!dmar_ir_support())
> > +		return 0;
> > +
> >  	for_each_drhd_unit(drhd) {
> >  		struct intel_iommu *iommu = drhd->iommu;
> >  
> > diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
> > index 482dc91..4f0a72a 100644
> > --- a/include/linux/intel-iommu.h
> > +++ b/include/linux/intel-iommu.h
> > @@ -360,4 +360,6 @@ extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep,
> >  
> >  extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);
> >  
> > +extern int dmar_ir_support(void);
> > +
> >  #endif
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

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

* Re: [PATCH] IR: Fix kernel hang if interrupt remapping disable in BIOS
  2009-09-19 16:59     ` David Woodhouse
@ 2009-09-20  0:45       ` Youquan,Song
  2009-09-19 17:09         ` David Woodhouse
  0 siblings, 1 reply; 7+ messages in thread
From: Youquan,Song @ 2009-09-20  0:45 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Youquan,Song, Suresh Siddha, Song, Youquan, mingo@elte.hu,
	hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org,
	gorcunov@gmail.com

On Sat, Sep 19, 2009 at 09:59:10AM -0700, David Woodhouse wrote:
> On Sat, 2009-09-19 at 20:29 -0400, Youquan,Song wrote:
> > 
> > David,  Can you please pick this up? We want the bug fixed at 2.6.32.
> > Thanks.
> 
> It's in my tree and in linux-next; will go to Linus shortly. I'm just
> doing some final testing -- and having just merged the integer overflow
> fixes that Ben pointed out, I think I may leave it another day or so
> before I ask Linus to pull.

Fine. thanks. sorry for the noise.
 

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

end of thread, other threads:[~2009-09-19 17:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-09 16:05 [PATCH] IR: Fix kernel hang if interrupt remapping disable in BIOS Youquan Song
2009-09-09  8:42 ` Cyrill Gorcunov
2009-09-09 21:38 ` Suresh Siddha
2009-09-20  0:29   ` Youquan,Song
2009-09-19 16:59     ` David Woodhouse
2009-09-20  0:45       ` Youquan,Song
2009-09-19 17:09         ` David Woodhouse

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.