From patchwork Mon Feb 20 18:40:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 655112 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1551910wrc; Mon, 20 Feb 2023 10:44:02 -0800 (PST) X-Google-Smtp-Source: AK7set8ZwDzMYrbghO+wN+mj6qx5708681xyOm88vkG1HMxFBnAs5DJez5ShCPKDZXgotZ7+dJdq X-Received: by 2002:a05:622a:409:b0:3a9:818f:db3d with SMTP id n9-20020a05622a040900b003a9818fdb3dmr20001985qtx.53.1676918642634; Mon, 20 Feb 2023 10:44:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676918642; cv=none; d=google.com; s=arc-20160816; b=kDGgFSrcKFSS/ir4NJEuVXqbVb2kj10RwxP38MQNkxZKYnoNUsWddlTP6SC09QqPuJ Xo5Lbt37FTLX097mVIjpMpMBExi45u7cmZYwvaLApoU5pKZvWlOlUlC430gspSIkoOP0 ybmjVbOh9rNXzXQaKZGybME8uqLiLxwcMSyqby5PNkh2qSdQiW2kKKrSKmxUPtygzwwY 9Crl/M1twKdsV2XFk11HAvzivhC4EdyKcuzpBTf+/GsknjceMggGlZ8GjC6EnuCEXqpK /bQJ6qM1+Vgms7xF2Ne1LQ0COm4Bc20ib4ahCZcErp4aZQXHBjCFxO0sVLYuoF53xkhm cgBw== 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=ZWlppU2XNhFXTdVt0C0CpRj3rW11FE4bGKcS7c5hawE=; b=nW1OzRdOAu8D8/ELDyDvP9yqdTdAFTIByxLa4XBjYwjK5K2AmejRuJMWcqFKJCFE0U xYJ0tXPQ+AtJ5HBUhUrHurGyiqjdzIDb8//SU3GpmNCHsMqDHiZZSXqdWtGHv+hcrseo zgifSKLUW7coJZH9u3yHG0ioyld2LGERlfe1dj3HD1wq2VHQoFpgvy+WSMZc/ABF/ynA dydRMC8e+fH23ghudTpcCq+iGITC0T7enctPYbuiPMm9iH1hSjhpH3kE2MpGR4DNUtn8 +DPnlVCPUsGmTYidd9TcvmZnrdO8T65IaDWaxUwJAkrs8rdU8aPyKITqeotK1zZSQWn4 FecQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YkXS++rA; 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 i124-20020a378682000000b00705f8d6c9ddsi9779404qkd.367.2023.02.20.10.44.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 10:44:02 -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=YkXS++rA; 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 1pUB8C-0006Lj-2f; Mon, 20 Feb 2023 13:43:20 -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 1pUB6g-0004fW-Ig for qemu-devel@nongnu.org; Mon, 20 Feb 2023 13:41:49 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUB6c-00045M-DB for qemu-devel@nongnu.org; Mon, 20 Feb 2023 13:41:45 -0500 Received: by mail-pl1-x632.google.com with SMTP id t14so2810258plo.2 for ; Mon, 20 Feb 2023 10:41:41 -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=ZWlppU2XNhFXTdVt0C0CpRj3rW11FE4bGKcS7c5hawE=; b=YkXS++rAzG+g59bE2dOEeHYSr2ib3vIn6M8PbG1sw+iGMkNNzopHMgNyoL2qMOyWip 4qG5XY3NaHFqMgsDx/eSKy2dZKT/bpvj0LCBoOdZ4PR+3euBOBHWH1pDJDiWZ2N48EO1 KIDhHSNwrs1w/BeqCqcgk854qxQWX1kgPBNSVWSYH8A/f0ugcJd0FUwujwmsJOeIws8k dFCsnDC4CiRQzjdfCq82Kgu9PQlRbbjTls33L8UesrpVzflKy4XZw9zSVXYf7rASjZkC 4y36VJtTL3jTmd+NkV6F5oqna6fsQpnXpsbWTK2EGJCjOEvlW7JlvXKzKZ3IGdqFVOQI 5BFQ== 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=ZWlppU2XNhFXTdVt0C0CpRj3rW11FE4bGKcS7c5hawE=; b=o+Ro2UZ7LVWn9rRHUUoQDG+oNx9RsNiOH4S/Vz8f79Jr49zSCoVGLhKco5tnE2ffsu cySdVuX6Cpqt789muRMdCYTzwKU1IAFJvFFLZOoj3fWxqXOs/t3ODM6sqiqd6WfqFtRH FF0x1RBTTD63XAKT9EhbP7bm5bN5bHrgOKPNDLt/uxDt6osXfFlzpsG154bbLCjSW/7Q HacdC0Vh0/M6FnooFuXLx9F1XJeitRc6hs37cGkuU2et3dlHEZe9tDJoS/Q4JBo1KOs1 G7U+MCcT33opS/DVj/5vBMNoZ9E7HDmc6z/ouSSsdjrK/VKDia/v9sb8SyoMeCQmfe6q 5CyQ== X-Gm-Message-State: AO0yUKULCFoD6t9PUmFIjCnotmHyjQoHN23ZDDe6FGE2O2eT9t5nhzPb UHNYhwz5LK3GqWhvNEdb9vCm7hcie/2d7ud4KRs= X-Received: by 2002:a17:902:fa0d:b0:199:11c3:cc4f with SMTP id la13-20020a170902fa0d00b0019911c3cc4fmr1542500plb.44.1676918501653; Mon, 20 Feb 2023 10:41:41 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id jk20-20020a170903331400b0019258bcf3ffsm1911676plb.56.2023.02.20.10.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 10:41:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: thuth@redhat.com, qemu-s390x@nongnu.org, Ilya Leoshkevich Subject: [PATCH v4 25/27] tests/tcg/s390x: Add per.S Date: Mon, 20 Feb 2023 08:40:50 -1000 Message-Id: <20230220184052.163465-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230220184052.163465-1-richard.henderson@linaro.org> References: <20230220184052.163465-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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 avoid regressions. Signed-off-by: Ilya Leoshkevich Message-Id: <20221130174610.434590-2-iii@linux.ibm.com> Signed-off-by: Richard Henderson --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/per.S | 55 +++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 tests/tcg/s390x/per.S diff --git a/tests/tcg/s390x/Makefile.softmmu-target b/tests/tcg/s390x/Makefile.softmmu-target index 725b6c598d..c286d22a9f 100644 --- a/tests/tcg/s390x/Makefile.softmmu-target +++ b/tests/tcg/s390x/Makefile.softmmu-target @@ -9,3 +9,4 @@ QEMU_OPTS=-action panic=exit-failure -kernel TESTS += unaligned-lowcore TESTS += bal TESTS += sam +TESTS += per diff --git a/tests/tcg/s390x/per.S b/tests/tcg/s390x/per.S new file mode 100644 index 0000000000..02f8422c44 --- /dev/null +++ b/tests/tcg/s390x/per.S @@ -0,0 +1,55 @@ +#define N_ITERATIONS 10 + + .org 0x8d +ilc: + .org 0x8e +program_interruption_code: + .org 0x96 +per_code: + .org 0x150 +program_old_psw: + .org 0x1d0 /* program new PSW */ + .quad 0,pgm_handler + .org 0x200 /* lowcore padding */ + + .globl _start +_start: + lpswe per_on_psw +start_per: + lghi %r0,N_ITERATIONS + xgr %r1,%r1 + lctlg %c9,%c11,per_on_regs +loop: + brct %r0,loop + lctlg %c9,%c11,per_off_regs + cgijne %r1,N_ITERATIONS-1,fail /* expected number of events? */ + lpswe success_psw +fail: + lpswe failure_psw + +pgm_handler: + chhsi program_interruption_code,0x80 /* PER event? */ + jne fail + cli per_code,0x80 /* successful-branching event? */ + jne fail + la %r1,1(%r1) /* increment event counter */ + mvc return_psw(8),program_old_psw + lg %r3,program_old_psw+8 + llgc %r2,ilc + sgr %r3,%r2 /* rewind PSW */ + stg %r3,return_psw+8 + lpswe return_psw + + .align 8 +per_on_psw: + .quad 0x4000000000000000,start_per +per_on_regs: + .quad 0x80000000,0,-1 /* successful-branching everywhere */ +per_off_regs: + .quad 0,0,0 +return_psw: + .quad 0,0 +success_psw: + .quad 0x2000000000000,0xfff /* see is_special_wait_psw() */ +failure_psw: + .quad 0x2000000000000,0 /* disabled wait */