From patchwork Thu Sep 26 16:26:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 174486 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2293987ill; Thu, 26 Sep 2019 09:38:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEFKPscRBopOGlxA1cdRmZYKABwoVjbWv9O6JztH8KlAeDQOp2j+GgOwUgnAzklccTguyJ X-Received: by 2002:ac8:100b:: with SMTP id z11mr5011367qti.377.1569515891639; Thu, 26 Sep 2019 09:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569515891; cv=none; d=google.com; s=arc-20160816; b=TERtO2RCMgweP52vg31AaqTmxpawXz9kEzhdDmadqTWIQuE4Yg0sy3fLqQtyzEoTnx rZesm1zAzoZwjMzYbiqrh/eL2g0HIoh9J2FVUXr4L9jBLlXH9nXt29agn/w71ZVdMZ4E eIlEpy5lNCB7XWELOkMiLC9mTXdDugzw450oydjRTWvIjJq+BJ0MAcfufJdZqb4gET57 RQC7bKihvHwEm5W7AKVs5/ewirI5VxF4kDoCUKbkUQbuXRxwjXktuMn3G1EEf9Z4e875 k+onA/+/uen4RdvxidzMPyPkFr8suXn3HrroF53PNYddr1Sp/M2jK7aDWH/p6QSEuYi+ EIZw== 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=fGRu+QIbI0OANf3LHBbL23ZhxIBUgo0bhuy8UzPS3No=; b=K4Ghq5AaasElmPSA1yyoCd78mSzGD+dJdzJTKwXst3EFdxgxGjtHOkfKcbzvYBu7Df QOyi5BHNYTS/WDpVFgAKcPs1CiRqLGyWN9VP4S2Phd86/kdLJ86nFs0rKZaO8o19YFCJ hANOiu+AYItKSLnvhAQmTe8m7F88ZRh4wQxNQK5Bc2xyVXuB1W88QO6kdEcT3osjZl9D AxsB6vXAzRUmKp4WYoeFnYYmDkyh9nIyK5CVVamzowbe9eXQe9S8yXbd4+Ta6V32KdYR udHu2bWh9Q5EeJmP+UKLu4wvKh1NkEyfqhYxvkYAPYIzkiZ+66YlKde1SeNZqEDFltlz PpWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=aL6dZLIJ; 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 i2si1787463qtp.398.2019.09.26.09.38.11 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Sep 2019 09:38:11 -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=aL6dZLIJ; 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]:40810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDWmQ-0004j5-Cc for patch@linaro.org; Thu, 26 Sep 2019 12:38:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41277) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDWcE-0002gL-0j for qemu-devel@nongnu.org; Thu, 26 Sep 2019 12:27:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iDWc9-0004kc-02 for qemu-devel@nongnu.org; Thu, 26 Sep 2019 12:27:36 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:38996) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iDWc8-0004hA-KU for qemu-devel@nongnu.org; Thu, 26 Sep 2019 12:27:32 -0400 Received: by mail-pl1-f193.google.com with SMTP id s17so1527977plp.6 for ; Thu, 26 Sep 2019 09:27:29 -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=fGRu+QIbI0OANf3LHBbL23ZhxIBUgo0bhuy8UzPS3No=; b=aL6dZLIJntEIKwuU1EJKaOys73DRWM/AzLtL0VP2ZCcZE3yBVr794qvxjNnoaO29tJ OnOHwBKrPRdvlm+YFph6s0EhEo/nV5oAC81Jg49g63vLSkuByS0CdYtb0B5b+1FoJ6FO XigYen3SSQgZlheFPX7Vi/94qWbP/dpUluO9QDDHUmJQZpF6wmVEy301ktxf1pDbSnAg JbRHzr6fOcII06xzUU++TfNffg0yV0ikt9ePEGBHiYRcxez2xzWa3YpYKhV6ppvcv4H5 m04wjk3d+h5Nml+va0jO1sp+FiR3Fa4oK6osjdx1QgB7ZPv3MkDe3WGjUNE2uQ/Wqdn9 YwLw== 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=fGRu+QIbI0OANf3LHBbL23ZhxIBUgo0bhuy8UzPS3No=; b=PjF2I5Kt5AcO4vuK1Etcpf8ubWkFDtDy7ZoJn1y3Xe3HikpskTHdj6MklJRRXOb8Vp B/ldfrikCNIOOmGvOByKZzvbIf6v/63BwRqkaBIrWX3yPhU8XadQHZ/1HfBWMa5u9GBx T1buXjKE/L2R7bMAS+D3BQCVfldN5K58xINKJw3W058jX1h1KGF+a+66AAYgRYZCLq2j A4IlEY9r8APSrH8Ca2Eu30/NsJblnF1g352EbOYonVVmfcoWC3B7bUUCpzdWSrmhL0Jv b8yaRGwBTkgaG6s7iZ0G8zWZcpsH3l5ddDyQxeiJkOg0T/jcATNzyQuqCr2Ptp9AkDuj csUw== X-Gm-Message-State: APjAAAUo6V+WBXKf8p/Z8MMPBrG2YvfMdbbqDKYaFE3LSK+C5bAFONZI /CV0plC8TQjGf3xwbnOqSFKAH/PleW0= X-Received: by 2002:a17:902:9a81:: with SMTP id w1mr5152871plp.124.1569515187948; Thu, 26 Sep 2019 09:26:27 -0700 (PDT) Received: from localhost.localdomain ([12.157.10.114]) by smtp.gmail.com with ESMTPSA id 64sm4453169pfx.31.2019.09.26.09.26.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 09:26:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 07/18] target/s390x: Handle tec in s390_cpu_tlb_fill Date: Thu, 26 Sep 2019 09:26:04 -0700 Message-Id: <20190926162615.31168-8-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.214.193 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. Signed-off-by: Richard Henderson --- target/s390x/excp_helper.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.17.1 Reviewed-by: David Hildenbrand 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);