Skip to content
Permalink
Browse files

boards: qemu_x86: properly enable XIP

The '#if XIP' in the DTS file never worked properly,
causing the QEMU build to think it has much more RAM
then it actually has. If RAM overflowed, this would not
be caught by the build, instead there would be strange
crashes when the data copy takes place.

The QEMU targets themselves are not XIP, everything
is actually RAM, but the first 4 megabytes are
considered to be a memory-mapped flash region. This
is done to ensure that the XIP data copying infrastructure
doesn't bit-rot on x86. We are at the point where
a lot of things depend on this, so just select it in
the board Kconfig instead of enabling in the
defconfigs.

Fixes: #15835

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
  • Loading branch information...
andrewboie authored and nashif committed May 3, 2019
1 parent 9485172 commit 87d1f0682b36f844e7002da9a71133f75c8e7bf4
@@ -1,4 +1,9 @@
# SPDX-License-Identifier: Apache-2.0
#
# The QEMU targets themselves are not XIP, everything is actually RAM, but we
# pretend the first 4 megabytes are a memory-mapped flash region. This is done
# to ensure that the XIP data copying infrastructure doesn't bit-rot on
# x86.

config BOARD_QEMU_X86
bool "QEMU x86"
@@ -7,10 +12,12 @@ config BOARD_QEMU_X86
select HAS_DTS_ETHERNET
select CPU_HAS_FPU
select HAS_COVERAGE_SUPPORT
select XIP

config BOARD_QEMU_X86_IAMCU
bool "QEMU x86 (IAMCU ABI)"
depends on SOC_IA32
select QEMU_TARGET
select HAS_DTS_ETHERNET
select HAS_COVERAGE_SUPPORT
select XIP
@@ -5,12 +5,7 @@
#include <mem.h>

#define DT_FLASH_SIZE DT_SIZE_K(1024)

#if XIP
#define DT_SRAM_SIZE DT_SIZE_K(4096)
#else
#define DT_SRAM_SIZE DT_SIZE_K(8188)
#endif
#define DT_SRAM_SIZE DT_SIZE_K(4096)

#include <ia32.dtsi>

@@ -15,7 +15,6 @@ CONFIG_UART_NS16550=y
CONFIG_UART_CONSOLE=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=25000000
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_XIP=y
CONFIG_X86_MMU=y
CONFIG_DEBUG_INFO=y
CONFIG_SCHED_SCALABLE=y
@@ -15,6 +15,5 @@ CONFIG_UART_NS16550=y
CONFIG_UART_CONSOLE=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=25000000
CONFIG_X86_IAMCU=y
CONFIG_XIP=y
CONFIG_X86_MMU=y
CONFIG_DEBUG_INFO=y
@@ -15,5 +15,4 @@ CONFIG_UART_NS16550=y
CONFIG_UART_CONSOLE=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=25000000
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_XIP=y
CONFIG_DEBUG_INFO=y

0 comments on commit 87d1f06

Please sign in to comment.
You can’t perform that action at this time.