From patchwork Sat Dec 28 23:11:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 182517 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp4648197ild; Sat, 28 Dec 2019 15:23:57 -0800 (PST) X-Google-Smtp-Source: APXvYqxdzc5XOV18xxEJtt3IZcOJD10zun4pdTKHA7PXHWyTRLkKN3n4CfVbJAi6MoTO4q2tSMXI X-Received: by 2002:a05:6830:194:: with SMTP id q20mr67666481ota.92.1577575437430; Sat, 28 Dec 2019 15:23:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577575437; cv=none; d=google.com; s=arc-20160816; b=PjX1aLiWf0DlXtRKow5e3jjm61fwbCrcSMmO25zUYX76HOV96a8A0os1E7ucdG8XsO taweKv83H2EAtU7LJFo3nmD++Ef37YoAneP3j73icxc1b2LJ/7jAX4H86kWxawb9o5su YkSWSC13EeVkl6KjAfED7wH9rwsYeyfjQPq2COX1/YLdP3oDx01J962bqeRHDMT1gAkR Lo/zRVnlDvRDw5T39R27bqk19tVInLJcOUGbTdtGD+23yCgDeX4VubbJTm8MmAeePgBO o9btCe2RIyAufVrPUK8+OjrHCQKhVtS3KzmQUNhFUM30rnN2E4/DXZ3YOE1Eg8ZDb0XU gPjw== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=YGX16RdW2itYDRX1lminhJhJxtzn0dioVEW1Yirv0gs=; b=Z0v8jtZaq6g+MAPk+EHHmxbXcGMMhQVufblxcH/MZ/d3VaJdL0N73O1n85XMnKW6+V uGw608mBSQPYMtC+iE4lOn6TL+Y1GhIfZdS5v3o/br19IqZ+gqeCMjhLBMeeWax2FzvS d+9sLjU7pe2ZGGA5y91ViLs1jCCIs7ZRCYy1qofMwoAFpN+RnetoaMx+eCg+Csygpd0s D9XSJJMDBf0qlc2y2FUcKI5GvHwEiU3CAUgiekJOhrsmPxFXXauH///TdTpMf4JsdGnP 8rgF8WKQhVJT00k4JMrmKn352uz1jrHicbsWaTl2BeMNpZS4DQkNIAuFuCn0wHhjU+lI +4uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=TBqcKKCc; 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 q6si24585564otg.248.2019.12.28.15.23.57 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 28 Dec 2019 15:23:57 -0800 (PST) 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=TBqcKKCc; 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]:47418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilLR6-0002Uv-Ai for patch@linaro.org; Sat, 28 Dec 2019 18:23:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43047) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilLGM-0005xw-PS for qemu-devel@nongnu.org; Sat, 28 Dec 2019 18:12:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ilLGL-0001Ma-JU for qemu-devel@nongnu.org; Sat, 28 Dec 2019 18:12:50 -0500 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:40503) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ilLGL-0001J1-CG for qemu-devel@nongnu.org; Sat, 28 Dec 2019 18:12:49 -0500 Received: by mail-pg1-x541.google.com with SMTP id k25so16252482pgt.7 for ; Sat, 28 Dec 2019 15:12:49 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=YGX16RdW2itYDRX1lminhJhJxtzn0dioVEW1Yirv0gs=; b=TBqcKKCcaHD8bof+7XxtpikGQ9wx5h5ki1LyQRHJ3p36w+zWjnfZnEGp3HThdUmVF8 dGGl6XatM9eDfd30Sa5NC+xMUtDDAtWtl87woqwAXi0fTn3ZUHZtHKSMHxCmzEFDffGl 0NQwO66omS8Nd7oBme7njgMLFn6V3254qiDa+IDALjwx3bgGksBgUkShmOKMkVdiv3KD oFNasLNlFHR3LiNaNMXciYA+SSH95S8WppbC4PZr+hRwS5d4+dN8b4eriKTsX1R3OkJP v4ldG76OD+lGMj65O3q9RdFWK2PpAV16Ynoyen98tzTbtR7mWSGqgdLu8YM9T++zn1oz J7Sg== 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:mime-version:content-transfer-encoding; bh=YGX16RdW2itYDRX1lminhJhJxtzn0dioVEW1Yirv0gs=; b=I0ZaOz6KVOLfz6kysFZCyfq7SPpu0TPNo6gGAdLELm0gbkjkk7CyBK6OHFOmwCAtys e6krqmhxpJ4k/z7mhwX3g+xD2SKCc4Zfy+sLaQrnb3Tf7qOUdFTDRLTsRcIACULEpFJm X6kFylKblC+jp3qV3aD/fShPtjoghWxtSBzP2KYaWpE6cILBSK/1kVzoEsX53rWd6+sB uIC6s1pN0JN5xnBMIf8uarwj6I3cqFhrChEy9DW2PduOYGi1KM8w6GUJpvJGq9PacSfD tSWMXm2HvF7JG5hIci5162pWIKqSKDCOmPVTK5I+GL9G54WOOsont15DyijZ5q+1SdFQ WJzw== X-Gm-Message-State: APjAAAWJ8NW6TYvNYZS+4zPipawh7CpZLfpACVcsBz5dvMBQSAM1h4ZR cMV0l9ykOevHDq+jbetGcwDB1dWTE7o= X-Received: by 2002:a62:1613:: with SMTP id 19mr64371582pfw.7.1577574768260; Sat, 28 Dec 2019 15:12:48 -0800 (PST) Received: from localhost.localdomain (194-223-58-9.tpgi.com.au. [194.223.58.9]) by smtp.gmail.com with ESMTPSA id c18sm21077186pfr.40.2019.12.28.15.12.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2019 15:12:47 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 26/29] target/s390x: Use cpu_*_mmuidx_ra instead of MMU_MODE*_SUFFIX Date: Sun, 29 Dec 2019 10:11:21 +1100 Message-Id: <20191228231124.18307-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191228231124.18307-1-richard.henderson@linaro.org> References: <20191228231124.18307-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::541 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: =?utf-8?q?Alex_Benn=C3=A9e?= , David Hildenbrand Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The generated functions aside from *_real are unused. The *_real functions have a couple of users in mem_helper.c; use *_mmuidx_ra instead, with MMU_REAL_IDX. Reviewed-by: David Hildenbrand Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- v2: Use *_mmuidx_ra directly, without intermediate macros. --- target/s390x/cpu.h | 5 ----- target/s390x/mem_helper.c | 10 +++++----- 2 files changed, 5 insertions(+), 10 deletions(-) -- 2.20.1 diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index e195e5c7c8..8a557fd8d1 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -36,11 +36,6 @@ #define TARGET_INSN_START_EXTRA_WORDS 2 -#define MMU_MODE0_SUFFIX _primary -#define MMU_MODE1_SUFFIX _secondary -#define MMU_MODE2_SUFFIX _home -#define MMU_MODE3_SUFFIX _real - #define MMU_USER_IDX 0 #define S390_MAX_CPUS 248 diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index 20a84b3912..428bde4c54 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -2026,7 +2026,7 @@ uint32_t HELPER(testblock)(CPUS390XState *env, uint64_t real_addr) real_addr = wrap_address(env, real_addr) & TARGET_PAGE_MASK; for (i = 0; i < TARGET_PAGE_SIZE; i += 8) { - cpu_stq_real_ra(env, real_addr + i, 0, ra); + cpu_stq_mmuidx_ra(env, real_addr + i, 0, MMU_REAL_IDX, ra); } return 0; @@ -2260,11 +2260,11 @@ void HELPER(idte)(CPUS390XState *env, uint64_t r1, uint64_t r2, uint32_t m4) for (i = 0; i < entries; i++) { /* addresses are not wrapped in 24/31bit mode but table index is */ raddr = table + ((index + i) & 0x7ff) * sizeof(entry); - entry = cpu_ldq_real_ra(env, raddr, ra); + entry = cpu_ldq_mmuidx_ra(env, raddr, MMU_REAL_IDX, ra); if (!(entry & REGION_ENTRY_I)) { /* we are allowed to not store if already invalid */ entry |= REGION_ENTRY_I; - cpu_stq_real_ra(env, raddr, entry, ra); + cpu_stq_mmuidx_ra(env, raddr, entry, MMU_REAL_IDX, ra); } } } @@ -2291,9 +2291,9 @@ void HELPER(ipte)(CPUS390XState *env, uint64_t pto, uint64_t vaddr, pte_addr += VADDR_PAGE_TX(vaddr) * 8; /* Mark the page table entry as invalid */ - pte = cpu_ldq_real_ra(env, pte_addr, ra); + pte = cpu_ldq_mmuidx_ra(env, pte_addr, MMU_REAL_IDX, ra); pte |= PAGE_ENTRY_I; - cpu_stq_real_ra(env, pte_addr, pte, ra); + cpu_stq_mmuidx_ra(env, pte_addr, pte, MMU_REAL_IDX, ra); /* XXX we exploit the fact that Linux passes the exact virtual address here - it's not obliged to! */