From patchwork Mon Dec 16 22:11:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 181814 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp4937439ile; Mon, 16 Dec 2019 14:23:12 -0800 (PST) X-Google-Smtp-Source: APXvYqwHvReqGN5FIiVv4lIJ2ZHCoQLSq4BjA4w9tt9bralP1YHXAHr45oBE7x5KXDv+yx8JE3Kf X-Received: by 2002:ac8:4446:: with SMTP id m6mr1723289qtn.159.1576534991948; Mon, 16 Dec 2019 14:23:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576534991; cv=none; d=google.com; s=arc-20160816; b=xR2zt21vvmtTq7w10JBHFNwYSygUqR658LnRiOVOQMuqwBqvwcPY68NS7DrPDFT+Ai G2veFcrpn60pUkY6r0U9KP8eslJjGWhMRGjqbphBRFbfTwoPf9JRSBJ6YNSYdAg+rxwB 4V54GEyZeQSF0A0gPGbzdWMBfjHNC8cy4/68QJhg1nT2qlCNSGiBzksoerhCAZviD2pE Wee1erb/ZF3xM2zwwG1t7lfNaVbLMUOkPP2k7UoOsLhxzKra+3k7x3CzahNBV2dqyPlq y7dTXT2KXYSv6Gx0Tdmh2VMAw5RicDX3Ysg51VRnTprWwfeFtm4+5i2PH+N8Y86Bjl0E r/bw== 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=X2GZDJtWgjhwatqn2siyQYT3flCAUk5Su3sfOLoNGxk=; b=jLEB3F0whN8EVy0RXsDEdEFkclynFVKhqKh66iAEu5gPcsKV6esKk8CbmlBpq3sE/D 4pQ7as/FncpgOHIlCaPG2X3hSOPSN0EhTEP9CeFCfegVcjXBamKKbxISDyoUPxy65iXY jafoDuhpjBIaMq680t9zw6H36TXtK0aWiOkYGWw/w8t+NM/9/Ilmu7xz1aoK1C64iY3r VvNpHLzEWIhm2wZfJwF3eOava4R8GIXJkg/56Ihpo0APz9svE8HRgfxdgYzX3Fbd5jHW qsaYeefkkLLMnKJP5BqIMpBQjXzTlYiJIiDKlDPNSgMpCRpf847SwO6XXMVnCGJOqPC8 EZMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t+e5ujur; 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=pass (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 j4si10084229qtq.307.2019.12.16.14.23.11 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Dec 2019 14:23:11 -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=pass header.i=@linaro.org header.s=google header.b=t+e5ujur; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igylj-0001tY-0e for patch@linaro.org; Mon, 16 Dec 2019 17:23:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37127) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igyba-0005gk-I8 for qemu-devel@nongnu.org; Mon, 16 Dec 2019 17:12:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igybZ-0007m5-9a for qemu-devel@nongnu.org; Mon, 16 Dec 2019 17:12:42 -0500 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:42391) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igybZ-0007ks-43 for qemu-devel@nongnu.org; Mon, 16 Dec 2019 17:12:41 -0500 Received: by mail-pl1-x642.google.com with SMTP id p9so871716plk.9 for ; Mon, 16 Dec 2019 14:12:41 -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=X2GZDJtWgjhwatqn2siyQYT3flCAUk5Su3sfOLoNGxk=; b=t+e5ujurwJrOUDpMki+lqYnE3+1m/6DAiFZyKPGMkyfwalrDOFuuxbCLxvJV9aA3Ug FRI7V0fGhwYMKckurFUWWesyQVqQ3BtphfSfR82juA6XkJsWWbfWV87J0bI0m1sHsrFV 0fyCDoiW5Vg8b7cGf7TfgGFOCr6oA1PLSEQ8Y/2wDoe+QtVeUOa7vugyDTgT0yQsYzRA DP/6NAQLDe9zJL5vLUYwdcEnAOkvmDebYKMqI8OhY6WnRcjCGBjfuBzcGC7eyfMk6DX4 5jNO+E8h+4F0GeONeORCIpm8lGhU3tjm7q8oBh8u/1xXDwdmu2j3nhdY4hcbYH9IerfL qFxA== 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=X2GZDJtWgjhwatqn2siyQYT3flCAUk5Su3sfOLoNGxk=; b=l+PzOWfQJsx4numtfYL229eeAeu3BAQQa5EJDfYZxDMHGBzxRgHd4drE8Zc2m5245S oIQayqzB+qJMuNU/NiwPxe2CTDWsxKhlS5UEHrg01C84jjex782f28UBXJfuA9yVuGjV MJ0GvYVcRI4x+fp/sxZwctT8c4QGKVN/zqZkLBMTGEc1Ci7wORrBlInsQrjakq7ujgRO VVImpw9Lz7aYYoHKhf+cnZerEmVHzmjGkZPxH0c1kqgFp2Fm+nZokrSZSIoL9nsWmE7v ycKnLm7DpVgfKD0ETERAqDmQvw9j57IRQtizr9qbv+VDcf5Eg8Q9N05wKmB/9hpongpT 54sQ== X-Gm-Message-State: APjAAAUIjNIdX5ukXwVj/XmcHufCyrNHjyYhGfxgWIp1a13OdRBaFmW7 o+BHouON2vh2FGWJbBOymQoexkdgRH8= X-Received: by 2002:a17:902:b418:: with SMTP id x24mr18748104plr.85.1576534359856; Mon, 16 Dec 2019 14:12:39 -0800 (PST) Received: from localhost.localdomain ([2605:e000:c74f:dc00:6838:d2b2:17e2:8445]) by smtp.gmail.com with ESMTPSA id d6sm529767pjl.8.2019.12.16.14.12.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2019 14:12:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 25/28] target/s390x: Use cpu_*_mmuidx_ra instead of MMU_MODE*_SUFFIX Date: Mon, 16 Dec 2019 12:11:55 -1000 Message-Id: <20191216221158.29572-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191216221158.29572-1-richard.henderson@linaro.org> References: <20191216221158.29572-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::642 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: 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 Signed-off-by: Richard Henderson --- v2: Use *_mmuidx_ra directly, without intermediate macros. --- target/s390x/cpu.h | 5 ----- target/s390x/mem_helper.c | 21 ++++++++++++--------- 2 files changed, 12 insertions(+), 14 deletions(-) -- 2.20.1 Reviewed-by: Alex Bennée diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index aa829e954c..cfa8a81265 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 57ce17c252..6f4a16b9b2 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! */ @@ -2333,18 +2333,21 @@ void HELPER(purge)(CPUS390XState *env) /* load using real address */ uint64_t HELPER(lura)(CPUS390XState *env, uint64_t addr) { - return cpu_ldl_real_ra(env, wrap_address(env, addr), GETPC()); + return cpu_ldl_mmuidx_ra(env, wrap_address(env, addr), + MMU_REAL_IDX, GETPC()); } uint64_t HELPER(lurag)(CPUS390XState *env, uint64_t addr) { - return cpu_ldq_real_ra(env, wrap_address(env, addr), GETPC()); + return cpu_ldq_mmuidx_ra(env, wrap_address(env, addr), + MMU_REAL_IDX, GETPC()); } /* store using real address */ void HELPER(stura)(CPUS390XState *env, uint64_t addr, uint64_t v1) { - cpu_stl_real_ra(env, wrap_address(env, addr), (uint32_t)v1, GETPC()); + cpu_stl_mmuidx_ra(env, wrap_address(env, addr), (uint32_t)v1, + MMU_REAL_IDX, GETPC()); if ((env->psw.mask & PSW_MASK_PER) && (env->cregs[9] & PER_CR9_EVENT_STORE) && @@ -2357,7 +2360,7 @@ void HELPER(stura)(CPUS390XState *env, uint64_t addr, uint64_t v1) void HELPER(sturg)(CPUS390XState *env, uint64_t addr, uint64_t v1) { - cpu_stq_real_ra(env, wrap_address(env, addr), v1, GETPC()); + cpu_stq_mmuidx_ra(env, wrap_address(env, addr), v1, MMU_REAL_IDX, GETPC()); if ((env->psw.mask & PSW_MASK_PER) && (env->cregs[9] & PER_CR9_EVENT_STORE) &&