[tip:x86/setup] x86, setup: guard against pre-ACPI 3 e820 code not updating %ecx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  cd670599b7b00d9263f6f11a05c0edeb9cbedaf3
Gitweb:     http://git.kernel.org/tip/cd670599b7b00d9263f6f11a05c0edeb9cbedaf3
Author:     H. Peter Anvin <hpa@xxxxxxxxx>
AuthorDate: Wed, 1 Apr 2009 11:35:00 -0700
Committer:  H. Peter Anvin <hpa@xxxxxxxxx>
CommitDate: Wed, 1 Apr 2009 11:35:00 -0700

x86, setup: guard against pre-ACPI 3 e820 code not updating %ecx

Impact: BIOS bug safety

For pre-ACPI 3 BIOSes, pre-initialize the end of the e820 buffer just
in case the BIOS returns an unchanged %ecx but without actually
touching the ACPI 3 extended flags field.

Signed-off-by: H. Peter Anvin <hpa@xxxxxxxxx>


---
 arch/x86/boot/memory.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c
index d5d2360..5054c2d 100644
--- a/arch/x86/boot/memory.c
+++ b/arch/x86/boot/memory.c
@@ -31,6 +31,12 @@ static int detect_memory_e820(void)
 	struct e820entry *desc = boot_params.e820_map;
 	static struct e820_ext_entry buf; /* static so it is zeroed */
 
+	/*
+	 * Set this here so that if the BIOS doesn't change this field
+	 * but still doesn't change %ecx, we're still okay...
+	 */
+	buf.ext_flags = 1;
+
 	do {
 		size = sizeof buf;
 
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux