From patchwork Mon Dec 16 22:11:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 181803 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp4928454ile; Mon, 16 Dec 2019 14:14:44 -0800 (PST) X-Google-Smtp-Source: APXvYqzQaYWPF3icgk8qc6uJH8czkd9FkW6ktJjBBcygM11/sDSrceYSArhhmV9R9qEJuCgjm2Kw X-Received: by 2002:ad4:4949:: with SMTP id o9mr1652150qvy.189.1576534484749; Mon, 16 Dec 2019 14:14:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576534484; cv=none; d=google.com; s=arc-20160816; b=ynj9yubJfmZLgDckjL4CSVfmBTSOZsESOXTLyKUo5+QplGkxVsKDKaASrYoFc9tJaC 3NFiJ0DO1B6J16g3oroiphwzSEBw4H2HKFipOHP3XzycNAB5d4PCImTjbmkIvuHSPZvJ GbH21yfHXarEf07fS/HofncOsJa7gv7pnEwK/oU7Taa3JaBKpEMtUCIeC3H71p+J7bsP vrZ6JykasdA+gt9esrTf2oh7yIlf0QpVkIH/PclVXZUCsPZG0ol/z8jc5CLI4amDJzga x9kdMsMx9N+b+QvZ88QboaDrgfRnzZCG/NjGmW/gD7dY/fJloL/tcsqD6RX+vqRRHWi7 6dZg== 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:message-id:date:subject:to:from:dkim-signature; bh=uClweReSFDUrj6phTjOLn2zSfSBOWmvO4yEJytycYg0=; b=xWcauobmroWxrbQX6AUx0CWGuZjyh2AZ3sGbWQucP1xFjdYhebt16NbooQTw9pRhMP Fs7aB2vc0qOll9zslFWZtEla8y0Wii/CKzz6O4l9FjLFKbmeGtI4+N2vGvMsifZtCxV6 KamWAzxa7lu4RmVV7UTQqfCry7/MHCMPJIzGFlocn+UIKz6NC109pX3off6GRkAA2aUl 6r/B1wwjz/jt1im+RW6Ye68fX6RAzYrxbkbx4nvuO32yNFQKQmwdHyKbDdJTs48mXZEh lukRss0RrPw75o7DAbACpeUGrVtLt2D5n8Sjsqrtgbb5uKhGJj+7jzdGHKI8n9lCJy7v Ze6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=mCs55jqo; 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 s5si10514334qvm.36.2019.12.16.14.14.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Dec 2019 14:14:44 -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=mCs55jqo; 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]:60642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igydX-00086c-Po for patch@linaro.org; Mon, 16 Dec 2019 17:14:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36586) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igyb1-0004lD-Gz for qemu-devel@nongnu.org; Mon, 16 Dec 2019 17:12:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igyay-0006uF-8V for qemu-devel@nongnu.org; Mon, 16 Dec 2019 17:12:07 -0500 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:37845) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igyax-0006u5-W0 for qemu-devel@nongnu.org; Mon, 16 Dec 2019 17:12:04 -0500 Received: by mail-pg1-x52c.google.com with SMTP id q127so4502036pga.4 for ; Mon, 16 Dec 2019 14:12:03 -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:mime-version :content-transfer-encoding; bh=uClweReSFDUrj6phTjOLn2zSfSBOWmvO4yEJytycYg0=; b=mCs55jqotoYkQF8ecIu1vTcxFyBTkUKWeALgKK2Uqw2Jk1Zrhrsv+AkfH13u89ochH Kyf1P4R1MuTXyhjIvESwo+lQgzS9WkJgdmVOTZbasLCutctgznABLCJrdszAxmjqWgAp qhHgmQJq6P1WZiLLGd3fgiVJnCgHKly+BnqGeHslVuCdCxT1P3hTB7M91v5RI5jg9FYj dzK66OKQ71p7aGJEHlfYgGNGP1GjNvTIQV0pi5lQRJB7L3CV05RVOdaBjAMMrpmtZLH8 9dr7igxp1A6gmKJjjPJT8qlTIP6VdNVgXVjBr2cG7fubUtpY/0+TfltQGwd2vETbijYP IRaw== 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:mime-version :content-transfer-encoding; bh=uClweReSFDUrj6phTjOLn2zSfSBOWmvO4yEJytycYg0=; b=eJ8KQHVRQUxz6ZulGToVA0GaNexZecw1LcCtY1N3+bb49ur8y9Ppb04B1HRHEqkGal ZlowwtKL8VuJ63MqY8lQhSNRoXcSJW248cB4qKPTKA14i73DQrPihS2geWQR8wIZvDYT KwrO/HjhxHosTe6LY1hyNJqAgIyHrxI+oW5a1yf/ityKHLP9quAV1QaCkhyGBo+WOsnK 78NvK3h0WG+2H3SGORv4jjUtm/TN3l+fFK06firtUFljQKtoG/mGYNuboheoex1G169O t6inUYTskU8imcVr66M0/7C2fa2kbKR7zH9k5HFqo+OCpKmwPmU1bixqsF0F8Gz+wY1P WYCw== X-Gm-Message-State: APjAAAXYlY+y+3ZupTij2wA3FD7n+OY2/+cdnb/mqu153JWYLOsT01aw 8P4TcyuFGQ05gjtm8mZaPoMG6YZwp28= X-Received: by 2002:aa7:85d8:: with SMTP id z24mr19275148pfn.202.1576534322153; Mon, 16 Dec 2019 14:12:02 -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.11.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2019 14:12:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 00/28] cputlb: Remove support for MMU_MODE*_SUFFIX Date: Mon, 16 Dec 2019 12:11:30 -1000 Message-Id: <20191216221158.29572-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 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::52c 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: Marek Vasut , Peter Maydell , Eduardo Habkost , David Hildenbrand , Chris Wulff , Laurent Vivier , Max Filippov , Aleksandar Markovic , Paolo Bonzini , "Edgar E . Iglesias" , Aleksandar Rikalo , Guan Xuetao , Aurelien Jarno , David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is part of a project to raise the limit on NB_MMU_MODES. One of those is in cpu_ldst.h, in support of MMU_MODE*_SUFFIX. While this could be extended, it's not the best interface for such things. Better is a single interface that allows a variable mmu_idx. The best exemplars of that is the usage in target/mips and target/ppc. In the process, I tried to clean up the implementation of these functions for softmmu and user-only. Aleksander asked about code size changes. They vary between a minor size increase (e.g. for qemu-system-alpha, where there are in fact no uses of the functions, which are now present as out-of-line functions rather than eliminated inline functions), to a minor size decrease (e.g. -79k/-1.6% for qemu-system-i386). See below for details. Changes for v2: * Significantly revised docs/devel/loads-stores.rst. * m68k and s390x dropped #defines and use *_mmuidx_ra directly. r~ Cc: Aleksandar Markovic Cc: Aleksandar Rikalo Cc: Aurelien Jarno Cc: Chris Wulff Cc: David Gibson Cc: David Hildenbrand Cc: Edgar E. Iglesias Cc: Eduardo Habkost Cc: Guan Xuetao Cc: Laurent Vivier Cc: Marek Vasut Cc: Max Filippov Cc: Paolo Bonzini Cc: Peter Maydell Richard Henderson (28): target/xtensa: Use probe_access for itlb_hit_test cputlb: Use trace_mem_get_info instead of trace_mem_build_info trace: Remove trace_mem_build_info_no_se_[bl]e cputlb: Move body of cpu_ldst_template.h out of line translator: Use cpu_ld*_code instead of open-coding cputlb: Rename helper_ret_ld*_cmmu to cpu_ld*_code cputlb: Provide cpu_(ld,st}*_mmuidx_ra for user-only target/i386: Use cpu_*_mmuidx_ra instead of templates target/s390x: Include tcg.h in mem_helper.c target/arm: Include tcg.h in sve_helper.c accel/tcg: Include tcg.h in tcg-runtime.c linux-user: Include tcg.h in syscall.c linux-user: Include trace-root.h in syscall-trace.h cputlb: Expand cpu_ldst_useronly_template.h in user-exec.c target/nios2: Remove MMU_MODE{0,1}_SUFFIX target/alpha: Remove MMU_MODE{0,1}_SUFFIX target/cris: Remove MMU_MODE{0,1}_SUFFIX target/i386: Remove MMU_MODE{0,1,2}_SUFFIX target/microblaze: Remove MMU_MODE{0,1,2}_SUFFIX target/sh4: Remove MMU_MODE{0,1}_SUFFIX target/unicore32: Remove MMU_MODE{0,1}_SUFFIX target/xtensa: Remove MMU_MODE{0,1,2,3}_SUFFIX target/m68k: Use cpu_*_mmuidx_ra instead of MMU_MODE{0,1}_SUFFIX target/mips: Use cpu_*_mmuidx_ra instead of MMU_MODE*_SUFFIX target/s390x: Use cpu_*_mmuidx_ra instead of MMU_MODE*_SUFFIX target/ppc: Use cpu_*_mmuidx_ra instead of MMU_MODE*_SUFFIX cputlb: Remove support for MMU_MODE*_SUFFIX cputlb: Expand cpu_ldst_template.h in cputlb.c accel/tcg/atomic_template.h | 67 ++-- include/exec/cpu_ldst.h | 444 +++++++--------------- include/exec/cpu_ldst_template.h | 211 ---------- include/exec/cpu_ldst_useronly_template.h | 159 -------- include/exec/translator.h | 48 +-- include/user/syscall-trace.h | 2 + target/alpha/cpu.h | 2 - target/cris/cpu.h | 2 - target/i386/cpu.h | 3 - target/m68k/cpu.h | 2 - target/microblaze/cpu.h | 3 - target/mips/cpu.h | 4 - target/nios2/cpu.h | 2 - target/ppc/cpu.h | 2 - target/s390x/cpu.h | 5 - target/sh4/cpu.h | 2 - target/unicore32/cpu.h | 2 - target/xtensa/cpu.h | 4 - tcg/tcg.h | 29 -- trace/mem-internal.h | 17 - accel/tcg/cputlb.c | 315 +++++++++++---- accel/tcg/tcg-runtime.c | 1 + accel/tcg/user-exec.c | 236 ++++++++++++ linux-user/syscall.c | 1 + target/arm/sve_helper.c | 1 + target/i386/seg_helper.c | 56 +-- target/m68k/op_helper.c | 77 ++-- target/mips/op_helper.c | 182 +++------ target/ppc/mem_helper.c | 11 +- target/s390x/mem_helper.c | 22 +- target/xtensa/mmu_helper.c | 5 +- docs/devel/loads-stores.rst | 215 ++++++++--- 32 files changed, 966 insertions(+), 1166 deletions(-) delete mode 100644 include/exec/cpu_ldst_template.h delete mode 100644 include/exec/cpu_ldst_useronly_template.h -- 2.20.1 orig new text text size size change %change binary ------- ------- ------- ------- ----------------- 2097672 2101864 4192 0.20% qemu-aarch64 2102760 2107304 4544 0.22% qemu-aarch64_be 961464 965960 4496 0.47% qemu-alpha 1463736 1468200 4464 0.30% qemu-arm 1470072 1474632 4560 0.31% qemu-armeb 990584 995224 4640 0.47% qemu-cris 1009656 1012792 3136 0.31% qemu-hppa 1295728 1250064 -45664 -3.52% qemu-i386 1091560 1091928 368 0.03% qemu-m68k 965720 970232 4512 0.47% qemu-microblaze 961000 965496 4496 0.47% qemu-microblazeel 1959864 1957224 -2640 -0.13% qemu-mips 2001688 2003768 2080 0.10% qemu-mips64 1996184 1998232 2048 0.10% qemu-mips64el 1954648 1951928 -2720 -0.14% qemu-mipsel 2004936 2006888 1952 0.10% qemu-mipsn32 1999272 1999320 48 0.00% qemu-mipsn32el 933400 937896 4496 0.48% qemu-nios2 964024 969176 5152 0.53% qemu-or1k 1643400 1643272 -128 -0.01% qemu-ppc 1670168 1669192 -976 -0.06% qemu-ppc64 1693048 1691784 -1264 -0.07% qemu-ppc64abi32 1667880 1667080 -800 -0.05% qemu-ppc64le 973416 978024 4608 0.47% qemu-riscv32 970664 975112 4448 0.46% qemu-riscv64 1176952 1159928 -17024 -1.45% qemu-s390x 970600 974808 4208 0.43% qemu-sh4 975368 979656 4288 0.44% qemu-sh4eb 981992 986424 4432 0.45% qemu-sparc 1020168 1024008 3840 0.38% qemu-sparc32plus 1022264 1026072 3808 0.37% qemu-sparc64 926616 930872 4256 0.46% qemu-tilegx 1300464 1249504 -50960 -3.92% qemu-x86_64 1236648 1240952 4304 0.35% qemu-xtensa 1241896 1246360 4464 0.36% qemu-xtensaeb orig new text text size size change %change binary ------- ------- ------- ------- ----------------- 6324680 6327256 2576 0.04% qemu-system-aarch64 3961000 3966200 5200 0.13% qemu-system-alpha 5580408 5583768 3360 0.06% qemu-system-arm 2816936 2822072 5136 0.18% qemu-system-cris 3969576 3971624 2048 0.05% qemu-system-hppa 4856824 4777432 -79392 -1.63% qemu-system-i386 2936584 2940984 4400 0.15% qemu-system-lm32 3010216 3002088 -8128 -0.27% qemu-system-m68k 2817400 2822264 4864 0.17% qemu-system-microblaze 2817160 2821912 4752 0.17% qemu-system-microblazeel 5098264 5101288 3024 0.06% qemu-system-mips 5205096 5206408 1312 0.03% qemu-system-mips64 5222424 5223704 1280 0.02% qemu-system-mips64el 5094216 5097048 2832 0.06% qemu-system-mipsel 2729320 2733448 4128 0.15% qemu-system-moxie 2750200 2755048 4848 0.18% qemu-system-nios2 2777656 2782840 5184 0.19% qemu-system-or1k 5020408 5018312 -2096 -0.04% qemu-system-ppc 5401848 5396936 -4912 -0.09% qemu-system-ppc64 4029464 4034520 5056 0.13% qemu-system-riscv32 4030632 4035320 4688 0.12% qemu-system-riscv64 3576984 3523992 -52992 -1.48% qemu-system-s390x 3952872 3958376 5504 0.14% qemu-system-sh4 3957032 3962680 5648 0.14% qemu-system-sh4eb 3003368 3009048 5680 0.19% qemu-system-sparc 4013240 4018040 4800 0.12% qemu-system-sparc64 2936472 2923080 -13392 -0.46% qemu-system-tricore 2824456 2829560 5104 0.18% qemu-system-unicore32 4886520 4816088 -70432 -1.44% qemu-system-x86_64 4160168 4165400 5232 0.13% qemu-system-xtensa 4164232 4169528 5296 0.13% qemu-system-xtensaeb