svn commit: r263305 - head/sys/x86/iommu

Konstantin Belousov kib at FreeBSD.org
Tue Mar 18 16:20:34 UTC 2014


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 at 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++) {


More information about the svn-src-head mailing list