public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmconfig: Some additional chipset register values validation.
@ 2007-05-02  0:50 Olivier Galibert
  2007-05-02  9:52 ` Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Olivier Galibert @ 2007-05-02  0:50 UTC (permalink / raw)
  To: linux-kernel, akpm, ak, greg, jesse.barnes

On i945, a mmconfig range hitting the f0000000-ffffffff zone conflicts
with the APIC registers and others.  Consider it invalid.

On E7520, values 0000 and f000 for the window register are defined
invalid in the documentation.

---

I haven't seen a bios use these values, but who trusts biosen these
days?


 arch/i386/pci/mmconfig-shared.c |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/arch/i386/pci/mmconfig-shared.c b/arch/i386/pci/mmconfig-shared.c
index 747d8c6..c7cabee 100644
--- a/arch/i386/pci/mmconfig-shared.c
+++ b/arch/i386/pci/mmconfig-shared.c
@@ -60,14 +60,19 @@ static const char __init *pci_mmcfg_e7520(void)
 	u32 win;
 	pci_conf1_read(0, 0, PCI_DEVFN(0,0), 0xce, 2, &win);
 
-	pci_mmcfg_config_num = 1;
-	pci_mmcfg_config = kzalloc(sizeof(pci_mmcfg_config[0]), GFP_KERNEL);
-	if (!pci_mmcfg_config)
-		return NULL;
-	pci_mmcfg_config[0].address = (win & 0xf000) << 16;
-	pci_mmcfg_config[0].pci_segment = 0;
-	pci_mmcfg_config[0].start_bus_number = 0;
-	pci_mmcfg_config[0].end_bus_number = 255;
+	win = win & 0xf000;
+	if(win == 0x0000 || win == 0xf000)
+		pci_mmcfg_config_num = 0;
+	else {
+		pci_mmcfg_config_num = 1;
+		pci_mmcfg_config = kzalloc(sizeof(pci_mmcfg_config[0]), GFP_KERNEL);
+		if (!pci_mmcfg_config)
+			return NULL;
+		pci_mmcfg_config[0].address = win << 16;
+		pci_mmcfg_config[0].pci_segment = 0;
+		pci_mmcfg_config[0].start_bus_number = 0;
+		pci_mmcfg_config[0].end_bus_number = 255;
+	}
 
 	return "Intel Corporation E7520 Memory Controller Hub";
 }
@@ -108,6 +113,10 @@ static const char __init *pci_mmcfg_intel_945(void)
 	if ((pciexbar & mask) & 0x0fffffffU)
 		pci_mmcfg_config_num = 0;
 
+	/* Don't hit the APIC registers and their friends */
+	if ((pciexbar & mask) >= 0xf0000000U)
+		pci_mmcfg_config_num = 0;
+
 	if (pci_mmcfg_config_num) {
 		pci_mmcfg_config = kzalloc(sizeof(pci_mmcfg_config[0]), GFP_KERNEL);
 		if (!pci_mmcfg_config)
-- 
1.5.1.81.gee969


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

* Re: [PATCH] mmconfig: Some additional chipset register values validation.
  2007-05-02  0:50 [PATCH] mmconfig: Some additional chipset register values validation Olivier Galibert
@ 2007-05-02  9:52 ` Andi Kleen
  2007-05-02 11:05   ` Olivier Galibert
  0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2007-05-02  9:52 UTC (permalink / raw)
  To: Olivier Galibert; +Cc: linux-kernel, akpm, greg, jesse.barnes

On Wednesday 02 May 2007 02:50:11 Olivier Galibert wrote:
> On i945, a mmconfig range hitting the f0000000-ffffffff zone conflicts
> with the APIC registers and others.  Consider it invalid.
> 
> On E7520, values 0000 and f000 for the window register are defined
> invalid in the documentation.

Added thanks

-Andi

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

* Re: [PATCH] mmconfig: Some additional chipset register values validation.
  2007-05-02  9:52 ` Andi Kleen
@ 2007-05-02 11:05   ` Olivier Galibert
  0 siblings, 0 replies; 3+ messages in thread
From: Olivier Galibert @ 2007-05-02 11:05 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel, akpm, greg, jesse.barnes

On Wed, May 02, 2007 at 11:52:36AM +0200, Andi Kleen wrote:
> On Wednesday 02 May 2007 02:50:11 Olivier Galibert wrote:
> > On i945, a mmconfig range hitting the f0000000-ffffffff zone conflicts
> > with the APIC registers and others.  Consider it invalid.
> > 
> > On E7520, values 0000 and f000 for the window register are defined
> > invalid in the documentation.
> 
> Added thanks

Oh, feel free to add the:
Signed-off-by: Olivier Galibert <galibert@pobox.com>

I forgot in the original mail.

  OG.

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

end of thread, other threads:[~2007-05-02 11:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-02  0:50 [PATCH] mmconfig: Some additional chipset register values validation Olivier Galibert
2007-05-02  9:52 ` Andi Kleen
2007-05-02 11:05   ` Olivier Galibert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox