Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Mar 2017 03:35:50 +0000 (UTC)
From:      Dexuan Cui <dexuan@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r314828 - head/sys/boot/efi/loader
Message-ID:  <201703070335.v273Zogt023135@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dexuan
Date: Tue Mar  7 03:35:50 2017
New Revision: 314828
URL: https://svnweb.freebsd.org/changeset/base/314828

Log:
  loader.efi: fix an off-by-one bug in efi_verify_staging_size()
  
  Also remove the warning message: it may not be unusual to see
  the memory range containing 2MB is not of EfiConventionalMemory.
  
  MFC after:	2 weeks2 weeks
  Sponsored by:	Microsoft

Modified:
  head/sys/boot/efi/loader/copy.c

Modified: head/sys/boot/efi/loader/copy.c
==============================================================================
--- head/sys/boot/efi/loader/copy.c	Tue Mar  7 03:01:09 2017	(r314827)
+++ head/sys/boot/efi/loader/copy.c	Tue Mar  7 03:35:50 2017	(r314828)
@@ -79,10 +79,6 @@ efi_verify_staging_size(unsigned long *n
 		    KERNEL_PHYSICAL_BASE >= end)
 			continue;
 
-		if (p->Type != EfiConventionalMemory)
-			printf("Warning: wrong EFI memory type: %d\n",
-			    p->Type);
-
 		available_pages = p->NumberOfPages -
 			((KERNEL_PHYSICAL_BASE - start) >> EFI_PAGE_SHIFT);
 		break;
@@ -93,6 +89,7 @@ efi_verify_staging_size(unsigned long *n
 		goto out;
 	}
 
+	i++;
 	for ( ; i < ndesc;
 	     i++, p = NextMemoryDescriptor(p, dsz)) {
 		if (p->Type != EfiConventionalMemory &&



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