From patchwork Thu Dec 12 18:53:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 849736 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103026wry; Thu, 12 Dec 2024 10:55:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUL5Pc2H012Wm/qakMGQHp36rjLqhMk+FGHiu/vkW5GQde8+MyROQaT2sH+qBoR4KOdw2shOA==@linaro.org X-Google-Smtp-Source: AGHT+IGLlixC9jsl1CHnELEuAiQVyVzN7JGxgTFU/sZs1ta27eXN04xShgqU64alYuqB9hTjUsXj X-Received: by 2002:a05:622a:1491:b0:467:7441:270e with SMTP id d75a77b69052e-467a155f3b7mr22894711cf.6.1734029714783; Thu, 12 Dec 2024 10:55:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734029714; cv=none; d=google.com; s=arc-20240605; b=eSaqUPEND0d/wyKb4AUrfBRzMkMVMaCJTujsuObA04pDZ/2zQznKsOKXarJaTd3gck QSiuuTcJsCRCUVIuHUsIfSQNZG30odeAoY1/mc9mIGIwIsjNmjQhhbErGR+CR53xkuux b4cIKGwFdUGfRZsZ7/velHHlANvSAf6ZNmcUyG1vhjhbV9hAIzgeupehoF9DOwncInA/ aWd8TMYClRfK5ifTuM7fJk8jLK7eFTRWZOQ9MbqkRLBM5pWklkxZ/pXjvdvxCAx58+A0 FGa+eKlgYk5yV1ipVRVDx7rAmur4cPbj+wrhy6E6LuiOOfoUEUFgF9rXSyBwQrf3FZfB PoBQ== 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:cc:to:from:dkim-signature; bh=YmhSLELNDZOYP7FpGoXWoYAisIFfjK8kEBl0i/Kwy8w=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=cSn8Hja7rR1DTWLZ+UzdTNDOrxZGTkG1v4o/jrc1SY7p9/mClQ9875jRgThD8bkzlf c8rKCLE0XRifnfDo1asEPI6AqHcgdJrhNb71HX6y6fw6Wumj/SgSYlaRSTEdkY+eWhWF jhqrOaJseuJEf7Z6bvEYlCWoimrW2xGb46OV/EbHj9eXohQb//aZWl3BXPO51bQbivhX EQzmIUcOkEDrf2H0U5IeHMHw6U+soYPYu9xHp07wp2hqdSyrfeNDbP4/uQ8cvgmUdPGj eAgpowKIvv0sK7gKBFimzvhy3SIEq7tJokIEJAFSSI9BQLvwq7JwUAVy/3NR7Zav93/A sAWg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bK4jOhMy; 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; dara=fail 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 d75a77b69052e-467296bb75asi190012601cf.78.2024.12.12.10.55.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Dec 2024 10:55:14 -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=bK4jOhMy; 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; dara=fail 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 1tLoK1-0004bg-8y; Thu, 12 Dec 2024 13:54:01 -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 1tLoK0-0004bX-7k for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:54:00 -0500 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoJx-0006WO-SS for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:53:59 -0500 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-2ef89dbd8eeso631507a91.0 for ; Thu, 12 Dec 2024 10:53:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029632; x=1734634432; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=YmhSLELNDZOYP7FpGoXWoYAisIFfjK8kEBl0i/Kwy8w=; b=bK4jOhMyIrbGiUPdl6XnalzSqObDXXS4DhFS0nLcZqUXpXOuWnoR/ILkwqR5shmLeT gEogR9u0Pw6s4iNLuJC9VliCWmFZgQ+SqhJuccXNGj+SrBViWu9R+jpmJBQwlyyLvk5o X1HjGXBOZ0xTzxvB+o78LZgKPK6ywZJgCBbJ2IMm5ImIrZb8c1x07VLWDlF2e2vlw9jA S/TDtB8vwrGnHvAVRB4IlzG0mGTeOalFm0gf/sU/DY4g0EHvyYn3PAdL9G86B8TcVoLs OYCud1if4hcd+1+vedKzsg44YlqGlnEagdJoANyQNTlq2aiAlQcNy3UmiC7VrWeKKxav UVEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029632; x=1734634432; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YmhSLELNDZOYP7FpGoXWoYAisIFfjK8kEBl0i/Kwy8w=; b=i7OePxpnNuIQOTmUm0/Qezb14QJiBhBECc+SwA5+QWNhN1APVYbdqodljFhDHbnYGM ucF9ZK/8bFBuIszAX8ac5RMtpnHJp+tnmGUbdrA473I4rFBaahQB56fj8QLKi19q9Td8 VutzA/XOtSk4+gljsXpBLb7YWb84rcnPvmTCE3C40XrCa8vseAnZYULAq8glB29k4++w /CMAeHLphYQVVjvqItcwS1aFa6AtAoszcxkZD3ncUwUtAr55msLb7wdBIc/OnPdKW8+X I571rFI1a0ndnwlHF46NjrDbcc68Cqaxvd6BzravMJ2K2rKha+KKjXviWCUtxB3Tv1ME do5Q== X-Gm-Message-State: AOJu0YxBhTX3sslI/wpY3NIJ6uLL4YpqpfI8BGq4BVVSTFSfaPPmf3Tk tGeIftyydcMeqqIFBNzEGdkAKg73tvqrSvX0Dmn4Ur3QKLrvtbHUy4XkirtP8HC5mZyL1+BqRhM 2 X-Gm-Gg: ASbGnctkp6fVe90BiZyXPW+j0nZZhJphelUhSBRhMovvsvD8ykLaq8mNGe9+pI47kjv wiW0NFgLRxaAx7vLXHLstjprGHRnPPcn5WRqqZL/22ZwLMe8clSrlngUpZnqIaIWg8biJKXg/Rn LgpPv7OgQ8PJWwJWP+0TPSdb4lZCDByUCt4+NU3OmVUOZhmXKBWCIt1E0H8kHP/Eds8CKRQhHsO wveV+MijilNSrYpCFLtjqH9ne/8isL9qJWYBWGjGVqhwhWrQmabJW104eOnuQGePAVuBiXRd33l X-Received: by 2002:a17:90b:4b88:b0:2ee:5691:774e with SMTP id 98e67ed59e1d1-2f13925ac9dmr7120215a91.2.1734029631915; Thu, 12 Dec 2024 10:53:51 -0800 (PST) Received: from localhost.localdomain ([88.187.86.199]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142de3473sm1604990a91.24.2024.12.12.10.53.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:53:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PATCH 00/18] accel/tcg: Extract user APIs out of 'exec/[cpu, exec]-all.h' Date: Thu, 12 Dec 2024 19:53:23 +0100 Message-ID: <20241212185341.2857-1-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=philmd@linaro.org; helo=mail-pj1-x102c.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 The goal of this series is to clarify user emulation APIs, and clean the mixed bag of exec/foo-all.h headers. Move user specific declarations out of the generic - "exec/cpu-all.h", - "exec/cpu_ldst.h", - "exec/exec-all.h" and - "exec/translate-all.h" to the generic: - "accel/tcg/tb-internal.h" and - "exec/page-protection.h" and the user specific: - "user/cpu_loop.h", - "user/guest-host.h" and - "user/page-protection.h" Philippe Mathieu-Daudé (18): exec: Introduce 'user/guest-host.h' header linux-user/aarch64: Include missing 'user/abitypes.h' header include: Include missing 'qemu/clang-tsa.h' header accel/tcg: Declare mmap_[un]lock() in 'exec/page-protection.h' accel/tcg: Use tb_page_addr_t type in page_unprotect() accel/tcg: Move page_[un]protect() to 'user/page-protection.h' system: Remove unnecessary 'exec/translate-all.h' include accel/tcg: Move 'exec/translate-all.h' -> 'tb-internal.h' accel/tcg: Un-inline log_pc() accel/tcg: Move TranslationBlock declarations to 'tb-internal.h' accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (1/4) accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (2/4) accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (3/4) accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (4/4) user: Forward declare target_cpu_copy_regs structure user: Move 'linux-user/cpu_loop-common.h' -> 'user/cpu_loop.h' user: Declare cpu_loop() once in 'user/cpu_loop.h' user: Move various declarations out of 'exec/exec-all.h' accel/tcg/internal-target.h | 43 +--------- accel/tcg/tb-internal.h | 53 +++++++++++++ bsd-user/bsd-mem.h | 1 + bsd-user/qemu.h | 3 +- include/block/block_int-common.h | 1 + include/exec/cpu-all.h | 112 +-------------------------- include/exec/cpu_ldst.h | 47 +---------- include/exec/exec-all.h | 72 +---------------- include/exec/page-protection.h | 24 ++++++ include/exec/translate-all.h | 33 -------- include/user/cpu_loop.h | 90 +++++++++++++++++++++ include/user/guest-host.h | 87 +++++++++++++++++++++ include/user/page-protection.h | 99 +++++++++++++++++++++++ linux-user/aarch64/mte_user_helper.h | 2 + linux-user/cpu_loop-common.h | 31 -------- linux-user/qemu.h | 1 + linux-user/user-internals.h | 1 - accel/tcg/cpu-exec.c | 13 ++++ accel/tcg/cputlb.c | 3 +- accel/tcg/tb-maint.c | 6 +- accel/tcg/translate-all.c | 4 +- accel/tcg/translator.c | 1 + accel/tcg/user-exec.c | 6 +- accel/tcg/watchpoint.c | 3 +- block/create.c | 1 + bsd-user/main.c | 1 + bsd-user/mmap.c | 1 + bsd-user/signal.c | 2 + cpu-target.c | 2 +- linux-user/aarch64/cpu_loop.c | 4 +- linux-user/alpha/cpu_loop.c | 4 +- linux-user/arm/cpu_loop.c | 5 +- linux-user/elfload.c | 2 +- linux-user/flatload.c | 1 + linux-user/hexagon/cpu_loop.c | 4 +- linux-user/hppa/cpu_loop.c | 4 +- linux-user/i386/cpu_loop.c | 4 +- linux-user/loongarch64/cpu_loop.c | 4 +- linux-user/m68k/cpu_loop.c | 4 +- linux-user/main.c | 3 +- linux-user/microblaze/cpu_loop.c | 4 +- linux-user/mips/cpu_loop.c | 4 +- linux-user/mmap.c | 1 + linux-user/openrisc/cpu_loop.c | 4 +- linux-user/ppc/cpu_loop.c | 4 +- linux-user/riscv/cpu_loop.c | 4 +- linux-user/s390x/cpu_loop.c | 4 +- linux-user/sh4/cpu_loop.c | 4 +- linux-user/signal.c | 2 + linux-user/sparc/cpu_loop.c | 4 +- linux-user/syscall.c | 3 +- linux-user/xtensa/cpu_loop.c | 4 +- system/physmem.c | 1 - target/arm/helper.c | 1 + target/arm/tcg/helper-a64.c | 3 + target/arm/tcg/mte_helper.c | 4 + target/arm/tcg/sve_helper.c | 3 + target/hppa/op_helper.c | 3 + target/s390x/tcg/mem_helper.c | 4 +- target/sparc/ldst_helper.c | 3 + tests/unit/test-bdrv-drain.c | 1 + tests/unit/test-block-iothread.c | 1 + util/qemu-thread-posix.c | 1 + 63 files changed, 467 insertions(+), 382 deletions(-) create mode 100644 accel/tcg/tb-internal.h delete mode 100644 include/exec/translate-all.h create mode 100644 include/user/cpu_loop.h create mode 100644 include/user/guest-host.h create mode 100644 include/user/page-protection.h delete mode 100644 linux-user/cpu_loop-common.h Reviewed-by: Richard Henderson