From patchwork Fri Jan 15 13:08:20 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: 363640 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp320846jap; Fri, 15 Jan 2021 06:02:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3TsvaPN2icjPxkmJwS1vX55kjq45V1Zn1t0hX8ijVU9iOiaDujILO+cu1/YX9hk3eE1CX X-Received: by 2002:a05:6902:1025:: with SMTP id x5mr17612573ybt.21.1610719328830; Fri, 15 Jan 2021 06:02:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610719328; cv=none; d=google.com; s=arc-20160816; b=shg1P22do0weX/gQE/HJKocPn1zR7RVQymY8VQRCyu2Q54Zz1dJIQNfEn791Y5y24H NF/1aHxksT9GKNVq1ZmTC5I1Kpxbh3OpLau+cMkmT2pBl6ar0oFsAsONFLnbbl6hvuKk X6NZlc/lwD4bvZemA+Pd+rGU4PPCLui9m7UmdCqg1h2teiyCTUzQQle79CKCw6ApMCNs ZeaK79j4YsLLlLPqWG0DlEDCbgTQfV3HZtmjLneQCdwhsaf/otYcw1L8ydV7+CraygkQ JcSOMbFc98ntX/hkrlW1G45krkv9pa8JKWc0/NMhFHSDP5B22kvG2Gm/i8SO2qKHsyOI ZStg== 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=tuoacA6ETpiSNAlNzO7Jo0J8CYkUv6GuPz2V5DgQzqM=; b=mLsO4an8Nh7/o6hDkAdXEDFoMZWGg7A/zW0PB9qUo8QZ0DPlbL6wHonqZ1GAt/Unrs YkdMrVXfkpqH/JJGrWEYfr70+hZ2mTpBijMlPVI15xFmg84o5UTN6VFlrlLPSN8EmbPl 08lTleRwhgvGSd2BKVmzrCImLHd168fzxrXV45VrZe3QwyT7H4gzDoNhsg8cXjAKV/3P bwVvJIRW8T/JPZ+n4c/bzEV7XEtf3zj0h1VAVx3JUYuRiTk8R4JOdGbd2mwimJC/I8a3 +uv/rZWrEDAELUG7UeK/vR13uO8BASbjajnJrXnn+qax865xXn/ytOBye7wsGU8+VSzA cxYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WzjqJ7a3; 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 e64si3414164ybi.44.2021.01.15.06.02.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Jan 2021 06:02:08 -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=WzjqJ7a3; 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]:37674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0Pg0-0001z6-8Q for patch@linaro.org; Fri, 15 Jan 2021 09:02:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0PEW-00016c-0k for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:33:44 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:37187) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l0PET-00085M-VZ for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:33:43 -0500 Received: by mail-wr1-x435.google.com with SMTP id v15so5638971wrx.4 for ; Fri, 15 Jan 2021 05:33:41 -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=tuoacA6ETpiSNAlNzO7Jo0J8CYkUv6GuPz2V5DgQzqM=; b=WzjqJ7a3B/DXUEwygRJwChspjb0Wex5U8T3j03LBXHypMq0RUn/vNiHkuxm1gknrqd OnB9FSUWSUVj1bGBVOuauzjw39cXhWpMuwW8qfymyt/UIy2OcWS7D+dE4DhpQWB6bI2v NJwLkL2g8jyrP/9v6aGOBN28tYfNyrKOrVlJe+UHoFnCqFGAk9Nhh6QaCvZWaH+VwJpa LEuFNbalTKA2oViK8OXG1ecwdQSfLoqCGVQPBef3NQBBZG/HahJz3+chbC8xyVMR4bA2 W9+jKF76+wHSGOXjjXXqpYa+i2QCELpp2a/B3hYlWd2PH7AgtLdeJzd6xyqwumfkkRlx cd9w== 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=tuoacA6ETpiSNAlNzO7Jo0J8CYkUv6GuPz2V5DgQzqM=; b=e9roeWFyCqvICaua7nrTxeYeUsXCRoEbVEEgN/2FA1PaYOQhDnuanAh261hlBHftDp DbI23SZdIaxn7DdJ2IUoELDimRCZYxjvrs6DdYAOws4aKz1jS/lbPoaRbN8OCba+zxOB 2cc7aYvkhCs143gJ2RXsYFUzdmiv9k31iKwVvIUcoj7zzK9lLkPzurIUXgOL98jzk6wR VZ0LXdCJREkAKEprAKb8o39FqgqKE8ohtmIiFgOGcYUYU/72Otw+/m0XuRxl88ycSQCu KhUMLgu17Q/Ja99ncP7AT3y1Pocz6wVQ/aaM4/rnoZ06RtbOi2++K5Aks8ciybS9DE4g cxIw== X-Gm-Message-State: AOAM532AwZueO/i9YcJirXpi27gDzkptbC2F5P7LecN31b+4nn3UTbJK zIGLeQdIM4ddltExCUGKeiuKtw== X-Received: by 2002:a5d:6cd4:: with SMTP id c20mr13244276wrc.57.1610717620697; Fri, 15 Jan 2021 05:33:40 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id m21sm12231414wml.13.2021.01.15.05.33.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 05:33:40 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AB1EB1FFAB; Fri, 15 Jan 2021 13:08:33 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 22/30] semihosting: Move ARM semihosting code to shared directories Date: Fri, 15 Jan 2021 13:08:20 +0000 Message-Id: <20210115130828.23968-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210115130828.23968-1-alex.bennee@linaro.org> References: <20210115130828.23968-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.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: Keith Packard , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Laurent Vivier , qemu-devel@nongnu.org, "open list:ARM TCG CPUs" , Alistair Francis , =?utf-8?q?Alex_Benn=C3=A9e?= 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 [AJB: rename arm-compat-semi, select SEMIHOSTING] Signed-off-by: Alex Bennée Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210107170717.2098982-2-keithp@keithp.com> Message-Id: <20210108224256.2321-13-alex.bennee@linaro.org> -- 2.20.1 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/arm-compat-semi.c similarity index 100% rename from target/arm/arm-semi.c rename to hw/semihosting/arm-compat-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..eaf3a20ef5 100644 --- a/hw/semihosting/Kconfig +++ b/hw/semihosting/Kconfig @@ -1,3 +1,7 @@ config SEMIHOSTING bool + +config ARM_COMPATIBLE_SEMIHOSTING + bool + select SEMIHOSTING diff --git a/hw/semihosting/meson.build b/hw/semihosting/meson.build index f40ac574c4..ea8090abe3 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('arm-compat-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(