To work around various bugs running KVM enabled, copy page tables to DRAM in assembly before jumping to x86_64 mode. Tested on QEMU using KVM, no more stange bugs happen: Tested on host - CPU Intel(R) Core(TM) i7-7700HQ - Linux 5.9 - qemu 4.2.1 Used to crash on emulating MMX instructions and failed to translate some addresses using the virtual MMU when running in long mode. Tested on host - CPU AMD EPYC 7401P 24-Core Processor - Linux 5.4 - qemu 4.2.1 Used to crash on jumping to long mode. Change-Id: Ic0bdd2bef7197edd2e7488a8efdeba7eb4ab0dd4 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/49228 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
97 lines
2.2 KiB
Plaintext
97 lines
2.2 KiB
Plaintext
if BOARD_EMULATION_QEMU_X86_Q35
|
|
|
|
config BOARD_SPECIFIC_OPTIONS
|
|
def_bool y
|
|
select CPU_QEMU_X86
|
|
select SOUTHBRIDGE_INTEL_I82801IX
|
|
select IOAPIC_INTERRUPTS_ON_APIC_SERIAL_BUS
|
|
select HAVE_CMOS_DEFAULT
|
|
select HAVE_OPTION_TABLE
|
|
# select HAVE_PIRQ_TABLE
|
|
select HAVE_ACPI_TABLES
|
|
select BOARD_ROMSIZE_KB_2048 if !VBOOT
|
|
select BOARD_ROMSIZE_KB_16384 if VBOOT
|
|
select MAINBOARD_HAS_NATIVE_VGA_INIT
|
|
select MAINBOARD_FORCE_NATIVE_VGA_INIT if !CHROMEOS
|
|
select MAINBOARD_HAS_LPC_TPM
|
|
select MAINBOARD_HAS_CHROMEOS
|
|
|
|
config VBOOT
|
|
select VBOOT_MUST_REQUEST_DISPLAY
|
|
select VBOOT_STARTS_IN_BOOTBLOCK
|
|
select VBOOT_SEPARATE_VERSTAGE
|
|
select VBOOT_VBNV_CMOS
|
|
select VBOOT_NO_BOARD_SUPPORT if !CHROMEOS
|
|
select GBB_FLAG_DISABLE_LID_SHUTDOWN
|
|
select GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC
|
|
select GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC
|
|
select GBB_FLAG_DISABLE_FWMP
|
|
|
|
config FMDFILE
|
|
string
|
|
default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/vboot-rwa-16M.fmd" if VBOOT_SLOTS_RW_A && !VBOOT_SLOTS_RW_AB
|
|
default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/vboot-rwab-16M.fmd" if VBOOT_SLOTS_RW_AB
|
|
|
|
if ARCH_BOOTBLOCK_X86_64
|
|
# Need to install page tables in DRAM as the virtual MMU has problems translating paging
|
|
# request when the page table resides in emulated ROM. This causes undefined behaviour
|
|
# when handling data requests, as well as fetching and decoding instructions
|
|
# Real hardware didn't show any problems until now.
|
|
config ARCH_X86_64_PGTBL_LOC
|
|
default 0x8000
|
|
endif
|
|
|
|
if VBOOT
|
|
|
|
config VBOOT_SLOTS_RW_A
|
|
default y
|
|
|
|
endif
|
|
|
|
config VBOOT_VBNV_OFFSET
|
|
hex
|
|
default 0x2c
|
|
|
|
config MAINBOARD_DIR
|
|
string
|
|
default "emulation/qemu-q35"
|
|
|
|
config MAINBOARD_PART_NUMBER
|
|
string
|
|
default "QEMU x86 q35/ich9"
|
|
|
|
config MMCONF_BASE_ADDRESS
|
|
hex
|
|
default 0xb0000000
|
|
|
|
# fw_cfg tables can be larger than the default when TPM is enabled
|
|
config MAX_ACPI_TABLE_SIZE_KB
|
|
int
|
|
default 224
|
|
|
|
# Skip the first 64KiB as coreboot table pointer is installed
|
|
# at address 0
|
|
config DCACHE_RAM_BASE
|
|
hex
|
|
default 0x10000
|
|
|
|
# Memory at 0xa0000 decodes to VGA
|
|
config DCACHE_RAM_SIZE
|
|
hex
|
|
default 0x90000
|
|
|
|
# Do not show IFD/blob options since QEMU doesn't care
|
|
config HAVE_INTEL_FIRMWARE
|
|
bool
|
|
default n
|
|
|
|
config C_ENV_BOOTBLOCK_SIZE
|
|
hex
|
|
default 0x4000
|
|
|
|
config DCACHE_BSP_STACK_SIZE
|
|
hex
|
|
default 0x4000
|
|
|
|
endif # BOARD_EMULATION_QEMU_X86_Q35
|