aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-21 14:46:16 -0400
committerH. Peter Anvin <hpa@zytor.com>2009-05-22 14:14:02 -0400
commitbca23dba760d6705c013f89113c46570378fb626 (patch)
tree31f52293a54d418ff347e7de20ffc702acf554be /arch/x86/boot
parent88dff4936c0a5fa53080cca68dc963a8a2a674b0 (diff)
x86, setup: revert ACPI 3 E820 extended attributes support
Remove ACPI 3 E820 extended memory attributes support. At least one vendor actively set all the flags to zero, but left ECX on return at 24. This bug may be present in other BIOSes. The breakage functionally means the ACPI 3 flags are probably completely useless, and that no OS any time soon is going to rely on their existence. Therefore, drop support completely. We may want to revisit this question in the future, if we find ourselves actually needing the flags. This reverts all or part of the following checkins: cd670599b7b00d9263f6f11a05c0edeb9cbedaf3 c549e71d073a6e9a4847497344db28a784061455 However, retain the part from the latter commit that copies e820 into a temporary buffer; that is an unrelated BIOS workaround. Put in a comment to explain that part. See https://bugzilla.redhat.com/show_bug.cgi?id=499396 for some additional information. [ Impact: detect all memory on affected machines ] Reported-by: Thomas J. Baker <tjb@unh.edu> Signed-off-by: H. Peter Anvin <hpa@zytor.com> Acked-by: Len Brown <len.brown@intel.com> Cc: Chuck Ebbert <cebbert@redhat.com> Cc: Kyle McMartin <kmcmartin@redhat.com> Cc: Matt Domsch <matt_domsch@dell.com>
Diffstat (limited to 'arch/x86/boot')
-rw-r--r--arch/x86/boot/memory.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c
index 5054c2ddd1a0..74b3d2ba84e9 100644
--- a/arch/x86/boot/memory.c
+++ b/arch/x86/boot/memory.c
@@ -17,11 +17,6 @@
17 17
18#define SMAP 0x534d4150 /* ASCII "SMAP" */ 18#define SMAP 0x534d4150 /* ASCII "SMAP" */
19 19
20struct e820_ext_entry {
21 struct e820entry std;
22 u32 ext_flags;
23} __attribute__((packed));
24
25static int detect_memory_e820(void) 20static int detect_memory_e820(void)
26{ 21{
27 int count = 0; 22 int count = 0;
@@ -29,13 +24,21 @@ static int detect_memory_e820(void)
29 u32 size, id, edi; 24 u32 size, id, edi;
30 u8 err; 25 u8 err;
31 struct e820entry *desc = boot_params.e820_map; 26 struct e820entry *desc = boot_params.e820_map;
32 static struct e820_ext_entry buf; /* static so it is zeroed */ 27 static struct e820entry buf; /* static so it is zeroed */
33 28
34 /* 29 /*
35 * Set this here so that if the BIOS doesn't change this field 30 * Note: at least one BIOS is known which assumes that the
36 * but still doesn't change %ecx, we're still okay... 31 * buffer pointed to by one e820 call is the same one as
32 * the previous call, and only changes modified fields. Therefore,
33 * we use a temporary buffer and copy the results entry by entry.
34 *
35 * This routine deliberately does not try to account for
36 * ACPI 3+ extended attributes. This is because there are
37 * BIOSes in the field which report zero for the valid bit for
38 * all ranges, and we don't currently make any use of the
39 * other attribute bits. Revisit this if we see the extended
40 * attribute bits deployed in a meaningful way in the future.
37 */ 41 */
38 buf.ext_flags = 1;
39 42
40 do { 43 do {
41 size = sizeof buf; 44 size = sizeof buf;
@@ -66,13 +69,7 @@ static int detect_memory_e820(void)
66 break; 69 break;
67 } 70 }
68 71
69 /* ACPI 3.0 added the extended flags support. If bit 0 72 *desc++ = buf;
70 in the extended flags is zero, we're supposed to simply
71 ignore the entry -- a backwards incompatible change! */
72 if (size > 20 && !(buf.ext_flags & 1))
73 continue;
74
75 *desc++ = buf.std;
76 count++; 73 count++;
77 } while (next && count < ARRAY_SIZE(boot_params.e820_map)); 74 } while (next && count < ARRAY_SIZE(boot_params.e820_map));
78 75