diff mbox series

[kvm-unit-tests,1/2] arm: Change text base address for 32 bit tests when running under kvmtool

Message ID 20220309162117.56681-2-alexandru.elisei@arm.com (mailing list archive)
State New, archived
Headers show
Series arm: 32 bit tests improvements | expand

Commit Message

Alexandru Elisei March 9, 2022, 4:21 p.m. UTC
The 32 bit tests do not have relocation support and rely on the build
system to set the text base address to 0x4001_0000, which is the memory
location where the test is placed by qemu. However, kvmtool loads a payload
at a different address, 0x8000_8000, when loading a test with --kernel.
When using --firmware, the default is 0x8000_0000, but that can be changed
with the --firmware-address comand line option.

When 32 bit tests are configured to run under kvmtool, set the text base
address to 0x8000_8000.

Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
 arm/Makefile.arm | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Andrew Jones March 9, 2022, 5:01 p.m. UTC | #1
On Wed, Mar 09, 2022 at 04:21:16PM +0000, Alexandru Elisei wrote:
> The 32 bit tests do not have relocation support and rely on the build
> system to set the text base address to 0x4001_0000, which is the memory
> location where the test is placed by qemu. However, kvmtool loads a payload
> at a different address, 0x8000_8000, when loading a test with --kernel.
> When using --firmware, the default is 0x8000_0000, but that can be changed
> with the --firmware-address comand line option.
> 
> When 32 bit tests are configured to run under kvmtool, set the text base
> address to 0x8000_8000.
> 
> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
> ---
>  arm/Makefile.arm | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arm/Makefile.arm b/arm/Makefile.arm
> index 3a4cc6b26234..01fd4c7bb6e2 100644
> --- a/arm/Makefile.arm
> +++ b/arm/Makefile.arm
> @@ -14,7 +14,13 @@ CFLAGS += $(machine)
>  CFLAGS += -mcpu=$(PROCESSOR)
>  CFLAGS += -mno-unaligned-access
>  
> +ifeq ($(TARGET),qemu)
>  arch_LDFLAGS = -Ttext=40010000
> +else ifeq ($(TARGET),kvmtool)
> +arch_LDFLAGS = -Ttext=80008000
> +else
> +$(error Unknown target $(TARGET))
> +endif
>  
>  define arch_elf_check =
>  endef
> -- 
> 2.35.1
>

Applied to arm/queue,
https://gitlab.com/rhdrjones/kvm-unit-tests/-/commits/arm/queue

Thanks,
drew
diff mbox series

Patch

diff --git a/arm/Makefile.arm b/arm/Makefile.arm
index 3a4cc6b26234..01fd4c7bb6e2 100644
--- a/arm/Makefile.arm
+++ b/arm/Makefile.arm
@@ -14,7 +14,13 @@  CFLAGS += $(machine)
 CFLAGS += -mcpu=$(PROCESSOR)
 CFLAGS += -mno-unaligned-access
 
+ifeq ($(TARGET),qemu)
 arch_LDFLAGS = -Ttext=40010000
+else ifeq ($(TARGET),kvmtool)
+arch_LDFLAGS = -Ttext=80008000
+else
+$(error Unknown target $(TARGET))
+endif
 
 define arch_elf_check =
 endef