All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Hurley <peter@hurleysoftware.com>
To: linux-kernel@vger.kernel.org
Cc: Peter Hurley <peter@hurleysoftware.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org
Subject: [PATCH 4/5] x86: acpi: Print warning for malformed host bridge resources
Date: Wed,  7 Nov 2012 21:55:55 -0500	[thread overview]
Message-ID: <1352343356-4006-5-git-send-email-peter@hurleysoftware.com> (raw)
In-Reply-To: <1352343356-4006-1-git-send-email-peter@hurleysoftware.com>

An incorrectly specified host bridge window may prevent
other devices from claiming assigned resources. For example,
this flawed _CRS resource descriptor from a Dell T5400:
     DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
     	 0x00000000,         // Granularity
         0xF0000000,         // Range Minimum
         0xFE000000,         // Range Maximum
         0x00000000,         // Translation Offset
         0x0E000000,         // Length
         ,, , AddressRangeMemory, TypeStatic)
prevents the adjacent device from claiming [mem 0xfe0000000-0xfe01ffff]

Sanity check that the resource at least conforms to a valid
PCI BAR; if not, emit a diagnostic warning.

Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: x86@kernel.org
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
 arch/x86/pci/acpi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 192397c..3468d16 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -298,6 +298,10 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
 			"host bridge window [%#llx-%#llx] "
 			"([%#llx-%#llx] ignored, not CPU addressable)\n", 
 			start, orig_end, end + 1, orig_end);
+	} else if (flags & IORESOURCE_MEM && (start & 0x0f || ~end & 0x0f)) {
+		dev_warn(&info->bridge->dev,
+			 "invalid host bridge window [%#llx-%#llx]\n",
+			 start, end);
 	}
 
 	res = &info->res[info->res_num];
-- 
1.7.12.3


  parent reply	other threads:[~2012-11-08  2:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-08  2:55 [PATCH 0/5] Add diagnostics for iomem resources Peter Hurley
2012-11-08  2:55 ` [PATCH 1/5] resources: Print resource ranges when expanding overlaps Peter Hurley
2012-11-08  2:55 ` [PATCH 2/5] resources: Print resource conflicts for failed requests Peter Hurley
2012-11-08  2:55 ` [PATCH 3/5] resources: Print warning when inserting resource [mem 0x00000000] Peter Hurley
2012-11-08  2:55 ` Peter Hurley [this message]
2012-11-10 21:52   ` [PATCH 4/5] x86: acpi: Print warning for malformed host bridge resources Bjorn Helgaas
2012-11-11 14:49     ` Peter Hurley
2012-12-14 12:51       ` Peter Hurley
2012-11-08  2:55 ` [PATCH 5/5] drivers: mfd: Fix resource request for [mem 0x00000000] Peter Hurley
2012-11-08 17:04   ` Aaron Sierra
2012-11-08 18:24     ` Peter Hurley
2012-11-08 18:58       ` Aaron Sierra
2012-11-09 11:55         ` [PATCH v3] mfd: lpc_ich: " Peter Hurley
2012-11-19 17:46           ` Samuel Ortiz
2012-11-19 18:28             ` Peter Hurley
2012-11-21 16:33               ` Samuel Ortiz

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=1352343356-4006-5-git-send-email-peter@hurleysoftware.com \
    --to=peter@hurleysoftware.com \
    --cc=bhelgaas@google.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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.