From nobody Sat Jul 27 02:56:31 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=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1678985171; cv=none; d=zohomail.com; s=zohoarc; b=ORnLAbJLY/V38wS9y4P3jymmXRlGYdfC2XkICwkbCzIeEd5RbW8q6TMaGKbdzqkso/w1rojVPQG616JH9txsqqbpPCLkA2p4+rAS7TVpFKHaXslXDwg/8mm1E+SR1+ytQ1UEz+9rMMY07vfaYe8Omvk2jDHCtI+ISB+22AsR/04= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678985171; 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=jqBVGq8yc0E6kS17ER39cm+YQ8MGSS4zSVebVECvQOw=; b=hte8vkd6jcBYhsOb6kxkfICKmCv5iUn6IrOlITUggI2DSsZMB5CopcN2Fw0Q3LkuQ8uA7gwtca1Vdg0pXG7D9uZDCFnyZrMI2YhNfwktkdYUPGO6+QRaiQpntzLf/ZoqMSq7W+7vXNI5UD83U7kKSnYticOc5rt/mq8iAJrj7TM= 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=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1678985171655216.63091728559766; Thu, 16 Mar 2023 09:46:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcqir-00053i-Os; Thu, 16 Mar 2023 12:45:01 -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 1pcqip-00052S-O2; Thu, 16 Mar 2023 12:44:59 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcqin-0008MX-E2; Thu, 16 Mar 2023 12:44:59 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32GFmYGa019793; Thu, 16 Mar 2023 16:44:55 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pc62uhm4y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Mar 2023 16:44:54 +0000 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32GFnQlu021684; Thu, 16 Mar 2023 16:44:54 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pc62uhm3y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Mar 2023 16:44:54 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32G1e82r001711; Thu, 16 Mar 2023 16:44:52 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3pbsmrgt3d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Mar 2023 16:44:51 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32GGineT55050514 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Mar 2023 16:44:49 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6C9DC20040; Thu, 16 Mar 2023 16:44:49 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E1E2320043; Thu, 16 Mar 2023 16:44:48 +0000 (GMT) Received: from heavy.boeblingen.de.ibm.com (unknown [9.171.2.157]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 16 Mar 2023 16:44:48 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=jqBVGq8yc0E6kS17ER39cm+YQ8MGSS4zSVebVECvQOw=; b=tSulQ2SNJL6/9VNR/nkcgkLNbGoFuXMxXntuaPbA3zcQ6Ddft6SbxVGjUvbZmK+1uvcD iqQHjwZf8XbKjtMiE4bdayavXmrNkdG+v20coyuYw6GVuSdDWqpwofpHM6UHjqEISbmy w5BCqljkZ/TwKM24h1fsKIrPPisDLdBJX7aeZP5yCWohb7+RfmTreZNA6d8lZXD4IHaI ccE7EMopadFUZz0eSrqXEJyBD/s2vbC2s0RjzfcMxjCvR6ATo5jbIqwixT1jCG1AL+PZ XEXbI0tla/7mS1fhXnS5dYEABPb4AsJWtC4I6MtC5DsCvsFh/K6oSKpCGtOYGB5L5y0r vw== From: Ilya Leoshkevich To: Richard Henderson , David Hildenbrand Cc: Thomas Huth , qemu-s390x@nongnu.org, qemu-devel@nongnu.org, Ilya Leoshkevich Subject: [PATCH v4 12/12] tests/tcg/s390x: Test unaligned accesses Date: Thu, 16 Mar 2023 17:44:28 +0100 Message-Id: <20230316164428.275147-13-iii@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230316164428.275147-1-iii@linux.ibm.com> References: <20230316164428.275147-1-iii@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: QScGhWvVDuqQ12re-ggwQ5QsK06-fXOR X-Proofpoint-ORIG-GUID: dOMa9Ku-v1ATm6dSXwxsAqIpyyXXwQy7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-16_10,2023-03-16_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 adultscore=0 mlxscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 impostorscore=0 clxscore=1015 bulkscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303160131 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=148.163.156.1; envelope-from=iii@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, 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.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 @ibm.com) X-ZM-MESSAGEID: 1678985172192100005 Content-Type: text/plain; charset="utf-8" Add a number of small test that check whether accessing unaligned addresses in various ways leads to a specification exception. Run these test both in softmmu and user configurations; expect a PGM in one case and SIGILL in the other. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.softmmu-target | 15 ++++++-- tests/tcg/s390x/Makefile.target | 8 +++++ tests/tcg/s390x/br-odd.S | 16 +++++++++ tests/tcg/s390x/cgrl-unaligned.S | 16 +++++++++ tests/tcg/s390x/clrl-unaligned.S | 16 +++++++++ tests/tcg/s390x/crl-unaligned.S | 16 +++++++++ tests/tcg/s390x/ex-odd.S | 17 +++++++++ tests/tcg/s390x/lgrl-unaligned.S | 16 +++++++++ tests/tcg/s390x/llgfrl-unaligned.S | 16 +++++++++ tests/tcg/s390x/lpswe-unaligned.S | 18 ++++++++++ tests/tcg/s390x/lrl-unaligned.S | 16 +++++++++ tests/tcg/s390x/pgm-specification-softmmu.S | 40 +++++++++++++++++++++ tests/tcg/s390x/pgm-specification-user.c | 37 +++++++++++++++++++ tests/tcg/s390x/pgm-specification.mak | 15 ++++++++ tests/tcg/s390x/softmmu.ld | 20 +++++++++++ tests/tcg/s390x/stgrl-unaligned.S | 16 +++++++++ tests/tcg/s390x/strl-unaligned.S | 16 +++++++++ 17 files changed, 311 insertions(+), 3 deletions(-) create mode 100644 tests/tcg/s390x/br-odd.S create mode 100644 tests/tcg/s390x/cgrl-unaligned.S create mode 100644 tests/tcg/s390x/clrl-unaligned.S create mode 100644 tests/tcg/s390x/crl-unaligned.S create mode 100644 tests/tcg/s390x/ex-odd.S create mode 100644 tests/tcg/s390x/lgrl-unaligned.S create mode 100644 tests/tcg/s390x/llgfrl-unaligned.S create mode 100644 tests/tcg/s390x/lpswe-unaligned.S create mode 100644 tests/tcg/s390x/lrl-unaligned.S create mode 100644 tests/tcg/s390x/pgm-specification-softmmu.S create mode 100644 tests/tcg/s390x/pgm-specification-user.c create mode 100644 tests/tcg/s390x/pgm-specification.mak create mode 100644 tests/tcg/s390x/softmmu.ld create mode 100644 tests/tcg/s390x/stgrl-unaligned.S create mode 100644 tests/tcg/s390x/strl-unaligned.S diff --git a/tests/tcg/s390x/Makefile.softmmu-target b/tests/tcg/s390x/Make= file.softmmu-target index 725b6c598db..6d8bf299b28 100644 --- a/tests/tcg/s390x/Makefile.softmmu-target +++ b/tests/tcg/s390x/Makefile.softmmu-target @@ -1,11 +1,20 @@ S390X_SRC=3D$(SRC_PATH)/tests/tcg/s390x VPATH+=3D$(S390X_SRC) QEMU_OPTS=3D-action panic=3Dexit-failure -kernel +LINK_SCRIPT=3D$(S390X_SRC)/softmmu.ld +LDFLAGS=3D-nostdlib -static -Wl,-T$(LINK_SCRIPT) =20 -%: %.S - $(CC) -march=3Dz13 -m64 -nostdlib -static -Wl,-Ttext=3D0 \ - -Wl,--build-id=3Dnone $< -o $@ +%.o: %.S + $(CC) -march=3Dz13 -m64 -c $< -o $@ + +%: %.o $(LINK_SCRIPT) + $(CC) $< -o $@ $(LDFLAGS) =20 TESTS +=3D unaligned-lowcore TESTS +=3D bal TESTS +=3D sam + +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) diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.tar= get index cf93b966862..1002ab79886 100644 --- a/tests/tcg/s390x/Makefile.target +++ b/tests/tcg/s390x/Makefile.target @@ -2,6 +2,9 @@ S390X_SRC=3D$(SRC_PATH)/tests/tcg/s390x VPATH+=3D$(S390X_SRC) CFLAGS+=3D-march=3DzEC12 -m64 =20 +%.o: %.c + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@ + config-cc.mak: Makefile $(quiet-@)( \ $(call cc-option,-march=3Dz14, CROSS_CC_HAS_Z14); \ @@ -33,6 +36,11 @@ TESTS+=3Dchrl cdsg: CFLAGS+=3D-pthread cdsg: LDFLAGS+=3D-pthread =20 +include $(S390X_SRC)/pgm-specification.mak +$(PGM_SPECIFICATION_TESTS): pgm-specification-user.o +$(PGM_SPECIFICATION_TESTS): LDFLAGS+=3Dpgm-specification-user.o +TESTS +=3D $(PGM_SPECIFICATION_TESTS) + Z13_TESTS=3Dvistr $(Z13_TESTS): CFLAGS+=3D-march=3Dz13 -O2 TESTS+=3D$(Z13_TESTS) diff --git a/tests/tcg/s390x/br-odd.S b/tests/tcg/s390x/br-odd.S new file mode 100644 index 00000000000..2fae47a9e34 --- /dev/null +++ b/tests/tcg/s390x/br-odd.S @@ -0,0 +1,16 @@ +/* + * Test BRanching to a non-mapped odd address. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + .globl test +test: + lgrl %r1,odd_addr + br %r1 + + .align 8 +odd_addr: + .quad 0xDDDDDDDDDDDDDDDD + .globl expected_old_psw +expected_old_psw: + .quad 0x180000000,0xDDDDDDDDDDDDDDDD diff --git a/tests/tcg/s390x/cgrl-unaligned.S b/tests/tcg/s390x/cgrl-unalig= ned.S new file mode 100644 index 00000000000..164d68f2e64 --- /dev/null +++ b/tests/tcg/s390x/cgrl-unaligned.S @@ -0,0 +1,16 @@ +/* + * Test CGRL with a non-doubleword aligned address. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + .globl test +test: + cgrl %r1,unaligned + + .align 8 + .globl expected_old_psw +expected_old_psw: + .quad 0x180000000,test + .long 0 +unaligned: + .quad 0 diff --git a/tests/tcg/s390x/clrl-unaligned.S b/tests/tcg/s390x/clrl-unalig= ned.S new file mode 100644 index 00000000000..182b1b6462f --- /dev/null +++ b/tests/tcg/s390x/clrl-unaligned.S @@ -0,0 +1,16 @@ +/* + * Test CLRL with a non-word aligned address. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + .globl test +test: + clrl %r1,unaligned + + .align 8 + .globl expected_old_psw +expected_old_psw: + .quad 0x180000000,test + .short 0 +unaligned: + .long 0 diff --git a/tests/tcg/s390x/crl-unaligned.S b/tests/tcg/s390x/crl-unaligne= d.S new file mode 100644 index 00000000000..b86fbe0ef3f --- /dev/null +++ b/tests/tcg/s390x/crl-unaligned.S @@ -0,0 +1,16 @@ +/* + * Test CRL with a non-word aligned address. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + .globl test +test: + crl %r1,unaligned + + .align 8 + .globl expected_old_psw +expected_old_psw: + .quad 0x180000000,test + .short 0 +unaligned: + .long 0 diff --git a/tests/tcg/s390x/ex-odd.S b/tests/tcg/s390x/ex-odd.S new file mode 100644 index 00000000000..4e42a47df34 --- /dev/null +++ b/tests/tcg/s390x/ex-odd.S @@ -0,0 +1,17 @@ +/* + * Test EXECUTing a non-mapped odd address. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + .globl test +test: + lgrl %r1,odd_addr +fail: + ex 0,0(%r1) + + .align 8 +odd_addr: + .quad 0xDDDDDDDDDDDDDDDD + .globl expected_old_psw +expected_old_psw: + .quad 0x180000000,fail diff --git a/tests/tcg/s390x/lgrl-unaligned.S b/tests/tcg/s390x/lgrl-unalig= ned.S new file mode 100644 index 00000000000..ef8d51d47c9 --- /dev/null +++ b/tests/tcg/s390x/lgrl-unaligned.S @@ -0,0 +1,16 @@ +/* + * Test LGRL from a non-doubleword aligned address. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + .globl test +test: + lgrl %r1,unaligned + + .align 8 + .globl expected_old_psw +expected_old_psw: + .quad 0x180000000,test + .long 0 +unaligned: + .quad 0 diff --git a/tests/tcg/s390x/llgfrl-unaligned.S b/tests/tcg/s390x/llgfrl-un= aligned.S new file mode 100644 index 00000000000..c9b4eeaecf5 --- /dev/null +++ b/tests/tcg/s390x/llgfrl-unaligned.S @@ -0,0 +1,16 @@ +/* + * Test LLGFRL from a non-word aligned address. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + .globl test +test: + llgfrl %r1,unaligned + + .align 8 + .globl expected_old_psw +expected_old_psw: + .quad 0x180000000,test + .short 0 +unaligned: + .long 0 diff --git a/tests/tcg/s390x/lpswe-unaligned.S b/tests/tcg/s390x/lpswe-unal= igned.S new file mode 100644 index 00000000000..989f249a6ad --- /dev/null +++ b/tests/tcg/s390x/lpswe-unaligned.S @@ -0,0 +1,18 @@ +/* + * Test LPSWE from a non-doubleword aligned address. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + .globl test +test: + larl %r1,unaligned +fail: + lpswe 0(%r1) + + .align 8 + .globl expected_old_psw +expected_old_psw: + .quad 0x180000000,fail + .long 0 +unaligned: + .quad 0 diff --git a/tests/tcg/s390x/lrl-unaligned.S b/tests/tcg/s390x/lrl-unaligne= d.S new file mode 100644 index 00000000000..11eb07f93a7 --- /dev/null +++ b/tests/tcg/s390x/lrl-unaligned.S @@ -0,0 +1,16 @@ +/* + * Test LRL from a non-word aligned address. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + .globl test +test: + lrl %r1,unaligned + + .align 8 + .globl expected_old_psw +expected_old_psw: + .quad 0x180000000,test + .short 0 +unaligned: + .long 0 diff --git a/tests/tcg/s390x/pgm-specification-softmmu.S b/tests/tcg/s390x/= pgm-specification-softmmu.S new file mode 100644 index 00000000000..d534f4e505d --- /dev/null +++ b/tests/tcg/s390x/pgm-specification-softmmu.S @@ -0,0 +1,40 @@ +/* + * Common softmmu code for specification exception testing. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + .section .head + .org 0x8d +ilc: + .org 0x8e +program_interruption_code: + .org 0x150 +program_old_psw: + .org 0x1D0 /* program new PSW */ + .quad 0x180000000,pgm /* 64-bit mode */ + .org 0x200 /* lowcore padding */ + + .globl _start +_start: + lpswe test_psw + +pgm: + chhsi program_interruption_code,0x6 /* PGM_SPECIFICATION? */ + jne failure + lg %r0,expected_old_psw+8 /* ilc adjustment */ + llgc %r1,ilc + agr %r0,%r1 + stg %r0,expected_old_psw+8 + clc expected_old_psw(16),program_old_psw /* correct location? */ + jne failure + lpswe success_psw +failure: + lpswe failure_psw + + .align 8 +test_psw: + .quad 0x180000000,test /* 64-bit mode */ +success_psw: + .quad 0x2000180000000,0xfff /* see is_special_wait_psw() */ +failure_psw: + .quad 0x2000180000000,0 /* disabled wait */ diff --git a/tests/tcg/s390x/pgm-specification-user.c b/tests/tcg/s390x/pgm= -specification-user.c new file mode 100644 index 00000000000..9ee6907b7c2 --- /dev/null +++ b/tests/tcg/s390x/pgm-specification-user.c @@ -0,0 +1,37 @@ +/* + * Common user code for specification exception testing. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include +#include +#include +#include +#include + +extern void test(void); +extern long expected_old_psw[2]; + +static void handle_sigill(int sig, siginfo_t *info, void *ucontext) +{ + if ((long)info->si_addr !=3D expected_old_psw[1]) { + _exit(EXIT_FAILURE); + } + _exit(EXIT_SUCCESS); +} + +int main(void) +{ + struct sigaction act; + int err; + + memset(&act, 0, sizeof(act)); + act.sa_sigaction =3D handle_sigill; + act.sa_flags =3D SA_SIGINFO; + err =3D sigaction(SIGILL, &act, NULL); + assert(err =3D=3D 0); + + test(); + + return EXIT_FAILURE; +} diff --git a/tests/tcg/s390x/pgm-specification.mak b/tests/tcg/s390x/pgm-sp= ecification.mak new file mode 100644 index 00000000000..2999aee26e6 --- /dev/null +++ b/tests/tcg/s390x/pgm-specification.mak @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# List of specification exception tests. +# Shared between the softmmu and the user makefiles. +PGM_SPECIFICATION_TESTS =3D \ + br-odd \ + cgrl-unaligned \ + clrl-unaligned \ + crl-unaligned \ + ex-odd \ + lgrl-unaligned \ + llgfrl-unaligned \ + lpswe-unaligned \ + lrl-unaligned \ + stgrl-unaligned \ + strl-unaligned diff --git a/tests/tcg/s390x/softmmu.ld b/tests/tcg/s390x/softmmu.ld new file mode 100644 index 00000000000..ea944eaa3cb --- /dev/null +++ b/tests/tcg/s390x/softmmu.ld @@ -0,0 +1,20 @@ +/* + * Linker script for the softmmu test kernels. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +ENTRY(_start) + +SECTIONS { + . =3D 0; + + .text : { + *(.head) + *(.text) + } + + /DISCARD/ : { + *(*) + } +} diff --git a/tests/tcg/s390x/stgrl-unaligned.S b/tests/tcg/s390x/stgrl-unal= igned.S new file mode 100644 index 00000000000..32df37780ad --- /dev/null +++ b/tests/tcg/s390x/stgrl-unaligned.S @@ -0,0 +1,16 @@ +/* + * Test STGRL to a non-doubleword aligned address. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + .globl test +test: + stgrl %r1,unaligned + + .align 8 + .globl expected_old_psw +expected_old_psw: + .quad 0x180000000,test + .long 0 +unaligned: + .quad 0 diff --git a/tests/tcg/s390x/strl-unaligned.S b/tests/tcg/s390x/strl-unalig= ned.S new file mode 100644 index 00000000000..1d248819f02 --- /dev/null +++ b/tests/tcg/s390x/strl-unaligned.S @@ -0,0 +1,16 @@ +/* + * Test STRL to a non-word aligned address. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + .globl test +test: + strl %r1,unaligned + + .align 8 + .globl expected_old_psw +expected_old_psw: + .quad 0x180000000,test + .short 0 +unaligned: + .long 0 --=20 2.39.2