From patchwork Wed Mar 9 16:21:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Elisei X-Patchwork-Id: 12775234 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1010AC433EF for ; Wed, 9 Mar 2022 16:25:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235894AbiCIQ0X (ORCPT ); Wed, 9 Mar 2022 11:26:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238337AbiCIQVw (ORCPT ); Wed, 9 Mar 2022 11:21:52 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EF2283A5 for ; Wed, 9 Mar 2022 08:20:53 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BD673168F; Wed, 9 Mar 2022 08:20:53 -0800 (PST) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BF9B33F7F5; Wed, 9 Mar 2022 08:20:52 -0800 (PST) From: Alexandru Elisei To: drjones@redhat.com, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, pbonzini@redhat.com, thuth@redhat.com Subject: [kvm-unit-tests PATCH 1/2] arm: Change text base address for 32 bit tests when running under kvmtool Date: Wed, 9 Mar 2022 16:21:16 +0000 Message-Id: <20220309162117.56681-2-alexandru.elisei@arm.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220309162117.56681-1-alexandru.elisei@arm.com> References: <20220309162117.56681-1-alexandru.elisei@arm.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 --- 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