From nobody Wed Nov 27 07:39:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700755190; cv=none; d=zohomail.com; s=zohoarc; b=W3/OoYgCiRk2fcgcC2fUQLLXpi0iT54O89Qj9QvaQ7tZVGg0S0q2swYqzsJGk20B5yHzx+x3OTitI5vlJTrE1sVLPAqH9JoudNcQWU87SIdXaQcU6eJ82aAoV2S1YxrK08EGj26jaxd9DMbI9GANdB6sL6QTWMOmyfVMFW6wp0E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700755190; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=s+yUzGXsIXja0tGFBOZ/gTUt4pii4b19n7jKgHDQET8=; b=bmqmocWKnFbFoAckalfCGbIo/LoQj9kX4ddu0rkb1pevVuudWIkgvgZMFBKLeV27S0PFv2wPErqVuSxyofwSxrzpGFvZry2QZgnYCey+jGEghrhdzGkKU0DTohmvYUZIezkQlPR+tDla11VY+ir8b/UyqWQUmSOZcHrDs0nuaEg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700755190821528.3827003372048; Thu, 23 Nov 2023 07:59:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6C4H-00063a-1Y; Thu, 23 Nov 2023 10:56:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6C4D-00061q-Up for qemu-devel@nongnu.org; Thu, 23 Nov 2023 10:56:37 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6C48-0002Ou-ND for qemu-devel@nongnu.org; Thu, 23 Nov 2023 10:56:37 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40b344101f2so6192745e9.0 for ; Thu, 23 Nov 2023 07:56:32 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o15-20020a05600c4fcf00b0040586360a36sm3112417wmq.17.2023.11.23.07.56.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:56:30 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B739064600; Thu, 23 Nov 2023 15:56:21 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700754991; x=1701359791; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s+yUzGXsIXja0tGFBOZ/gTUt4pii4b19n7jKgHDQET8=; b=wDC4egp1xjruGDPXSzgg7g2NckO9uS3qf7WT4WdhG8MJr6LjZb6sje8/yncFfM8/eI AAe4A2RdOYDNzJUu369orHQ/mTCyV4U+T4h3Bvi1EmYSPdwcE8eAhL43Cw7k7TCXbpV2 pMfu5cffAiDAeb2zMz8J3KsJN//7OoqdnONsSpXgFMOrqM6HP4s0ei2YK2mqKSOnm2Sv 6zEW9Z8kGxL7/bcJzEraEyBCm/em00/JenkYoCOGc1nXt0N3ogtFjSzZjsTc527num3I JM3LVUXWU/F652E2qQ3QgzMuw7bWyOna5R/okJCGHWiWzLpfTYwdstm75RhmJMijb/Ql 5HTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700754991; x=1701359791; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s+yUzGXsIXja0tGFBOZ/gTUt4pii4b19n7jKgHDQET8=; b=dGwcUX6RnxH2srwaR4aNFrpi6ijh1LvBZPINyx+gyi81LIw24b6j1voMSgPkWQXp76 2nNgqpXSGCTZ3VVeDWwWeYwdm5hKsUXOhH5cAGEMvWz+F8UQ6boNLohHGdX0HdShAUIr BpwojtdNRJIpvGbbaZDV9O2eQFmXd5NSilIPECGZ/cB9fRndjDW0jyo2++vRiUXa4GHe RAw1ws+LW7aiPgp0gs9ZvLmpUz3q7abSegjwsmP98kqHCeF7ief7tZTwziqdjUpqDIlU 6XowtOtSlh5ucCJYayala2Z3UuTJyj+ExaoBH7a86moYBDBwfdLed8zciS5rIlNsCaXl asdA== X-Gm-Message-State: AOJu0YzVgOFT8OvQEqJwt1561kLkmqAeOgYbUaOn0a4l1uehozXhkgs+ r3nioFUnl1zbTLsBYX/wBBhVTA== X-Google-Smtp-Source: AGHT+IFdQckx2wfJFq/wfKH7G0VDTzqUZbRwWlKzYen9Fpa+9heeCD8HuKygE0lD5ruZ8/XPn8bakg== X-Received: by 2002:a05:600c:5124:b0:406:51a0:17ea with SMTP id o36-20020a05600c512400b0040651a017eamr2711081wms.10.1700754991329; Thu, 23 Nov 2023 07:56:31 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Peter Maydell , qemu-arm@nongnu.org (open list:ARM TCG CPUs) Subject: [PULL 12/14] tests/tcg: enable semiconsole test for Arm Date: Thu, 23 Nov 2023 15:56:18 +0000 Message-Id: <20231123155620.3042891-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231123155620.3042891-1-alex.bennee@linaro.org> References: <20231123155620.3042891-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700755191989100007 This still remains a MANUAL test due to blocking issues. Signed-off-by: Alex Benn=C3=A9e Message-Id: <20231120150833.2552739-13-alex.bennee@linaro.org> diff --git a/tests/tcg/arm/system/semiconsole.c b/tests/tcg/arm/system/semi= console.c new file mode 100644 index 0000000000..206dd60eed --- /dev/null +++ b/tests/tcg/arm/system/semiconsole.c @@ -0,0 +1,42 @@ +/* + * Semihosting Console Test + * + * Copyright (c) 2019 Linaro Ltd + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include +#include + +#define SYS_READC 0x7 + +uintptr_t __semi_call(uintptr_t type, uintptr_t arg0) +{ + register uintptr_t t asm("r0") =3D type; + register uintptr_t a0 asm("r1") =3D arg0; +#ifdef __thumb__ +# define SVC "svc 0xab" +#else +# define SVC "svc 0x123456" +#endif + asm(SVC : "=3Dr" (t) + : "r" (t), "r" (a0)); + + return t; +} + +int main(void) +{ + char c; + + ml_printf("Semihosting Console Test\n"); + ml_printf("hit X to exit:"); + + do { + c =3D __semi_call(SYS_READC, 0); + __sys_outc(c); + } while (c !=3D 'X'); + + return 0; +} diff --git a/tests/tcg/arm/Makefile.softmmu-target b/tests/tcg/arm/Makefile= .softmmu-target index aadc12767e..4c9264057f 100644 --- a/tests/tcg/arm/Makefile.softmmu-target +++ b/tests/tcg/arm/Makefile.softmmu-target @@ -48,6 +48,15 @@ memory: CFLAGS+=3D-DCHECK_UNALIGNED=3D0 QEMU_BASE_MACHINE=3D-M virt -cpu max -display none QEMU_OPTS+=3D$(QEMU_BASE_MACHINE) -semihosting-config enable=3Don,target= =3Dnative,chardev=3Doutput -kernel =20 +# console test is manual only +QEMU_SEMIHOST=3D-serial none -chardev stdio,mux=3Don,id=3Dstdio0 -semihost= ing-config enable=3Don,chardev=3Dstdio0 -mon chardev=3Dstdio0,mode=3Dreadli= ne +run-semiconsole: QEMU_OPTS=3D$(QEMU_BASE_MACHINE) $(QEMU_SEMIHOST) -kernel +run-semiconsole: semiconsole + $(call skip-test, $<, "MANUAL ONLY") + $(if $(V),@printf " %-7s %s %s\n" "TO RUN" $(notdir $(QEMU)) "$(QEMU_OPT= S) $<") +run-plugin-semiconsole-with-%: semiconsole + $(call skip-test, $<, "MANUAL ONLY") + # Simple Record/Replay Test .PHONY: memory-record run-memory-record: memory-record memory --=20 2.39.2