Commit bca23dba authored by H. Peter Anvin's avatar H. Peter Anvin

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:

     cd670599
     c549e71d

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: default avatarThomas J. Baker <tjb@unh.edu>
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
Acked-by: default avatarLen Brown <len.brown@intel.com>
Cc: Chuck Ebbert <cebbert@redhat.com>
Cc: Kyle McMartin <kmcmartin@redhat.com>
Cc: Matt Domsch <matt_domsch@dell.com>
parent 88dff493
...@@ -17,11 +17,6 @@ ...@@ -17,11 +17,6 @@
#define SMAP 0x534d4150 /* ASCII "SMAP" */ #define SMAP 0x534d4150 /* ASCII "SMAP" */
struct e820_ext_entry {
struct e820entry std;
u32 ext_flags;
} __attribute__((packed));
static int detect_memory_e820(void) static int detect_memory_e820(void)
{ {
int count = 0; int count = 0;
...@@ -29,13 +24,21 @@ static int detect_memory_e820(void) ...@@ -29,13 +24,21 @@ static int detect_memory_e820(void)
u32 size, id, edi; u32 size, id, edi;
u8 err; u8 err;
struct e820entry *desc = boot_params.e820_map; struct e820entry *desc = boot_params.e820_map;
static struct e820_ext_entry buf; /* static so it is zeroed */ static struct e820entry buf; /* static so it is zeroed */
/* /*
* Set this here so that if the BIOS doesn't change this field * Note: at least one BIOS is known which assumes that the
* but still doesn't change %ecx, we're still okay... * buffer pointed to by one e820 call is the same one as
* the previous call, and only changes modified fields. Therefore,
* we use a temporary buffer and copy the results entry by entry.
*
* This routine deliberately does not try to account for
* ACPI 3+ extended attributes. This is because there are
* BIOSes in the field which report zero for the valid bit for
* all ranges, and we don't currently make any use of the
* other attribute bits. Revisit this if we see the extended
* attribute bits deployed in a meaningful way in the future.
*/ */
buf.ext_flags = 1;
do { do {
size = sizeof buf; size = sizeof buf;
...@@ -66,13 +69,7 @@ static int detect_memory_e820(void) ...@@ -66,13 +69,7 @@ static int detect_memory_e820(void)
break; break;
} }
/* ACPI 3.0 added the extended flags support. If bit 0 *desc++ = buf;
in the extended flags is zero, we're supposed to simply
ignore the entry -- a backwards incompatible change! */
if (size > 20 && !(buf.ext_flags & 1))
continue;
*desc++ = buf.std;
count++; count++;
} while (next && count < ARRAY_SIZE(boot_params.e820_map)); } while (next && count < ARRAY_SIZE(boot_params.e820_map));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment