mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Youquan Song <youquan.song@intel.com>
Cc: mingo@elte.hu, hpa@zytor.com, tglx@linutronix.de,
	linux-kernel@vger.kernel.org, dwmw2@infradead.org,
	Suresh Siddha <suresh.b.siddha@intel.com>
Subject: Re: [PATCH] IR: Fix kernel hang if interrupt remapping disable in  BIOS
Date: Wed, 9 Sep 2009 12:42:22 +0400	[thread overview]
Message-ID: <aa79d98a0909090142h5f9aaeb0rd4ba0da8a772f029@mail.gmail.com> (raw)
In-Reply-To: <20090909160538.GA3799@youquan-linux.bj.intel.com>

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
>

  reply	other threads:[~2009-09-09  8:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-09 16:05 Youquan Song
2009-09-09  8:42 ` Cyrill Gorcunov [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa79d98a0909090142h5f9aaeb0rd4ba0da8a772f029@mail.gmail.com \
    --to=gorcunov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    --cc=youquan.song@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®