From patchwork Sat Dec 28 23:10:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 182499 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp4639254ild; Sat, 28 Dec 2019 15:11:52 -0800 (PST) X-Google-Smtp-Source: APXvYqyDDw5x7w14L6WiHaNoJE7pM748Y0hyqUeD386aWKikP1Vc/HPaq9nw1hJt3PdCpgnpwdMO X-Received: by 2002:aca:458:: with SMTP id 85mr4992753oie.56.1577574712587; Sat, 28 Dec 2019 15:11:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577574712; cv=none; d=google.com; s=arc-20160816; b=FmuqRbfBFYmvfCqiCN9Oj7q3ciV+xdwkwyyXvDNE+HZkmrPxIsG+sMu04/WP9q+7IE gVGhAp10EYD0Wg0pggmOUbPERP5gtMyIRcqe4EkIBsLwyCRbxialfvZRTuflpPvnqdai psw6NV67uDNmjY8O4Ejo0Ac0ahSj+zauBaT5wZKXRTWbttarX7Dim4pNF7x1t2s6fntb CEIEVETyO6BeAuch3GOWMaxfhyo+2dmvkQwWzwcaHLJgpYwZAHTgPdrzD1XbrhQW4254 NsnKIIJdMJjlVK6UvzKLsZ7491npikWIYanKAO4BJNFuRgw7c61bkpsZapXuoGcezYYV jAxQ== 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=bgWTTY8z0xp+JXJD0z4cLIj82JxbQOWmMs5uOXXKMys=; b=d4HkOdWCPYPyZvZIXRnN3DZhTEOOantW08SkD8IXwCXecB2cAiotZWC7vroDwn7cBy v31olM3nkmd2USzia0a9nYR5ZolNEXSWD2loVrNW05WQ6Gp+wSsEFyoSNEE88z+oY2l/ vrplzaIBTYOyW9AooYHknSlhIx/O5fhIAGcrEwxGY3hPRTEGZ2r/LhsIBrVbN5UGV1zq +UmrkXS/8oS14KKmIx1mllJirjA90YRyE/vedYvfpHkgsusIqsbC64I/0cLPUayTG+bu EfL+qlDukWqD7Zbac84z68P76lIEnOm19Ht+SEAauMHwj8mBV7Fp0RBwSURUH/cAFvCP /lNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=qiAIn3bK; 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 l132si13302098oib.192.2019.12.28.15.11.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 28 Dec 2019 15:11:52 -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=qiAIn3bK; 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]:47008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilLFP-0004E0-7q for patch@linaro.org; Sat, 28 Dec 2019 18:11:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38739) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilLFE-0004Do-Tv for qemu-devel@nongnu.org; Sat, 28 Dec 2019 18:11:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ilLFB-0003CI-7O for qemu-devel@nongnu.org; Sat, 28 Dec 2019 18:11:40 -0500 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:38953) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ilLFA-00037C-VH for qemu-devel@nongnu.org; Sat, 28 Dec 2019 18:11:37 -0500 Received: by mail-pl1-x642.google.com with SMTP id g6so10250666plp.6 for ; Sat, 28 Dec 2019 15:11:36 -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=bgWTTY8z0xp+JXJD0z4cLIj82JxbQOWmMs5uOXXKMys=; b=qiAIn3bKTkkg5MPlL/K5oC49KUI0enIxAr7iIwh+lL6ZJidJsVto1jGebImP9S8L2H AqWsj4GZ+oDj14zcHsN2RcZDzxigT9tuUNKNI4XWUZc2t5lKGvKxNd8QqDBQ+pgWRNTh sGjKdEw9kE/FrewmCcBlpS/oDuKa/U5vahFIuHgRNiiMPLxv0ApkEQvYQGKaCmtAKbqR mhEOrD25WyhRvOWxTfZ/joqc2n49k9dsjPvd8aGK/hW3vVlEIQq5nP0ta526bH3vuJHq VaPe+ikeTxYZRFoVLNJHhz5WqolK1q7aekLU89xdHMGLuu2tMOt0K+gQ+1I2azJaSdLt 5XOg== 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=bgWTTY8z0xp+JXJD0z4cLIj82JxbQOWmMs5uOXXKMys=; b=RoDclc96R/g+C41bcyNTwL2Ns6AybcSPOBYlHoZ0TceHEGHOjcFF/hGJm3a1FW/OSr Gf/rsTaPrZpsFHPvpfU6ksjyWuUyup87weREyK9axQaryzW5SvfWGJJkssZS+uAhaGUb YTKlSuvkTNVua7dYE33xg7fazzkkP/XDrgX+DuMhQd5E4bmmSmoZr3DUwt7fiMNpdZ9u kUC/cfNznDzC6z+QB71rpCF1hyXi1yhaFofZS0X1mGwQMf0x8dkeHyLHjLoYA7S0l2/j tYcoJ3565NeINbMogKpvjgJcpoImfPrYGcrJ5jOU6+MYgx6NkQRRBmOVSATTOGmorhfp pB5Q== X-Gm-Message-State: APjAAAWAZw8nsVxtUyB/E25oWH+MdAr73ysOfr9+PnXWoUGEaUKl/8ga ZAkuzn/Ug9ltK7PpOQ8y9+NNZ6Kb2ks= X-Received: by 2002:a17:902:8d95:: with SMTP id v21mr59852918plo.61.1577574695464; Sat, 28 Dec 2019 15:11:35 -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.11.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2019 15:11:34 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 00/29] cputlb: Remove support for MMU_MODE*_SUFFIX Date: Sun, 29 Dec 2019 10:10:55 +1100 Message-Id: <20191228231124.18307-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::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: 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 v3: * Add patch to avoid breaking build for --enable-plugins. * Rebase on master and resolve conflicts. Changes for v2: * Significantly revised docs/devel/loads-stores.rst. * m68k and s390x dropped #defines and use *_mmuidx_ra directly. Patches lacking review: 0009-plugins-Include-trace-mem.h-in-api.c.patch 0010-cputlb-Move-body-of-cpu_ldst_template.h-out-of-li.patch 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 (29): 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 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 plugins: Include trace/mem.h in api.c 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 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 + plugins/api.c | 2 + 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 | 11 +- target/xtensa/mmu_helper.c | 5 +- docs/devel/loads-stores.rst | 215 ++++++++--- 33 files changed, 961 insertions(+), 1162 deletions(-) delete mode 100644 include/exec/cpu_ldst_template.h delete mode 100644 include/exec/cpu_ldst_useronly_template.h -- 2.20.1