Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Mar 2014 16:20:34 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r263305 - head/sys/x86/iommu
Message-ID:  <201403181620.s2IGKYGa029467@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Mar 18 16:20:33 2014
New Revision: 263305
URL: http://svnweb.freebsd.org/changeset/base/263305

Log:
  It is not uncommon for BIOSes to report wrong RMRR entries in DMAR
  table.  Among them, some (old AMI ?) BIOSes report entries with range
  like (bf7ec000, bf7ebfff).  Attempts to ignore the bogus entries
  result in faults, so the range must be covered somehow.
  
  Provide a workaround by identity mapping the 32 pages after the bogus
  entry start, which seems to be enough for the reported BIOS.
  
  Reported and tested by:	Jason Harmening <jason.harmening@gmail.com>
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/x86/iommu/intel_ctx.c

Modified: head/sys/x86/iommu/intel_ctx.c
==============================================================================
--- head/sys/x86/iommu/intel_ctx.c	Tue Mar 18 15:59:06 2014	(r263304)
+++ head/sys/x86/iommu/intel_ctx.c	Tue Mar 18 16:20:33 2014	(r263305)
@@ -182,6 +182,15 @@ ctx_init_rmrr(struct dmar_ctx *ctx, devi
 		end = entry->end;
 		entry->start = trunc_page(start);
 		entry->end = round_page(end);
+		if (entry->start == entry->end) {
+			/* Workaround for some AMI (?) BIOSes */
+			if (bootverbose) {
+				device_printf(dev, "BIOS bug: dmar%d RMRR "
+				    "region (%jx, %jx) corrected\n",
+				    ctx->dmar->unit, start, end);
+			}
+			entry->end += DMAR_PAGE_SIZE * 0x20;
+		}
 		size = OFF_TO_IDX(entry->end - entry->start);
 		ma = malloc(sizeof(vm_page_t) * size, M_TEMP, M_WAITOK);
 		for (i = 0; i < size; i++) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403181620.s2IGKYGa029467>