mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
b677dfae5a
In some old AMD KVM implementation, guest's EFER.LME bit is cleared by KVM when the hypervsior detects that the guest sets CR0.PG to 0. This causes the guest OS to reboot when it tries to return from 32-bit trampoline code because the CPU is in incorrect state: CR4.PAE=1, CR0.PG=1, CS.L=1, but EFER.LME=0. As a precaution, set EFER.LME=1 as part of long mode activation procedure. This extra step won't cause any harm when Linux is booted on a bare-metal machine. Signed-off-by: Wei Huang <wei@redhat.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: bp@alien8.de Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/20190104054411.12489-1-wei@redhat.com
21 lines
495 B
C
21 lines
495 B
C
#ifndef BOOT_COMPRESSED_PAGETABLE_H
|
|
#define BOOT_COMPRESSED_PAGETABLE_H
|
|
|
|
#define TRAMPOLINE_32BIT_SIZE (2 * PAGE_SIZE)
|
|
|
|
#define TRAMPOLINE_32BIT_PGTABLE_OFFSET 0
|
|
|
|
#define TRAMPOLINE_32BIT_CODE_OFFSET PAGE_SIZE
|
|
#define TRAMPOLINE_32BIT_CODE_SIZE 0x70
|
|
|
|
#define TRAMPOLINE_32BIT_STACK_END TRAMPOLINE_32BIT_SIZE
|
|
|
|
#ifndef __ASSEMBLER__
|
|
|
|
extern unsigned long *trampoline_32bit;
|
|
|
|
extern void trampoline_32bit_src(void *return_ptr);
|
|
|
|
#endif /* __ASSEMBLER__ */
|
|
#endif /* BOOT_COMPRESSED_PAGETABLE_H */
|