From patchwork Fri Jan 8 22:42:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 359083 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp950537jai; Fri, 8 Jan 2021 14:59:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJw98a26SY7vvm7bBFa2hWb4egBeNmnosn149RECPWCTGnkijSLI2fImsrXo5J8Ghl2yfRlK X-Received: by 2002:a25:1541:: with SMTP id 62mr9037378ybv.484.1610146785653; Fri, 08 Jan 2021 14:59:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610146785; cv=none; d=google.com; s=arc-20160816; b=t3vqlqnfL9lmCP4m8w4b7HVcBNYFEUkiVYy1kB9Lu22eHhI4PS4/cz+H1zYeY7b058 XhNn373L2jgeUlL0wGoUFo/jTKq84Bp/pRcexYZDr74J1RnyAh5kadizOQmXbiopj7+K ly2dDa+RWWEmvnQODvncZ9U+6LbMVmE+rPisOcz6xxoh95d1J6qPrUl9JzmYiCZW33Kj hXKAUaOQFn71wWXte6mtX+/rZxV4YVFu8EEitey73Pj3+WS8MxXhxoYHy3d0kiXHPzkp a02+BXlJLoo0jOElRwpmrEpyN2QlkfMpzYcFEjLTLMYp9xInDojTFQJapqgyeaOoUpF4 Iluw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=unT7z9mkiA80xkm/QImpuTMY4ioyoQFP+jpExhzHPEY=; b=0Fspy0G9sFVitBtIB+ew5zAeI5kweLDZFZ69+KX2pV8fv7ThLgN5nAe1x8mFOi5RAg N5bOmIc4pgnxTunyNGzmJ5Cy/JkJo3GS0ZCbhtwr8xJuOWvXC039iFdu1/udVDezpDTP QbXTMZtep27L1Dy4hamQsLakML4EAFdAVXVYgyKYTc1LGZA2NA2Ul70MsAajXl3B6V1E ZwOwBLvF5zndMmvZBPJE3rhAA2Z05MRFaSdaWaFYILsyo7mJN0Sv4hsykAk/ZSdcYY1E hiC0cBii4VM1sbTtxzR0ohY+T67I0emx4IF4AswX+KDNvOAiKfF0/NJGd5Qf7MXBKQ4s GFEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tnemzi7A; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u3si9957704ybk.381.2021.01.08.14.59.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Jan 2021 14:59:45 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tnemzi7A; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ky0jR-0007XA-63 for patch@linaro.org; Fri, 08 Jan 2021 17:59:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52406) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ky0Tb-00062f-OW for qemu-devel@nongnu.org; Fri, 08 Jan 2021 17:43:24 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:34798) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ky0TV-0003LC-PR for qemu-devel@nongnu.org; Fri, 08 Jan 2021 17:43:19 -0500 Received: by mail-wm1-x32a.google.com with SMTP id g25so7537758wmh.1 for ; Fri, 08 Jan 2021 14:43:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=unT7z9mkiA80xkm/QImpuTMY4ioyoQFP+jpExhzHPEY=; b=tnemzi7AS8fvcc6TGCW2d14S1x09xui7+78fTDAZU4qdpT1OKFEx/yP4RNCr0dTKeN 6YxU85Y0m/Pn+bGLdw9yLmfiNJyXjfBbVEhSohq++WI0tmf3Wu/X2K48GP/ZUa4zFqUj VI8KZOkHWlHu3nocYZddFRkrUsHtFp2H9JKBcinNHYGMu67fFej4LUVHORmjgZnP3sw1 N4l0MbKcB9o8sTtA+LsguWybeFslXSRwWQ26nLSnp/pVQxlwG/EUpCojDNmlxcvBX0Qw SS6R/fAuy3prr1vbbrcMfsIAex04iGCfxkttMH6cKFvpd1m6Z+JPLdSXzNW2JmZdMUbh J+Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=unT7z9mkiA80xkm/QImpuTMY4ioyoQFP+jpExhzHPEY=; b=OMJ7p7ZGeoDGdoASGpUEmZioamnTF4Qo/e3frVwPtfFMruVYNTf/5TsvC7M2dM3WA8 /cebvn9Beq7b6patx0JS79gD+eLfHH90MOGUzmp0VWCV6s1QzZqgMHtLIMG3ICRFAAWL kV7EyG7BEUIT2c9QNqblJRn+9rqS1ejirIhi1WxVtUFfOgH4q66HfZB00nq0X6DBfeIU wGqZEI25e/cmUC7IKqH8ywfYQvNsGIEGgGH8Phq0rXT3LhdM0VTOYtbimelS+RPaXLQm LP57lh+cLGKHy2X4dVxXEv86JiAc/zFG+Q/eJmNfRaw8G6VkSLvFis4tNEyG0egDN1zd FoNg== X-Gm-Message-State: AOAM5304ufNY5ETj4pW+dzQZPv4e8x+HGT+xv+nDmYC2lXt2d0S2kUr1 v8gr27zSVVFZakfY+5NxTW/Wlg== X-Received: by 2002:a7b:c4d5:: with SMTP id g21mr4918466wmk.92.1610145796408; Fri, 08 Jan 2021 14:43:16 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id l7sm13316032wme.4.2021.01.08.14.43.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jan 2021 14:43:08 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2BC261FF9B; Fri, 8 Jan 2021 22:42:58 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 12/20] semihosting: Move ARM semihosting code to shared directories Date: Fri, 8 Jan 2021 22:42:48 +0000 Message-Id: <20210108224256.2321-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210108224256.2321-1-alex.bennee@linaro.org> References: <20210108224256.2321-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Keith Packard , Laurent Vivier , "open list:ARM TCG CPUs" , Alistair Francis , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Keith Packard This commit renames two files which provide ARM semihosting support so that they can be shared by other architectures: 1. target/arm/arm-semi.c -> hw/semihosting/common-semi.c 2. linux-user/arm/semihost.c -> linux-user/semihost.c The build system was modified use a new config variable, CONFIG_ARM_COMPATIBLE_SEMIHOSTING, which has been added to the ARM softmmu and linux-user default configs. The contents of the source files has not been changed in this patch. Signed-off-by: Keith Packard Reviewed-by: Alistair Francis Signed-off-by: Alex Bennée Message-Id: <20210107170717.2098982-2-keithp@keithp.com> --- default-configs/devices/arm-softmmu.mak | 1 + default-configs/targets/aarch64-linux-user.mak | 1 + default-configs/targets/aarch64_be-linux-user.mak | 1 + default-configs/targets/arm-linux-user.mak | 1 + default-configs/targets/armeb-linux-user.mak | 1 + target/arm/arm-semi.c => hw/semihosting/common-semi.c | 0 linux-user/{arm => }/semihost.c | 0 hw/semihosting/Kconfig | 3 +++ hw/semihosting/meson.build | 3 +++ linux-user/arm/meson.build | 3 --- linux-user/meson.build | 1 + target/arm/meson.build | 2 -- 12 files changed, 12 insertions(+), 5 deletions(-) rename target/arm/arm-semi.c => hw/semihosting/common-semi.c (100%) rename linux-user/{arm => }/semihost.c (100%) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/default-configs/devices/arm-softmmu.mak b/default-configs/devices/arm-softmmu.mak index 08a32123b4..0500156a0c 100644 --- a/default-configs/devices/arm-softmmu.mak +++ b/default-configs/devices/arm-softmmu.mak @@ -42,4 +42,5 @@ CONFIG_FSL_IMX25=y CONFIG_FSL_IMX7=y CONFIG_FSL_IMX6UL=y CONFIG_SEMIHOSTING=y +CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y CONFIG_ALLWINNER_H3=y diff --git a/default-configs/targets/aarch64-linux-user.mak b/default-configs/targets/aarch64-linux-user.mak index 163c9209f4..4713253709 100644 --- a/default-configs/targets/aarch64-linux-user.mak +++ b/default-configs/targets/aarch64-linux-user.mak @@ -2,3 +2,4 @@ TARGET_ARCH=aarch64 TARGET_BASE_ARCH=arm TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml TARGET_HAS_BFLT=y +CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y diff --git a/default-configs/targets/aarch64_be-linux-user.mak b/default-configs/targets/aarch64_be-linux-user.mak index 4c953cf8c5..fae831558d 100644 --- a/default-configs/targets/aarch64_be-linux-user.mak +++ b/default-configs/targets/aarch64_be-linux-user.mak @@ -3,3 +3,4 @@ TARGET_BASE_ARCH=arm TARGET_WORDS_BIGENDIAN=y TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml TARGET_HAS_BFLT=y +CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y diff --git a/default-configs/targets/arm-linux-user.mak b/default-configs/targets/arm-linux-user.mak index c7cd872e86..e741ffd4d3 100644 --- a/default-configs/targets/arm-linux-user.mak +++ b/default-configs/targets/arm-linux-user.mak @@ -3,3 +3,4 @@ TARGET_SYSTBL_ABI=common,oabi TARGET_SYSTBL=syscall.tbl TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml TARGET_HAS_BFLT=y +CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y diff --git a/default-configs/targets/armeb-linux-user.mak b/default-configs/targets/armeb-linux-user.mak index 79bf10e99b..255e44e8b0 100644 --- a/default-configs/targets/armeb-linux-user.mak +++ b/default-configs/targets/armeb-linux-user.mak @@ -4,3 +4,4 @@ TARGET_SYSTBL=syscall.tbl TARGET_WORDS_BIGENDIAN=y TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml TARGET_HAS_BFLT=y +CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y diff --git a/target/arm/arm-semi.c b/hw/semihosting/common-semi.c similarity index 100% rename from target/arm/arm-semi.c rename to hw/semihosting/common-semi.c diff --git a/linux-user/arm/semihost.c b/linux-user/semihost.c similarity index 100% rename from linux-user/arm/semihost.c rename to linux-user/semihost.c diff --git a/hw/semihosting/Kconfig b/hw/semihosting/Kconfig index efe0a30734..4c30dc6b16 100644 --- a/hw/semihosting/Kconfig +++ b/hw/semihosting/Kconfig @@ -1,3 +1,6 @@ config SEMIHOSTING bool + +config ARM_COMPATIBLE_SEMIHOSTING + bool diff --git a/hw/semihosting/meson.build b/hw/semihosting/meson.build index f40ac574c4..5b4a170270 100644 --- a/hw/semihosting/meson.build +++ b/hw/semihosting/meson.build @@ -2,3 +2,6 @@ specific_ss.add(when: 'CONFIG_SEMIHOSTING', if_true: files( 'config.c', 'console.c', )) + +specific_ss.add(when: ['CONFIG_ARM_COMPATIBLE_SEMIHOSTING'], + if_true: files('common-semi.c')) diff --git a/linux-user/arm/meson.build b/linux-user/arm/meson.build index 432984b58e..5a93c925cf 100644 --- a/linux-user/arm/meson.build +++ b/linux-user/arm/meson.build @@ -1,6 +1,3 @@ -linux_user_ss.add(when: 'TARGET_AARCH64', if_true: files('semihost.c')) -linux_user_ss.add(when: 'TARGET_ARM', if_true: files('semihost.c')) - subdir('nwfpe') syscall_nr_generators += { diff --git a/linux-user/meson.build b/linux-user/meson.build index 2b94e4ba24..7fe28d659e 100644 --- a/linux-user/meson.build +++ b/linux-user/meson.build @@ -16,6 +16,7 @@ linux_user_ss.add(rt) linux_user_ss.add(when: 'TARGET_HAS_BFLT', if_true: files('flatload.c')) linux_user_ss.add(when: 'TARGET_I386', if_true: files('vm86.c')) +linux_user_ss.add(when: 'CONFIG_ARM_COMPATIBLE_SEMIHOSTING', if_true: files('semihost.c')) syscall_nr_generators = {} diff --git a/target/arm/meson.build b/target/arm/meson.build index f5de2a77b8..15b936c101 100644 --- a/target/arm/meson.build +++ b/target/arm/meson.build @@ -32,8 +32,6 @@ arm_ss.add(files( )) arm_ss.add(zlib) -arm_ss.add(when: 'CONFIG_TCG', if_true: files('arm-semi.c')) - arm_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c', 'kvm64.c'), if_false: files('kvm-stub.c')) arm_ss.add(when: 'TARGET_AARCH64', if_true: files(