From: Yinghai Lu <yinghai@kernel.org>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Brad Spengler <spender@grsecurity.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
Matthew Wilcox <matthew@wil.cx>
Subject: [PATCH] pci: fix crash about old IA64 about pci_cfg_space_size
Date: Sun, 11 Oct 2009 14:00:22 -0700 [thread overview]
Message-ID: <4AD24766.7050205@kernel.org> (raw)
In-Reply-To: <4AD1AE0D.1030007@kernel.org>
Brad reported that his SGI 750 (Itanium 1) will crash from 2.6.26, and bisected
to
| commit: dfadd9edff498d767008edc6b2a6e86a7a19934d
|
|Many host bridges support a 4k config space, so check them directy
|instead of using quirks to add them.
|
|We only need to do this extra check for host bridges at this point,
|because only host bridges are known to have extended address space
|without also having a PCI-X/PCI-E caps. Other devices with this
|property could be done with quirks (if there are any).
|
|As a bonus, we can remove the quirks for AMD host bridges with family
|10h and 11h since they're not needed any more.
|
|With this patch, we can get correct pci cfg size of new Intel CPUs/IOHs
|with host bridges.
it turns out for old IA64 without SAL 3.2 pci_cfg_space_size_ext will cause
problem and those system didn't have PCI-X and PCI-E, so that function was
not called before.
so don't call it in pci_cfg_sapce_size now.
later call it after pci ops code in ia64 could detect and use raw_pci_ops
and raw_pci_ext_ops according to SAL version.
Reported-by: Brad Spengler <spender@grsecurity.net>
Bisected-by: Brad Spengler <spender@grsecurity.net>
Tested-by: Brad Spengler <spender@grsecurity.net>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 8105e32..0c80a07 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -901,11 +901,24 @@ int pci_cfg_space_size(struct pci_dev *dev)
{
int pos;
u32 status;
+
+#ifndef CONFIG_IA64
+/*
+ * not use it with IA64 at this point
+ * ia64 SAL 3.2 before doesn't support ext space, so
+ * pci_read_config_dword(dev, 0x100, &status) would cause GP
+ * the problem is not triggered, because system with SAL 3.2 before
+ * doesn't include PCI-X 2.0 or PCI Express, so pci_cfg_spce_size_ext()
+ * is not called with them.
+ * need to extend ia64 to detect sal version, and pci_root_ops
+ * to use raw_pci_ops and raw_pci_ext_ops like x86
+ */
u16 class;
class = dev->class >> 8;
if (class == PCI_CLASS_BRIDGE_HOST)
return pci_cfg_space_size_ext(dev);
+#endif
pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
if (!pos) {
next prev parent reply other threads:[~2009-10-11 21:01 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20091011074531.GA12357@grsecurity.net>
2009-10-11 10:06 ` Boot-time crash from "PCI/x86: detect host bridge config space size w/o using quirks" Yinghai Lu
2009-10-11 21:00 ` Yinghai Lu [this message]
2009-10-11 21:32 ` [PATCH] pci: fix crash about old IA64 about pci_cfg_space_size Brad Spengler
2009-10-11 23:10 ` Matthew Wilcox
2009-10-12 13:56 ` Brad Spengler
2009-10-12 14:24 ` [PATCH] ia64: Don't call SAL < 3.2 for extended config space Matthew Wilcox
2009-10-12 14:24 ` Matthew Wilcox
2009-10-13 3:33 ` Brad Spengler
2009-10-13 3:33 ` Brad Spengler
2009-10-13 4:58 ` Brad Spengler
2009-10-13 4:58 ` Brad Spengler
2009-11-04 17:16 ` Jesse Barnes
2009-11-04 17:16 ` Jesse Barnes
2009-11-04 17:20 ` Luck, Tony
2009-11-04 17:20 ` Luck, Tony
2009-11-04 17:22 ` Jesse Barnes
2009-11-04 17:22 ` Jesse Barnes
2009-10-11 22:16 ` [RFC PATCH] ia64/pci: add ext pci config detection for SAL 3.2 less Yinghai Lu
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=4AD24766.7050205@kernel.org \
--to=yinghai@kernel.org \
--cc=hpa@zytor.com \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=mingo@elte.hu \
--cc=spender@grsecurity.net \
/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 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.