From patchwork Thu Sep 26 16:26:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 174498 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2314269ill; Thu, 26 Sep 2019 09:57:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHPYpWjmm/14ORnqSQmD7bmyb9H9qlj23+hhac5Rm7WHtJhZAbaHZEiUosWBB118maJ1FX X-Received: by 2002:a37:8382:: with SMTP id f124mr4285882qkd.218.1569517045987; Thu, 26 Sep 2019 09:57:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569517045; cv=none; d=google.com; s=arc-20160816; b=nfb+RRW+Cj7rM1+9UPgLXDPUuFb/IgMGPVEo0Noc22ldYtkwuir1TRIllXQGVoFH81 MxwdqTVU2TeoBGDtwQvMurBaDdVPn8eaDsxCkyqY+aXMW0SmnAew09qT+2lG2KpFz223 lcw/pfXb85d7hwTCQGX5QEF4Gs0L3yMGx9d39expaO3sn+E9+TAieY4Yw6WpAG7qeOTY TLvcyemqHHTrsP3v6jUXx9KBdYAlw3Rp7rTPy63DwOIccxRsPwJO8IArs2g2H+BhsPEE XebBN2b8gqKLs4q/L6j/1ONs5e/woNJLXq2fgMGuKA0xXyyCRsKARdsjmasM/fjjLFVM bqhg== 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=k7SDLRyU0L6BXBxdXsZbeGOUPnjW/+4D7x0wD4wfAkI=; b=N1Rf/bEYqeo8r2su/ylgx/cibo32TQ90V0Yh1FILWQaoOnVoRF5A91g+p/UvLJ1OJR i2QRB1ViQ95JK9ujifcGJrae1c73Hn+3C81r9ppSXx4iL9YcUv14iL38VscPqDrbceyw OgTOPqsl+71Rl18Qm1o8PdRepe3ustI8nQBpQHhk3M2lvCe8OG+DjKoGsXD55rm0Kpy8 /rOP81tjkIgfEms0hYGq/EYnbBuIEIJw2WCBHSn0M6efU5gdI8UnzlwwqkGAmlaJS3h9 LusV5/dic9chrsN5Zkn5gi24tnOiT6f9SfPLjLBhPMIzS4lPsYDG1oXT3OCTsxsbSw4Y A7Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="JZDj7/Yl"; 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 t15si1982293qvb.208.2019.09.26.09.57.25 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Sep 2019 09:57:25 -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="JZDj7/Yl"; 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]:41110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDX53-0008Lu-DR for patch@linaro.org; Thu, 26 Sep 2019 12:57:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41348) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDWcF-0002i5-Gg for qemu-devel@nongnu.org; Thu, 26 Sep 2019 12:27:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iDWcD-0004oK-Ox for qemu-devel@nongnu.org; Thu, 26 Sep 2019 12:27:39 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:44363) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iDWcD-0004nF-Fg for qemu-devel@nongnu.org; Thu, 26 Sep 2019 12:27:37 -0400 Received: by mail-pf1-f196.google.com with SMTP id q21so2103553pfn.11 for ; Thu, 26 Sep 2019 09:27:37 -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=k7SDLRyU0L6BXBxdXsZbeGOUPnjW/+4D7x0wD4wfAkI=; b=JZDj7/YlPCsHNpH4dL9ZNtZwBd7wAb5Jypy78IZD4gYMegpOZFLgOlNhEn/b2b0J6W cT2jQfrWR5X4tfcJiEiDV+GpOIyRpxuko8w+kFoiN7CXSqU0+nFIWd7kflXJw8NW3uoI fSd/GyK2w5XilQ/xPWTAWKk38oJsDxD0Gt/spBOGQYeQOQZykflPJ1lFsZ8ccSruBZ9G 0WiHMq1rnkpXn+xoczrxSZlOni/N8FXXuVuQuD/rsIuqAw41YGm5InXyQvpV9pLgvXPA tmb9O96sMOvQwlNZBgTxCjFzmnHYHsFXOgsRn5iCwBXf4/6oBCBOO7RzGkCLavBOTzek Tkbg== 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=k7SDLRyU0L6BXBxdXsZbeGOUPnjW/+4D7x0wD4wfAkI=; b=t5CZAcObfBeqYdMF6ykzElFnXPBVguWo5ssuj1D2KSF+GKYObNxOifZuTz/7XfqoTJ aK7nmtYZUlf5gdwhu+1IWEjgHS0dsBSXIqkvjjUfnJ9s0wRjlXoiZ3LLOSQM4q0A9dit araV+9i8ZojTJqFLATNx/7aFhTGpy07o3QwadWghbHzHsF6GwvDKgabox45tdIVsuLHt ArV/Jx0cdpbpPdsfTXBuBiiGfyqMJlScGjb58gn2+Owok3NlrRB+9uIh6U82RnpNXdr+ JzfGmZjqs/qcWQwzzC6aQwO9WijZkdVKOuNVzw8HjDtSrl5+TQLENdBwNnj8e99l/2EE 36ZQ== X-Gm-Message-State: APjAAAU6IsLJky35qOdyhytD2AFf+IJL6s3NWQjmRL7yRNhrpzUDlMCD nnaLfQedcqwqD5FBUvzzP5DWDGkN/ms= X-Received: by 2002:a63:fc5f:: with SMTP id r31mr4192516pgk.55.1569515196055; Thu, 26 Sep 2019 09:26:36 -0700 (PDT) Received: from localhost.localdomain ([12.157.10.114]) by smtp.gmail.com with ESMTPSA id 64sm4453169pfx.31.2019.09.26.09.26.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 09:26:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 13/18] target/s390x: Simplify helper_lra Date: Thu, 26 Sep 2019 09:26:10 -0700 Message-Id: <20190926162615.31168-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926162615.31168-1-richard.henderson@linaro.org> References: <20190926162615.31168-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.210.196 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. Signed-off-by: Richard Henderson --- target/s390x/mem_helper.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) -- 2.17.1 Reviewed-by: David Hildenbrand 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;