From patchwork Mon Jan 9 20:07:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 640681 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2337565pvb; Mon, 9 Jan 2023 12:16:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXtKvp10ZWMUvQlHng0DHQfqKPdr228j+QlclPmoCTKGlD+bfeBmnM56yl1IR5HV2sFow99V X-Received: by 2002:a67:b205:0:b0:3b1:5691:2bca with SMTP id b5-20020a67b205000000b003b156912bcamr32831965vsf.11.1673295393320; Mon, 09 Jan 2023 12:16:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673295393; cv=none; d=google.com; s=arc-20160816; b=tcHxhyI2WvQXPWmnWV7TZx0IbR8AhQRLXgu3TJ80zfeiduzbhMLFbht5Bv7eef6qgq be2t1BThWzmvcnq4c/vnLF+Yq7MpvWx5i6mvPXVUPfaF8tsPfRxEG/f+g7XNzkW0Vd2N vWhnxO6a5x/ULlo6Xqjxsz7OvUN3Y19DpwOYQ0/Y/JY+ElCASnaRIuRW/DNk5ccERMQ+ ZMaWbAsH8ROt4unl1LSGAklenHTv7KSj/Sqf9pihHkVHt4OYpAWCJPII6HQNx0wGYrMB 0tRUixRGfp0hTk0gvX97j8xTSY/RlQm3gnBn31kn3hqvVGN8WE0H7azSKFNTgEbJhO7h 6Rpg== 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=7Jm8IvT8OnM6ntzNw++ITlfcs7TcV+gT1sswHnCP9Os=; b=HAlgiD0WwF4Ur8TNliXoZfjTjYesByErgQvJdDfs7HuYzqxiLcR4/dADu0hWTqdez/ efRAoY0XwbYoyvTAgeG2uTnpVByvEHnvZct9hDPU2YOUpffcIrBRBlz39sufI9LVP8FJ vPO52MchAcf8HgGLYmOzi661veyurgMd9TTP8jUldOasYnkVWKUSMlNiEPZ4zXdQZJ1Y bsf62YMmRFMskdgCI/Q5BxmWrtp2IHshuxvdIqpVcOMkkkaeWUBempcbOWyH6jIQ/rKH uMJiePvMJGJZahXBVAtyl4Lu/66twkiCa+mP2BKby7QylIYXKjdZbsO/+9J9gaA9jw6j Z6yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HczyxnSG; 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 v190-20020a37dcc7000000b006fcb2a73e43si4992318qki.185.2023.01.09.12.16.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 12:16:33 -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=HczyxnSG; 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 1pEyRk-00031t-1o; Mon, 09 Jan 2023 15:08:40 -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 1pEyRd-0002uA-VA for qemu-devel@nongnu.org; Mon, 09 Jan 2023 15:08:34 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEyRa-0007OD-N0 for qemu-devel@nongnu.org; Mon, 09 Jan 2023 15:08:33 -0500 Received: by mail-pj1-x102b.google.com with SMTP id fz16-20020a17090b025000b002269d6c2d83so12049511pjb.0 for ; Mon, 09 Jan 2023 12:08:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=7Jm8IvT8OnM6ntzNw++ITlfcs7TcV+gT1sswHnCP9Os=; b=HczyxnSG1cF3PnQGsi52Gld1no8ZC6NNK9Yta5ipxLu4TSYu0jIaqeAR+fWaoWPrBS v40cagqJBXHuzDVRqUOmm1jsAPzRqTrYIqa+VP8SsDPCW4Bc+MA5Q7mmyooEtC5YAig0 u84TXqluJVK8JoddqpZVnuQwqhA1GvSsqvc6ZlSs0CfoJMRhdtQa78cFUGwMqjjtUfUD 8Mmerl00BdedGZA0exoWCCobNOgZdYYjK8ricp+q8sdWtU+lsCbLQmDi4Br4cvn6gjCJ azJ+v/dSmhOsoN3IfWcXbbH/qDRnEnfg9uri55V4xSltLDRibh/6aWi6XjxXamT7aXxe Me8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=7Jm8IvT8OnM6ntzNw++ITlfcs7TcV+gT1sswHnCP9Os=; b=BLx6ud5bHpbgHDsrPn1wqxKZazwclE5oFD0BGP7GlXO7fIB/2X6DQ9yARB3D47xM0o NYP6aMY0hQG1iH1Vaf+ng+rW71435iTgDFYccNNSvPQq6k9coy6hBp9lj6IJ8gPpkS6e F0NLNTTEM84CHxgcknHPlPQrPRrvYxHp8edB1T6mVs91gF44LXHQnJEqsOfZMEhlcauY Ji2oGVsOXY/qvtXEop5xO9NNnAlD8ZWx9wj2HJjJOdCcwxcHbiAeBVgBUpLGSTpUaCoi ekj95WEnJ0XKhD5QfsmT1v7YHlK5WzJMndN1idJG4T37AHb1s1tmIXRYrLHsTWLxCZOX TxgQ== X-Gm-Message-State: AFqh2kpxhehMBPLGW9iqdmSSBxD5pHKeHS9KXaCrOJAPgb9FxQlF2Sus EYee593oX9vlh33ZtRuPJoNNzAWkwALfoXIq X-Received: by 2002:a17:90b:19cc:b0:226:cdcf:da83 with SMTP id nm12-20020a17090b19cc00b00226cdcfda83mr15746645pjb.46.1673294909345; Mon, 09 Jan 2023 12:08:29 -0800 (PST) Received: from stoup.. ([2602:47:d48c:8101:158e:facf:7a46:ba9f]) by smtp.gmail.com with ESMTPSA id l2-20020a17090a384200b0022727d4af8dsm577574pjf.48.2023.01.09.12.08.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 12:08:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Ilya Leoshkevich Subject: [PATCH v3 06/27] tests/tcg/s390x: Add sam.S Date: Mon, 9 Jan 2023 12:07:58 -0800 Message-Id: <20230109200819.3916395-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230109200819.3916395-1-richard.henderson@linaro.org> References: <20230109200819.3916395-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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.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 From: Ilya Leoshkevich Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich Message-Id: <20221129015328.55439-1-iii@linux.ibm.com> Signed-off-by: Richard Henderson --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/sam.S | 67 +++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 tests/tcg/s390x/sam.S diff --git a/tests/tcg/s390x/Makefile.softmmu-target b/tests/tcg/s390x/Makefile.softmmu-target index 295df08491..d6ca8d7342 100644 --- a/tests/tcg/s390x/Makefile.softmmu-target +++ b/tests/tcg/s390x/Makefile.softmmu-target @@ -8,3 +8,4 @@ QEMU_OPTS=-action panic=exit-failure -kernel TESTS += unaligned-lowcore TESTS += bal +TESTS += sam diff --git a/tests/tcg/s390x/sam.S b/tests/tcg/s390x/sam.S new file mode 100644 index 0000000000..4cab2dd200 --- /dev/null +++ b/tests/tcg/s390x/sam.S @@ -0,0 +1,67 @@ +/* DAT on, home-space mode, 64-bit mode */ +#define DAT_PSWM 0x400c00180000000 +#define VIRTUAL_BASE 0x123456789abcd000 + + .org 0x8e +program_interruption_code: + .org 0x150 +program_old_psw: + .org 0x1d0 /* program new PSW */ + .quad 0,pgm_handler + .org 0x200 /* lowcore padding */ + + .globl _start +_start: + lctlg %c13,%c13,hasce + lpswe dat_psw +start_dat: + sam24 +sam24_suppressed: + /* sam24 should fail */ +fail: + basr %r12,%r0 + lpswe failure_psw-.(%r12) +pgm_handler: + chhsi program_interruption_code,6 /* specification exception? */ + jne fail + clc suppressed_psw(16),program_old_psw /* correct location? */ + jne fail + lpswe success_psw + + .align 8 +dat_psw: + .quad DAT_PSWM,VIRTUAL_BASE+start_dat +suppressed_psw: + .quad DAT_PSWM,VIRTUAL_BASE+sam24_suppressed +success_psw: + .quad 0x2000000000000,0xfff /* see is_special_wait_psw() */ +failure_psw: + .quad 0x2000000000000,0 /* disabled wait */ +hasce: + /* DT = 0b11 (region-first-table), TL = 3 (2k entries) */ + .quad region_first_table + (3 << 2) + 3 + .align 0x1000 +region_first_table: + .org region_first_table + ((VIRTUAL_BASE >> 53) & 0x7ff) * 8 + /* TT = 0b11 (region-first-table), TL = 3 (2k entries) */ + .quad region_second_table + (3 << 2) + 3 + .org region_first_table + 0x800 * 8 +region_second_table: + .org region_second_table + ((VIRTUAL_BASE >> 42) & 0x7ff) * 8 + /* TT = 0b10 (region-second-table), TL = 3 (2k entries) */ + .quad region_third_table + (2 << 2) + 3 + .org region_second_table + 0x800 * 8 +region_third_table: + .org region_third_table + ((VIRTUAL_BASE >> 31) & 0x7ff) * 8 + /* TT = 0b01 (region-third-table), TL = 3 (2k entries) */ + .quad segment_table + (1 << 2) + 3 + .org region_third_table + 0x800 * 8 +segment_table: + .org segment_table + ((VIRTUAL_BASE >> 20) & 0x7ff) * 8 + /* TT = 0b00 (segment-table) */ + .quad page_table + .org segment_table + 0x800 * 8 +page_table: + .org page_table + ((VIRTUAL_BASE >> 12) & 0xff) * 8 + .quad 0 + .org page_table + 0x100 * 8