From patchwork Fri Sep 27 19:39:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 174646 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp3969956ill; Fri, 27 Sep 2019 12:44:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3/7Z0cYN/2gPirJTuB1wYiW8l6EIvtCDnwET1c6BCwNkfMNXgWdWanrt/GgPiLfDQsVYX X-Received: by 2002:ac8:6b16:: with SMTP id w22mr12012326qts.39.1569613443637; Fri, 27 Sep 2019 12:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569613443; cv=none; d=google.com; s=arc-20160816; b=F7TifQRCfcQpyVFV8Bzf3guA+eIccPYSyvZw0IlFx7eVO+pgeaynU6vf2aVvF3Wr8J ZEMsrQ5AC7/ndPBj7ln87s02Rw59WC3EkS9tSWj4DTVJGeqRnqrYxgQCX31mD3lv6149 5DfZcw5dbZ0wNl9YP+RPtNEEjUFRNLL7Ro7cS2ny9ridhKnKSagZs6OPR1lx+W3wymG9 62GDRMi9d8K8a5zvR/FHO/fVgilqnubSTtHkXrr5nINuwUpbyEzCWf/5cxierBj12tE3 2UWsXzumrSnI0uX5VlU0TeMfi8pcg3kjx5rzUxrcnZyywGlTE8mm96ODmAFcPSP+R9ag bW3g== 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=H3DBi0mNjNbESSisGeli3T+KiEWE4J/mD2CVZfFgXJw=; b=PmZr0iXvVoaJDC9Oj9U7Nka+HrJvT3HiRZHUvJ15d15GrSSYkdi8+eRLX9Ut28xNdX qWAfRgqyTor8vFN636aJ5qCexrfSJKtGyol2wU2uymMVsHZmO+kY0+ASa2bgnP2eHWlQ ZKanM+m0L3ICHICL3++QEkr7TBL1IwXt7en02W3rM/UDy93ex4NtF9pS1eCq60GpmysC FX4J+XqZ7BubVnmOm7AfVATkNvzPOnHVu/elcQD8wwnfoBDrnevdB45Piz04NqBrKnlw TvnscewxFKp21VcSRdFZqvoCIGZzJ9nkiH6KUAkbxNuwn4D5ad1ZAikG7YyXm1jyExYv 1QIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KNX6fbR8; 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 t1si3344187qkf.2.2019.09.27.12.44.03 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Sep 2019 12:44:03 -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=KNX6fbR8; 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]:56786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDw9q-0007J8-LP for patch@linaro.org; Fri, 27 Sep 2019 15:44:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46523) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDw5i-0003JW-PB for qemu-devel@nongnu.org; Fri, 27 Sep 2019 15:39:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iDw5f-0006Le-2k for qemu-devel@nongnu.org; Fri, 27 Sep 2019 15:39:45 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:38606) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iDw5e-0006K5-K3 for qemu-devel@nongnu.org; Fri, 27 Sep 2019 15:39:42 -0400 Received: by mail-pf1-x441.google.com with SMTP id h195so2133390pfe.5 for ; Fri, 27 Sep 2019 12:39:42 -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=H3DBi0mNjNbESSisGeli3T+KiEWE4J/mD2CVZfFgXJw=; b=KNX6fbR8apO+g8LVDSzEEfiqlm1PbknhpJtagRAUlwitBE/EqjnrOibnDMhzOpuDjZ iHzRylMJzzq/fbpVoh2+FseNSoikft2QddbFT/sfZ9niUQycGM2ow55/AMAdrceZC0SJ WcYUZBTGvKxqBA8qhw2xZ698qe049xyBfVhNo5M9OCIH5t1QVQNXcTUFsGCxg8gShsh4 NaraKIDDdQAUw92+PVCPxqt0mbC0LmZqu7fcVV4w1WT0oeK0bkuzwd9Lx3nEjuXZHL4y lKggtvdaswB4kzHXa16ZaGkreYahE9YUJQfhTkxoEgcb11XIUv6z1TS7Z6xurFAzlW12 F5lQ== 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=H3DBi0mNjNbESSisGeli3T+KiEWE4J/mD2CVZfFgXJw=; b=c0HRmma1hJpbR8g74Pkp8tdsMYJs4MxfuiQJ9yw5jpUyPToUJkzX2dVeyoXAHQpQzF 45gcxY9KnSGaqgZMV6zetwxxJuTChrC8EuL7H7dvUe/UzfNm+AfIom6T4s0Ocu6dI0w4 YbeldD3Fxl15opkw+nfAU+m+lsUb0eOI1JxU+gd1wCQ7WLGcQBhMQqfaXXwNrLuMgzkj Y5Ve+kVZE9fF5pLg9cytXEX6CZFy9jOcjIDr9K3gataG1tI43mszM0b1xmsTCx2FQ8oD PwS//o9qpIAUQLzzMBdUOOj1ROma9xyPoGJsFmHkJXsNlizXhFR20EKFD6BrOzCWrgbg 0Geg== X-Gm-Message-State: APjAAAVsyyqla90eRv+GD7Urq+Tcenn3Ps3FS5k0FYe7SYHqMWyKCSUc T3BN/VC7qgbJK5L/rILvJAK0HKpKlY4= X-Received: by 2002:a63:b102:: with SMTP id r2mr10894222pgf.370.1569613180880; Fri, 27 Sep 2019 12:39:40 -0700 (PDT) Received: from localhost.localdomain ([12.206.46.62]) by smtp.gmail.com with ESMTPSA id 192sm3676403pfb.110.2019.09.27.12.39.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2019 12:39:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 06/18] target/s390x: Handle tec in s390_cpu_tlb_fill Date: Fri, 27 Sep 2019 12:39:13 -0700 Message-Id: <20190927193925.23567-7-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::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: qemu-s390x@nongnu.org, david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" As a step toward moving all excption handling out of mmu_translate, copy handling of the LowCore tec value from trigger_access_exception into s390_cpu_tlb_fill. So far this new plumbing isn't used. Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- target/s390x/excp_helper.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c index 552098be5f..ab2ed47fef 100644 --- a/target/s390x/excp_helper.c +++ b/target/s390x/excp_helper.c @@ -126,7 +126,7 @@ bool s390_cpu_tlb_fill(CPUState *cs, vaddr address, int size, S390CPU *cpu = S390_CPU(cs); CPUS390XState *env = &cpu->env; target_ulong vaddr, raddr; - uint64_t asc; + uint64_t asc, tec; int prot, fail, excp; qemu_log_mask(CPU_LOG_MMU, "%s: addr 0x%" VADDR_PRIx " rw %d mmu_idx %d\n", @@ -162,6 +162,7 @@ bool s390_cpu_tlb_fill(CPUState *cs, vaddr address, int size, "%s: raddr %" PRIx64 " > ram_size %" PRIx64 "\n", __func__, (uint64_t)raddr, (uint64_t)ram_size); excp = PGM_ADDRESSING; + tec = 0; /* unused */ fail = 1; } @@ -178,6 +179,10 @@ bool s390_cpu_tlb_fill(CPUState *cs, vaddr address, int size, } if (excp) { + if (excp != PGM_ADDRESSING) { + stq_phys(env_cpu(env)->as, + env->psa + offsetof(LowCore, trans_exc_code), tec); + } trigger_pgm_exception(env, excp, ILEN_AUTO); } cpu_restore_state(cs, retaddr, true);