From 16fe5e1511dde46ec3a82988361ebdae54802cbc Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Tue, 22 Jun 2021 15:41:59 +0200 Subject: [PATCH] src: Consolidate x86_64 support Kconfig Introduce `USE_EXP_X86_64_SUPPORT` in `src/arch/x86/Kconfig` and guard it with `HAVE_EXP_X86_64_SUPPORT`. Replace the per-CPU implementations of the same functionality with the newly-added Kconfig options. Update documentation and the config file for QEMU accordingly. Change-Id: I550216fd2a8323342d6b605306b0b95ffd5dcd1c Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/55760 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Rudolph --- .../mainboard/emulation/qemu-i440fx.md | 2 +- Documentation/mainboard/emulation/qemu-q35.md | 2 +- .../config.emulation_qemu_x86_i440fx_x86_64 | 2 +- src/arch/x86/Kconfig | 18 ++++++++++++++++++ src/cpu/intel/model_206ax/Kconfig | 7 +------ src/cpu/qemu-x86/Kconfig | 9 +-------- 6 files changed, 23 insertions(+), 17 deletions(-) diff --git a/Documentation/mainboard/emulation/qemu-i440fx.md b/Documentation/mainboard/emulation/qemu-i440fx.md index 059ad123c5..a311fddb09 100644 --- a/Documentation/mainboard/emulation/qemu-i440fx.md +++ b/Documentation/mainboard/emulation/qemu-i440fx.md @@ -15,7 +15,7 @@ processor supports x86_64 instructions (long mode). The qemu-i440fx mainboard has been ported to x86_64 and will serve as reference platform to enable additional platforms. -To enable the support set the Kconfig option ``CONFIG_CPU_QEMU_X86_64=y``. +To enable the support set the Kconfig option ``CONFIG_USE_EXP_X86_64_SUPPORT=y``. ## Installing qemu diff --git a/Documentation/mainboard/emulation/qemu-q35.md b/Documentation/mainboard/emulation/qemu-q35.md index 00163e89fc..cebbc637d6 100644 --- a/Documentation/mainboard/emulation/qemu-q35.md +++ b/Documentation/mainboard/emulation/qemu-q35.md @@ -15,7 +15,7 @@ processor supports x86_64 instructions (long mode). The qemu-q35 mainboard has been ported to x86_64 and will serve as reference platform to enable additional platforms. -To enable the support set the Kconfig option ``CONFIG_CPU_QEMU_X86_64=y``. +To enable the support set the Kconfig option ``CONFIG_USE_EXP_X86_64_SUPPORT=y``. ## Installing qemu diff --git a/configs/config.emulation_qemu_x86_i440fx_x86_64 b/configs/config.emulation_qemu_x86_i440fx_x86_64 index 0ddb3f1339..d31bbf2d61 100644 --- a/configs/config.emulation_qemu_x86_i440fx_x86_64 +++ b/configs/config.emulation_qemu_x86_i440fx_x86_64 @@ -1 +1 @@ -CONFIG_CPU_QEMU_X86_64=y +CONFIG_USE_EXP_X86_64_SUPPORT=y diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig index 2a42a1c7c7..ef07a2a03a 100644 --- a/src/arch/x86/Kconfig +++ b/src/arch/x86/Kconfig @@ -63,6 +63,24 @@ config ARCH_ALL_STAGES_X86 bool default y +config HAVE_EXP_X86_64_SUPPORT + bool + help + Enable experimental support to build and run coreboot in 64-bit mode. + When selecting this option for a new platform, it is highly advisable + to provide a config file for Jenkins to build-test the 64-bit option. + +config USE_EXP_X86_64_SUPPORT + bool "[EXPERIMENTAL] Run coreboot in long (64-bit) mode" + depends on HAVE_EXP_X86_64_SUPPORT + select ARCH_ALL_STAGES_X86_64 + help + When set, most of coreboot runs in long (64-bit) mode instead of the + usual protected flat (32-bit) mode. 64-bit CPUs and OSes can be used + irrespective of whether coreboot runs in 32-bit or 64-bit mode. This + is an experimental option: do not enable unless one wants to test it + and has the means to recover a system when coreboot fails to boot. + config ARCH_X86_64_PGTBL_LOC hex "x86_64 page table location in CBFS" depends on ARCH_BOOTBLOCK_X86_64 diff --git a/src/cpu/intel/model_206ax/Kconfig b/src/cpu/intel/model_206ax/Kconfig index 67fd701c35..c168c9bd01 100644 --- a/src/cpu/intel/model_206ax/Kconfig +++ b/src/cpu/intel/model_206ax/Kconfig @@ -3,16 +3,11 @@ config CPU_INTEL_MODEL_206AX if CPU_INTEL_MODEL_206AX -config ARCH_EXP_X86_64 - bool "Experimental 64bit support" - depends on USE_NATIVE_RAMINIT - default n - config CPU_SPECIFIC_OPTIONS def_bool y - select ARCH_ALL_STAGES_X86_64 if ARCH_EXP_X86_64 select ARCH_X86 select BOOT_DEVICE_SPI_FLASH_NO_EARLY_WRITES + select HAVE_EXP_X86_64_SUPPORT if USE_NATIVE_RAMINIT select MMX select SSE2 select UDELAY_TSC diff --git a/src/cpu/qemu-x86/Kconfig b/src/cpu/qemu-x86/Kconfig index 6d897fe501..2f961dca90 100644 --- a/src/cpu/qemu-x86/Kconfig +++ b/src/cpu/qemu-x86/Kconfig @@ -3,6 +3,7 @@ config CPU_QEMU_X86 bool select ARCH_X86 + select HAVE_EXP_X86_64_SUPPORT select UDELAY_TSC select TSC_MONOTONIC_TIMER select UNKNOWN_TSC_RATE @@ -49,12 +50,4 @@ config MAX_CPUS default 32 if SMM_TSEG default 4 -config CPU_QEMU_X86_64 - bool "Experimental 64bit support" - select ARCH_ALL_STAGES_X86_64 - -config CPU_QEMU_X86_32 - bool - default n if CPU_QEMU_X86_64 - default y endif