From patchwork Tue Oct 1 17:16:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 174911 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp8857683ill; Tue, 1 Oct 2019 10:33:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwWzW+L8KpvIlklYnMBfiMq4CrI9w0JLPQH2zyV9AiBYX6OGwCog+M5wyGlOxMvHkerpnW X-Received: by 2002:a50:d55e:: with SMTP id f30mr27268490edj.35.1569951231087; Tue, 01 Oct 2019 10:33:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569951231; cv=none; d=google.com; s=arc-20160816; b=uoJRXIJF8y7YkoDXKwMxAPtihUEFFKzAy20Cfq2soW9WBjFXN7JgM6FvZ89tER0VXE jOHsz+Q6HbLsg1VmrKaAkRzyCqyoGG+IaYp+S4UtwFNM0eM/Ou4k3252yECjkSwxJHzR JpdZhpeeREVoiE/ttej4VgQX8Iw6mNQHa0xWLGLwaIpfFCMN0SeUqHc24CcWIjv5MajL bloMrkMv3zD1aRV2nMzzsyxjYoTZR/lKizVAzM8yMv7PzNw3yBdUnxl3B+o9gN9LF/Hg fd4wB6+EbO+0Z+WCYx3jC4Ocx8KxFFvX8YudtZUpvSBw9qm7bYCCldWvbcCRjIxFvWJn 1OQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=vJYZZP2e9BNSzbbwHk+HhznESdz192Yke+3plcKoZ6o=; b=ARQ90wedqb1WVtmquTJYpnk3cubQwyuULrSwNT2iDpCbkl1SpjI/naskszuyTyLo7G N06yfKgie30kWqpw7HtMOD9Tzv7BE9mWGdIBO9Z3sZvRwk8lp5P8UZcSJokomvN5ZkGd +/FN4ik4Ki3riYIVZTCeBwhJjlDqunyOrqmy19JaHvpiVcn2jBCTSh6Nsy4BPntYW3Ha Qcesak1O6JvHKsUSY6BqD2Pu3nT1/uAVPyjqruQQ62UmN6I8cY3e800fAerdgdgHqsNl olimC8r/s9sRYrYWJ1pIXmkwaBUskulyiX7Dwt/nOPShKXV1in8yDb+Z4+AdEhiC00FG xY/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XzIkzCRU; 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 w6si9746066eda.336.2019.10.01.10.33.50 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 Oct 2019 10:33:51 -0700 (PDT) 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=XzIkzCRU; 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]:45834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFM21-0001iX-Vc for patch@linaro.org; Tue, 01 Oct 2019 13:33:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32918) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFLlK-0001fe-Ki for qemu-devel@nongnu.org; Tue, 01 Oct 2019 13:16:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFLlJ-0005Zu-KP for qemu-devel@nongnu.org; Tue, 01 Oct 2019 13:16:34 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:37412) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFLlJ-0005ZW-FS for qemu-devel@nongnu.org; Tue, 01 Oct 2019 13:16:33 -0400 Received: by mail-pf1-x441.google.com with SMTP id y5so8478713pfo.4 for ; Tue, 01 Oct 2019 10:16:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vJYZZP2e9BNSzbbwHk+HhznESdz192Yke+3plcKoZ6o=; b=XzIkzCRUjUk4HEBRS0gpgM6RZkrUiM/UgAAhxXtu674ygOePLxt8JTj79MXXOFvew7 5cXaQzauSFgEschhQrGI0wXw1Wkxp5GBh23/aZey20wOwOph/GKmADniiOY8gvAXm2CW lJt1CmkNY6Om98QILFzTsvU1td0FJTfuqblnYGeNFYVcAqMoT72biGxmQ0Z88BkVM/P0 3XcMkXJVXsYR8FOTSmeWNrGEA5cQzQx1H6OOgha61GE1fXErdyKKzvolysqdlv7+Jqop aWQKN6ZsXR0nD5+LzMxhyIDyXGQXvm6sif+rHftS1dE6iPahzk/K2xVq6DHB2oJhoKeO 1ObA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vJYZZP2e9BNSzbbwHk+HhznESdz192Yke+3plcKoZ6o=; b=leOdgKdvWEEX53p7jSSzJIkTLiCqJ1mT5wq7N3qEefzypFhQBEfIkkNFMVX6ulbtYY hu/D1VetCTV6nlXtKnhKdZUqRrVxdIUL4N0r86/QYDTLK5HvBNM4cVmXnssr5r/RQ2O5 QZxlNEA6pVEbGc8NtahMFpvKRHqSdf4165ZbP8iaL6ZCbMZkzEO3CrI0Qcw36gvEl9DM blOayinKD4+DVDVBrNrHT3zw0A7pAQ1ixzkZmlGMGqwiH10BfLJsTyVCcPjCZn6yL9B8 qI/Qx4iiXUn061UTRJgucoHC9yGr86q1Pz+eS/kIUHFj5YlSZszTK1ZmuUq0xOnjjART uRDQ== X-Gm-Message-State: APjAAAWIU9Plv7TrVPn6TaxD8ZOTx9xXhQEPb5pJ5CIvcw9fk6O0L+Yd diC9kRRzmkaPmW0sxEh0oh2xIbDYNOE= X-Received: by 2002:a17:90a:fe04:: with SMTP id ck4mr6872581pjb.74.1569950191808; Tue, 01 Oct 2019 10:16:31 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id w7sm2863568pjn.1.2019.10.01.10.16.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2019 10:16:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 12/18] target/s390x: Simplify helper_lra Date: Tue, 1 Oct 2019 10:16:08 -0700 Message-Id: <20191001171614.8405-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191001171614.8405-1-richard.henderson@linaro.org> References: <20191001171614.8405-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::441 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We currently call trigger_pgm_exception to set cs->exception_index and env->int_pgm_code and then read the values back and then reset cs->exception_index so that the exception is not delivered. Instead, use the exception type that we already have directly without ever triggering an exception that must be suppressed. Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- target/s390x/mem_helper.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) -- 2.17.1 diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index e15aa296dd..4254548935 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -2361,34 +2361,23 @@ void HELPER(sturg)(CPUS390XState *env, uint64_t addr, uint64_t v1) /* load real address */ uint64_t HELPER(lra)(CPUS390XState *env, uint64_t addr) { - CPUState *cs = env_cpu(env); - uint32_t cc = 0; uint64_t asc = env->psw.mask & PSW_MASK_ASC; uint64_t ret, tec; - int old_exc, flags, exc; + int flags, exc, cc; /* XXX incomplete - has more corner cases */ if (!(env->psw.mask & PSW_MASK_64) && (addr >> 32)) { tcg_s390_program_interrupt(env, PGM_SPECIAL_OP, GETPC()); } - old_exc = cs->exception_index; exc = mmu_translate(env, addr, 0, asc, &ret, &flags, &tec); if (exc) { - /* - * We don't care about ILEN or TEC, as we're not going to - * deliver the exception -- thus resetting exception_index below. - * TODO: clean this up. - */ - trigger_pgm_exception(env, exc, ILEN_UNWIND); cc = 3; - } - if (cs->exception_index == EXCP_PGM) { - ret = env->int_pgm_code | 0x80000000; + ret = exc | 0x80000000; } else { + cc = 0; ret |= addr & ~TARGET_PAGE_MASK; } - cs->exception_index = old_exc; env->cc_op = cc; return ret;