coreboot-kgpe-d16/src/cpu
Raul E Rangel 1eae39f4cd arch/x86,cpu/x86: Fix 64-bit CPU_INFO_V2 build errors
There are two possible code sections where the cpu_info macros can be
included: .code32 and .code64

Doing a `push %eax` while in a .code64 section will result in a compiler
error. This macro manually pushes the 32-bit register onto the stack so
we can share the code between 32 and 64 bit builds.

We also can't implicitly dereference per_cpu_segment_selector because
it's a 32-bit address. Trying to do this results in the following:
  E: Invalid reloc type: 11
  E: Illegal use of 32bit sign extended addressing at offset 0x1b2

If we load the address first, then dereference it, we can work around
the limitation.

With these fixes, 64-bit builds can now use CPU_INFO_V2.

BUG=b:179699789
TEST=Boot qemu 64 bit build with CPU_INFO_V2 and 4 CPUs. See AP init
work as expected.

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I4e72a808c9583bb2d0f697cbbd9cb9c0aa0ea2dc
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58232
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2021-10-21 17:36:09 +00:00
..
amd cpu: add missing arch/cpu.h includes 2021-09-17 20:28:09 +00:00
armltd Kconfig: comply to Linux 5.3's Kconfig language rules 2019-11-23 20:09:56 +00:00
intel cpu/intel/speedstep: Constify get_cst_entries() 2021-10-19 15:00:01 +00:00
qemu-power8 src: Remove leading blank lines from SPDX header 2020-05-18 07:00:27 +00:00
qemu-x86 cpu/x86/tsc: Deduplicate Makefile logic 2021-09-08 14:35:16 +00:00
x86 arch/x86,cpu/x86: Fix 64-bit CPU_INFO_V2 build errors 2021-10-21 17:36:09 +00:00
Kconfig src/cpu: Remove unused symbols 2021-02-18 10:11:24 +00:00
Makefile.inc src/cpu: Remove unused symbols 2021-02-18 10:11:24 +00:00