From patchwork Mon Nov 20 15:08:31 2023 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: 745363 Delivered-To: patch@linaro.org Received: by 2002:a5d:5052:0:b0:32d:baff:b0ca with SMTP id h18csp1343725wrt; Mon, 20 Nov 2023 07:09:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IFf24WcK1kqgcjfdNnd3PH071elnHo+HevD4albEYpPPW5G9I+uMsws6IJWRMhNZpNY6hd2 X-Received: by 2002:a05:622a:145:b0:401:e2b1:d28d with SMTP id v5-20020a05622a014500b00401e2b1d28dmr8030161qtw.20.1700492995996; Mon, 20 Nov 2023 07:09:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700492995; cv=none; d=google.com; s=arc-20160816; b=tOWBM3sHxsaqMVjPJ5sjMSXjbeaxwtKIvHvOKY9w8vEmJX1tLeiMZwFBO/zVss3THy vcTmV37oBinkzRYAo4Yw/PXkZZxklwPXIIUrDhwekhK5F3sO0cXwsNj1xDOkZjUc0oQJ np2dLN04SRs5TvP4hqV83SF2ZE+aViX+aRmMV/lwVVFkjBb5GlXE0T1Wqhv15DfslMOd D06mrgRlBazLi/TtuLyuio09QHiCfthO61sOqmHY5aIoW0oywDfZS8l/v05LpVOwqAa1 O2lM2NGczjPqX9lEPpnQTFRai36v/VG2qQUmjlyJcuU/M8+vAjPs4G1UXwlYfbbxhldP 02CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=Gyb1IbDacWS+M0sLJpuM3eBiDXIMLrNrMXya8IYdc1k=; fh=L8gboe2BpnMHPozXPXZ1zwcw4kd4+Ep8z61Ccww9Lhk=; b=wji6aLVwY2/RTOMimFB5cCSujcQcHHBNLq+AOmOw5PDudb3Q/4jHpA1iGByDB1CU8b QQ6LNVJaTEHYhrq5vo51X7brhprUm2uhkOMma/w4GUWDvTg04kRlAkVU0QgNcdZPrirc PvdVlshkQg5OfrEEOYdPsCPI6Z+xQ+xm+XFw0J2zHBHbGZtnSsyQL2nNlF04++pWiD5x x7jPEXPOrG+PYXyHLhN5FmvI04MEiUEJWPRy0l4WyNKSpDSapZhPKZyQLQxonPpk4vyu kET/RSfAOlANTu5mejUMEnYIb9cE4CuohGLHGyzhHORjOl7dnHeYHSDUVZn38D97dIqn 5c1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YDrUotk2; 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=pass (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 c1-20020ac87dc1000000b00419629d080fsi7594203qte.386.2023.11.20.07.09.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Nov 2023 07:09:55 -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=pass header.i=@linaro.org header.s=google header.b=YDrUotk2; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r55tk-0006SD-JQ; Mon, 20 Nov 2023 10:09:16 -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 1r55tU-0005vD-So for qemu-devel@nongnu.org; Mon, 20 Nov 2023 10:09:02 -0500 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r55tG-0001Im-Nc for qemu-devel@nongnu.org; Mon, 20 Nov 2023 10:09:00 -0500 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2c5071165d5so55854991fa.0 for ; Mon, 20 Nov 2023 07:08:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700492924; x=1701097724; 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=Gyb1IbDacWS+M0sLJpuM3eBiDXIMLrNrMXya8IYdc1k=; b=YDrUotk2GqBTeKyBVfDfKYhW2+uvDVEcLj54dmHdwuBlQ7hFoRvMRG+yLoFwYvm66u 2L+zcbLfOySVXLLQf73fdXEmYAtIMNKsJOYn2uBqat62RHAWYbcfzLqBNgX2qxIbxRTT LYhe8uZDgCq/ngdkOr8iSZOWG5JRVSHqK6uNEYlO8EQDPn+tE73YMpXY6rXHiEnkwApB pucR+xZCRN2kPAi2KF56uRc+UyuFqimrMJy2lXFKLQXa4z95JnIGC9/6FUslf37irUe/ loE3iFlUadrKKareSf8sy3yfJ8CQcNjMmVyDJdLoRcUkm8JnJcVwXw9fjl4UhBUZV4Nu RtcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700492924; x=1701097724; 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=Gyb1IbDacWS+M0sLJpuM3eBiDXIMLrNrMXya8IYdc1k=; b=IB57HMTfqAIMXOf56DAv4Z2GRR9y6lmbxNO5Nkuvgs2FxLWsYUZJsQwNd8SgCKMXIu gfYKgSjyCb6O+riSPA+de3t9JmeodS3qB8etAUeiFuWLhwSqzfn26yHUObtnHSgzVk2D njOONIly7HEeZbmuOvVh3ehqqyF95W9ge+Wh/YREGIaz7t1SUo8J+GoSCeAiTSOptfPf 7zBkLNPWdYL2CAJryflgz2CsbFsm/pVMfihIuYOC8WhegJZcf9/ahZRfzZidqJYKYIo/ n9WsZfCUo2BcKe08aISmHcx6x1p61tXAqonTZhkYrl21x8C8JnB+qUZ8nAKAnFW4TnUI ItRg== X-Gm-Message-State: AOJu0Yzxmu/KvprNYCcQXcgRAe5Z7xSBWZkHQN6kemu2hrFHdrzP+J3y 7q1J6/yCStnIRxw3SngrJrH7Hg== X-Received: by 2002:a2e:8ec2:0:b0:2c5:3139:2d04 with SMTP id e2-20020a2e8ec2000000b002c531392d04mr5312124ljl.47.1700492924291; Mon, 20 Nov 2023 07:08:44 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id fb11-20020a05600c520b00b004076f522058sm18057174wmb.0.2023.11.20.07.08.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 07:08:42 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 185C965779; Mon, 20 Nov 2023 15:08:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?utf-8?q?C=C3=A9dric?= =?utf-8?q?_Le_Goater?= , Mahmoud Mandour , Peter Maydell , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-s390x@nongnu.org, Beraldo Leal , qemu-arm@nongnu.org, devel@lists.libvirt.org, qemu-ppc@nongnu.org, Daniel Henrique Barboza , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alexandre Iooss , Marek Vasut , Thomas Huth , Chris Wulff , Ilya Leoshkevich , Richard Henderson , Nicholas Piggin Subject: [PATCH v2 12/14] tests/tcg: enable semiconsole test for Arm Date: Mon, 20 Nov 2023 15:08:31 +0000 Message-Id: <20231120150833.2552739-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231120150833.2552739-1-alex.bennee@linaro.org> References: <20231120150833.2552739-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22e; envelope-from=alex.bennee@linaro.org; helo=mail-lj1-x22e.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=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This still remains a MANUAL test due to blocking issues. Signed-off-by: Alex Bennée --- tests/tcg/arm/system/semiconsole.c | 42 +++++++++++++++++++++++++++ tests/tcg/arm/Makefile.softmmu-target | 9 ++++++ 2 files changed, 51 insertions(+) create mode 100644 tests/tcg/arm/system/semiconsole.c diff --git a/tests/tcg/arm/system/semiconsole.c b/tests/tcg/arm/system/semiconsole.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") = type; + register uintptr_t a0 asm("r1") = arg0; +#ifdef __thumb__ +# define SVC "svc 0xab" +#else +# define SVC "svc 0x123456" +#endif + asm(SVC : "=r" (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 = __semi_call(SYS_READC, 0); + __sys_outc(c); + } while (c != '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+=-DCHECK_UNALIGNED=0 QEMU_BASE_MACHINE=-M virt -cpu max -display none QEMU_OPTS+=$(QEMU_BASE_MACHINE) -semihosting-config enable=on,target=native,chardev=output -kernel +# console test is manual only +QEMU_SEMIHOST=-serial none -chardev stdio,mux=on,id=stdio0 -semihosting-config enable=on,chardev=stdio0 -mon chardev=stdio0,mode=readline +run-semiconsole: QEMU_OPTS=$(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_OPTS) $<") +run-plugin-semiconsole-with-%: semiconsole + $(call skip-test, $<, "MANUAL ONLY") + # Simple Record/Replay Test .PHONY: memory-record run-memory-record: memory-record memory