From patchwork Tue Dec 10 16:04:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 848794 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp406378wrn; Tue, 10 Dec 2024 08:05:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUOSAcn9hm49nJerpLHfT72pe9y0YCzglnFMmkGD8V+LUzLtXel6Bk4pQQfbU7GnKxY6NWcnw==@linaro.org X-Google-Smtp-Source: AGHT+IHtxmdvSlam2ZX/Y9uZ6iDkBVjRqsCQBwoq2ElG8/lC4CCUaGKMCEGp+b7DcyszwK7w81zP X-Received: by 2002:a05:620a:468a:b0:7b1:45be:2e87 with SMTP id af79cd13be357-7b6dce17f9emr757468285a.18.1733846740774; Tue, 10 Dec 2024 08:05:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733846740; cv=none; d=google.com; s=arc-20240605; b=gOrkppwizThSBUvvf++5sESNJ2+dRLhHUpHZnXNt7BD7vHzfDjalC+hrQDqjHX82lT L/BPq4JdMn+1A0x72ugUsHGpnv01+e94VlVX6jGzf8xKv6EnIWtoVqddVHibj3+pm+oH VjXzVSInNL6seQrPNIFla5t16kyLtzIYF1kuCPjMdS6AOCcbSvj+r7epMYwnfj5pBJoj hfG+RCBxDAa7BlVUncJrMqdVvlknBngnj81ROvoC/aGALX/YzDax4/fvv+1J+AzXP9gz hKDsz+z2tfBhnRww3SfQz2lqUVmiq7+AAxZyjnlOqSQ1xOWU470y8ALmKBOPwRCqc2j2 UP8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to: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=FoswyhGfKme1kpeEV97ZDIIbmDczfqis10Qe9ki5BgU=; fh=Q4UnooZhRYy7yWSuFO6jQdTOKPEDifUO2U3NkZywXCU=; b=VbunIadI49YWJs0CM8VvHWu0QapqkLhCsIZJaKWWgoDqKisqDyHywdj3RfZv6QIz75 94/uayN5s230oSxL/LaTJ0z06BxuziSs2Tgu4qdBRcKx+L06gJuVce6rYs6TJ5IJjIzQ G2xz7IxMKeuN9N8/yGVpz2Au9vbgiJT3EXshzColPVgdGn5vJ+OprGnph4gJYqrO2QL/ orsVZ7PsTicaV6ZKYJmHobWzSYjM2Gb3B1+c8G7Xc/KspvadN2EiYh/9QCKBKApk5fso EmLOgNqpsCpggdswoDdF3goeh/USjcwhaIY4gdRtOF45SW5oRCq9kPQUESh2IiBRXeGZ PqUw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SoUKW+VH; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b6d4e837f0si654342985a.129.2024.12.10.08.05.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 08:05:40 -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=SoUKW+VH; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tL2jS-0000o1-CT; Tue, 10 Dec 2024 11:05:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tL2jO-0000nM-Cj for qemu-devel@nongnu.org; Tue, 10 Dec 2024 11:05:03 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL2jK-0004M3-Tu for qemu-devel@nongnu.org; Tue, 10 Dec 2024 11:05:01 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-43618283d48so4338125e9.1 for ; Tue, 10 Dec 2024 08:04:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733846697; x=1734451497; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=FoswyhGfKme1kpeEV97ZDIIbmDczfqis10Qe9ki5BgU=; b=SoUKW+VH1z5Cku/Qn2WCKEXnYk6n86LWogY+XplQs5ftHmLYKUDijiQaRqGVZyxDZ4 9grgUxAc2m1Leo5GyqnKx28BjDycfyREEUd6nwt8l+0woBosen/JDQ2yVOoKwnnebtRQ 4GgklA+6yp3KeaZR+27t/9AaT/CgghF+HB5FUG86lyhZXMBwe2zCliZkJfEiFOXpezWj 3tzuW705aofQJlUvJjWMW+3mh2BFSoxLKsHFi3BwOSPKWamb13MhEHsE+CI9Nh4SVB4g d5ptmmLYVXIauWXH32oRK68Elu/pBZuoN2gWg0kfq3v8RDqALfYOIJbEBndeJ7m8Ezwa 0R8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733846697; x=1734451497; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FoswyhGfKme1kpeEV97ZDIIbmDczfqis10Qe9ki5BgU=; b=CaGl2BKIhd3kF/q7X3275N6PeE6Z2+eOiaSmYo/MVjj1OTqzJJ/OK4J4ww8wMKYqxO VCrRS+EgsamgkfJ8uC/mF/1uVw/JHjm/Ka7zwdb78Cs498PhW5B4tSaKHx5Vi71mgKzi c8s7P36u9s9heTrRnyEhJEl7pia77Z/+eBszINEe7psyERlVnPljECi4kSdkQMB5UQ5w xEC6NNG/6Ap6RuMmnReXLORXgb7T+ddAiei1XJ00vqVNkgvmkqoRphSjVvnrz1l8ihBp tyIQ7ShdXawo/3pJdz8nVMkfsu8O7P4qWeCTVdvujajKMXIOdLnY+PkFO2NQ8b6zv2iO VSXQ== X-Forwarded-Encrypted: i=1; AJvYcCURgB763EVabicVQ42xrhfM6IMER2or8ZjoggOvAtVt/gp4aMCAb88yYM1PG1bvLsCesWKQ5hLaMUHl@nongnu.org X-Gm-Message-State: AOJu0Yy7kqHrnv6yFAnAgakZwb+NOlvw7rFq5dUScS7hvLUPmzfbdhMR uPbAD/41ZUL7GRj0Q774fyyr076aPY8caG6qhQswl3yky3Or8ZkzBsEO8pen858= X-Gm-Gg: ASbGnctahMdzMRjL/4pffGjTSgXoDB8jdbEXwk4ksM/2pN5jEPW7Vj/Im67CRS3sR/f bHY8A9aArlNi59VDNh8MN+vL8DtnEoa3RGid9UqpEh7BwJD7wBHLe800r7vG1HieWanj2+llM0U QVanUxQPf7whL0yg/py+iy+cBtRNl4r/0GjlFW/3PDz5b+4rXwleRn9+ZmuoMasrrED8K6J7P4W SvaG0kWtENw/XQIr0puhdjjJBKS60AZwC1SSGXL6XrCbFtoZTMmKMNLECTt X-Received: by 2002:a05:600c:470b:b0:434:f767:68ea with SMTP id 5b1f17b1804b1-434f7676e9dmr68077905e9.5.1733846694173; Tue, 10 Dec 2024 08:04:54 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434e8ec8072sm124671605e9.18.2024.12.10.08.04.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 08:04:53 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 00/10] target/arm: Pull TLBI insns out to their own source file Date: Tue, 10 Dec 2024 16:04:42 +0000 Message-Id: <20241210160452.2427965-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org target/arm/helper.c is very large and unwieldy at nearly 13,000 lines. One subset of code that we can pull out into its own file is the cpreg arrays and corresponding functions for the TLBI instructions: these mostly stand separately from the other code in the file and have few shared functions or other interactions with it. They make up about 10% of the existing helper.c code. Because these are instructions they are only relevant for TCG and we can make the new file only be built for CONFIG_TCG. I split the move up into multiple pieces in the hope of making it easier to review that way; but in the end the code should all have wound up in the new file in the same order it was in helper.c. (Hopefully this will make any backporting of patches to stable branches smoother; it does mean that in some cases the order of functions remains slightly odd.) This is hardly the most urgent cleanup in the codebase; and there are other parts that could probably be pulled out (maybe the PMU emulation, and the timer/counter emulation?). But I did the TLBI stuff because FEAT_XS is about to add more TLB ops, so it felt worthwhile to move the code out to a new file first. thanks -- PMM Peter Maydell (10): target/arm: Move some TLBI insns to their own source file target/arm: Move TLBI insns for AArch32 EL2 to tlbi_insn_helper.c target/arm: Move AArch64 TLBI insns from v8_cp_reginfo[] target/arm: Move the AArch64 EL2 TLBI insns target/arm: Move AArch64 EL3 TLBI insns target/arm: Move TLBI range insns target/arm: Move the TLBI OS insns to tlb-insns.c. target/arm: Move small helper functions to tlb-insns.c target/arm: Move RME TLB insns to tlb-insns.c target/arm: Simplify condition for tlbi_el2_cp_reginfo[] target/arm/internals.h | 9 + target/arm/helper.c | 1208 +--------------------------------- target/arm/tcg-stubs.c | 5 + target/arm/tcg/tlb-insns.c | 1266 ++++++++++++++++++++++++++++++++++++ target/arm/tcg/meson.build | 1 + 5 files changed, 1284 insertions(+), 1205 deletions(-) create mode 100644 target/arm/tcg/tlb-insns.c