From nobody Sun Feb 8 22:58:02 2026 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684157987; cv=none; d=zohomail.com; s=zohoarc; b=IDEL9aej4Ujnccqs2NElLPlVBiuoBVOxIqqr2oaV89yV+0jyFqcnNDGkTucsHf2IxUxqtOo5gUYobUcqH7j0CSq2SEo2FAMgS3iNee4DkB2TDmhSmV/wudrP9xngDpkx0ZNI0OTaiihOZ1HRxJUJtVBAPPaRboMAFek2xKflLMQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684157987; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dw2BzZtOdqC/O7zL/Dn36Xo/A9SifLvA+jFcs1epDwU=; b=OwfunsBRM/c1SbKvLn++NMRmej0nzVBUdu+XBM2a3mnDN0h4S/oh2KdquSSYP7ioC9e4Rj1IS003lc1Kuk8RozMiXFBTYz7UXeh/iuK/Smy1Qtwlema4gToJ7dEuqkT40XBbmqw23+DkzQMHcOk2unFTmfNJtH9UZ1UbwWIc3L4= 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 1684157987061413.5111445310455; Mon, 15 May 2023 06:39:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pyXsc-0000Ud-Ko; Mon, 15 May 2023 09:04:46 -0400 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 1pyXr9-0004wJ-MY for qemu-devel@nongnu.org; Mon, 15 May 2023 09:03:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pyXr4-00016E-W0 for qemu-devel@nongnu.org; Mon, 15 May 2023 09:03:15 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-457-0c3MkFl6O9WtKUJS6vpzsw-1; Mon, 15 May 2023 09:03:01 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 14010299E763; Mon, 15 May 2023 13:02:59 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D37E4078906; Mon, 15 May 2023 13:02:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684155785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dw2BzZtOdqC/O7zL/Dn36Xo/A9SifLvA+jFcs1epDwU=; b=BVKyYNvOySCR3ojiKLaXhoMHt/OHOmZpem9YWoaR+G35X0FN/Jx9IRTBjZT/CnbMLoSQPZ P2g3ltQ/72/UidtCMJEEHsoRDPev9Oi2dLuJEkJR6ObYlFzlU+r0TuT1HqKWU+RQAAVdd8 Gw6i0uSAn4G/ujg87Jx/vy/XIukuntk= X-MC-Unique: 0c3MkFl6O9WtKUJS6vpzsw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Ilya Leoshkevich Subject: [PULL 19/21] tests/tcg/s390x: Enable the multiarch system tests Date: Mon, 15 May 2023 15:02:31 +0200 Message-Id: <20230515130233.418183-20-thuth@redhat.com> In-Reply-To: <20230515130233.418183-1-thuth@redhat.com> References: <20230515130233.418183-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1684157988545100003 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Multiarch tests are written in C and need support for printing characters. Instead of implementing the runtime from scratch, just reuse the pc-bios/s390-ccw one. Run tests with -nographic in order to enable SCLP (enable this for the existing tests as well, since it does not hurt). Use the default linker script for the new tests. Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Message-Id: <20230511114651.439872-3-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/tcg/s390x/console.c | 12 ++++++++ tests/tcg/s390x/Makefile.softmmu-target | 40 ++++++++++++++++--------- tests/tcg/s390x/head64.S | 31 +++++++++++++++++++ 3 files changed, 69 insertions(+), 14 deletions(-) create mode 100644 tests/tcg/s390x/console.c create mode 100644 tests/tcg/s390x/head64.S diff --git a/tests/tcg/s390x/console.c b/tests/tcg/s390x/console.c new file mode 100644 index 0000000000..d43ce3f44b --- /dev/null +++ b/tests/tcg/s390x/console.c @@ -0,0 +1,12 @@ +/* + * Console code for multiarch tests. + * Reuses the pc-bios/s390-ccw implementation. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include "../../../pc-bios/s390-ccw/sclp.c" + +void __sys_outc(char c) +{ + write(1, &c, sizeof(c)); +} diff --git a/tests/tcg/s390x/Makefile.softmmu-target b/tests/tcg/s390x/Make= file.softmmu-target index 192315dd20..44dfd71629 100644 --- a/tests/tcg/s390x/Makefile.softmmu-target +++ b/tests/tcg/s390x/Makefile.softmmu-target @@ -1,28 +1,40 @@ S390X_SRC=3D$(SRC_PATH)/tests/tcg/s390x VPATH+=3D$(S390X_SRC) -QEMU_OPTS=3D-action panic=3Dexit-failure -kernel +QEMU_OPTS=3D-action panic=3Dexit-failure -nographic -kernel LINK_SCRIPT=3D$(S390X_SRC)/softmmu.ld -LDFLAGS=3D-nostdlib -static -Wl,-T$(LINK_SCRIPT) -Wl,--build-id=3Dnone +CFLAGS+=3D-ggdb -O0 +LDFLAGS=3D-nostdlib -static =20 %.o: %.S $(CC) -march=3Dz13 -m64 -c $< -o $@ =20 -%: %.o $(LINK_SCRIPT) +%.o: %.c + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -march=3Dz13 -m64 -c $< -o $@ + +%: %.o $(CC) $< -o $@ $(LDFLAGS) =20 -TESTS +=3D unaligned-lowcore -TESTS +=3D bal -TESTS +=3D sam -TESTS +=3D lpsw -TESTS +=3D lpswe-early -TESTS +=3D ssm-early -TESTS +=3D stosm-early -TESTS +=3D exrl-ssm-early +ASM_TESTS =3D = \ + bal = \ + exrl-ssm-early = \ + sam = \ + lpsw = \ + lpswe-early = \ + ssm-early = \ + stosm-early = \ + unaligned-lowcore =20 include $(S390X_SRC)/pgm-specification.mak $(PGM_SPECIFICATION_TESTS): pgm-specification-softmmu.o $(PGM_SPECIFICATION_TESTS): LDFLAGS+=3Dpgm-specification-softmmu.o -TESTS +=3D $(PGM_SPECIFICATION_TESTS) +ASM_TESTS +=3D $(PGM_SPECIFICATION_TESTS) + +$(ASM_TESTS): LDFLAGS +=3D -Wl,-T$(LINK_SCRIPT) -Wl,--build-id=3Dnone +$(ASM_TESTS): $(LINK_SCRIPT) +TESTS +=3D $(ASM_TESTS) =20 -# We don't currently support the multiarch system tests -undefine MULTIARCH_TESTS +S390X_MULTIARCH_RUNTIME_OBJS =3D head64.o console.o $(MINILIB_OBJS) +$(MULTIARCH_TESTS): $(S390X_MULTIARCH_RUNTIME_OBJS) +$(MULTIARCH_TESTS): LDFLAGS +=3D $(S390X_MULTIARCH_RUNTIME_OBJS) +$(MULTIARCH_TESTS): CFLAGS +=3D $(MINILIB_INC) +memory: CFLAGS +=3D -DCHECK_UNALIGNED=3D0 diff --git a/tests/tcg/s390x/head64.S b/tests/tcg/s390x/head64.S new file mode 100644 index 0000000000..c6f36dfea4 --- /dev/null +++ b/tests/tcg/s390x/head64.S @@ -0,0 +1,31 @@ +/* + * Startup code for multiarch tests. + * Reuses the pc-bios/s390-ccw implementation. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#define main main_pre +#include "../../../pc-bios/s390-ccw/start.S" +#undef main + +main_pre: + aghi %r15,-160 /* reserve stack for C code */ + brasl %r14,sclp_setup + brasl %r14,main + larl %r1,success_psw /* check main() return code */ + ltgr %r2,%r2 + je 0f + larl %r1,failure_psw +0: + lpswe 0(%r1) + + .align 8 +success_psw: + .quad 0x2000180000000,0xfff /* see is_special_wait_psw() */ +failure_psw: + .quad 0x2000180000000,0 /* disabled wait */ + + .section .bss + .align 0x1000 +stack: + .skip 0x8000 --=20 2.31.1