From patchwork Fri Sep 27 19:39:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 174656 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp3982300ill; Fri, 27 Sep 2019 12:56:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLMXuuv7TftcBMhu0G4uGnfuaEsLXwH+FFGcqOzJzdIKyDjJ7LVy0td62A5kEmLLl2Cbvt X-Received: by 2002:a37:a943:: with SMTP id s64mr6311696qke.404.1569614188378; Fri, 27 Sep 2019 12:56:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569614188; cv=none; d=google.com; s=arc-20160816; b=vD8Scgmt2YD9ji7fymE1QZFHLoobG5Z5Z0tyIzdQEiuuHcPaKMte97DZJZQdtLVeuL tp2amXD2PH9axLhAoa7GcPuB/M/c3b3L1FRuzZEb5tgcmp5vzaOtAlST8tNlDR1gDqi2 FOda75mGZQeBkwk0qMcUG47+wvb4avzMjsP47Oe2bGdDwMXhjleu2UXMjNEH3ak8Z+H5 cwus/PS63IP1RVldfTZl3Noqg5SbGHPTS95P4myMTFaAOOaUwCT1kC2PeVjoDtxXXRPF FauVgJT+fEoksm0S/GbuOf85IV31/0k/8Pk5CryqGDtD/ySWBr8S8ElFG1ZZfphALVUL P9nw== 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=JRvdMyM9Sj/RUuKpg8/TgrKRC1uF6ZGFoIXA3Jik0UOBRR/8utPT38cza8hnGT53Mc IcOg887zonUido7fiwyrghWpS/Ss+Vo8Xcsc/nniP2pgbREZyCGatXubJSVw+P89HJfr eVs+TeYKRDqVGhAsI1YE95hC+sf33WUY/tIlHYK6qCwS6EQbtRVy96zGjbdoIFEtAJZ7 iPHdJBFmGgKSBjrN1HXTkyGgX4K/uWLOLhBANVCmDAiGWMflscnvLilpZSNMj0a4RdOY NTJTaf5t1xSjc0LgqA6vrve7EZuAqDpkT3UjF56YmGh9YtqGehC6qWwFLvLRSLyfdM6h h2Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=dHqQcKcS; 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=fail (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 s46si5744013qvs.131.2019.09.27.12.56.28 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Sep 2019 12:56:28 -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=fail header.i=@linaro.org header.s=google header.b=dHqQcKcS; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDwLr-0004L1-RP for patch@linaro.org; Fri, 27 Sep 2019 15:56:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46681) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDw5r-0003Q9-Sh for qemu-devel@nongnu.org; Fri, 27 Sep 2019 15:39:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iDw5p-0006X1-8f for qemu-devel@nongnu.org; Fri, 27 Sep 2019 15:39:55 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:41002) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iDw5o-0006V1-N4 for qemu-devel@nongnu.org; Fri, 27 Sep 2019 15:39:52 -0400 Received: by mail-pf1-x443.google.com with SMTP id q7so2129405pfh.8 for ; Fri, 27 Sep 2019 12:39:52 -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=dHqQcKcS5KBF6O77Plq4rDj88JAbk5pu6LwtBQU8M0h8gG5Xw8hAxzb6qIuHHkqLF2 cDkV41xYHWCRAQ1Cx7DvZcHOwJPNMUyUtumdCXb1Y6MoyYPAyglmn3b/eCL3M+S+tq6o PeoYDRYs+2Xi17wO9jh4HL7QcmAFuzB3i+A1Gu2F46/9Z4Pf5FMkpGRGfC01kYxrv/F5 vzk4KJZ3IgilHkyH773copXHutd+QW6ynYY+kZHjFGd93yQUK/IurGINa/TeXeJvJFwT lpYpKkMCHqR7FAJOrpIN4iw4WDbs3CV0WXaliZ0ZigeNhAUIXQ52iznTxTQz1D/zxjOY +Kvg== 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=L8Twkh8vHCaeX2vyyXwxztibMvRr3l+EBN5Lh5X0ZsC0pCcE2926LEUC8GTyJShml7 BVk3iRyoNVInq0dXK1jPENNahyWbxjQoYa0AeRMCIBPTwhPqivZ2XGw8gGT48MaSEFTZ 0QK/dDKLf6Sl60Z/PGfc3Gdm9XQPBzPPrmc6G5GtoTuoUB31eeG/uL/F0+PUJVx48Uzc se5Jcd6CgFPnvvjsIQQb7bB+z2+OnIbRnHVZ0pMTBPbqPbtCBjZ5QG4L+Go0G80aUKF5 DOpWpz5IIHSeYzdl3/uxkFWiZ4S+m74HZb2ng/hIS5OSGQfInS4SXtfDHKtbAJfmqTIp hudw== X-Gm-Message-State: APjAAAUt7MuptgXlJFF/It9yoOdK/8UCF0l1wWM3WuMiuugSQHoszMye AAKLWeZq7yD20tJRgUNtgiEWctPY19s= X-Received: by 2002:a63:eb18:: with SMTP id t24mr10939654pgh.214.1569613190764; Fri, 27 Sep 2019 12:39:50 -0700 (PDT) Received: from localhost.localdomain ([12.206.46.62]) by smtp.gmail.com with ESMTPSA id 192sm3676403pfb.110.2019.09.27.12.39.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2019 12:39:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 12/18] target/s390x: Simplify helper_lra Date: Fri, 27 Sep 2019 12:39:19 -0700 Message-Id: <20190927193925.23567-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190927193925.23567-1-richard.henderson@linaro.org> References: <20190927193925.23567-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::443 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: qemu-s390x@nongnu.org, 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;