mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-02 15:56:42 +07:00
1c10070a55
On some systems the ACPI NVS area is located in the first 1 MB of RAM and it is overwritten by the i386 code during the restore after hibernation. This confuses the ACPI platform firmware that doesn't update the AC adapter status appropriately as a result (http://bugzilla.kernel.org/show_bug.cgi?id=7995). The solution is to register the reserved memory in the first 1 MB as 'nosave', so that swsusp doesn't touch it during the restore. Also, this has been done on x86_64 for a long time now, so this patch makes the i386 restore code behave like the x86_64 one. [akpm@linux-foundation.org: build fix] Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Cc: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
61 lines
1.6 KiB
C
61 lines
1.6 KiB
C
/*
|
|
* structures and definitions for the int 15, ax=e820 memory map
|
|
* scheme.
|
|
*
|
|
* In a nutshell, arch/i386/boot/setup.S populates a scratch table
|
|
* in the empty_zero_block that contains a list of usable address/size
|
|
* duples. In arch/i386/kernel/setup.c, this information is
|
|
* transferred into the e820map, and in arch/i386/mm/init.c, that
|
|
* new information is used to mark pages reserved or not.
|
|
*
|
|
*/
|
|
#ifndef __E820_HEADER
|
|
#define __E820_HEADER
|
|
|
|
#define E820MAP 0x2d0 /* our map */
|
|
#define E820MAX 128 /* number of entries in E820MAP */
|
|
#define E820NR 0x1e8 /* # entries in E820MAP */
|
|
|
|
#define E820_RAM 1
|
|
#define E820_RESERVED 2
|
|
#define E820_ACPI 3
|
|
#define E820_NVS 4
|
|
|
|
#define HIGH_MEMORY (1024*1024)
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
struct e820entry {
|
|
u64 addr; /* start of memory segment */
|
|
u64 size; /* size of memory segment */
|
|
u32 type; /* type of memory segment */
|
|
} __attribute__((packed));
|
|
|
|
struct e820map {
|
|
u32 nr_map;
|
|
struct e820entry map[E820MAX];
|
|
};
|
|
|
|
extern struct e820map e820;
|
|
|
|
extern int e820_all_mapped(unsigned long start, unsigned long end,
|
|
unsigned type);
|
|
extern int e820_any_mapped(u64 start, u64 end, unsigned type);
|
|
extern void find_max_pfn(void);
|
|
extern void register_bootmem_low_pages(unsigned long max_low_pfn);
|
|
extern void e820_register_memory(void);
|
|
extern void limit_regions(unsigned long long size);
|
|
extern void print_memory_map(char *who);
|
|
|
|
#if defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND)
|
|
extern void e820_mark_nosave_regions(void);
|
|
#else
|
|
static inline void e820_mark_nosave_regions(void)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
#endif/*!__ASSEMBLY__*/
|
|
|
|
#endif/*__E820_HEADER*/
|