From patchwork Thu Dec 12 18:53:24 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: 849739 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103028wry; Thu, 12 Dec 2024 10:55:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWFfJLzC2srO1m5QNJeO7q/ie8J+L2RtV+z4vE/nhWkKJJ6WBU9IPq2aMGCE82aIkmPJPlNOQ==@linaro.org X-Google-Smtp-Source: AGHT+IHKO5tbq6RtbRxZNBoA0C+nlYtpUETnzGSAe0y2tPSriJ1JYBUZH1TCa2rG2Cwvu4g4WJux X-Received: by 2002:ad4:5fc8:0:b0:6d4:2646:108a with SMTP id 6a1803df08f44-6db0f729210mr22023016d6.12.1734029714866; 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=GM0Acc1IspJsj7Hc3bXLLS/fRcRmZHEtfnFFM7ZbIsTM6w3SiYVeS73NcgLvCoUCpw DKTid+QIh9hbJDE/l5yUWDVKQLQZkA/4d0m2cq3ynCQi9xSNrM1kwvviK73B+lpq3l6n MXx2J8SQOAWTgzGw5Av/oYNe+UERz+rwIuU0j9xFxbcz8xWhAagyujXvow4ZvM2P34IG VpP6oBmvfyjWPiqL3JdrsxdTLQedt43c49FxxsokLKJoT/6qbVouRbrpgR2G/Ph7KYha jYvhPjl/OeXw6zeBFsJqWUnArT4JG0OQ/kipRTMl9XIfpy6B710f28b+/z2kqVnFPmRa qXXQ== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uY621Zpe5phiABfrjs1wu2fCtX/cc+LF2MmFvVEbl/U=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=XoHf4ONpKKe5UTp9xuGdS7f5iaOpxTYPVPBdkzPbi+v7ChuMaSOlz3s9cAvu6GWtLx afeax6a86uAwDR3v+FjLjzVDhMLba/e6jzKjNuPzgVQCYCQRvesWu4FN9sIYr6cWQzli CGtJOrApJ4fKUCzCePfXFON+4akO1PMPxQ0UdGbAuhkyS1GjtOYdy3Z3tVLbZ8dN6ZzF hPtqYQyYs2YrxNtAhcrQ1x0ct+UX8xIRdbkTyw6MVrAeYbm90Jf3cjJv85w2BW9pV0G5 JF6d6KeGuuOiMD9+p1yDkBbPzQmE8J7NI2vmDb0g4eaBIe5MtTSJMVT1SId2uiRiNQwD XrWg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="H/YwGtko"; 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 6a1803df08f44-6d8da69ead0si194718976d6.134.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=pass header.i=@linaro.org header.s=google header.b="H/YwGtko"; 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 1tLoKA-0004dA-BK; Thu, 12 Dec 2024 13:54:10 -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 1tLoK8-0004ca-HL for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:54:08 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoK6-0006X5-Lt for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:54:08 -0500 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-2165448243fso10858735ad.1 for ; Thu, 12 Dec 2024 10:54:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029643; x=1734634443; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uY621Zpe5phiABfrjs1wu2fCtX/cc+LF2MmFvVEbl/U=; b=H/YwGtkoBKenFK3cuba5UZHJHPHQECf6cwcjBrdRKCeSPjh5xh51RSP6lP6g+cwFMr g8Y3ra+ETIbjBGa/YEX6GiF5/0AkiFdHT/7Kr0UpepcQZr1/dWF7FFHJmQ9sg1L+J1Ak Vp5zH2x7jbrylZDyJpgPvV6Y97Eenz8bbMG8a/qX4L3M79FIKFB8sD+HHgS1vFJWjrB3 sD4HfHTTiFSJDYFe2il4vJpE778C6vQHbF2J5j5YdKRVYSkGfmJsTG1++2oKS6D5Xq0u Yt+XEj9abLUSlbtRTl4RvuHKCvwP9bfruKkswgr4fn7N07ytYNJe14+o2o6uFeiWn9Ky qIfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029643; x=1734634443; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uY621Zpe5phiABfrjs1wu2fCtX/cc+LF2MmFvVEbl/U=; b=q2Yi3AbLnCfcvUnWHE0S0YhLwzbvmtJ6pNnJRXbbfnjvJbF9vnWq9Z1OS6OzYslv9o hn6pnyj/MB+TGG3jK3AayAyK2SsKhK+Krizks/rYl+H/UCmireJ9dEDyyL9JL3sWI1f8 w2xyyO09SFFcCTjHm047sj66ZSsob+TSGxMkEA1a0TQ/xEodKpm1szJh4bXAt73MMz5n PL/X8+vhViwWMDM0c2THVuykHH4GPINtGDwARnWhHxnZ/MfQUaDiSTZRU2j49XL04FdU pXf0bY7pbY8xujwrEQXKrz1irevKAxnhvlt8g0LMwHLlVkupkE3ihLW2U6LICDKJqwFE P3Uw== X-Gm-Message-State: AOJu0YwJRDH3O/eLM0RKv/Oy+evjasbeIOxrjdo4jzKSf48pLvZ/AOw/ 1tZRph+Mxnr39y2qukcw/PSSXSWzb7m7UpRAw3DzntX6N2mbOnSYFCABktugP+6SHfuLMdSySnu Y X-Gm-Gg: ASbGncv8/Bno2xU8UhsQG+3hQ+X8orolUCdE+WzUgWLQITTA5dbSvub0i2bBJ7/4+8+ p05A0OVKsKFj4RUm80d93I77BWTmcChvlLatA3wAErGcyPC5vgyz7b/pkCOB8n58wt/nQQuRt78 mOb0s9Bmf8SNySfAbe4ytk00Ks3sFXsyThkgWWHLRvjaVke2OVfu+lTeKBo49n3DShZKI/QQnwX f9mcXLz5v91xmS3B6jh+wIMBnJ44OJZO/5yi0+M4Eh4GkIrCiR79mXaOh/3x7lLN0uTAP0btMnn TlEgEBs+TzUEWNpGEeGM2Zy1ZPizpDI= X-Received: by 2002:a17:902:db05:b0:215:f1c2:fcc4 with SMTP id d9443c01a7336-2178aeefc4fmr69485115ad.41.1734029642736; Thu, 12 Dec 2024 10:54:02 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-215f8f29bcbsm126158075ad.262.2024.12.12.10.53.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:54:02 -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 01/18] exec: Introduce 'user/guest-host.h' header Date: Thu, 12 Dec 2024 19:53:24 +0100 Message-ID: <20241212185341.2857-2-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=philmd@linaro.org; helo=mail-pl1-x636.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 Extract all declarations related to 'guest from/to host' address translation to a new "user/guest-host.h" header. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- include/exec/cpu-all.h | 34 +-------------- include/exec/cpu_ldst.h | 47 +-------------------- include/user/guest-host.h | 87 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+), 79 deletions(-) create mode 100644 include/user/guest-host.h diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 1c40e276728..1c8e0446d06 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -64,39 +64,7 @@ /* MMU memory access macros */ -#if defined(CONFIG_USER_ONLY) -#include "user/abitypes.h" - -/* - * If non-zero, the guest virtual address space is a contiguous subset - * of the host virtual address space, i.e. '-R reserved_va' is in effect - * either from the command-line or by default. The value is the last - * byte of the guest address space e.g. UINT32_MAX. - * - * If zero, the host and guest virtual address spaces are intermingled. - */ -extern unsigned long reserved_va; - -/* - * Limit the guest addresses as best we can. - * - * When not using -R reserved_va, we cannot really limit the guest - * to less address space than the host. For 32-bit guests, this - * acts as a sanity check that we're not giving the guest an address - * that it cannot even represent. For 64-bit guests... the address - * might not be what the real kernel would give, but it is at least - * representable in the guest. - * - * TODO: Improve address allocation to avoid this problem, and to - * avoid setting bits at the top of guest addresses that might need - * to be used for tags. - */ -#define GUEST_ADDR_MAX_ \ - ((MIN_CONST(TARGET_VIRT_ADDR_SPACE_BITS, TARGET_ABI_BITS) <= 32) ? \ - UINT32_MAX : ~0ul) -#define GUEST_ADDR_MAX (reserved_va ? : GUEST_ADDR_MAX_) - -#else +#if !defined(CONFIG_USER_ONLY) #include "exec/hwaddr.h" diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index dac12bd8eb3..a26ab49b0b4 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -72,52 +72,7 @@ #include "qemu/int128.h" #if defined(CONFIG_USER_ONLY) - -#include "user/guest-base.h" - -#ifndef TARGET_TAGGED_ADDRESSES -static inline abi_ptr cpu_untagged_addr(CPUState *cs, abi_ptr x) -{ - return x; -} -#endif - -/* All direct uses of g2h and h2g need to go away for usermode softmmu. */ -static inline void *g2h_untagged(abi_ptr x) -{ - return (void *)((uintptr_t)(x) + guest_base); -} - -static inline void *g2h(CPUState *cs, abi_ptr x) -{ - return g2h_untagged(cpu_untagged_addr(cs, x)); -} - -static inline bool guest_addr_valid_untagged(abi_ulong x) -{ - return x <= GUEST_ADDR_MAX; -} - -static inline bool guest_range_valid_untagged(abi_ulong start, abi_ulong len) -{ - return len - 1 <= GUEST_ADDR_MAX && start <= GUEST_ADDR_MAX - len + 1; -} - -#define h2g_valid(x) \ - (HOST_LONG_BITS <= TARGET_VIRT_ADDR_SPACE_BITS || \ - (uintptr_t)(x) - guest_base <= GUEST_ADDR_MAX) - -#define h2g_nocheck(x) ({ \ - uintptr_t __ret = (uintptr_t)(x) - guest_base; \ - (abi_ptr)__ret; \ -}) - -#define h2g(x) ({ \ - /* Check if given address fits target address space */ \ - assert(h2g_valid(x)); \ - h2g_nocheck(x); \ -}) - +#include "user/guest-host.h" #endif /* CONFIG_USER_ONLY */ uint32_t cpu_ldub_data(CPUArchState *env, abi_ptr ptr); diff --git a/include/user/guest-host.h b/include/user/guest-host.h new file mode 100644 index 00000000000..8d2079bbbba --- /dev/null +++ b/include/user/guest-host.h @@ -0,0 +1,87 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * guest <-> host helpers. + * + * Copyright (c) 2003 Fabrice Bellard + */ + +#ifndef USER_GUEST_HOST_H +#define USER_GUEST_HOST_H + +#include "user/abitypes.h" +#include "user/guest-base.h" +#include "cpu.h" + +/* + * If non-zero, the guest virtual address space is a contiguous subset + * of the host virtual address space, i.e. '-R reserved_va' is in effect + * either from the command-line or by default. The value is the last + * byte of the guest address space e.g. UINT32_MAX. + * + * If zero, the host and guest virtual address spaces are intermingled. + */ +extern unsigned long reserved_va; + +/* + * Limit the guest addresses as best we can. + * + * When not using -R reserved_va, we cannot really limit the guest + * to less address space than the host. For 32-bit guests, this + * acts as a sanity check that we're not giving the guest an address + * that it cannot even represent. For 64-bit guests... the address + * might not be what the real kernel would give, but it is at least + * representable in the guest. + * + * TODO: Improve address allocation to avoid this problem, and to + * avoid setting bits at the top of guest addresses that might need + * to be used for tags. + */ +#define GUEST_ADDR_MAX_ \ + ((MIN_CONST(TARGET_VIRT_ADDR_SPACE_BITS, TARGET_ABI_BITS) <= 32) ? \ + UINT32_MAX : ~0ul) +#define GUEST_ADDR_MAX (reserved_va ? : GUEST_ADDR_MAX_) + +#ifndef TARGET_TAGGED_ADDRESSES +static inline abi_ptr cpu_untagged_addr(CPUState *cs, abi_ptr x) +{ + return x; +} +#endif + +/* All direct uses of g2h and h2g need to go away for usermode softmmu. */ +static inline void *g2h_untagged(abi_ptr x) +{ + return (void *)((uintptr_t)(x) + guest_base); +} + +static inline void *g2h(CPUState *cs, abi_ptr x) +{ + return g2h_untagged(cpu_untagged_addr(cs, x)); +} + +static inline bool guest_addr_valid_untagged(abi_ulong x) +{ + return x <= GUEST_ADDR_MAX; +} + +static inline bool guest_range_valid_untagged(abi_ulong start, abi_ulong len) +{ + return len - 1 <= GUEST_ADDR_MAX && start <= GUEST_ADDR_MAX - len + 1; +} + +#define h2g_valid(x) \ + (HOST_LONG_BITS <= TARGET_VIRT_ADDR_SPACE_BITS || \ + (uintptr_t)(x) - guest_base <= GUEST_ADDR_MAX) + +#define h2g_nocheck(x) ({ \ + uintptr_t __ret = (uintptr_t)(x) - guest_base; \ + (abi_ptr)__ret; \ +}) + +#define h2g(x) ({ \ + /* Check if given address fits target address space */ \ + assert(h2g_valid(x)); \ + h2g_nocheck(x); \ +}) + +#endif From patchwork Thu Dec 12 18:53:25 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: 849740 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103034wry; Thu, 12 Dec 2024 10:55:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWJYQLT+xGHnEWt+GjPASn7v/+zzQQV0okxdKXFq1xKM66OfMGshRfoJzIx2rIxRR5Gx9tMRg==@linaro.org X-Google-Smtp-Source: AGHT+IHOMQuCTbFwHx1770lGvBLsXh1FpOZ2CBtiMZ2Acozjo5TMRI9rZXTK5nAzCofk2eyRTnge X-Received: by 2002:a05:620a:27d1:b0:7a9:d14f:2374 with SMTP id af79cd13be357-7b6f899fa50mr270161685a.44.1734029715016; Thu, 12 Dec 2024 10:55:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734029715; cv=none; d=google.com; s=arc-20240605; b=XdWcE0hxBfMTdo+vkgjBLd/3TvBUvo5YejAZVeOs+vg63oB6O7pz9Q9W4tRf76Sexq BzE/d9eGQ7GxPjCsF/ftYAdWmNW3vbbRCpsyT65Byfk5Pqp5UiPrIkRjiE/LQBO8LwHX 4euXa4o7UmU4bE3Y1HOp888mz2KB64LMcfNrQmZLwF3ABH1DAYpQ6G6tiN+o68cDxNlz AB5wpEE7pcMiGfJ6kJ6p/5Pf3K44TT0TIhyQcdaRJi9xGgu6yr0mUtI+zNRntzFPhyIG +8DrbyczmpHfLgr1JyaV/7I0vHhg8Igy0YoWDuFM3O7m05B1CYUhxDBax8cuc6M4PWMC HRNw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=COQa0IDmzSYvfWdSQf7pgjwEYz5PX2cSNYwHo2OnbHQ=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=N1FrTYuRjE2ywt0+ys79vbKpwktcLV+o4GgszgdpEkD67+fVQP7j1EKCu/QPuXUY+b v8etTIz1YlvZ1qfesIaWPpRYEqtCJKp7SxjylOMPM23WdD++w8/uLFNoA4top0+pdxru N2LVxkjiji/CRNriwrrTDTF+/Cfi//H9AP5waum7L2Vfp/5lbjQ6O6XXOo/aKfDE1Ny7 dEt5DqbLGPm5Dl/uzeKf4JFYoTZfTt8NMacdiwAS9eilxhsO0xkYGSRnsDNFqroCGgiL 8/O4mz0MeG/t3mOa36JzbY0RHSzFbYSmQJtXs7hOvPxRaCkyNGaATolRPaPJQsl3kYEH Iy8g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RH2WLNVi; 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-7b6b5a46a3fsi730598385a.102.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=pass header.i=@linaro.org header.s=google header.b=RH2WLNVi; 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 1tLoKM-0004eH-AT; Thu, 12 Dec 2024 13:54:22 -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 1tLoKK-0004dt-CI for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:54:20 -0500 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoKI-0006Xw-2k for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:54:19 -0500 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-728eccf836bso896713b3a.1 for ; Thu, 12 Dec 2024 10:54:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029654; x=1734634454; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=COQa0IDmzSYvfWdSQf7pgjwEYz5PX2cSNYwHo2OnbHQ=; b=RH2WLNViv5rxLLEtqjvRqVJn1hud/r/EPad5mdfhrhBEFe42heHMfFlOhtgtiliDaV msCSnoH5gPior3a84eKU+PiMJCZXAaN5jAPFO94ettyd7Wt9wD0KYY0wbArkiKhiDfHK JC0Z/iVj7yWyIHTlKZyuCn5tcG2XQs+Zl29Pp/WmL5bTfUrv+vIMGkdm8IHIuIeAVVwg ISNEGfs9FvqhPnUD40tkwIFTXpaoRPA3wwhZmYx8mKmPBfu1blYGAkk8WimYVAgPsTea 7Yy9FRvqBwaWUca5DQHfO21LBJZRoAChpo5Sze2SCEr0KR03z2x8J2/kRuDlizy0l3a/ 1yHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029654; x=1734634454; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=COQa0IDmzSYvfWdSQf7pgjwEYz5PX2cSNYwHo2OnbHQ=; b=vOjoqd1ZCdksyHqiFAiAa5iw8dlAygJt37MmuXdPByN5c7JcvZnVc9+lDSP50kI47/ 8BbFMvERvpNTFCOfgNmCHywCptVnggI/3eABWnvlNgRaU/7Gyc2CURMbvsMH7lnqiklR QPL6licDzFIiOvRecbtd8Wz8FDMc2kREVSWIl8X6WTPROixdVTpSGbYDeCMXJEAko+AE vmIOoOMjqPpPQ8kkmVk5C8RYBk6xG57BC0LI8Kq5mUsYZWBEH0URol23fAoJR1QJpNED rv/lQEo5ntJWH0oDqXd7MwP7wwIrya1ty8Asn5LJhqNdemq+pEveR0akbL02HCglKl20 Rd5g== X-Gm-Message-State: AOJu0Yyi5gWyxQVsEZJO3xEy5wTQmSG7bNfzABoEWRYKRsTrxAD8w9SY BFck/lM6RHhxPvoVmndek4J2SMjkqPMMjtIYLC0Irkgwxc32Z4pS3H3w188WQbN/S1r3RLSvrAD f X-Gm-Gg: ASbGnctevQOQUUIx6cD2E4iirnaybNuRuBK/DSHCH2UaR5pel0KE0NQZgJALTzjqGR9 BflITkOmxHIlS3f5/UHnZdwTMpVTwwuUPcL25DG8DzeIBYiUZ82XE12A1OL7az27m/kIa2SClY4 bRWEzp/Y5dzprlxlx3E34vPiYTEaqD03Ze6ItXpOQdfqAwQaaZHsVE9kjljufpOBNfbpTbKq2ur QctPRHvQWqMiFcWSHJlSqmlJ5h2vttosJmmT5/YWnzuPh3MJ/2XVP0Luv1npvrO4HyulRtyx/tl YMw5r/6L6W+6KN8ZVc6kRFYquUHy5Lw= X-Received: by 2002:a05:6a00:2885:b0:728:fab1:edbb with SMTP id d2e1a72fcca58-72906ae391emr2144317b3a.20.1734029654724; Thu, 12 Dec 2024 10:54:14 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7273beba847sm5963884b3a.174.2024.12.12.10.54.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:54:14 -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 02/18] linux-user/aarch64: Include missing 'user/abitypes.h' header Date: Thu, 12 Dec 2024 19:53:25 +0100 Message-ID: <20241212185341.2857-3-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-pf1-x434.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 arm_set_mte_tcf0() uses the abi_long type which is defined in "user/abitypes.h". Include it in order to avoid when refactoring: In file included from ../../target/arm/gdbstub64.c:28: ../linux-user/aarch64/mte_user_helper.h:30:42: error: unknown type name ‘abi_long’; did you mean ‘u_long’? 30 | void arm_set_mte_tcf0(CPUArchState *env, abi_long value); | ^~~~~~~~ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- linux-user/aarch64/mte_user_helper.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux-user/aarch64/mte_user_helper.h b/linux-user/aarch64/mte_user_helper.h index 8685e5175a2..0c53abda222 100644 --- a/linux-user/aarch64/mte_user_helper.h +++ b/linux-user/aarch64/mte_user_helper.h @@ -9,6 +9,8 @@ #ifndef AARCH64_MTE_USER_HELPER_H #define AARCH64_MTE USER_HELPER_H +#include "user/abitypes.h" + #ifndef PR_MTE_TCF_SHIFT # define PR_MTE_TCF_SHIFT 1 # define PR_MTE_TCF_NONE (0UL << PR_MTE_TCF_SHIFT) From patchwork Thu Dec 12 18:53:26 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: 849738 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103025wry; Thu, 12 Dec 2024 10:55:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV8pyEgjYBndFQPb+p7sQR1QUoTlC8vspfPJConBo8tNsqH/7uhLQ7hdZerxmD7UB2lp8mGug==@linaro.org X-Google-Smtp-Source: AGHT+IEZfeyjCQr6ef1rZOSsjyHJnhkX7l7zd4jUMe78HvIjQ9FmuPPrB+gCEVbHKwi0/G09ZF7b X-Received: by 2002:a05:622a:60d:b0:45d:8be9:b0e6 with SMTP id d75a77b69052e-467a16d7ab7mr25295771cf.43.1734029714800; 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=QlC1/SOwxr8vKsf8vwzOUCOrj0R0QPqdOnOzzE6VogqXpBfumuHhHnvaSgrO0L+z/A BpiNIvAa1XnOPrTVIVN1WZilk7JXGbf2YtDMV+dKCLaM/K4QeRRYl00x3En48MaQ36Db sZ+KrDW/k+jKIhUdtHdQGnE2bdgcWU+A4nCim3upLpRn/mQxIoYFR7b+7RAJu9tz6fM5 5nwLWrCJZdVOeSnyUIT0OGdxzm52pKwEvMDg6kEdwFWqXc9L0eC+WlWwDmOQnWw9Xk8x HXfVbZnxv0lMbhgNNKyx+XcVRhb6sJbYiXcb9GX0SMMcgBFcvs8HyVggwHZOTZ714oON 9Hqg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HazQIxFPlU3a2oysjMUdZiZcfaWSWluyVNuDTpHIcic=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=Sf3i1ifCEeYGbwSt24l3VDcImzlR2my5pSmlI3gqfWSelJS+rl+dDsbrStXB1X/vw2 atXpjw6u3X6EtfJuqY8yw93HgGlCyT8vDh+/o9UVbcVyiRjTrnYDbTNdSimGVkFKuFMa J2xxqJsCHGfHEJQzfyGd2Y40XsAbA/AQlri9Jmxx63kLUfQNZy05ojKcUyUmrOEpB2+/ 3n4ZWi6DeF24Up8lJoyM7PIFqVueo+LFa0nMGros4v9J8s4sL4CBvCrs0LoSCA49XE+N YgQ/0BOfDoM3lkVReEzDxH43EFUC1o8eVPb2Iwe0/iBW6HbajybHBRlBHJ3LgGQm6DXn UbEw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bI3Fxu08; 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 d75a77b69052e-467850fb01fsi62053081cf.208.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=pass header.i=@linaro.org header.s=google header.b=bI3Fxu08; 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 1tLoKW-0004gI-AH; Thu, 12 Dec 2024 13:54:32 -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 1tLoKT-0004ez-M7 for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:54:29 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoKS-0006Ys-23 for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:54:29 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-2161eb95317so9263235ad.1 for ; Thu, 12 Dec 2024 10:54:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029666; x=1734634466; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HazQIxFPlU3a2oysjMUdZiZcfaWSWluyVNuDTpHIcic=; b=bI3Fxu08aimMMzeMbRWNnaGvT0OYeDXGchKhbBUvHN7YoK0qzzcFcELs6XnGozIx2r GuPGvQ6k4K8IIzbNll7p6tVDRolM8HvXciuP5iEvcfKtZo84JwB3r3bqHvmoPrP4S8Uc Gz26TaEHQzda1J4uvwtxeJq3CoEUHyapfP7VHn4ep242jnP3Jf2MvbyIFHc33VHlyRyg 77ltblWonqTP9/7VcrTF8GEsJ1BKBhiFnfvOya6x+qoFyOaSqL79SPrMzcr2fLTOhTtE lKJeL3BJZrOlc+tpa89Kb8PvYQ7U7YQz64Vg4/66un/oq6wbyySHarz/oQ2qcy4PYjaf ypDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029666; x=1734634466; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HazQIxFPlU3a2oysjMUdZiZcfaWSWluyVNuDTpHIcic=; b=X7nkZiFkUUJN5YZLQUoSqdUHgg7KlMjg4C0nIdSWD7qRA0tM8hFPPa9LA3gOr8MQRQ UPUm4n8Ht8i1dQDpgrt9LGTw62H5apumURFJ7IURc/+rbXXV8EguIlcaXXywyNWTBOUN mAM5YjEhT9/V/cNLFy6ixx05WB2Wla/G9EHqYeA8mnrIefwPtgyNSPvT7Ze2/juKlJ0W NOB8xcxrV52phIXAK2wakahuc+HPfVr0OhL0hidou7Yz6vgajTbgY+Gw4AGEvYJUnM4A r1m+wa/xtBQIoHmJ14qrX009HUWi157PdOnKH3M02ZA6SfU/tmjQCd2SLRHlJFT/8mKa PkpQ== X-Gm-Message-State: AOJu0YzW8aek+sXbhVRLTdX5lLHdhQo7tgYwtfy8yRDTtwV5OhARb8YP QXeG1YBVfjFnbKaImZrUIL2zmCgs5c1d4P8aczGJ+LVD2iCvmy6JMDuXkcszX8Bub/Dafkigyi1 y X-Gm-Gg: ASbGncv3r1XD+TvK35wEfDAqqCrvSYSJ1Y0j14RmmWeqLEMlA+W7c1BZs1cvyh/1TDP iFmmXxE+TLZ+hLGpiNAjr5Ph4jvUmY0fVjBPeE/6WLc/+vVz7hLJECqPSIRNLDWJIhfiRDKP/Nu sEu000P0+2FZMvKG2D+SX039qhODnJb3jK/At5zt057tjzIr3UizB27PDhcOnp7ce6s4pkM1SPg qGByHLOONF5Z7bpIJ2UgIh+4HcEI4DWswqXx/dN2wjR8e2gqGQKdFtpNb+QYrnM/OoJHsRwYZPo PpsHf95yWpcvUoqb7Gd1ou7SG2hO39g= X-Received: by 2002:a17:903:1c2:b0:216:1ad2:1d5 with SMTP id d9443c01a7336-21778549cf8mr115840235ad.41.1734029665998; Thu, 12 Dec 2024 10:54:25 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21781ced307sm29179555ad.31.2024.12.12.10.54.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:54:25 -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 03/18] include: Include missing 'qemu/clang-tsa.h' header Date: Thu, 12 Dec 2024 19:53:26 +0100 Message-ID: <20241212185341.2857-4-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=philmd@linaro.org; helo=mail-pl1-x630.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 next commit will remove "qemu/clang-tsa.h" of "exec/exec-all.h", however the following files indirectly include it: $ git grep -L qemu/clang-tsa.h $(git grep -wl TSA_NO_TSA) block/create.c include/block/block_int-common.h tests/unit/test-bdrv-drain.c tests/unit/test-block-iothread.c util/qemu-thread-posix.c Explicitly include it so we can process with the removal in the next commit. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- include/block/block_int-common.h | 1 + block/create.c | 1 + tests/unit/test-bdrv-drain.c | 1 + tests/unit/test-block-iothread.c | 1 + util/qemu-thread-posix.c | 1 + 5 files changed, 5 insertions(+) diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h index ebb4e56a503..bb91a0f62fa 100644 --- a/include/block/block_int-common.h +++ b/include/block/block_int-common.h @@ -28,6 +28,7 @@ #include "block/block-common.h" #include "block/block-global-state.h" #include "block/snapshot.h" +#include "qemu/clang-tsa.h" #include "qemu/iov.h" #include "qemu/rcu.h" #include "qemu/stats64.h" diff --git a/block/create.c b/block/create.c index 6b23a216753..72abafb4c12 100644 --- a/block/create.c +++ b/block/create.c @@ -24,6 +24,7 @@ #include "qemu/osdep.h" #include "block/block_int.h" +#include "qemu/clang-tsa.h" #include "qemu/job.h" #include "qemu/main-loop.h" #include "qapi/qapi-commands-block-core.h" diff --git a/tests/unit/test-bdrv-drain.c b/tests/unit/test-bdrv-drain.c index 7410e6f3528..98ad89b390c 100644 --- a/tests/unit/test-bdrv-drain.c +++ b/tests/unit/test-bdrv-drain.c @@ -28,6 +28,7 @@ #include "system/block-backend.h" #include "qapi/error.h" #include "qemu/main-loop.h" +#include "qemu/clang-tsa.h" #include "iothread.h" static QemuEvent done_event; diff --git a/tests/unit/test-block-iothread.c b/tests/unit/test-block-iothread.c index 26a6c051758..1de04a8a13d 100644 --- a/tests/unit/test-block-iothread.c +++ b/tests/unit/test-block-iothread.c @@ -29,6 +29,7 @@ #include "system/block-backend.h" #include "qapi/error.h" #include "qapi/qmp/qdict.h" +#include "qemu/clang-tsa.h" #include "qemu/main-loop.h" #include "iothread.h" diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index b2e26e21205..6fff4162ac6 100644 --- a/util/qemu-thread-posix.c +++ b/util/qemu-thread-posix.c @@ -17,6 +17,7 @@ #include "qemu-thread-common.h" #include "qemu/tsan.h" #include "qemu/bitmap.h" +#include "qemu/clang-tsa.h" #ifdef CONFIG_PTHREAD_SET_NAME_NP #include From patchwork Thu Dec 12 18:53:27 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: 849737 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103027wry; Thu, 12 Dec 2024 10:55:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWDIqGO3VTQ/otxbjrnX6xmoWdtZpCpGUAzN8nuXclRDWmqFbvS4Trclwx0ZUZr12lmU/7vdw==@linaro.org X-Google-Smtp-Source: AGHT+IH+scAGeOeXJyP5nshfDbWUTSSy/j+m/iJY42f6xWRLHenynlitBNFIA+v1F3dWa5YcRk0n X-Received: by 2002:a05:622a:1491:b0:467:70ce:75e9 with SMTP id d75a77b69052e-467a1547b19mr28108021cf.23.1734029714769; 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=DwhtmV/BBCliwGhH7jDLdot2N0BShE5oz3eMtlyUZxispTKQVRs27aEJtrCgjbQYiq 7g5WlWmA6CH/9eIFMKCue7fCPjwO9G1OorD2cgKXk4QxQLBjL8HtS1+Xsad3bEjwPd+8 g/8vlRtN4K2VDyaIBzBnpnscHUH6co0l//3c7h2qtdC7yAaIaZp8WaAuNWoE4g7zhfL+ U6GxqcjIphNg97o1u8imBbzD1dVWCHGwh0nfx84dkhBWzx67rtYcuuPjnUe256nJQJHL yjNc5GRjI5bYa58rbbkuy8izahPHXir4nuoYUL8tNJV2Vbis5ptt/PTtGal6lJl6WWgg aL2w== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Pl4taCtFHZe8oQC4px0PP3McFaT9srtUpF3ia8zOgEk=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=BgPfL9YhrF5NiDy5MAvUZre/oPPjchi/ogc1YEUcQXRfL5vnf2UeJMnjOM9EsBVAXD aXz2tnJMO3pF7yKfmSUjzHiUJtO/6jCsAYtrwHvrDZvT9m2cpNROIx7h0weL7SCiD6+3 SnZSzNRy1gLUvAYPQkHRdvdI7UIQKpLZgi8n+bV2C82TqmVpsSiGW8+wHRd0JPquA+DI PrT6k0qDCIxRxlc7yLPzC9aSUzy+hxyJPT1cmng8dxb08BMq++49CIgifRoPYzXyrhNL gLWQ8LkuLiVY6FEHP/A36Y6FaReBKk0nYnFk55Cjtoe/fOnfjJkHk3RBsR63SkFZd+lF GmuQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GpV2Zh8z; 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-7b6f10f1607si333622985a.657.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=pass header.i=@linaro.org header.s=google header.b=GpV2Zh8z; 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 1tLoKg-0004ou-7s; Thu, 12 Dec 2024 13:54:42 -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 1tLoKe-0004og-HF for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:54:40 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoKc-0006Zg-Ro for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:54:40 -0500 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-2165448243fso10863785ad.1 for ; Thu, 12 Dec 2024 10:54:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029677; x=1734634477; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Pl4taCtFHZe8oQC4px0PP3McFaT9srtUpF3ia8zOgEk=; b=GpV2Zh8zBLMzZzxT+92bpSq3tjTPhB22Hgyy3Hd60JekXUmZVGtL+rSp3tFWbQ2lnC rvNAfsI3vSJ8qzXIBVbmYN7fWjlBlJob5umxiHlbHHAkrMDX1wQV3CPVIYy6kMKAbELo DmzQucaaZFzm80tyNowTyrwVH4RjnxxpT4ThQ28OQLB8hS63L5/YD52W3DwAfNroqZOM FQcCQnI8fWxNvJiPCHSIU5mXb6MCqSLVIL8wmaXCSxDGv3UDqqHdIiIW30U0+KbU0dLK EG4+XYnnHE2JMDtSGrnDTnO1flru338E3cPqovmpNHT+GHXNLXhhdw4k73V6VXLB6rXi 0NLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029677; x=1734634477; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pl4taCtFHZe8oQC4px0PP3McFaT9srtUpF3ia8zOgEk=; b=XkV9KLCz4QftIn9XE0CSRVzqXaVwbGynghFf7taY0ENKHHaBxEtCikQdplKlrVBQeW eBUsbjQEQADJqMhvBZ/n08uM2pGUPymNnFalMU0CjL7tzmzdYFWnF0LF/Eov/VzYDKFx b+h7eXDHZc4WK+JqP43GGkcWi8xl6vwtF1Fy1PRArsAt4lebKXDSf+s9vgdk8A0CqZiE pr/F2u8U22YZJPecBSSzjJw5U3Ro6IQnrUtgQbtlEC92s/6tPwkcXIBLXcsk+f+Y61Xx pPwISDKpv6GMw0Y4xinArZqS7048Zjx+0kyoJsZ+ofpOc+zFj2sfHdSeUHk7tVrqbTUG yhDg== X-Gm-Message-State: AOJu0Yz59tpaQagzazsAdAV/LZ9dy/qe/MtOxQMyLsrNaTpNmT9Cslng GRO+l5csgDrGaYHg9TJQS8ja2Uz8bhOnhtOmGXss+dHuVkyXrlNuxFgIH0CPpMqv5zhkdD/j9Nl K X-Gm-Gg: ASbGncvzo7h81TB6cJ1VXFxo5AZawExJw7rio5w4mtnAUTaKzqHfkisU6cXKm0Q9i3I wCUEXiGp65ksP7aZUijGH5BZ/iBv3kqPZFF5pzDGBJOGfCVjmM/hWHXooAO1GFSoxoPCgeuxZHl vjhDEf39Lhb31O+SvRVXnOb6U259Lx8R8vGYk/H5N3zyZ8WrQBOzOYUlFKMEDysmkYheI9z+KNV FdAQzWGy9Uj/lywocaNt4/C3rfdPNm7ympIT6l7noPxBT4yHHDjA4urNXBOQiT4NUE3jZubiVDj HDEWfiV32kw/Ukeh2DssPyQyTdEL8JY= X-Received: by 2002:a17:902:f648:b0:216:6855:164 with SMTP id d9443c01a7336-2178aeefc23mr74126785ad.39.1734029677241; Thu, 12 Dec 2024 10:54:37 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21653b0d4f5sm69493115ad.70.2024.12.12.10.54.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:54:36 -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 04/18] accel/tcg: Declare mmap_[un]lock() in 'exec/page-protection.h' Date: Thu, 12 Dec 2024 19:53:27 +0100 Message-ID: <20241212185341.2857-5-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-pl1-x633.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 Move mmap_lock(), mmap_unlock() declarations and the WITH_MMAP_LOCK_GUARD() definition to 'exec/page-protection.h'. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- include/exec/exec-all.h | 17 ----------------- include/exec/page-protection.h | 24 ++++++++++++++++++++++++ accel/tcg/cpu-exec.c | 1 + accel/tcg/translate-all.c | 1 + accel/tcg/watchpoint.c | 1 + linux-user/flatload.c | 1 + target/arm/helper.c | 1 + 7 files changed, 29 insertions(+), 17 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 2e4c4cc4b46..b5ea607cf45 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -27,7 +27,6 @@ #endif #include "exec/mmu-access-type.h" #include "exec/translation-block.h" -#include "qemu/clang-tsa.h" /** * cpu_loop_exit_requested: @@ -520,18 +519,6 @@ static inline tb_page_addr_t get_page_addr_code(CPUArchState *env, } #if defined(CONFIG_USER_ONLY) -void TSA_NO_TSA mmap_lock(void); -void TSA_NO_TSA mmap_unlock(void); -bool have_mmap_lock(void); - -static inline void mmap_unlock_guard(void *unused) -{ - mmap_unlock(); -} - -#define WITH_MMAP_LOCK_GUARD() \ - for (int _mmap_lock_iter __attribute__((cleanup(mmap_unlock_guard))) \ - = (mmap_lock(), 0); _mmap_lock_iter == 0; _mmap_lock_iter = 1) /** * adjust_signal_pc: @@ -585,10 +572,6 @@ G_NORETURN void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, uintptr_t ra); #else -static inline void mmap_lock(void) {} -static inline void mmap_unlock(void) {} -#define WITH_MMAP_LOCK_GUARD() - void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length); void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length); diff --git a/include/exec/page-protection.h b/include/exec/page-protection.h index c43231af8b5..bae3355f62c 100644 --- a/include/exec/page-protection.h +++ b/include/exec/page-protection.h @@ -38,4 +38,28 @@ */ #define PAGE_PASSTHROUGH 0x0800 +#ifdef CONFIG_USER_ONLY + +#include "qemu/clang-tsa.h" + +void TSA_NO_TSA mmap_lock(void); +void TSA_NO_TSA mmap_unlock(void); +bool have_mmap_lock(void); + +static inline void mmap_unlock_guard(void *unused) +{ + mmap_unlock(); +} + +#define WITH_MMAP_LOCK_GUARD() \ + for (int _mmap_lock_iter __attribute__((cleanup(mmap_unlock_guard))) \ + = (mmap_lock(), 0); _mmap_lock_iter == 0; _mmap_lock_iter = 1) +#else + +static inline void mmap_lock(void) {} +static inline void mmap_unlock(void) {} +#define WITH_MMAP_LOCK_GUARD() + +#endif /* !CONFIG_USER_ONLY */ + #endif diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index c13f4a7cbbf..f82870a1e2a 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -25,6 +25,7 @@ #include "trace.h" #include "disas/disas.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "tcg/tcg.h" #include "qemu/atomic.h" #include "qemu/rcu.h" diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index a8b24be0b96..d586ac9bb1d 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -44,6 +44,7 @@ #endif #include "exec/cputlb.h" +#include "exec/page-protection.h" #include "exec/translate-all.h" #include "exec/translator.h" #include "exec/tb-flush.h" diff --git a/accel/tcg/watchpoint.c b/accel/tcg/watchpoint.c index ca641eb95cf..8923301b8b8 100644 --- a/accel/tcg/watchpoint.c +++ b/accel/tcg/watchpoint.c @@ -22,6 +22,7 @@ #include "qemu/error-report.h" #include "exec/exec-all.h" #include "exec/translate-all.h" +#include "exec/page-protection.h" #include "system/tcg.h" #include "system/replay.h" #include "hw/core/tcg-cpu-ops.h" diff --git a/linux-user/flatload.c b/linux-user/flatload.c index 0e4be5bf44a..d5cb1830ddf 100644 --- a/linux-user/flatload.c +++ b/linux-user/flatload.c @@ -34,6 +34,7 @@ #include "qemu/osdep.h" #include "qemu.h" +#include "exec/page-protection.h" #include "user-internals.h" #include "loader.h" #include "user-mmap.h" diff --git a/target/arm/helper.c b/target/arm/helper.c index 63fe4ba318b..c35cb0f6a54 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -13,6 +13,7 @@ #include "internals.h" #include "cpu-features.h" #include "exec/helper-proto.h" +#include "exec/page-protection.h" #include "qemu/main-loop.h" #include "qemu/timer.h" #include "qemu/bitops.h" From patchwork Thu Dec 12 18:53:28 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: 849744 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103424wry; Thu, 12 Dec 2024 10:56:07 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUHbzpso8CAy5ifw/l8GeqMN1WpX0g2z0SCAsBEYyuqK+Kq77jkvPv9KlmiZSgpnmj2dlEioQ==@linaro.org X-Google-Smtp-Source: AGHT+IFKnF2gNvOA+gg0jZbOamrpGhdIxzNVEPPbZJ2NVOy9bCRIfuylkJtUKdJC/sWSLmfJnU1k X-Received: by 2002:a05:622a:1348:b0:466:93b9:8356 with SMTP id d75a77b69052e-467a1856e21mr24512501cf.22.1734029767206; Thu, 12 Dec 2024 10:56:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734029767; cv=none; d=google.com; s=arc-20240605; b=iQwdUkOeIlikCrpZ7jrpmu0D/Hv+Pi0NalGda24j/muhU87G020JZT2pPhlPddhbEo OuiOMuOUEOsxqHPAf7JhuRYIaNCTNVN5ld9fMVQBa3EsQ5LcibPvpSTqx4lNYkimHmuG +U6uBjBx3H4+vdWqhhwSWpUaHBo/OZmtJN41Df3Zr/xO4ZDA/hp7z5RG3mNreeoUFCWv lzJ94RQCrmaTwmsQPSLvcqQ10h5pXjNlOjCVz2PH0+lorxini4rznxbSgfMcO4blUblz TZlpNOpqU458u1oFldCxnDRFa5aehxQgHF9PE553DtfIDZ8xvlP9qo+6VXpalW/ghfd1 V5hw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BSVRLQ/NCbTr+znZaNjcUH8IYeWT9qLO5QVBWX7wORU=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=VRNAP5XBHj/ayn6GNASCCYGkmrNQ1Fmk34dmPBYU6b2ejOVT99J3w23rYU267kmKBE Vx8FJZBa8muPRfscEUkWJd0BP0p/RoFRs2tSqLXLeNKO0DbLHeMJf6AgQvyGtx2blzVS RHFMauB6oCdWqQS0eXtJ54qnrsIc1JRwnVjMRx2ZfbJu8QQS3dMk9pnhwtC9dy8oJVki lc4GS/YXEh4D8DBgej0R00UPZdI7MpTDMtM4vy5WsQ58kfKYwBKRhkdkT2Gj2SnPTOns Xkutb1o/KS03j2VoGDF0WbdsCNLuEw6k3UGNzF68086+W7Iiq6g8OyBmbG/ZG3IBUC0c ULPg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rzVYXHRI; 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 d75a77b69052e-467893d8980si55418451cf.125.2024.12.12.10.56.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Dec 2024 10:56:07 -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=rzVYXHRI; 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 1tLoKr-0004zO-1W; Thu, 12 Dec 2024 13:54:53 -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 1tLoKp-0004yq-47 for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:54:51 -0500 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoKn-0006aA-EH for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:54:50 -0500 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-725e71a11f7so1704021b3a.1 for ; Thu, 12 Dec 2024 10:54:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029688; x=1734634488; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BSVRLQ/NCbTr+znZaNjcUH8IYeWT9qLO5QVBWX7wORU=; b=rzVYXHRIeIC9ukl6nnTzowbGMk8EFI4pOAy4sg+rlEZYoToCXkA0eB6tH85ZzWBpdm G/tZFeiEpmcFIVPrCLVRy1zUrKNpINhXGfmoxwrnseXtXn/WY54D6dHZW44S62EzvB1e s1LljfaV066ISObWtgAROik73FYtwzK4XxtRprFJKuulgmUtFfsGcKCvANKa/3kVOI9v pGZb1G+gq+2s2Q1+ig/Qo551zmYGgbTyfOO2qaM9THOl1Eca3gHjIsCSKCgLVR0JyM6Z fN1hcYIz1ZrItmm2770VRP3yRF0khHm0VR78FQyVkeS8BxZ3UwmAIXhhovbfhRNyGeZ7 X3dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029688; x=1734634488; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BSVRLQ/NCbTr+znZaNjcUH8IYeWT9qLO5QVBWX7wORU=; b=fQ2yjSoZ1TseIZfIY5KV2fHJxQ/aECy4d0QRXfZfywZHC9+aUcR7t3zczGEkgsEPdC 6yui8rkYMyElKJiRG8uTqD68b/QK1gIBIyMDzdCbVMdq2P8h+rnZddnmDwZRhSvycs6a /YD8C5tXF7cLZ4gOY1Qm2cIYtL82Hn71GtcifafzYd8hRjwcSGcYoYpl4HK9HP9Ey0dk dJovugAkwSsot59yXlePmLnpIf1b/55T48IPbRl4/1YaCYb84V5GrjwG43D40Tl52dLs z0u7PJBKuezEfTq/PVo9/6+CclaPnZkgKosT7SUYA8jHiX0l5v24rVoehD+ONWGOB89G OrqA== X-Gm-Message-State: AOJu0YyZ9J6AqRYbrTh/piw+MfBGRKzTEGX2/aZScUnvfmAgbIPukeYV YudfSmUi3Hf4Howw/hgV7hE/wc2+0koM9pCR4L/7CmsKw7PXqWmVuvpwIyZ3mpbYTVYzgOXn0lB 4 X-Gm-Gg: ASbGncskpYykMCTaShpixGyhJ75oeymU+MMD7IYkNwzs+fFOuD0XW/IHUr/2ZEUH8mK VLgZTtAhb0p5YDNLUG+i5Xm4qCj6RmaREM/Nlp+eaMu4uOw249BmkA2lpDKRmMIwmeAW73Hx628 y0Mfuf4+j974Sm2r/9y3N9CS2TBIoabpOUloDtICxaGg95cQEI5PLgstrQuL8mqAGS6JwPo+Rl9 4AJdM1dRS/OJv/iQZOXen1iF8XiyeQwxWRs782dMIeXlDoW2oLWV3akUodm3vOMbh75PHY2Kfac Ryw9SFuT0U4mW+htIWER0d0gk3Y+GB8= X-Received: by 2002:a05:6a00:4c87:b0:725:4301:ed5a with SMTP id d2e1a72fcca58-72907c19ba0mr1714891b3a.2.1734029687822; Thu, 12 Dec 2024 10:54:47 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-725ee10f928sm7499833b3a.32.2024.12.12.10.54.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:54:47 -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 05/18] accel/tcg: Use tb_page_addr_t type in page_unprotect() Date: Thu, 12 Dec 2024 19:53:28 +0100 Message-ID: <20241212185341.2857-6-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-pf1-x42a.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 Match with the page_protect() prototype, use a tb_page_addr_t argument instead of target_ulong. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- include/exec/translate-all.h | 2 +- accel/tcg/user-exec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/translate-all.h b/include/exec/translate-all.h index 85c9460c7ca..c50661a05d5 100644 --- a/include/exec/translate-all.h +++ b/include/exec/translate-all.h @@ -27,7 +27,7 @@ void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr); #ifdef CONFIG_USER_ONLY void page_protect(tb_page_addr_t page_addr); -int page_unprotect(target_ulong address, uintptr_t pc); +int page_unprotect(tb_page_addr_t address, uintptr_t pc); #endif #endif /* TRANSLATE_ALL_H */ diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 06016eb0301..4ed6dd19f30 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -696,7 +696,7 @@ void page_protect(tb_page_addr_t address) * immediately exited. (We can only return 2 if the 'pc' argument is * non-zero.) */ -int page_unprotect(target_ulong address, uintptr_t pc) +int page_unprotect(tb_page_addr_t address, uintptr_t pc) { PageFlagsNode *p; bool current_tb_invalidated; From patchwork Thu Dec 12 18:53:29 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: 849741 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103035wry; Thu, 12 Dec 2024 10:55:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWXcHGvERQMLzPCmsuQb21kn1dor4F6+5Ns0TmY0aQjkiI+z7eNVf9ntepbgwBG0zbHNQUuWA==@linaro.org X-Google-Smtp-Source: AGHT+IHAalnLKjXu13yVgvMBUw39h//qd0AB/rVbIqkoSzPBxijI49img6cR52U23zQrDEweESQp X-Received: by 2002:a05:6102:c0d:b0:4af:de38:dff7 with SMTP id ada2fe7eead31-4b25d6d83a1mr5988137.0.1734029715299; Thu, 12 Dec 2024 10:55:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734029715; cv=none; d=google.com; s=arc-20240605; b=LKIBbMrvwA2uJJMNXq4yt5JN7G8wb8+jYwK1D449tthbYLVb10mH33Xgw6FvdC3Cfi ZTtuE7Av0eS6NNO/FSpeG1hHVZTalUzxC2ajYC3oNTqs/oA+9/Dus4X0plyZIQmBNKmd btk6SpmCc8LwDTpLlAn1FRvmURzKDAbONVFBmuOvk6P9r2ZxioSw99ODsybXzxo9+p/h i1I9bCJAnKFZ9oEArEt4eGWc8J28r8Uob7W4wypELu0SfGbZSFG0VHQqKdTbZLv6nPyi NU2L1qFntMUzR2gzhCNODyKSlt04BUFmmRY+hOxjf8kjdnEPQIX5CCY8638bjVoSQJDl sYsA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wzjyx87cr+skPITGE7mdTMDmXSYN6jRMWc7DyfPZwow=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=UbylALwfWmhLy/Q5tI5gCQEWupHWyb5JLGNNrPFqSUYd8bODbQhOcsr0jiq/4bqW1B EW/zFvGgJB4UCbaDexXUZDL/+nRgLuUkzitqraWKaerED7NTnWhLqpzSvrcf9M92Pxnx Zj/mDedQqMsY5FEh0T2madp/KcAsxzApEmqEhAj2ME0n/5TAT7D9pNpW3j/miQGhDV4F sYj4sGh4zYp4mdwKNKmYqN5uIM7/vDGu7kfgshAqR2+FI/JKOG6TTRN0OicUiVjqm+Cv pf63s2oSwCiaksnrgjWW5f2kOMK+gCsVEQFhQch9yMevZNVib1dS9jB9QYE3jTVTd/Gu Q5Cw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YhHQ769n; 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 ada2fe7eead31-4aff7baeddfsi3156055137.747.2024.12.12.10.55.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Dec 2024 10:55:15 -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=YhHQ769n; 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 1tLoL2-0005Pt-1E; Thu, 12 Dec 2024 13:55:04 -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 1tLoL0-0005MR-7o for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:55:02 -0500 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoKy-0006ah-Gw for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:55:01 -0500 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-2eeb4d643a5so797642a91.3 for ; Thu, 12 Dec 2024 10:55:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029699; x=1734634499; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wzjyx87cr+skPITGE7mdTMDmXSYN6jRMWc7DyfPZwow=; b=YhHQ769nD7Xxa6qwvZJ4RlhDc+cy/LyLYfkNVNG6EC7S97dUUBXSJ38dcQdnlc3cxC ypkzCsjKUYxQrtiQyDaVJ+HDWXc1HASzTMlaT8euncCCCQq2UhuiO2V79msxhjdoyyhd 1pc8Rpqw7wzvDYsuaSufgCVAKz5eVxdJVB+mWJqb6dUOlBAbhrf/lfXRL33bhESSFQAI wX0Tr30zgJhIo1LvJX4cCrNbMW6d1ia4st2ToHUUBgRa90zl6aadMZT5RX7LXsB8OxoE woIpJ6d5jMNmsssPbsZ6Gky8fbdpjThCad3eI7a+nzomDxOyDvKtF5UKGuv2XKwMQci0 3KKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029699; x=1734634499; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wzjyx87cr+skPITGE7mdTMDmXSYN6jRMWc7DyfPZwow=; b=sQho6znuCzRm40FxnVaFdraVXkQOrBvVr6xZ5yZx0ik0I0Tm07KIWPN9V+lqK1KFwN SEDwaOkDZwDMzTVj1An7kxFBsfb64qkqie27brq36xN3WIeV9V6HHElOy7b3t7Sje+UB qaYcQp7761voKEUubJvPalUdkxkF074GkIuJH++5MaSp+tGdoII+UxCSFzM9NIPVj2QO MnrAoRet+ERYXQFylV38wGqf3P1zdZJF7fPCKjh1/2IAS370k3WIqIXjc/T8g0sDD85A GKZ8/rTKygEgoLb36ZMHWXZ4pkJX2J3GH13nkPtBaYfH7HPYf1gBpDijNAkw3scNts4v RGnQ== X-Gm-Message-State: AOJu0YxDdGgkm0Kndl0P30+6opZxCwh8hCy+LaKq6lSZV1RcAEpXD/hK PzYTqfOPTx7rYux/UapGLIQQ3Owzg7e6eMF9rWVr4BoVgMR9L11PE0OhCWyDrLOb5bwUrRfnmhP 0 X-Gm-Gg: ASbGnctUd+hFEZbIesjsd8rjwPemQCft0NW/lW9UOKsIfh0OClDRsKnr/D42Uv8JA1t okDoKfif5Htuqr5CIKP85xs9uuiv9CYywWzEgcczS9lD0V2CU7XSZrEXIrp+3unbwmYRV8pXKj0 b0D26t/Z8lhLckg9WRrq/D4GLPLaOALLK5oir8vlqKvQ3eDA0QhpNzNkh4Fu0iDgec4gBU1pSt6 XfFKUgroGUU9HA9u3KrPTlJLt1VlG5CKZdfKIVR3fiC9Dw+rUdIiu6PONka2W0U0OJKSTuESeem mHl+D7sIJeHEsB00eD8HpjoWxhXd/As= X-Received: by 2002:a17:90b:1647:b0:2ee:b2e6:4276 with SMTP id 98e67ed59e1d1-2f12802cf81mr11413213a91.27.1734029698931; Thu, 12 Dec 2024 10:54:58 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142daeed8sm1740256a91.16.2024.12.12.10.54.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:54:58 -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 06/18] accel/tcg: Move page_[un]protect() to 'user/page-protection.h' Date: Thu, 12 Dec 2024 19:53:29 +0100 Message-ID: <20241212185341.2857-7-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=philmd@linaro.org; helo=mail-pj1-x1031.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- accel/tcg/internal-target.h | 1 + include/exec/translate-all.h | 5 ----- include/user/page-protection.h | 20 ++++++++++++++++++++ accel/tcg/user-exec.c | 2 +- linux-user/elfload.c | 2 +- 5 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 include/user/page-protection.h diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h index fe109724c68..a03c05315a4 100644 --- a/accel/tcg/internal-target.h +++ b/accel/tcg/internal-target.h @@ -37,6 +37,7 @@ void page_table_config_init(void); #endif #ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" /* * For user-only, page_protect sets the page read-only. * Since most execution is already on read-only pages, and we'd need to diff --git a/include/exec/translate-all.h b/include/exec/translate-all.h index c50661a05d5..039668ff8ac 100644 --- a/include/exec/translate-all.h +++ b/include/exec/translate-all.h @@ -25,9 +25,4 @@ /* translate-all.c */ void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr); -#ifdef CONFIG_USER_ONLY -void page_protect(tb_page_addr_t page_addr); -int page_unprotect(tb_page_addr_t address, uintptr_t pc); -#endif - #endif /* TRANSLATE_ALL_H */ diff --git a/include/user/page-protection.h b/include/user/page-protection.h new file mode 100644 index 00000000000..448c7a03449 --- /dev/null +++ b/include/user/page-protection.h @@ -0,0 +1,20 @@ +/* + * QEMU page protection declarations. + * + * Copyright (c) 2003 Fabrice Bellard + * + * SPDX-License-Identifier: LGPL-2.1+ + */ +#ifndef USER_PAGE_PROTECTION_H +#define USER_PAGE_PROTECTION_H + +#ifndef CONFIG_USER_ONLY +#error Cannot include this header from system emulation +#endif + +#include "exec/translation-block.h" + +void page_protect(tb_page_addr_t page_addr); +int page_unprotect(tb_page_addr_t address, uintptr_t pc); + +#endif diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 4ed6dd19f30..636932303bb 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -25,7 +25,7 @@ #include "qemu/rcu.h" #include "exec/cpu_ldst.h" #include "qemu/main-loop.h" -#include "exec/translate-all.h" +#include "user/page-protection.h" #include "exec/page-protection.h" #include "exec/helper-proto.h" #include "qemu/atomic128.h" diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 471a384b222..521fdde0aa2 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -3918,7 +3918,7 @@ int load_elf_binary(struct linux_binprm *bprm, struct image_info *info) } #ifdef USE_ELF_CORE_DUMP -#include "exec/translate-all.h" +#include "user/page-protection.h" /* * Definitions to generate Intel SVR4-like core files. From patchwork Thu Dec 12 18:53:30 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: 849742 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103274wry; Thu, 12 Dec 2024 10:55:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVfXo5I4Uj9cxpyuq67P7t35Z8pX7kbGZgO/NND5jyYM5V/JYY9LdissouGKxcrlNOwnNKyOw==@linaro.org X-Google-Smtp-Source: AGHT+IHfWllujUvl/qXXmYotDM6sTI4THncv8FZeBW8mF3c+fJFKYNUhUsIYrVy3QwKdr6Yu5pHZ X-Received: by 2002:a05:620a:1998:b0:7b1:12f5:7af5 with SMTP id af79cd13be357-7b6f88c3a4emr199407685a.3.1734029747801; Thu, 12 Dec 2024 10:55:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734029747; cv=none; d=google.com; s=arc-20240605; b=aeoZeV6+1mmL3qBu7XxjXOFpgzX5w4UIRzJjuA2WJifDGafWbMlhUjgKoMrarCkZTG Sj1U5poTPXeqlLX7zBETsH78WhjxaqdGYRqQsvFHN5rK+moMCXUvwspMlvHf4do8i2O5 +w2CyKvWy3SNjsKDfIZjPtrzGjgHvwTWJctZ5PCaPegV6mYRtwHuXZk77BxWF8yrqsTI qM0/5LBIGonDTj265ZUkKG9sbVu7gzi8CgFnEUwcmPsbI5OGmgCdd3ebSexKW7DG1FZP hbWv4PP0hZlCeVvpIjSjpKQORZFY5DExPU/Iv4UvtMz1xlVWMtTA7Oa9sn2vLlCcZwyw 0lLw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BOxJYB9c/D0W9G+42lYaV6c+pfgO+zsH3Ru4s5NUUH0=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=UggmMnEmFdknG/okDlNp1L1yaFoJUTBI1HdR6ut84nHdvimSiBH/CiPwzr0PD3DWDj 3sO8l5qTxjV2sGqU93B4jB50avPg+z+uNwIG4T/yeuHtA/p6xZk0wbH0jVEkSDGa98r9 BwG5uJ6CPsiTb3UDG+4h06c+39938Efck5MKTR2Q1KGCy/ywHRxy9LJdvRgyvwsOReN7 42V/n0jIBN9tC/zhjvWjnxXDLoaGBYFLsd0FNs/2T68BqUXRQT6sxA1OlPAQQlNkB0It jeKP0fYuVl47/UvY9INscHLfUNjklKJG+TVl4/2+LcQxqDYxbzXJhwplXSkuRnl2lxUW Bi8A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="WjYAOu/I"; 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-7b6b5a48215si2351026385a.4.2024.12.12.10.55.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Dec 2024 10:55:47 -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="WjYAOu/I"; 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 1tLoLM-000623-QC; Thu, 12 Dec 2024 13:55:24 -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 1tLoLC-0005uW-PS for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:55:16 -0500 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoL9-0006mW-PY for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:55:13 -0500 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-725ea1e19f0so787914b3a.3 for ; Thu, 12 Dec 2024 10:55:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029710; x=1734634510; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BOxJYB9c/D0W9G+42lYaV6c+pfgO+zsH3Ru4s5NUUH0=; b=WjYAOu/IuYQ0b8Lq6mFv/fwHOIvLNWIFA5CjN0HvSkYMNT9dCF++aA/hpwP8nCsm7i pvCUyC4I2y2sEGXqXFATbbM88D8MTTbmzNcvcrAHOaknoD0Uw8hTX2+JalC1lcfAtv8L LRIg3/EerA7vCMLvEz2soWR2vVCQ1fKKUqhR7ZmE2psG7rxHA38+UKTYXJQ+s3/R2WJM JuFiF9k9Oc3Y8bBvzr1kEOc93AhhknUFRPN3THRe5jMPBBPPWumcAF6Cu4f3pTUKzDRJ C75SPMQ+ubJgc9pkvlmQQNbS/Jx4Xm4T85+fuBHdJoOD/nKpeUna2TeA8wyjYTCPTqeg dD6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029710; x=1734634510; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BOxJYB9c/D0W9G+42lYaV6c+pfgO+zsH3Ru4s5NUUH0=; b=dRIhh5VSD0j+vDsQesIfa3jNuRTUj2hhDG1Nd1CrNjrXWXHmbcKB4FEzOc38kLXiZn P35bJn935uU0hWBIOzrKhWm8PQy0xuZZPLQveYks/XSGH1opzFX77DACLD4+IPqp9Bs1 kcLYrwsGuxAMzB7kWnzU/6INpe3Oo7T7rCZbAPN0SjmgfduRy3Oq3DIgb1ChAb+nxsrJ spOSMHAQ4y0bGNDmHD8ALEYvoSOGNLq4s3dAr/eYHuXVi1v4wS6pFandn7ehJRQlQmgo rXZLoxK0jwSO/Fd7R00J3sMuz2WcwgxrSkD27onhoFZOhUl5QiuERCVSkFFoF/Cv8g1Q GTcw== X-Gm-Message-State: AOJu0YyPXViZtU3tqzVM2k0jUP8THgIgWJVaXPGLwVdb4BUHH6+oUwCH MVaVdWDwRUHj0ctWp1kXn1PaDZg0v6HW/Ea9BYVa6aPPFEzNg62YqaC9cSGcJ5cL/yZOgdED2VN x X-Gm-Gg: ASbGnctvYqgRA4/r/477wz6hwiN82y7i2+r8mRzgYnQMLzwUye0TdaHri3hvNFjEBml vfx6Ca3cLCTlxSlXdsX5hUZhhw9wVr5X/SqnlYass9L9t1dDAFmK8yZ05XhMXukeMYopY5JK/A4 6KUakn9Cy6XYtAGmpfQ9AbWmJz5MOZWyI7BpsIB/VfAylFMVNiD81HGU6auZI6aaDIRHkb5zSnB Lnw2PUOoQA87yzWbv9+kGkPHlhZI39ze0PU6kdebrr+3bV1a0H7OKe/T8sbSdJx3KU+qgIE8OSb +VRIvqVc4RxO5CE1R5ht2F1ffKdkIgM= X-Received: by 2002:a05:6a00:4404:b0:71e:e4f:3e58 with SMTP id d2e1a72fcca58-72906ac98ebmr1837097b3a.17.1734029710104; Thu, 12 Dec 2024 10:55:10 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-725e9f70dc8sm8283864b3a.64.2024.12.12.10.55.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:55:09 -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 07/18] system: Remove unnecessary 'exec/translate-all.h' include Date: Thu, 12 Dec 2024 19:53:30 +0100 Message-ID: <20241212185341.2857-8-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-pf1-x433.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 At this point "exec/translate-all.h" only declare tb_check_watchpoint(), which isn't used by any of cpu-target.c or system/physmem.c, so remove its inclusion. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- cpu-target.c | 1 - system/physmem.c | 1 - 2 files changed, 2 deletions(-) diff --git a/cpu-target.c b/cpu-target.c index 5a7c3290814..4a88f1c6db8 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -41,7 +41,6 @@ #include "exec/cpu-common.h" #include "exec/exec-all.h" #include "exec/tb-flush.h" -#include "exec/translate-all.h" #include "exec/log.h" #include "hw/core/accel-cpu.h" #include "trace/trace-root.h" diff --git a/system/physmem.c b/system/physmem.c index 93c0ff60eb4..0fa6c37c774 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -61,7 +61,6 @@ #include "qemu/rcu_queue.h" #include "qemu/main-loop.h" -#include "exec/translate-all.h" #include "system/replay.h" #include "exec/memory-internal.h" From patchwork Thu Dec 12 18:53:31 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: 849743 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103343wry; Thu, 12 Dec 2024 10:55:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWPaMSQylvE98Dlcwv55qgoOgYtgWo8TYvrji6RaLjWlx9uWDL7qTLStD1iynqSV2qtmIU/NQ==@linaro.org X-Google-Smtp-Source: AGHT+IGX3ek0rAlUPRudwGPDs+agOorXIkj29gvRk0QNk/5PVBVP97ofA9TSmI68gG6So91zCk3a X-Received: by 2002:a05:6214:2524:b0:6d8:899e:c3bf with SMTP id 6a1803df08f44-6db0f7f8fb7mr19174136d6.34.1734029756467; Thu, 12 Dec 2024 10:55:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734029756; cv=none; d=google.com; s=arc-20240605; b=OpVom7GoPXRuFndkiFYhXBYfAbJHhtz/bkuViqgRV4vP444oA0HNkScCRnuXavMNjd hnSEueNnzyXyWalIjcXnHvBrpRt4JNgplt+Mbw+F6/bhhEHxGnRJn/uCv5jQ41KU27Vj Zxj6GhlSPfwSwVCHqbDFkOwMDCVoLL3NX+34zcnFvjTj/4Z3FHKlursnhjs8f4/LFSfY o60vodUas9lpYV7aPXacrsZ1Bs30L1nugudgAVuUpiGbX+LbjKFQstLRw0iCEiDC1lOB s+6osS5ybGEz4H7qJf/+fyTsuafL9OfxalBD6zGCYAJsbdRxHOusLGcWeNVVcgVZs2Ap 8dIg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Gpa7MaWk80JbZDJF1tLVqJgKe0L0noYL27xWxmaxilM=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=H/XM75evuI+OgRshdqS57KAH1JsRYcErvzZYrvTTrxcHnCaFBJGYEgvw1VZPbi4QIp fIdBTCu4GIz5qu4u47eK3gilWWxdm//jiEeFg6lb6l6N/3OdgvC2aVkNJdAoC4H2sSbJ cBZ7uJe+XJspixLACEEKSVhY1taFEIi2iNPwAW04pntUxX/QTUvjMbDdHXQnJgE+jVkp LuX0fjyBm978sebbQ3TgZRU4DiVUXdzw/Ru+c7586eGVx4vhNwa+nbZpAQBSRtQmnz1h Rmb6SxVJVxOr+ZQtObSo+rIgcvnnYKA1CqETooyOyXLjZgfn/IvCVdhW8xmaht3mQD4l EORg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jaUeTtWd; 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 6a1803df08f44-6d8f5a5254csi163068836d6.127.2024.12.12.10.55.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Dec 2024 10:55:56 -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=jaUeTtWd; 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 1tLoLi-0006XJ-CU; Thu, 12 Dec 2024 13:55:50 -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 1tLoLP-0006BG-4U for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:55:28 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoLK-0006ni-Lf for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:55:26 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-21675fd60feso11385765ad.2 for ; Thu, 12 Dec 2024 10:55:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029721; x=1734634521; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Gpa7MaWk80JbZDJF1tLVqJgKe0L0noYL27xWxmaxilM=; b=jaUeTtWdqnpsXGeVxx3YbQMHiFyy/JVOXfeTC1hjluvcw8XrV6b99W2FNHKGnL0mIa YIXOfiQ0riTeiAZhITXy8sRYN12TxQ+TQxg0O01AOhKrPQqnhH2XunzEzGhdKKj9r6hb HSEqhtt0fFQYwNAp0i64fO0wvuw/hXzXf4rqJqAMgZm8/M1JqCouRyc4Dl2MXOOXji3X VueX/ugkmhe/lBu1keKSNCuwDkASyUPlk+lJklUsNPu3SJQxkUu+IiWXsxCzPMV8PMVt ApFiwImhDJUgEtEqzq0DN5xahWdpAacnJQtt/gzMlrg+otqCEFkexiE2JITj7CySnZMz uNjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029721; x=1734634521; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gpa7MaWk80JbZDJF1tLVqJgKe0L0noYL27xWxmaxilM=; b=m4WavLunSCP/+d2gby2UFKrn/iLA4CLaRJaK+owUVH6SEVps3EpjwFsa5AATqsKnuS kEz/Z05W1rjNMFQT4CCsPmvDlyGywJShblAKCSSpSGcMfi9suCjIDdaWq8QLWrJDSOLy E+vtyeIDSa04jzQeuoqoCqFmIPNspp2ractG+JH5KC7N12fWqRQp+r/AN6x1s6TBInO2 NcXykvyTXn8RITY+d+6q16Dyql83FzFekP4RDA3xQhOgIJcOxi3lyUSGFW+qtu7Um8wr AEa53UCoqd0/44XjorvapGQcdV94KME82UUuTuYY/goQJg0nc1M8xsWzxZ/SCJwOLDu8 sC/w== X-Gm-Message-State: AOJu0YzhAE3M9lmyjW+5Bm+SEFmtMubTky2oWB2dvH2pIwrOxCXjm/QY m2Z6lH3feL2c6qAtz2chJ0hH5/bpEB+cksPHkN6WRhhobNaNFPoPOfeKZU5VNJUzuj9nUDnmx+v D X-Gm-Gg: ASbGncsyMw89KKgnAzEzJrtQa2TAOdLpEgImPqQsUXVaFd4K9O4Z90X9dI5WmINLtmI PFCa0m930IMZa3RtZ2ibwE06z3nMHXkaDjdxg+dzbzxQThqRk+kC0VTRE510twR2fGOp+zNGlOF yBAwatS5Jpk2FIv1FRnULwCMsYo/CU0ciY1T78pPM6m56cnY8AcsqvXbBjwOIhaIaXL69+RYQaL kcRHLF64H3KjAAsSN7+0qLN7WH/+rbs8Ol49HzG0G5KkGrnItRMCFqYzr7qbbtu/IX3aofOemUk xikbMJ0h+pm+RLOkt3FyT4S/AnA9Cdk= X-Received: by 2002:a17:902:f648:b0:216:6855:164 with SMTP id d9443c01a7336-2178aeefc23mr74158235ad.39.1734029721067; Thu, 12 Dec 2024 10:55:21 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7fd1570ae4esm11093308a12.43.2024.12.12.10.55.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:55:20 -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 08/18] accel/tcg: Move 'exec/translate-all.h' -> 'tb-internal.h' Date: Thu, 12 Dec 2024 19:53:31 +0100 Message-ID: <20241212185341.2857-9-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=philmd@linaro.org; helo=mail-pl1-x634.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 "exec/translate-all.h" is only useful to TCG accelerator, so move it to accel/tcg/, after renaming it 'tb-internal.h'. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- accel/tcg/internal-target.h | 2 +- accel/tcg/tb-internal.h | 14 ++++++++++++++ include/exec/translate-all.h | 28 ---------------------------- accel/tcg/cputlb.c | 2 +- accel/tcg/tb-maint.c | 2 +- accel/tcg/translate-all.c | 2 +- accel/tcg/user-exec.c | 1 + accel/tcg/watchpoint.c | 2 +- 8 files changed, 20 insertions(+), 33 deletions(-) create mode 100644 accel/tcg/tb-internal.h delete mode 100644 include/exec/translate-all.h diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h index a03c05315a4..6f4ec0bd424 100644 --- a/accel/tcg/internal-target.h +++ b/accel/tcg/internal-target.h @@ -10,7 +10,7 @@ #define ACCEL_TCG_INTERNAL_TARGET_H #include "exec/exec-all.h" -#include "exec/translate-all.h" +#include "tb-internal.h" /* * Access to the various translations structures need to be serialised diff --git a/accel/tcg/tb-internal.h b/accel/tcg/tb-internal.h new file mode 100644 index 00000000000..8313f90fd71 --- /dev/null +++ b/accel/tcg/tb-internal.h @@ -0,0 +1,14 @@ +/* + * TranslationBlock internal declarations (target specific) + * + * Copyright (c) 2003 Fabrice Bellard + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef ACCEL_TCG_TB_INTERNAL_TARGET_H +#define ACCEL_TCG_TB_INTERNAL_TARGET_H + +void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr); + +#endif diff --git a/include/exec/translate-all.h b/include/exec/translate-all.h deleted file mode 100644 index 039668ff8ac..00000000000 --- a/include/exec/translate-all.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Translated block handling - * - * Copyright (c) 2003 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . - */ -#ifndef TRANSLATE_ALL_H -#define TRANSLATE_ALL_H - -#include "exec/exec-all.h" - - -/* translate-all.c */ -void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr); - -#endif /* TRANSLATE_ALL_H */ diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index b76a4eac4e0..451cf13e876 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -37,7 +37,7 @@ #include "exec/helper-proto-common.h" #include "qemu/atomic.h" #include "qemu/atomic128.h" -#include "exec/translate-all.h" +#include "tb-internal.h" #include "trace.h" #include "tb-hash.h" #include "internal-common.h" diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 97d2e39ec0d..bdf5a0b7d58 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -25,7 +25,7 @@ #include "exec/exec-all.h" #include "exec/page-protection.h" #include "exec/tb-flush.h" -#include "exec/translate-all.h" +#include "tb-internal.h" #include "system/tcg.h" #include "tcg/tcg.h" #include "tb-hash.h" diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index d586ac9bb1d..bad3fce0ffb 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -45,7 +45,7 @@ #include "exec/cputlb.h" #include "exec/page-protection.h" -#include "exec/translate-all.h" +#include "tb-internal.h" #include "exec/translator.h" #include "exec/tb-flush.h" #include "qemu/bitmap.h" diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 636932303bb..815a39503f3 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -33,6 +33,7 @@ #include "tcg/tcg-ldst.h" #include "internal-common.h" #include "internal-target.h" +#include "tb-internal.h" __thread uintptr_t helper_retaddr; diff --git a/accel/tcg/watchpoint.c b/accel/tcg/watchpoint.c index 8923301b8b8..e24baead562 100644 --- a/accel/tcg/watchpoint.c +++ b/accel/tcg/watchpoint.c @@ -21,8 +21,8 @@ #include "qemu/main-loop.h" #include "qemu/error-report.h" #include "exec/exec-all.h" -#include "exec/translate-all.h" #include "exec/page-protection.h" +#include "tb-internal.h" #include "system/tcg.h" #include "system/replay.h" #include "hw/core/tcg-cpu-ops.h" From patchwork Thu Dec 12 18:53:32 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: 849747 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103666wry; Thu, 12 Dec 2024 10:56:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVKcmpSi2KHg2H4jvRsmh6BjNodUZokO8e1hW85sizT7RrX3xEuxIwRabx4HAmZhg73V1FX6w==@linaro.org X-Google-Smtp-Source: AGHT+IHM6PEQV4o/0yVwA6dL7KuXuS6iit5S3NYN9PPT0gBWAIcN2jGTSNRZiPsf34w39BY264WO X-Received: by 2002:a05:620a:a108:b0:7b6:d58b:9dce with SMTP id af79cd13be357-7b6f89f3b9fmr178410785a.51.1734029805043; Thu, 12 Dec 2024 10:56:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734029805; cv=none; d=google.com; s=arc-20240605; b=Rv3nD1X4OGmX994aNmfxwGXP0IYu5u0Q/nmzwUdf2kTzptxnkU1pZ+qm4Vvg/6wdJn 9cMNZk44SufWwckih2NR/FLzjY8zV2vMeBy+kBB88klxYf3WjJ/S3dUi0qYhYaKC06QJ 7Pc2eW6PmC7YXT9TW33yWcG66ARXFZUpzqpRFVIdv6RrBVwpmW86FocfkJt3Sf6ah/3H wrjwMpETfrclJMmxn4ED5qc4hjPEfyb3W5yUYfmGWRX82lZyVbTBefTLA4/FxxVTwDIY 2H6Q0O4Yg5cb6MHsW2egNmrgvOR7xTiD3O+YX/8c/hUPGuoENdtQsyESy3JAtMLd01yi I/3g== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ziwrhan20pghgkypPdFtUixUvLCoelaBHFetr07pBgc=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=YK6/n4plW7QlqcJaCwM3I2n2i4SYqIk4HGpI6TyGN7oJ1HZfHO3xkgbQZGSdVuJJLh VZdQB25F6l4wjyjQ0jZRCNDBRHAGX9rujXyNyA6SIPuYBynGwG6OSnLEpOxNLbLItTIk /XEJ101yC/29i8ONCPbhnLSWf+S8a3Sw33fUIshTrettGlkFdfVipsf6AwVhy1QNlWI8 0765DzzqRhB2cef53DmpJpp198CJgBdzx7fIMw7JpjxejzbI7l4Bf0cAbMKDUDCCXon6 ZS/ZTqFVGYAYA3fLwgzo7MggJTWdtN2JrL8EmRQrxfR+FrkKdC5jxKi3gfra7reYrGuh vZlw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yMu1IIsN; 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 d75a77b69052e-46788430b10si52323621cf.557.2024.12.12.10.56.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Dec 2024 10:56:45 -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=yMu1IIsN; 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 1tLoLu-0006z7-2k; Thu, 12 Dec 2024 13:55:58 -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 1tLoLX-0006Tm-82 for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:55:37 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoLV-0006pf-M0 for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:55:34 -0500 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2ee51c5f000so656450a91.0 for ; Thu, 12 Dec 2024 10:55:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029732; x=1734634532; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ziwrhan20pghgkypPdFtUixUvLCoelaBHFetr07pBgc=; b=yMu1IIsN01z52n5su6yZffIIwa8ADp1YFG7Lhe6fR2inJHeJ9HElGs031pke33avwX 8zLFGZjZTy6aClwEm+EkAfkqRHRjN4wGJowPEl0iHfFC0QBdOhlvO88SR2moUojQnFf5 9slG/7Ic+SiZGfTNVhMvLsF9AWbw8ABqh+jlVXdmV8AtemCdzsgWql4VtrpQy3O+0w7i tELgQDzRkcmqYq7aowadqpByjHjHusy8fcN8+NmCWzlgXtMUaAxUVroh0NChYoEJkPsL HSitagiOWrcnvm0VSfgGExn4tIZgx4XGdOP5XVP3otXcUzOmHOBl3q+ww4msKW7hxL6i KNRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029732; x=1734634532; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ziwrhan20pghgkypPdFtUixUvLCoelaBHFetr07pBgc=; b=Zxlqb5BQsHHIdGlaiyEV/H/2MEdM48gYM2tzF9//egrJqk4h5LOOwtcNbgOiglskvS M0mf4C1diZr2P9gj8UdHmJYxaiyDAhMj7USGR/LnTjLoFw2Oe9AMUbKFnbKPiZ4fnQn6 cpM4vIxov5MT2tysi7ftn7teAdH8HaKuBEM1sPfV/YZpjtqzlupYl4aXiQZk198OzofX QpEdc10krtTOQV/jXG85X4QR87/irVlWHXRELtRu9diOgPJbeBTVry9DCFqx97LXnc9s cNTSigGFGT3Owx7kBhXpzKMfm3Kccm31qS2QmJc/CfeUuiY2WKOt8RvY/OeMJl4/uaKI xLXg== X-Gm-Message-State: AOJu0YzMEMqIzUnCWOmLfkULI8ROzuLmTf5APKrv0Kk5D9FYvBCsSYB1 bmv4bFd8w8d6y99YTr7TxLsGCm8DyW0XU2EcucQIuCg8UNVV2BPHwA6qIH0InK9C9g11QunaLUV W X-Gm-Gg: ASbGncsuMny4/AH5E5clxoNkzHqNjb0gCfqzEk2NunlqFwBzr/ZenQ0UZu/pwO33jYt ao21A4BeeAbWmgyTznMwhTzq24EL29/QTWmFLQByVjk7rPnPYVSEW5C8kvUmS8bMz25Bhb1zd7+ 3E+Cc66I09Av+F38/bpZrs7I4EfMZc/kyJCGz5tPdUvB8xNH7Sd9pccauXwsg1pLiz4KOt+GzJ6 Ojpluq6MxhZM5yAJHvrNtvF0J1cEDwdPqN/tfyQrGRlheQr3CmEb3mUPFRWdUWgzUASAHPAZMkN 4TVMD+KGP1QC5ouv5NVHsafzixeQ7qc= X-Received: by 2002:a17:90b:1a8b:b0:2ee:7538:be70 with SMTP id 98e67ed59e1d1-2f127f5502emr12265129a91.5.1734029732064; Thu, 12 Dec 2024 10:55:32 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142de347esm1620629a91.25.2024.12.12.10.55.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:55:31 -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 09/18] accel/tcg: Un-inline log_pc() Date: Thu, 12 Dec 2024 19:53:32 +0100 Message-ID: <20241212185341.2857-10-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=philmd@linaro.org; helo=mail-pj1-x1032.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 log_pc() is only used within cpu-exec.c, no need to expose it via "internal-target.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- accel/tcg/internal-target.h | 10 ---------- accel/tcg/cpu-exec.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h index 6f4ec0bd424..0437d798295 100644 --- a/accel/tcg/internal-target.h +++ b/accel/tcg/internal-target.h @@ -72,16 +72,6 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc); -/* Return the current PC from CPU, which may be cached in TB. */ -static inline vaddr log_pc(CPUState *cpu, const TranslationBlock *tb) -{ - if (tb_cflags(tb) & CF_PCREL) { - return cpu->cc->get_pc(cpu); - } else { - return tb->pc; - } -} - /** * tcg_req_mo: * @type: TCGBar diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index f82870a1e2a..396fa6f4a6b 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -21,6 +21,7 @@ #include "qemu/qemu-print.h" #include "qapi/error.h" #include "qapi/type-helpers.h" +#include "hw/core/cpu.h" #include "hw/core/tcg-cpu-ops.h" #include "trace.h" #include "disas/disas.h" @@ -434,6 +435,16 @@ const void *HELPER(lookup_tb_ptr)(CPUArchState *env) return tb->tc.ptr; } +/* Return the current PC from CPU, which may be cached in TB. */ +static vaddr log_pc(CPUState *cpu, const TranslationBlock *tb) +{ + if (tb_cflags(tb) & CF_PCREL) { + return cpu->cc->get_pc(cpu); + } else { + return tb->pc; + } +} + /* Execute a TB, and fix up the CPU state afterwards if necessary */ /* * Disable CFI checks. From patchwork Thu Dec 12 18:53:33 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: 849745 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103557wry; Thu, 12 Dec 2024 10:56:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUbhy9KwJ0QWqVxGzn7/VQumDG9cwPp21UJJRfuYvSP9dRWNckkXmPq2zui6UmUpbPEknfHHw==@linaro.org X-Google-Smtp-Source: AGHT+IHt1mfYRdOeTTPOQEoXvlvtAqeNER0bTJA/UXDOjySc6HDF1GDgx+jJG2HtJrTsLbrCQ4xf X-Received: by 2002:a05:620a:720b:b0:7b1:11ac:627a with SMTP id af79cd13be357-7b6f894245amr231157285a.25.1734029789999; Thu, 12 Dec 2024 10:56:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734029789; cv=none; d=google.com; s=arc-20240605; b=C10fKkh/48r5g7DQDjdzVo7nOKYI4zO1HvBo16wILsMSQ9e/zs5MhFeuBb+z7wQzEw glh2X5ErOxtgjSU0gLQCsV3xst1kmqrzz8vVLSj5ZYNDxYsbYWKgqkIwLjO4FNal+7zI +k4OadVoKTpknLuJPFkjmjnleTkqkkanMjXwvkqB/AGY4TMlETgoAJz2zbMRqkIInQ43 9TgY1wHFeQ1w9AHlt/QlPnAjqGCfgAnmTUNset179fA/bd3FnwNWl5qqpI52gN9QaO5Q S8zAYuCAdYd9lpxcBa77PE+KPt6ZMu0PhqBkW/RM2ydOR8LuTP9T0Riek5dWnTN4ozLx Y7Sg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=D1n7XC7xi+MDcynuS7YvQbch88e08UKjXYajcUgA5ak=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=BPnvZhQ4zO0G8HS3fOEEKpM8Gi7ifJ1SSOz5BkdnVL9r2zBvCFrfaFD3HmB18foHGE yOdXTO1zV5iawD6b0/9I6xK6LXux2oWf7xs4naZL0pLr59eOfLFLPLpX5a2WwNNKuAVu +chfxyoDCYv3WXjGVbW9ezytXUqzyK24TO13bZfiercSV3fMDPxuC+4+vXqfpZZl3q7Y yy4BtyTTj74e+h2NZwSkn07LbXnx6gIyMNZxKYWvRT2L8IlfE0h6Z4Z4AwK36gjYYsTN +ZlL/6+NeZZkYHiq0jprh1GVOI83ThNFoYEx1ZZbCZTIenyslOJICT5jpUxVFF3AP5oT jHlA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CNSjHlhS; 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-7b6f084a73esi409397285a.293.2024.12.12.10.56.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Dec 2024 10:56:29 -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=CNSjHlhS; 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 1tLoLu-0006yS-2q; Thu, 12 Dec 2024 13:55:59 -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 1tLoLl-0006jt-0K for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:55:51 -0500 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoLh-0006qD-L3 for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:55:47 -0500 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-2eed82ca5b4so795133a91.2 for ; Thu, 12 Dec 2024 10:55:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029743; x=1734634543; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=D1n7XC7xi+MDcynuS7YvQbch88e08UKjXYajcUgA5ak=; b=CNSjHlhSyr9lqq7Z+7AMERGjgaSDBMhB++VW/nid6vN4e8UvDEwMx38+9rJaq9AFTQ yKDqgBkB+/MvYiJSDjCCHuIQfMA9wbFTOmi7b2kE1NsNbUKTDw33ie812IvhBU1LewCP kgLg5j4TC8aGffPmEDN2eijHTZL4hrwMyMmH0GlZgyRv1OB3O3zQ1l69xYa0PMgE98le DEjjLL5nrBDVxM4DZEk24jYh3Hu/FzGV937NKscXgYU9QbpnImwp3YETC0JyLD97w59D QQHQAcCgz5COrbx+v0trhJf2Y9Ry1UepTY1N3R/tYugE3OZHFRz1edkr0KHZ7gsmV32g QmQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029743; x=1734634543; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D1n7XC7xi+MDcynuS7YvQbch88e08UKjXYajcUgA5ak=; b=Pp8ljpLbWZlel/gBpRrMCLN8vCnthVV8GaTXZzMae1kJImGy3DDbgsep5zcqQvduHR TZLx3Ur2JGnVpq+ZnqsLSxKOtUMLm0nLnKHSIiZhcM1A+wvdBhQ/T0PbTTpL1xrzk4FU VV3UcIl4Brqi/r8N/mhE/dXxtrr38nEG3FRHGkREE7RyfxY/G4MK1xw+epZQ6TLRyKTk xtpFBAt7GuWVsIX91T1Qy9ZYh0OV+QfcEwxAldlZN6N5ztfhMnKpwilWv3ADJoLs0Ifb wX1dqT6uiOUtdu7P6o8rz9QtG7gLgT8HwRsNi7v81e7AuMA08ShHOCoD4gvaKI/Jzdk4 esww== X-Gm-Message-State: AOJu0Yw8HxukOYu5yxLUCffEU8jLGfrQWg6T5BIIykRU1kqO8gxl5anD zqTLVLXGW84/F7ygE1NmQr0aiQqpjyMte8nOS2Fz4/TnGr+hB048isXGqWN8ch8vZBycNt+/xue q X-Gm-Gg: ASbGncuQYEfOQLfEbYlKkCGfpVL1htrU3JAqHPAExMOKPln2gPCqVsSy6JLfqHCSzsH ylBuQ4ZdK89dCfjCOhEuZH/749YChSu5uWscLNwjz4ymq7HPjGv9nDPgRBycnTHYODSs6EuUiG1 2toOxga8FmQy4nWSJZgr8E/hzQ4kdkAOqciJKTiylGLdhcW1VG0CzGVBrxnOZqPVrZByeU0UdON Y/Jer2kQZP4dyl3R69qLGFE8uiG8SfrQTq6wrLmiWE1hiXbaauvgz0MyFqefclnudD5jh/UinDj YZciAy/5mpPnqaSbAGgidOmGnvIFMnw= X-Received: by 2002:a17:90b:2e4e:b0:2ea:8d1e:a85f with SMTP id 98e67ed59e1d1-2f127fd7c19mr14135244a91.17.1734029743673; Thu, 12 Dec 2024 10:55:43 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142de360fsm1612797a91.27.2024.12.12.10.55.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:55:43 -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 10/18] accel/tcg: Move TranslationBlock declarations to 'tb-internal.h' Date: Thu, 12 Dec 2024 19:53:33 +0100 Message-ID: <20241212185341.2857-11-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=philmd@linaro.org; helo=mail-pj1-x102a.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 Move declarations related to TranslationBlock out of the generic "internal-target.h" to "tb-internal.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- accel/tcg/internal-target.h | 32 ------------------------------ accel/tcg/tb-internal.h | 39 +++++++++++++++++++++++++++++++++++++ accel/tcg/cpu-exec.c | 1 + accel/tcg/cputlb.c | 1 + accel/tcg/tb-maint.c | 1 + accel/tcg/translate-all.c | 1 + accel/tcg/translator.c | 1 + 7 files changed, 44 insertions(+), 32 deletions(-) diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h index 0437d798295..1cfa318dc6c 100644 --- a/accel/tcg/internal-target.h +++ b/accel/tcg/internal-target.h @@ -36,42 +36,10 @@ static inline void page_table_config_init(void) { } void page_table_config_init(void); #endif -#ifdef CONFIG_USER_ONLY -#include "user/page-protection.h" -/* - * For user-only, page_protect sets the page read-only. - * Since most execution is already on read-only pages, and we'd need to - * account for other TBs on the same page, defer undoing any page protection - * until we receive the write fault. - */ -static inline void tb_lock_page0(tb_page_addr_t p0) -{ - page_protect(p0); -} - -static inline void tb_lock_page1(tb_page_addr_t p0, tb_page_addr_t p1) -{ - page_protect(p1); -} - -static inline void tb_unlock_page1(tb_page_addr_t p0, tb_page_addr_t p1) { } -static inline void tb_unlock_pages(TranslationBlock *tb) { } -#else -void tb_lock_page0(tb_page_addr_t); -void tb_lock_page1(tb_page_addr_t, tb_page_addr_t); -void tb_unlock_page1(tb_page_addr_t, tb_page_addr_t); -void tb_unlock_pages(TranslationBlock *); -#endif - #ifdef CONFIG_SOFTMMU -void tb_invalidate_phys_range_fast(ram_addr_t ram_addr, - unsigned size, - uintptr_t retaddr); G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); #endif /* CONFIG_SOFTMMU */ -bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc); - /** * tcg_req_mo: * @type: TCGBar diff --git a/accel/tcg/tb-internal.h b/accel/tcg/tb-internal.h index 8313f90fd71..90be61f296a 100644 --- a/accel/tcg/tb-internal.h +++ b/accel/tcg/tb-internal.h @@ -9,6 +9,45 @@ #ifndef ACCEL_TCG_TB_INTERNAL_TARGET_H #define ACCEL_TCG_TB_INTERNAL_TARGET_H +#include "exec/cpu-all.h" +#include "exec/exec-all.h" +#include "exec/translation-block.h" + +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +/* + * For user-only, page_protect sets the page read-only. + * Since most execution is already on read-only pages, and we'd need to + * account for other TBs on the same page, defer undoing any page protection + * until we receive the write fault. + */ +static inline void tb_lock_page0(tb_page_addr_t p0) +{ + page_protect(p0); +} + +static inline void tb_lock_page1(tb_page_addr_t p0, tb_page_addr_t p1) +{ + page_protect(p1); +} + +static inline void tb_unlock_page1(tb_page_addr_t p0, tb_page_addr_t p1) { } +static inline void tb_unlock_pages(TranslationBlock *tb) { } +#else +void tb_lock_page0(tb_page_addr_t); +void tb_lock_page1(tb_page_addr_t, tb_page_addr_t); +void tb_unlock_page1(tb_page_addr_t, tb_page_addr_t); +void tb_unlock_pages(TranslationBlock *); +#endif + +#ifdef CONFIG_SOFTMMU +void tb_invalidate_phys_range_fast(ram_addr_t ram_addr, + unsigned size, + uintptr_t retaddr); +#endif /* CONFIG_SOFTMMU */ + +bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc); + void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr); #endif diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 396fa6f4a6b..e9eaab223f9 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -41,6 +41,7 @@ #include "tb-jmp-cache.h" #include "tb-hash.h" #include "tb-context.h" +#include "tb-internal.h" #include "internal-common.h" #include "internal-target.h" diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 451cf13e876..4f6eebd90ec 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -40,6 +40,7 @@ #include "tb-internal.h" #include "trace.h" #include "tb-hash.h" +#include "tb-internal.h" #include "internal-common.h" #include "internal-target.h" #ifdef CONFIG_PLUGIN diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index bdf5a0b7d58..8e272cf790f 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -30,6 +30,7 @@ #include "tcg/tcg.h" #include "tb-hash.h" #include "tb-context.h" +#include "tb-internal.h" #include "internal-common.h" #include "internal-target.h" diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index bad3fce0ffb..572a8a87972 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -62,6 +62,7 @@ #include "tb-jmp-cache.h" #include "tb-hash.h" #include "tb-context.h" +#include "tb-internal.h" #include "internal-common.h" #include "internal-target.h" #include "tcg/perf.h" diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index ff5dabc9014..ce5eae4349e 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -19,6 +19,7 @@ #include "tcg/tcg-op-common.h" #include "internal-target.h" #include "disas/disas.h" +#include "tb-internal.h" static void set_can_do_io(DisasContextBase *db, bool val) { From patchwork Thu Dec 12 18:53:34 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: 849749 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103679wry; Thu, 12 Dec 2024 10:56:46 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUT5XNTj90wrTABcSLxIs9jH5Y59lheb/E6S87VYjIaVDFZklLsEbKGeaeodIN0jx6UKkpQOw==@linaro.org X-Google-Smtp-Source: AGHT+IHgjT+R0JCDiql1HMU6FYk00ifEagkIma0bJTn3tGE2+lVRzAUSW0k1yK78/fObTJBI8bGZ X-Received: by 2002:a05:6214:2023:b0:6d9:353b:a8e9 with SMTP id 6a1803df08f44-6db0f7332ddmr26020276d6.15.1734029806528; Thu, 12 Dec 2024 10:56:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734029806; cv=none; d=google.com; s=arc-20240605; b=WXBzzWHklhkRxTInLl0ytYNXnOF6TBKbzHvIfXZJeWpevSeyCgyvJV9ApxLFP8p6IZ KwKYyIv9+eLyzJqm+XJnvhSY/sgSkT+RSG9iogol85+21s5QsYsJ7FIR/y/MUD/RtXPB TK7P8IyhULjoVVIKS9PFcllQhNUAvi4k2uFgmC4v/uk8hMQ/qD2VlH35gY90c1SW50wM yu0FleM5vvPMDJ/J+/VPxuf+I2xyBD7id0R7aoHhf2yvFiOlU67k2RASfTG1w0XPhghC JXhO1vpie7qA1SuHS8nYx22b12IghXUCIFNEYkMxEoT4mdJgJKidYnK52FxUEL8rd8BH Xo4w== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CdnrZGUpPexZaRp1gyb0f+RzXNxhb5NfrEmgTu8F7Mg=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=V2qPIoODKd39Fj40LUJNXL+Sa6KX+hNy6lwXEleW+X7uVvHsagWOxGcaB9E4UG4Tyk 9yfZwPR/L02zkEeiWsLP46QtBqg4nLxuFqSO6Pdaod/Uiur1Xzvd41X5zE3QCE3jge7J O/so/YcZGNHTeGyVUHTZc7K2QjNxcYP12J0tKRSEzy0yK+L2P0CgekUfgZ1YhRn8Nksm j4CBF+BAO/o4d0MD9AXYjIJyMkBgxNi5+sH+GLG4NRkn+LmjQQtjsTlq+eWbUww60M25 gB1+kwsZ14P/f0yXoDwyru3GYOSI+qyo2tLxwzeoqlCykH11QFRyOqV8jupEuI8cQRSL o1LQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v5C1JNiD; 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 6a1803df08f44-6d8ea670617si168568996d6.552.2024.12.12.10.56.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Dec 2024 10:56:46 -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=v5C1JNiD; 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 1tLoM5-0008P3-OX; Thu, 12 Dec 2024 13:56:09 -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 1tLoLv-00079e-46 for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:55:59 -0500 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoLt-0006rB-Fj for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:55:58 -0500 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-725ef0397aeso855298b3a.2 for ; Thu, 12 Dec 2024 10:55:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029755; x=1734634555; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CdnrZGUpPexZaRp1gyb0f+RzXNxhb5NfrEmgTu8F7Mg=; b=v5C1JNiDlgdabxT/Q8X/VnkKqTRST9HJlyKDUO4l+gv3cwsDdWH38AR46P3aJFhcbj 4rODYm6SACHnNywqpAbwfwu9R6Ds3is3NJ9tLyd1tDXw1/r2oh/4RPY6R5gadE3TFD1q FqXB4Nd+wKVyvC7+GCPN2bJwyJi8862mJocTnuE7evc01GAgR8wTHvsiPP5HQsqZoOGe 64hnsewWzkwkbfLKXYziy4mrd/z7yNOFV6xHnxQ8TfPk2tRmURh2vssOfN90zzlwVAS4 6mmXXvZ7ttrXZ8V1c7rY4kIa0f+hfINdSEGFQrn/iuZxjywoZ34hojgZMKe/ITbotLqz 5yrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029755; x=1734634555; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CdnrZGUpPexZaRp1gyb0f+RzXNxhb5NfrEmgTu8F7Mg=; b=GAR0b9rnWnJ0c+dqCfH6+Qm0h2WHvtvXl21Wc4KhROHDf7iIes4zYO5AEf0s7Uf5t0 n7EYShNe5OlMd8UTSR6KhNfiM4V1eGfT1xMdxpIET7BhdAsL9SfLKhSh4zX5JCQDe2RJ J2HgaIg3/6sVBtoEKgk4DFRzJdyhqFkr2J1o8pE6wvVwsIqdbS8u4f/9DBtEBF0amYCl jgQAZnxKyfLVcP8YqfYPY+6Cqe/xJ3xabSPc7tJSFekzrrtg4iFlcZEZDGEV0BogaMjK gm61E+tNQI+tYIKBpijoJlkmtZk1AHsIZS5/POdqj/tLJkXbrkz4Zy4Vo+DDDA1HAZer 5Y9A== X-Gm-Message-State: AOJu0YyPktDfhA3r6yFIk5RBNVFT5CVOANm+1isn2W4+vKpL4mRmUR4x /OopkDx9lvk6YMHccu/4RUNM5etYFIyLs0K69QxM9TE7gLrYx+5vT5gRFSzmKJk3Zj4//Dy1WmV M X-Gm-Gg: ASbGncsQ251N8iCWcQoqyL0fjloZg82cyFQhvozVpjHAuB0jyWkUtwE+aAHHDuyex5X CEsRkEhmF8vUgsjklcQTQ6fLu6I3D9oayOaqCIdLswN4I7/XpGwbOWSJU+jXbrfcwxEaZ39Q7N6 sXSBqI5Aw9Jh+NQO0QEtNLsruNZOmUTMoqGwu81Jb5tL0QjERuLq5Kte7u4ARsJvWiFbe9e5+4B azAhe4QqO+WJZtckhcrZSRCUcBPOxcJ6l39ZcJW3i5vf7mHYoOmOg8Qb6p+dM3lu4a0wYvqI+tG Vo8SlR8Z5kgVq401blDJQ1nwalM1bXA= X-Received: by 2002:a05:6a20:728f:b0:1e1:ab63:c5e8 with SMTP id adf61e73a8af0-1e1dab643edmr1888496637.26.1734029754866; Thu, 12 Dec 2024 10:55:54 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-725da7e0181sm9392168b3a.134.2024.12.12.10.55.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:55:54 -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 11/18] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (1/4) Date: Thu, 12 Dec 2024 19:53:34 +0100 Message-ID: <20241212185341.2857-12-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-pf1-x433.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 Move declarations related to page protection under user emulation from "exec/cpu-all.h" to "user/page-protection.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- include/exec/cpu-all.h | 5 ----- include/user/page-protection.h | 8 ++++++++ bsd-user/main.c | 1 + bsd-user/mmap.c | 1 + linux-user/main.c | 1 + linux-user/mmap.c | 1 + linux-user/syscall.c | 1 + 7 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 1c8e0446d06..3d97323893b 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -127,11 +127,6 @@ extern const TargetPageBits target_page; #define TARGET_PAGE_ALIGN(addr) ROUND_UP((addr), TARGET_PAGE_SIZE) #if defined(CONFIG_USER_ONLY) -void page_dump(FILE *f); - -typedef int (*walk_memory_regions_fn)(void *, target_ulong, - target_ulong, unsigned long); -int walk_memory_regions(void *, walk_memory_regions_fn); int page_get_flags(target_ulong address); diff --git a/include/user/page-protection.h b/include/user/page-protection.h index 448c7a03449..ea11cf9e328 100644 --- a/include/user/page-protection.h +++ b/include/user/page-protection.h @@ -12,9 +12,17 @@ #error Cannot include this header from system emulation #endif +#include "cpu-param.h" +#include "exec/target_long.h" #include "exec/translation-block.h" void page_protect(tb_page_addr_t page_addr); int page_unprotect(tb_page_addr_t address, uintptr_t pc); +typedef int (*walk_memory_regions_fn)(void *, target_ulong, + target_ulong, unsigned long); + +int walk_memory_regions(void *, walk_memory_regions_fn); + +void page_dump(FILE *f); #endif diff --git a/bsd-user/main.c b/bsd-user/main.c index 61ca73c4781..0a5bc578365 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -38,6 +38,7 @@ #include "qemu/plugin.h" #include "exec/exec-all.h" #include "user/guest-base.h" +#include "user/page-protection.h" #include "tcg/startup.h" #include "qemu/timer.h" #include "qemu/envlist.h" diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c index 775e905960b..346f2cefd32 100644 --- a/bsd-user/mmap.c +++ b/bsd-user/mmap.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" #include "exec/page-protection.h" +#include "user/page-protection.h" #include "qemu.h" diff --git a/linux-user/main.c b/linux-user/main.c index b09af8d4365..06037304cb1 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -39,6 +39,7 @@ #include "qemu/module.h" #include "qemu/plugin.h" #include "user/guest-base.h" +#include "user/page-protection.h" #include "exec/exec-all.h" #include "exec/gdbstub.h" #include "gdbstub/user.h" diff --git a/linux-user/mmap.c b/linux-user/mmap.c index e4bf5d5f39c..4e0444b4cbc 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -22,6 +22,7 @@ #include "exec/log.h" #include "exec/page-protection.h" #include "qemu.h" +#include "user/page-protection.h" #include "user-internals.h" #include "user-mmap.h" #include "target_mman.h" diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1ce4c79784f..c54b199b6d3 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -135,6 +135,7 @@ #include "signal-common.h" #include "loader.h" #include "user-mmap.h" +#include "user/page-protection.h" #include "user/safe-syscall.h" #include "qemu/guest-random.h" #include "qemu/selfmap.h" From patchwork Thu Dec 12 18:53:35 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: 849746 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103564wry; Thu, 12 Dec 2024 10:56:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWJac43nwzIWxAIKmbwSRpwdWEhbzxdqgSsTxiV6ukLb14yaEUijppWii6bKSy/UcP0pEfhWA==@linaro.org X-Google-Smtp-Source: AGHT+IFNEqkF6Mg6FMeQSbeh30qcVL1K8iAe0O93uPh1oHIZOCawLxFAaOXWtS+u/XEGAcxnVRkg X-Received: by 2002:ac8:7d82:0:b0:467:61a5:1a85 with SMTP id d75a77b69052e-467a163bfddmr25945691cf.30.1734029790554; Thu, 12 Dec 2024 10:56:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734029790; cv=none; d=google.com; s=arc-20240605; b=aHMefSO+eumjQbPp/XRgnkAIGo9r+htZ8H3QPoWePSWfZWkzi0zoIWnpOC+zpCKC+f rG0jwnow4VaIeRjKLCqOwFkzv4gqHKy0pfV4DeBOba0czl87S94i10uZ4Pwjn70ca2hR bM4wSe+iCMWQqIqyGcNwtgToUoXaD3cnRgxu3lArWxSp31om3VGFlGNZ6rZb2bMwB3k9 cIz1Jgaw/3VXdOvU+00wKQ0mF2YsGDLAmEITcSfz1nYBa+HM+EczCfrS/TsyGIm3bNRF yn/gcO0oySOkwoIWVGU+NS6VWJhNQty6Q7TjieYwkwDU+RhQ5XHyg8rGSmMmru6U9WTy zlLA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rY7v3gnKlkSHCmEQoYs8O0U0xsJ45+WLP88dw8tMIX4=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=KIJa99BNwEfC6OwKY58mP9U1zP77Q0ukELE3zzVitwiFh13jrXufS5Mp+jd1+GqeBb ait7gt+3niC0i1V2ASmn8cPF5HuiloEQY1BwijqU86GD2sTZpm5GDIhh01NQLtEb7Hdt 7rZQFMydudblnpanpSDA9XfoVXbZBclTPOsidKi4/0zpy/zkF4UmLSD9HZdUPGy3xcLW K2qeL4+ijSCfM2K7WJHdhTfjwZ1Jkf7hAPF6lA5RWlQGKvKdGBSFJc0Rec4bgxVB6Ix1 wMIWrKYcygPkdZ+QmNptcTc7S+tn2bNxWfocHE8juSMZOEmIYiZV+AEUnijAoEwe7TMI vzXQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=twmqpiSx; 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 d75a77b69052e-46786f0241dsi60284671cf.419.2024.12.12.10.56.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Dec 2024 10:56:30 -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=twmqpiSx; 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 1tLoMB-0000VW-VP; Thu, 12 Dec 2024 13:56:16 -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 1tLoM9-0000II-KU for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:56:13 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoM4-0006rv-Nt for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:56:13 -0500 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-7fd51285746so645565a12.3 for ; Thu, 12 Dec 2024 10:56:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029766; x=1734634566; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rY7v3gnKlkSHCmEQoYs8O0U0xsJ45+WLP88dw8tMIX4=; b=twmqpiSxb3y7EY05D7DASlTZDg9F+7CguE6NRWWKjGeX4DbBBwyPM5rL8u2Dtgkf+r GyZ8PEPvfdLlzolDSssPGfxCwXBqgi+BqS1dfrRVozfPksdwQZ+dMo5FO66IDRaYO0Ij ZTpXJxLZFFjtF4LYSuzqtlWmocNOTSeEh+SaP/XZrnlZCJ1m2GqTPxkS5PjDti4VZR3V xvE+bWLRWy7atriEmyUBpeq8KxjAoY1MbZ3qpgFlWt5HLSDT9C+TZIfvHXfXJBd4+HXK 0xGqkXSmNoBtwu5iEF7Njns6FNwwtvM/vtETEbueHGuM5+QuywdExGIs7CTFrMI0NUmo 6Jew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029766; x=1734634566; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rY7v3gnKlkSHCmEQoYs8O0U0xsJ45+WLP88dw8tMIX4=; b=dWxYonaF9SFy3a4cjA72BkopyVSCJdAWBxAW9pMcXKwqU5CT8bzmM8XSspo8sQJIwx xrf9T1PPLqB0C/EwFT3DJ2PokdTMF8mnlRZY+MzZjSDwf+jjtRRlOHzkNoYYPu4gN4vj aZp6Pz4+48U8WD93A2XqbLdt0Ux1mEvmcTGVXMlxzgzJcmDALMNbvDKQxfzAOir6oakn Tx8xxzvipNIwEdRVgiupd5RPe/J9IrCRxzA3EyG6CLWMeQF3hdLFkFL0NOh69faXdTa4 sTZjfTXdAi9f5IJ5P8AodEdSposCeRJMLmXipqTNxFGS/vOe8ZRV+BaGhalQiu56HRei qI6g== X-Gm-Message-State: AOJu0YyC31d1YqEXNwzRgir9yLko5QKZLmokzbO7C+BqKgeR99i0EeLm UrwcQPyDF18MbFb0QXwUJiFEQIzk+6mEO2VjDs9fqbMq7qOeIKm2e3oBHoPOQfKPQoAxnC+OR5/ T X-Gm-Gg: ASbGnctptcZ+eDXzhmbACFR2T+AebhRIgyi3ME3OIdTzW7TrqhyFnS5MHVhKWmee/Qh kWWztJbz2pbocrLmbRoxQIZCq2mL+5SBNCgdriVfjMjzNFWkD337eQCEMmdDG+Y8pLZGKIY86gb yKq8C5K4RyMCJ2K9fxEfv4a8xP1+8VGETrVOJvLSSRuUFRV4LdPWWMaaPPQtZoIuTQzOJx63gkH IdXkGndfajex1cpu/wcZfOWXj2Fe1altVi4SrlSTZrJcjTcku3Mo2kmb+hCzQZmVPlvnAqs+lav HhliL+YS+jjbIvALABxjRlpik6z5rYE= X-Received: by 2002:a05:6a21:390:b0:1e0:d2f5:6eca with SMTP id adf61e73a8af0-1e1dac0ef09mr1813449637.46.1734029766200; Thu, 12 Dec 2024 10:56:06 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-725e62bb302sm8328220b3a.139.2024.12.12.10.56.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:56:05 -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 12/18] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (2/4) Date: Thu, 12 Dec 2024 19:53:35 +0100 Message-ID: <20241212185341.2857-13-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=philmd@linaro.org; helo=mail-pg1-x532.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 Move declarations related to page protection under user emulation from "exec/cpu-all.h" to "user/page-protection.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- bsd-user/bsd-mem.h | 1 + include/exec/cpu-all.h | 55 -------------------------------- include/user/page-protection.h | 57 ++++++++++++++++++++++++++++++++++ target/arm/tcg/mte_helper.c | 3 ++ 4 files changed, 61 insertions(+), 55 deletions(-) diff --git a/bsd-user/bsd-mem.h b/bsd-user/bsd-mem.h index eef6b222d9e..f5ec0de24ca 100644 --- a/bsd-user/bsd-mem.h +++ b/bsd-user/bsd-mem.h @@ -57,6 +57,7 @@ #include "qemu-bsd.h" #include "exec/page-protection.h" +#include "user/page-protection.h" extern struct bsd_shm_regions bsd_shm_regions[]; extern abi_ulong target_brk; diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 3d97323893b..86cd40020c9 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -130,21 +130,6 @@ extern const TargetPageBits target_page; int page_get_flags(target_ulong address); -/** - * page_set_flags: - * @start: first byte of range - * @last: last byte of range - * @flags: flags to set - * Context: holding mmap lock - * - * Modify the flags of a page and invalidate the code if necessary. - * The flag PAGE_WRITE_ORG is positioned automatically depending - * on PAGE_WRITE. The mmap_lock should already be held. - */ -void page_set_flags(target_ulong start, target_ulong last, int flags); - -void page_reset_target_data(target_ulong start, target_ulong last); - /** * page_check_range * @start: first byte of range @@ -157,46 +142,6 @@ void page_reset_target_data(target_ulong start, target_ulong last); */ bool page_check_range(target_ulong start, target_ulong last, int flags); -/** - * page_check_range_empty: - * @start: first byte of range - * @last: last byte of range - * Context: holding mmap lock - * - * Return true if the entire range [@start, @last] is unmapped. - * The memory lock must be held so that the caller will can ensure - * the result stays true until a new mapping can be installed. - */ -bool page_check_range_empty(target_ulong start, target_ulong last); - -/** - * page_find_range_empty - * @min: first byte of search range - * @max: last byte of search range - * @len: size of the hole required - * @align: alignment of the hole required (power of 2) - * - * If there is a range [x, x+@len) within [@min, @max] such that - * x % @align == 0, then return x. Otherwise return -1. - * The memory lock must be held, as the caller will want to ensure - * the returned range stays empty until a new mapping can be installed. - */ -target_ulong page_find_range_empty(target_ulong min, target_ulong max, - target_ulong len, target_ulong align); - -/** - * page_get_target_data(address) - * @address: guest virtual address - * - * Return TARGET_PAGE_DATA_SIZE bytes of out-of-band data to associate - * with the guest page at @address, allocating it if necessary. The - * caller should already have verified that the address is valid. - * - * The memory will be freed when the guest page is deallocated, - * e.g. with the munmap system call. - */ -void *page_get_target_data(target_ulong address) - __attribute__((returns_nonnull)); #endif CPUArchState *cpu_copy(CPUArchState *env); diff --git a/include/user/page-protection.h b/include/user/page-protection.h index ea11cf9e328..d21fab1aaf9 100644 --- a/include/user/page-protection.h +++ b/include/user/page-protection.h @@ -18,6 +18,63 @@ void page_protect(tb_page_addr_t page_addr); int page_unprotect(tb_page_addr_t address, uintptr_t pc); + +/** + * page_set_flags: + * @start: first byte of range + * @last: last byte of range + * @flags: flags to set + * Context: holding mmap lock + * + * Modify the flags of a page and invalidate the code if necessary. + * The flag PAGE_WRITE_ORG is positioned automatically depending + * on PAGE_WRITE. The mmap_lock should already be held. + */ +void page_set_flags(target_ulong start, target_ulong last, int flags); + +void page_reset_target_data(target_ulong start, target_ulong last); + +/** + * page_check_range_empty: + * @start: first byte of range + * @last: last byte of range + * Context: holding mmap lock + * + * Return true if the entire range [@start, @last] is unmapped. + * The memory lock must be held so that the caller will can ensure + * the result stays true until a new mapping can be installed. + */ +bool page_check_range_empty(target_ulong start, target_ulong last); + +/** + * page_find_range_empty + * @min: first byte of search range + * @max: last byte of search range + * @len: size of the hole required + * @align: alignment of the hole required (power of 2) + * + * If there is a range [x, x+@len) within [@min, @max] such that + * x % @align == 0, then return x. Otherwise return -1. + * The memory lock must be held, as the caller will want to ensure + * the returned range stays empty until a new mapping can be installed. + */ +target_ulong page_find_range_empty(target_ulong min, target_ulong max, + target_ulong len, target_ulong align); + +/** + * page_get_target_data(address) + * @address: guest virtual address + * + * Return TARGET_PAGE_DATA_SIZE bytes of out-of-band data to associate + * with the guest page at @address, allocating it if necessary. The + * caller should already have verified that the address is valid. + * + * The memory will be freed when the guest page is deallocated, + * e.g. with the munmap system call. + */ +__attribute__((returns_nonnull)) +void *page_get_target_data(target_ulong address); + typedef int (*walk_memory_regions_fn)(void *, target_ulong, target_ulong, unsigned long); diff --git a/target/arm/tcg/mte_helper.c b/target/arm/tcg/mte_helper.c index 9d2ba287eeb..ae037dc9143 100644 --- a/target/arm/tcg/mte_helper.c +++ b/target/arm/tcg/mte_helper.c @@ -23,6 +23,9 @@ #include "internals.h" #include "exec/exec-all.h" #include "exec/page-protection.h" +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif #include "exec/ram_addr.h" #include "exec/cpu_ldst.h" #include "exec/helper-proto.h" From patchwork Thu Dec 12 18:53:36 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: 849748 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103671wry; Thu, 12 Dec 2024 10:56:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXUFEDQVDvlTSG3NfduM9POMW7YuL8ibGojoUxgIDPXZdYVZAMy5K+Pucb+93M0dAqzaU/4hw==@linaro.org X-Google-Smtp-Source: AGHT+IFvEkdY3qXy0Mx3MwjwV9AFB/oO/Uyj0OVHBH+mipHOXUR8Yvz1DHvzzc+uC6SXk/iMkFKv X-Received: by 2002:a05:620a:4893:b0:7b6:cd90:c0e1 with SMTP id af79cd13be357-7b6f8979ed9mr265851785a.37.1734029805273; Thu, 12 Dec 2024 10:56:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734029805; cv=none; d=google.com; s=arc-20240605; b=H/bEqAwO5FJisPKWxu6M/A4yDRGLhtIiR5wvShptIi3WK/mxc5/jMoEAyacmeYyyYM w9DxH0DtSa5mysdufTId1snxpzKhXkPhAMioeXJAPcj2FnAd1GYUs+ATuggsGFO+G6c1 VKKXPhoYlEIyJNez7tatL4dbtT76DTCy2LcxYXpFI++VuYWpqBlBeCRdX77tSz2d2kCg AB3abCWMEAngsST4wvL3S4ctPZ6VmQeLXOG9Rqls7ZKQGvDgLsURbYNK82U+vfhgsNlV QXjnNvPs1AIIwriYJJO1iqArqgN3ENebMa6TLOSGGPgW/L8bTckcEBY5UNdYvRmuV7fN eSxw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8ZyQqmYchOy//62KNVupcJGjIjPSDBJu9hZW1p798Mo=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=CUgPgO9yHhBbAIXmAWVgLgrUxpTbUrjzDbD6yb4fcsoJ1JNtfdnLld4DMmY0909vYz 7XqNmsksI2lpa6rjSHmenQvMv8kspzXLtyDiqGRWyn5BCMPDrur2Xte+p27YQkr4KC8u VO9CIB5pueGmI7bzMvDKL7X1yIGOfj3Hfe5IyHFWemnq5OQq3YA7WxzMa/UDQBE9MtK7 E0YNirtnRF25LVZYjFIJpZSDGZCuK70pi3xbIAqAdxywV8TIcaeYbsHACmdCKaDbYMHh IPq4XMk08DlLCik0NyJOfWdQaebRvwN1yNFLggAq4eAai9Uk7NdHDrIyk8FAdwJZ9FVV jfyg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wW4EZLjp; 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-7b6f19e6865si313561285a.174.2024.12.12.10.56.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Dec 2024 10:56:45 -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=wW4EZLjp; 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 1tLoMR-00022Q-Pb; Thu, 12 Dec 2024 13:56:33 -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 1tLoMM-0001lG-9s for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:56:26 -0500 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoMF-0006sT-Nz for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:56:26 -0500 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-7242f559a9fso1142042b3a.1 for ; Thu, 12 Dec 2024 10:56:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029777; x=1734634577; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8ZyQqmYchOy//62KNVupcJGjIjPSDBJu9hZW1p798Mo=; b=wW4EZLjpA/XS7xUkXEwiqmNJxjQyDmIL/rBzswpl79RB+XtSHDqIJ+umsj3X2/Fcf1 DZM52W1Z33XTOz1/7T5NSekbjvCli/ybiZ3X5wApSD/dLNnIkJ7xXv0G3RCNtjjQYk21 u4jtqCjcHi+xWvP3HzaE5cRmm0ig3V61sd0lp993pIMuYaX2cA0h9pzwu7LmKfWBrOSP Y/ckwbmLyegt6VBcNVVIu1dRNSDycFk/RZTkOubhcGkwRfAHN9C6YIxyRfFWrbSgit0B dWxGxNsbR/IIm5geFIU5S3FHxqq4OgIs0J/3KBOYXg3yuBrQRa7Z1bWwCsx9Nmsi3ISD 6ItA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029777; x=1734634577; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8ZyQqmYchOy//62KNVupcJGjIjPSDBJu9hZW1p798Mo=; b=Qxn4SwuW1yTQEt0scZlURI94Ow02ZFVAb7h7L3vkczLZX5GgM3+iLXQ8IzMfb+nh/4 /r+FILx8PlKV2sOKVD2F9VuHQPrFcfNuahGjZ0to4KfM7/syTuGH1KcIQbfsQvvQ1foA HguX65Hsra7cF3TFXnPrCQERLxIwyXmqtLMcZrqzBx3ZcIcuaZ2JX3GCA8aNPTnMIHK9 hVJoTdiUH7A1miOVrsZwIyraXtofPk773yoZaj18ZyuCJazhPTm75PeT2ko7oKwPKHBp euMhcLqgEOv63rLHx2stQRqj7Fx1KuFONVA0qKEDRyAVrxIb0fT9xpUcAovRP5TU1xXO o4/A== X-Gm-Message-State: AOJu0YyLvAcmDvlzuoCVnurhOo323INUcd0MP2cSYHtYnCsZSJ2H0omX 8clobLy/VoR793XBAnDCuMhkySV1pwCA0SeZ4ECbdT3ABFszFa03CCPfE3xtVCJG/jOeQjs8B3I + X-Gm-Gg: ASbGncvDoPEyaBlRAfoGj0jniiR0oYeg8wlzpmsUpqv+oxELjWCCi6UjSRz2uzarHUZ udIDE3f+lbqfzqDkztm6jvtcGaeFjKDntWe3zwmiUiTs7UTJTUyQStNcjhLjjV63J0K+EjBAZO3 LS4o4KNnAJUs7ggnmgMWDJmNI65jDLhJpsLVUvyOrQwSh6bCpy9wFFbIhbfgpqCbt+2BYB1WA0R 45lGvHg+QMg+DaEFixGCX69ffUA77qYxNHqLSB4vrAEIuZfB3ZKWijPdMorFQu55VEQS2pNoa2p JONNScblyAqrRZG+GxWV0Xg0nV7QRJo= X-Received: by 2002:a05:6a00:2ea7:b0:725:e309:7110 with SMTP id d2e1a72fcca58-72906980ae5mr1767868b3a.5.1734029777632; Thu, 12 Dec 2024 10:56:17 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72904a0b171sm746922b3a.172.2024.12.12.10.56.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:56:17 -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 13/18] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (3/4) Date: Thu, 12 Dec 2024 19:53:36 +0100 Message-ID: <20241212185341.2857-14-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-pf1-x42e.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 Move declarations related to page protection under user emulation from "exec/cpu-all.h" to "user/page-protection.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- bsd-user/qemu.h | 1 + include/exec/cpu-all.h | 12 ------------ include/user/page-protection.h | 12 ++++++++++++ linux-user/qemu.h | 1 + target/arm/tcg/sve_helper.c | 3 +++ target/hppa/op_helper.c | 3 +++ target/sparc/ldst_helper.c | 3 +++ 7 files changed, 23 insertions(+), 12 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 3736c417860..04faee459df 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -26,6 +26,7 @@ #include "exec/exec-all.h" #include "user/abitypes.h" +#include "user/page-protection.h" extern char **environ; diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 86cd40020c9..73b11f58abb 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -130,18 +130,6 @@ extern const TargetPageBits target_page; int page_get_flags(target_ulong address); -/** - * page_check_range - * @start: first byte of range - * @len: length of range - * @flags: flags required for each page - * - * Return true if every page in [@start, @start+@len) has @flags set. - * Return false if any page is unmapped. Thus testing flags == 0 is - * equivalent to testing for flags == PAGE_VALID. - */ -bool page_check_range(target_ulong start, target_ulong last, int flags); - #endif CPUArchState *cpu_copy(CPUArchState *env); diff --git a/include/user/page-protection.h b/include/user/page-protection.h index d21fab1aaf9..bdd98a37de1 100644 --- a/include/user/page-protection.h +++ b/include/user/page-protection.h @@ -34,6 +34,18 @@ void page_set_flags(target_ulong start, target_ulong last, int flags); void page_reset_target_data(target_ulong start, target_ulong last); +/** + * page_check_range + * @start: first byte of range + * @len: length of range + * @flags: flags required for each page + * + * Return true if every page in [@start, @start+@len) has @flags set. + * Return false if any page is unmapped. Thus testing flags == 0 is + * equivalent to testing for flags == PAGE_VALID. + */ +bool page_check_range(target_ulong start, target_ulong last, int flags); + /** * page_check_range_empty: * @start: first byte of range diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 67bc81b1499..5f007501518 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -5,6 +5,7 @@ #include "exec/cpu_ldst.h" #include "user/abitypes.h" +#include "user/page-protection.h" #include "syscall_defs.h" #include "target_syscall.h" diff --git a/target/arm/tcg/sve_helper.c b/target/arm/tcg/sve_helper.c index 904296705c6..5a543b8dbc0 100644 --- a/target/arm/tcg/sve_helper.c +++ b/target/arm/tcg/sve_helper.c @@ -29,6 +29,9 @@ #include "vec_internal.h" #include "sve_ldst_internal.h" #include "hw/core/tcg-cpu-ops.h" +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif /* Return a value for NZCV as per the ARM PredTest pseudofunction. diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index 744325969f5..beb8f88799e 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -25,6 +25,9 @@ #include "exec/cpu_ldst.h" #include "qemu/timer.h" #include "trace.h" +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif G_NORETURN void HELPER(excp)(CPUHPPAState *env, int excp) { diff --git a/target/sparc/ldst_helper.c b/target/sparc/ldst_helper.c index d92c9f15934..4c54e456553 100644 --- a/target/sparc/ldst_helper.c +++ b/target/sparc/ldst_helper.c @@ -26,6 +26,9 @@ #include "exec/exec-all.h" #include "exec/page-protection.h" #include "exec/cpu_ldst.h" +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif #include "asi.h" //#define DEBUG_MMU From patchwork Thu Dec 12 18:53:37 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: 849751 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103897wry; Thu, 12 Dec 2024 10:57:19 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVH0gGSC0GOc3gUqeG5AXFC4ZrFNZiR9FHfa1tC/USR9IZcRKw4+8YiV7rQQqzLqV2zFjw6rw==@linaro.org X-Google-Smtp-Source: AGHT+IFKVdVP1WMoJEXILjUsIBZqaag+7M2XxKlg8JB89a0XVrP5hKUnDyFW3VBdFM/rKGAxv/YM X-Received: by 2002:a05:620a:4508:b0:7b6:dac1:cb73 with SMTP id af79cd13be357-7b6f89f3774mr213965385a.56.1734029839476; Thu, 12 Dec 2024 10:57:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734029839; cv=none; d=google.com; s=arc-20240605; b=NynAYG8SKjFSKPU8E1D+gtlN7oi8OGxXYbuB199XAfmzHKomKYME4VQwAXDxaNMK3Q R3n9jdMM131i2JNuWv5UuzXKVDdQ5XvKuwnmTW4iG4Lp8xWse8rXOzS3ft7+nxuSITnO voXl/risS3sv51cUrZH9P/uofkHb6+nYd+qIyqpbr1rOpx04YdGU6+LU89Yg9QJ5ak7z OeMBKz80oGK4K+kkaD3wEXOKcwnKBr2OvrFo+PsXB79EGtfXJwiu8rs1q17+GeVBiAFB LAWwOl86LlhH6lgNNgjNT13N6saSx/Tsi5VhuQ+v1yXHHHAFnsBnVvAOrsdYy128OfUm DxjA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NYC6oRELj+5ympYW3tq1E6/ibkizwxjQsKp5dy3fobw=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=DzatmY/yFtyEpZ4QB6GWW5d45is5jYU2bgUxO/jQklP6ah5Yc+wOOk/xsAXz9wENvF tpCV4o8jak5nKyQi4P5EjmfJtxYjLomrN8ITA77anRyfEJYf3uHJ4cmbDtUygvm8FTYV WWtIM7zx9iKJ4NOqqAyst9fmxSQRTPCH0MejgO88pjzqaJ8DxHQGhEPdsDsZJ2ZBlZpc D8YA5AsAvZUHk8ZzeQiOuSpLZzGOu71I/GqzMN1cP5nfSVqDo9KHX6QpPYDs3kgEeEYx yoYxqcD0B+mAM4S66C5RcEG9j6E+xtZ1XsDYbxd2b76/pGV1KLYyl/2k80f0MtlCYGQV EAmQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TZ9lkeo+; 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-7b6b5a856c5si2439778285a.315.2024.12.12.10.57.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Dec 2024 10:57:19 -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=TZ9lkeo+; 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 1tLoMZ-0002W8-N2; Thu, 12 Dec 2024 13:56:39 -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 1tLoMU-0002Eu-31 for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:56:34 -0500 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoMS-0006tc-BC for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:56:33 -0500 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-725ce7b82cbso1113815b3a.0 for ; Thu, 12 Dec 2024 10:56:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029789; x=1734634589; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NYC6oRELj+5ympYW3tq1E6/ibkizwxjQsKp5dy3fobw=; b=TZ9lkeo+fvSzeBvkj0/7+BWR6LmVO6ibjtluFKm9u7lvZ1t/a6kEFJfPWehOtBQ1Nm TAXj7R2RhpVVYDHyWY/xYoRikLJx1/7gmrJrT7BR71BtsDb1mwxSa6dhmA52bMfIAvlE FJIamEuWK3/ZRGsoE/UmkoYuKQoPpHGTMZwRAP7qyxurjpnpYSsQhxR54GgMpNg0pVlg LlppeWvOIQQC9JXXqfWAwNGnxMHEkJQspw/8YVCXAYcm8lz8ISIpQKEjI4FlV2QM5/6x iTxuOgI8VVG2WYV89ZdvV5FGNjRM58BYev9JDkpaDgQqpI+iwm/CyUV6TRi813BqEkVB thUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029789; x=1734634589; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NYC6oRELj+5ympYW3tq1E6/ibkizwxjQsKp5dy3fobw=; b=iLgf0sHNaiwvv4pol1W+Jet9ImOpZMrvoCb9sYEYtnTQV39KeQwPKUB4FSaCeUiEeS mh+P4tzkTqcXjc/l1ueeQ2otZu/p5Efq2eNM29n/4PYI1AC98dqS2pOtrBx/x7/2v0tr /U2IhFyc3TskQCxXaUsZVjejiagP7Uss/I9vfGsaZkwjuTxc/MW72S1PDDVXx9L0N2lS +JQbPrdpob8nTyoUa+HECzKuzJz/aqDo+PcsGwSQ/KjYq/x3DgQjkwzvb4QGk6hclBKp FXISgeXIwJdbGCoERjeQLucTuaPrjMcJBwSWb6iW2Mb+NnYJZGlkc1pB57mFOc3a/sk/ Xm9g== X-Gm-Message-State: AOJu0YyFgXB5eKZy+wnnwayadthzB+uyJ+/WZ3EaHXNyC6KPaKcUPjEz InYiXXtpv70fcgrs0FjBGTk4uqD2BvYTrwFtV4vsD4DTlPxwTOCcrJm8M4utKEvvUpphURE7V+R 7 X-Gm-Gg: ASbGncvq3F/7jU8psoEXqjvuRzX/fEaMkwTa+BQSMvC0ZCXuzCkrUlHhsSReyIfslH0 1+HNwOf1IZ9WxVsiJK8dcZ/tyQ+3FAXNtBsQyyCwLxmkTMnlWDHRhYDrXq3CMSAp8Pi6A/5EEzn 14JWAQ689I+9HSMq5E3H3TtweqsVHzcBnijcSF6TpJ3zlMEjpFgZ+ditj1xmcbnaG6F7QlBQqzx Q+j+25yI3F03dMS/q8kv90y0rG/NSg4rAZ3D+9diZMy9svrxphXPl11nw64moSC2NZM4kEX8cac 2LNaCyjhFIN63IApN13OI1HwqUnOnDY= X-Received: by 2002:a05:6a00:999:b0:725:cfd0:dffa with SMTP id d2e1a72fcca58-72906a01c5emr2101090b3a.5.1734029788724; Thu, 12 Dec 2024 10:56:28 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-725ceb7c00asm9859657b3a.95.2024.12.12.10.56.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:56:28 -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 14/18] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (4/4) Date: Thu, 12 Dec 2024 19:53:37 +0100 Message-ID: <20241212185341.2857-15-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-pf1-x433.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 Move declarations related to page protection under user emulation from "exec/cpu-all.h" to "user/page-protection.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- include/exec/cpu-all.h | 6 ------ include/user/page-protection.h | 2 ++ accel/tcg/tb-maint.c | 3 +++ bsd-user/signal.c | 1 + cpu-target.c | 1 + linux-user/arm/cpu_loop.c | 1 + linux-user/signal.c | 1 + target/arm/tcg/helper-a64.c | 3 +++ target/s390x/tcg/mem_helper.c | 4 +++- 9 files changed, 15 insertions(+), 7 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 73b11f58abb..f7eea33b101 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -126,12 +126,6 @@ extern const TargetPageBits target_page; #define TARGET_PAGE_ALIGN(addr) ROUND_UP((addr), TARGET_PAGE_SIZE) -#if defined(CONFIG_USER_ONLY) - -int page_get_flags(target_ulong address); - -#endif - CPUArchState *cpu_copy(CPUArchState *env); /* Flags for use in ENV->INTERRUPT_PENDING. diff --git a/include/user/page-protection.h b/include/user/page-protection.h index bdd98a37de1..51daa186480 100644 --- a/include/user/page-protection.h +++ b/include/user/page-protection.h @@ -19,6 +19,8 @@ void page_protect(tb_page_addr_t page_addr); int page_unprotect(tb_page_addr_t address, uintptr_t pc); +int page_get_flags(target_ulong address); + /** * page_set_flags: * @start: first byte of range diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 8e272cf790f..3f1bebf6ab5 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -33,6 +33,9 @@ #include "tb-internal.h" #include "internal-common.h" #include "internal-target.h" +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif /* List iterators for lists of tagged pointers in TranslationBlock. */ diff --git a/bsd-user/signal.c b/bsd-user/signal.c index da49b9bffc1..edbcd461bfa 100644 --- a/bsd-user/signal.c +++ b/bsd-user/signal.c @@ -22,6 +22,7 @@ #include "qemu/log.h" #include "qemu.h" #include "exec/page-protection.h" +#include "user/page-protection.h" #include "user/tswap-target.h" #include "gdbstub/user.h" #include "signal-common.h" diff --git a/cpu-target.c b/cpu-target.c index 4a88f1c6db8..69a49202110 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -29,6 +29,7 @@ #include "migration/vmstate.h" #ifdef CONFIG_USER_ONLY #include "qemu.h" +#include "user/page-protection.h" #else #include "hw/core/sysemu-cpu-ops.h" #include "exec/address-spaces.h" diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c index ec665862d93..709f718a99d 100644 --- a/linux-user/arm/cpu_loop.c +++ b/linux-user/arm/cpu_loop.c @@ -25,6 +25,7 @@ #include "signal-common.h" #include "semihosting/common-semi.h" #include "exec/page-protection.h" +#include "user/page-protection.h" #include "target/arm/syndrome.h" #define get_user_code_u32(x, gaddr, env) \ diff --git a/linux-user/signal.c b/linux-user/signal.c index 9b6d772882d..a191e9b26f2 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -33,6 +33,7 @@ #include "trace.h" #include "signal-common.h" #include "host-signal.h" +#include "user/page-protection.h" #include "user/safe-syscall.h" #include "tcg/tcg.h" diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c index 8f42a28d07b..bc144688dd5 100644 --- a/target/arm/tcg/helper-a64.c +++ b/target/arm/tcg/helper-a64.c @@ -34,6 +34,9 @@ #include "qemu/atomic128.h" #include "fpu/softfloat.h" #include /* for crc32 */ +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif /* C2.4.7 Multiply and divide */ /* special cases for 0 and LLONG_MIN are mandated by the standard */ diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index 0e12dae2aa8..307388e5bd1 100644 --- a/target/s390x/tcg/mem_helper.c +++ b/target/s390x/tcg/mem_helper.c @@ -31,7 +31,9 @@ #include "qemu/int128.h" #include "qemu/atomic128.h" -#if !defined(CONFIG_USER_ONLY) +#if defined(CONFIG_USER_ONLY) +#include "user/page-protection.h" +#else #include "hw/s390x/storage-keys.h" #include "hw/boards.h" #endif From patchwork Thu Dec 12 18:53:38 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: 849750 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103880wry; Thu, 12 Dec 2024 10:57:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVDULaZpYzBLYXE1MIUegCq/zmXXlCO03nqaBhZEJICkea2jMq2WVMh96fl3LSShwedRB49pg==@linaro.org X-Google-Smtp-Source: AGHT+IHniuUvBrtPMw1MLGmVhNQOg/8AyM4OZQzIJ/nSsRZvoOkd+5+6d02gtyp9HjDRFJWs3Nao X-Received: by 2002:a05:620a:4722:b0:7b1:5089:485b with SMTP id af79cd13be357-7b6f88cc948mr230961385a.3.1734029837374; Thu, 12 Dec 2024 10:57:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734029837; cv=none; d=google.com; s=arc-20240605; b=i/F7mkdCs/vId2fftXX8ECvEWUa9Wpl2DRMPpzJWg4XPEi5cZ9BaEPuPaoeHymvNn5 ubAf772lCZHEDvbC938sXWF0gobOic07idXB0qauJ9uOYwP+W3h3Ay8HKJ0isR1hI9Xh 5Kj7OBmTCKxIt+g9X2goZo351Y0gnW4mQzJ2dgnciqnm0DHF10udSO9oQpWRV1gqtT1Z ju6kOJt6Ilw0nwadRui0HapP9biGk7ul/TSOmsH6uAZyvy+5dvDIqFR+qYZRg7IN1AAc ioskNYtpgY+CtOoXmnTGmsRJKo6vEq7+BfgDlkP4i2KypTANrcC1Zn4bytXo0sk6WZKl Jxhg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sXbrBv48FmvVxm7EUcfZTZ2JWJOTl6EXN6xCwbK7DzM=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=JGusoRx1tXPJRBy4RuAVlu7henme1wWfehTcitmH7U9G2qzaoNFp28BT8vtFmjzMmr obRd5OPEihsF5+v1ea/xrIBxDY4AmcW30dczgfKmGh/pFudhAFJ9iVPAxhwkd6PNkl+G YR/7Ob7GnoEK3TMAiUuV6l3HD0nF6q/ZHRtClQrC9w1dkPcIiL2jibqPWXhCKxD4U/nZ T8rHDrgARXmb6nbRmPouM9qbyxBRjXe1uTyG233rfDsf0mImjL8CrziYK22TDmOCfZZb o854oiPNT2YQNvgIUU7MsgePRUovnA811VbrA3NZekLn7B/MnQO1vPwFBe12D9qjMuyT zSPQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BRpDtIKJ; 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 d75a77b69052e-4678f954869si40643741cf.185.2024.12.12.10.57.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Dec 2024 10:57:17 -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=BRpDtIKJ; 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 1tLoN6-0003S0-Lf; Thu, 12 Dec 2024 13:57:12 -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 1tLoMg-00035U-9e for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:56:47 -0500 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoMc-0006uM-By for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:56:46 -0500 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-728e81257bfso810638b3a.2 for ; Thu, 12 Dec 2024 10:56:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029800; x=1734634600; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sXbrBv48FmvVxm7EUcfZTZ2JWJOTl6EXN6xCwbK7DzM=; b=BRpDtIKJyWroV2he9v47NPd2s18RnBJtvRWN91NJOGzOC5Rl4w3varEtZ7pt0Hxvcx o/Mpn7NFiNno/QhH8i6p7bMWdJuHNrK54d5UOQdHXJS0DqTIPY2GLCIlsIcJAgEzMu0l /Wfmzibk1rGgHYK3Xztqq0rFfPJM0Jd3KELRcaWt8I3lLiQyGMGZq14XTBoF+QACLnK5 2tNOpH74Myc7mrgNPvV7eSoho2kuwTqhPd6aGaYDi10cxHsXe6NBUWy1Q6i4pwY2QxMA uhD7WXHBFpGeZk1epNsDp9rwBwA5Cc0b6pk7o5D+5VJ2qgCt8/AjGxwpePaObQYFWPpD MhzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029800; x=1734634600; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sXbrBv48FmvVxm7EUcfZTZ2JWJOTl6EXN6xCwbK7DzM=; b=oGtVeo3Viv87nrH297yIHjZQOZhCzXvvBnF9d2JxPssWlBK5Zk/LSLwBpM6XYwf94p npSiafWd5dBq+fcl4EF7Kx0Xi8OdOU9ToSESG+T3Io0FwLFtHM6DoEnBHuI/YscuTtVC 9HqUurdGtLFeWyoA9ynIyM/uuPQOuzZz1iL/TVJbKJtf6mdLeT2HBne96H0WCiNHU1Cs xOc+uvjwV/PNCF3xn7RCO+9SSpV2ugpG5WrPzYpvpb8eqk6JbF0jUXDDh3TZfKW+BI0y IdveUWjq3RBaQPaYVRl7NAgu81JfkRkAd9fORBRpq6oB4pvOKqT5e0KAP4A6+lqWjJBA JiAg== X-Gm-Message-State: AOJu0YxXNeGSvz4cSjyiSJeIohTBy1IVfknj7ItG5WuFvDwShS8WxCgp OUF9ungIRWvMcf0ckUADjgW4S0tgTmGs/yGN0JWT3Zvd0gAjffHeC56ls6DqBwpxBxT52dLKyqm 7 X-Gm-Gg: ASbGncstcdwQm5Z/BhVvAeaZb7XefxqOBqHluDXcgvL/Muut2h1VQiC/EeLWJixm/vQ VwrXCe84gnaLKgPp5KD3Dk5bwQttGpNFqTwNCz+Hq+Kkgm4NJ4Ne7CUrQQNs6lh65k0E6+LlobH w5k6NuNnhxs0MMxn6KxrlgNYDlblsJ/KIe4lLPxk6mNsjx5cXZV35O8YTm6GNIPl9rIHAQznO++ weGmq3OtsSX0eAVhhfOXiGJOAF0eP2gnuH913e4CxaRbO2DVwgKFBwbbQbTx2nz4VrSyQltdGMN 1dMQ6n9eo0pZejXEJFGkLBxfEkoofu0= X-Received: by 2002:a05:6a00:90a9:b0:727:3935:dc83 with SMTP id d2e1a72fcca58-7290696c670mr2222423b3a.10.1734029800451; Thu, 12 Dec 2024 10:56:40 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-725e2388d37sm8653945b3a.73.2024.12.12.10.56.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:56:40 -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 15/18] user: Forward declare target_cpu_copy_regs structure Date: Thu, 12 Dec 2024 19:53:38 +0100 Message-ID: <20241212185341.2857-16-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-pf1-x432.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- linux-user/cpu_loop-common.h | 5 ++++- linux-user/aarch64/cpu_loop.c | 2 +- linux-user/alpha/cpu_loop.c | 2 +- linux-user/arm/cpu_loop.c | 2 +- linux-user/hexagon/cpu_loop.c | 2 +- linux-user/hppa/cpu_loop.c | 2 +- linux-user/i386/cpu_loop.c | 2 +- linux-user/loongarch64/cpu_loop.c | 2 +- linux-user/m68k/cpu_loop.c | 2 +- linux-user/microblaze/cpu_loop.c | 2 +- linux-user/mips/cpu_loop.c | 2 +- linux-user/openrisc/cpu_loop.c | 2 +- linux-user/ppc/cpu_loop.c | 2 +- linux-user/riscv/cpu_loop.c | 2 +- linux-user/s390x/cpu_loop.c | 2 +- linux-user/sh4/cpu_loop.c | 2 +- linux-user/sparc/cpu_loop.c | 2 +- linux-user/xtensa/cpu_loop.c | 2 +- 18 files changed, 21 insertions(+), 18 deletions(-) diff --git a/linux-user/cpu_loop-common.h b/linux-user/cpu_loop-common.h index e644d2ef909..aca51f53238 100644 --- a/linux-user/cpu_loop-common.h +++ b/linux-user/cpu_loop-common.h @@ -27,5 +27,8 @@ void target_exception_dump(CPUArchState *env, const char *fmt, int code); #define EXCP_DUMP(env, fmt, code) \ target_exception_dump(env, fmt, code) -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs); +typedef struct target_pt_regs target_pt_regs; + +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs); + #endif diff --git a/linux-user/aarch64/cpu_loop.c b/linux-user/aarch64/cpu_loop.c index 71cdc8be50c..77f857a8216 100644 --- a/linux-user/aarch64/cpu_loop.c +++ b/linux-user/aarch64/cpu_loop.c @@ -185,7 +185,7 @@ void cpu_loop(CPUARMState *env) } } -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) { ARMCPU *cpu = env_archcpu(env); CPUState *cs = env_cpu(env); diff --git a/linux-user/alpha/cpu_loop.c b/linux-user/alpha/cpu_loop.c index 2ea039aa71f..b5403ed0e46 100644 --- a/linux-user/alpha/cpu_loop.c +++ b/linux-user/alpha/cpu_loop.c @@ -173,7 +173,7 @@ void cpu_loop(CPUAlphaState *env) } } -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) { int i; diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c index 709f718a99d..be1f11022a7 100644 --- a/linux-user/arm/cpu_loop.c +++ b/linux-user/arm/cpu_loop.c @@ -513,7 +513,7 @@ void cpu_loop(CPUARMState *env) } } -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) { CPUState *cpu = env_cpu(env); TaskState *ts = get_task_state(cpu); diff --git a/linux-user/hexagon/cpu_loop.c b/linux-user/hexagon/cpu_loop.c index d41159e52ad..a1794470113 100644 --- a/linux-user/hexagon/cpu_loop.c +++ b/linux-user/hexagon/cpu_loop.c @@ -79,7 +79,7 @@ void cpu_loop(CPUHexagonState *env) } } -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) { env->gpr[HEX_REG_PC] = regs->sepc; env->gpr[HEX_REG_SP] = regs->sp; diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index 23b38ff9b28..503a204460e 100644 --- a/linux-user/hppa/cpu_loop.c +++ b/linux-user/hppa/cpu_loop.c @@ -188,7 +188,7 @@ void cpu_loop(CPUHPPAState *env) } } -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) { int i; for (i = 1; i < 32; i++) { diff --git a/linux-user/i386/cpu_loop.c b/linux-user/i386/cpu_loop.c index 7a35215278a..e06aa23de4c 100644 --- a/linux-user/i386/cpu_loop.c +++ b/linux-user/i386/cpu_loop.c @@ -331,7 +331,7 @@ static void target_cpu_free(void *obj) g_free(obj); } -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) { CPUState *cpu = env_cpu(env); bool is64 = (env->features[FEAT_8000_0001_EDX] & CPUID_EXT2_LM) != 0; diff --git a/linux-user/loongarch64/cpu_loop.c b/linux-user/loongarch64/cpu_loop.c index 73d7b6796a4..935d5bcf2c8 100644 --- a/linux-user/loongarch64/cpu_loop.c +++ b/linux-user/loongarch64/cpu_loop.c @@ -97,7 +97,7 @@ void cpu_loop(CPULoongArchState *env) } } -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) { int i; diff --git a/linux-user/m68k/cpu_loop.c b/linux-user/m68k/cpu_loop.c index f79b8e4ab05..69cdce95518 100644 --- a/linux-user/m68k/cpu_loop.c +++ b/linux-user/m68k/cpu_loop.c @@ -92,7 +92,7 @@ void cpu_loop(CPUM68KState *env) } } -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) { CPUState *cpu = env_cpu(env); TaskState *ts = get_task_state(cpu); diff --git a/linux-user/microblaze/cpu_loop.c b/linux-user/microblaze/cpu_loop.c index 212e62d0a62..ee4ba768691 100644 --- a/linux-user/microblaze/cpu_loop.c +++ b/linux-user/microblaze/cpu_loop.c @@ -127,7 +127,7 @@ void cpu_loop(CPUMBState *env) } } -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) { env->regs[0] = regs->r0; env->regs[1] = regs->r1; diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c index 462387a0737..1331a9a2b8d 100644 --- a/linux-user/mips/cpu_loop.c +++ b/linux-user/mips/cpu_loop.c @@ -211,7 +211,7 @@ done_syscall: } } -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) { CPUState *cpu = env_cpu(env); TaskState *ts = get_task_state(cpu); diff --git a/linux-user/openrisc/cpu_loop.c b/linux-user/openrisc/cpu_loop.c index a7aa586c8f9..1bf9542d16a 100644 --- a/linux-user/openrisc/cpu_loop.c +++ b/linux-user/openrisc/cpu_loop.c @@ -83,7 +83,7 @@ void cpu_loop(CPUOpenRISCState *env) } } -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) { int i; diff --git a/linux-user/ppc/cpu_loop.c b/linux-user/ppc/cpu_loop.c index 02204ad8beb..e168f1ce947 100644 --- a/linux-user/ppc/cpu_loop.c +++ b/linux-user/ppc/cpu_loop.c @@ -378,7 +378,7 @@ void cpu_loop(CPUPPCState *env) } } -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) { int i; diff --git a/linux-user/riscv/cpu_loop.c b/linux-user/riscv/cpu_loop.c index 0af533e186f..a72bc76da3d 100644 --- a/linux-user/riscv/cpu_loop.c +++ b/linux-user/riscv/cpu_loop.c @@ -94,7 +94,7 @@ void cpu_loop(CPURISCVState *env) } } -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) { CPUState *cpu = env_cpu(env); TaskState *ts = get_task_state(cpu); diff --git a/linux-user/s390x/cpu_loop.c b/linux-user/s390x/cpu_loop.c index 8b7ac2879ef..42e4d24102e 100644 --- a/linux-user/s390x/cpu_loop.c +++ b/linux-user/s390x/cpu_loop.c @@ -180,7 +180,7 @@ void cpu_loop(CPUS390XState *env) } } -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) { int i; for (i = 0; i < 16; i++) { diff --git a/linux-user/sh4/cpu_loop.c b/linux-user/sh4/cpu_loop.c index c805f9db110..937d9fa265d 100644 --- a/linux-user/sh4/cpu_loop.c +++ b/linux-user/sh4/cpu_loop.c @@ -81,7 +81,7 @@ void cpu_loop(CPUSH4State *env) } } -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) { int i; diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 50424a54df5..58a2464da9f 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -357,7 +357,7 @@ void cpu_loop (CPUSPARCState *env) } } -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) { int i; env->pc = regs->pc; diff --git a/linux-user/xtensa/cpu_loop.c b/linux-user/xtensa/cpu_loop.c index d51ce053926..7564e25a966 100644 --- a/linux-user/xtensa/cpu_loop.c +++ b/linux-user/xtensa/cpu_loop.c @@ -238,7 +238,7 @@ void cpu_loop(CPUXtensaState *env) } } -void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) +void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) { int i; for (i = 0; i < 16; ++i) { From patchwork Thu Dec 12 18:53:39 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: 849753 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103981wry; Thu, 12 Dec 2024 10:57:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWKt5wnUZhLJuA5ciWg7DbASq8jMpDXVpzSDL23G01qJDjlIngQR1DCsm4qU1tQdOB1j32Zyg==@linaro.org X-Google-Smtp-Source: AGHT+IGnRnOkOtwY+hh291vM2FYZL6p2LGuL4R8N6NZYbhOFsvAsC/wFj7BJX3Ea1Cy+GBA+mbkC X-Received: by 2002:a05:622a:1a91:b0:467:7270:bc35 with SMTP id d75a77b69052e-467a15c5bf8mr23284541cf.14.1734029852466; Thu, 12 Dec 2024 10:57:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734029852; cv=none; d=google.com; s=arc-20240605; b=G4hQKafqoCAuvJT1quAb70l9q1Wl013qhwQFXmXm4B9RxKg1/JRzDtO/1bdEyLArCL /OZO3QdfS5hQOLmRW+UIWvphEZBKjsNd2ai/wtVnLDayz8t72CwzEYHRBObHn+kNM8UA gCdE3lNde/RFO8gS2CUurCbYsuvMSeCLcItJsID2BinV1PrDvQwMVJHOqqPyBm2Qket0 QL5C2nuf18GcTXJZBY7lAbRZUyvUT0UXwh9gY2lSgbVt6/t7TGBcv7cQgCN4Cxqbgmt2 27s5ZlDkOOQUrJwQzH0fysP0xi5/aCOLfkNYXbJozEeivH9NDYS9Yw/3UtPQtHzYr3SC Ablw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XxnAldCWCOu0O+NMnk+36JEDl4qw0oIa1uAJFBjrs8k=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=GO+U0E0tYInoE1JXW9pEvKhV5OK35kdMzNfdJHpB3B17k3J/5r9eVgCMhc5ld1v6px f/t0gXzNT5a06Mh5Z9+vSb8DOoQu3W0Z9Hpe5yfA76+CXohWMfpXNHKBpEqHu0sz3Wvi MlDKfzEObDKW7oc3qrS6cKMvVfAukkCx102kno0ynqdwC5diwtVrAN8Uzh39zM8vBplK ZmYLmRzOEL3VSr5/LpFm/X8lcO44Q2Sj7hDp7iT+CMa3LKEF8m9IMCy21jykIMuGXeu5 FuqTfuAWlwquLVmb4XUlq3V6CRUbdKBRjUy4Cp34xQwIIBsar9uFBTo85jY5VnFCWyOo iM2w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="X7EHtPW/"; 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 d75a77b69052e-4679c1ff3d8si16379831cf.252.2024.12.12.10.57.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Dec 2024 10:57:32 -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="X7EHtPW/"; 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 1tLoN9-0003k9-Cu; Thu, 12 Dec 2024 13:57:15 -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 1tLoMq-0003OC-F1 for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:56:58 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoMo-0006ul-AV for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:56:56 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-21669fd5c7cso8826155ad.3 for ; Thu, 12 Dec 2024 10:56:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029812; x=1734634612; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XxnAldCWCOu0O+NMnk+36JEDl4qw0oIa1uAJFBjrs8k=; b=X7EHtPW/TlEHJ2uvr2tMJ/i/9u44h9wkWXEDni4aExJt53bz9IjrjRs4WXr4SON0ph WtcYefDDU/Mhvm4lxEaZo89oXq1H0lF/XPgtyRahidnNmudDQkM6KXuD8OFXrCCHuKqB x7vUXGdyMmV/oWwrG/J2ZtQinYRYPFCJ1VVe9SPQetdFoMr3V8SFTTKyKrySpSvcEGx6 4xcFOSyUA7BBUpOOF1tpZzJ2bRkEbf4JdzNvHlmUx1ZN7z/LcwXWBZpHBdtrNV6U7x39 sA4Bl0n+uo5z5rZykcIndZoNbaDcPYE4iUGkZ5Wbuu7iq5j4cCv1oytsgxYoUbMLnfRW DGpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029812; x=1734634612; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XxnAldCWCOu0O+NMnk+36JEDl4qw0oIa1uAJFBjrs8k=; b=B+JfpCFaIccBWRi6jYH+fJTUoZ9HcWFmEcdTMZe8zcE9CrUMUwwFYhZBEsfBappWo6 3aB0fPbYcOh1GFDXdMea8JTL2Bl/KOF6OVEq9eEk+C5IhnPRiA7xKAYziVXv1IAepa3K TpOoux9WJ233RVCfVdHsoE10MsWwGsPUy0YdCwlXuL4M1Iuwtvu2l+GgFYTn0z6X6m0/ KioZVVK4xFcCqUeFO4ILTxGAfrfrU2eTuWYzp4h+eESwQHDww6CRNXacJHx8nhBTuati JKNzPWIA0krSDXTmyYNkVhJTSJha/T7uNCOK8fbbQqFV0d0jgIq2z/lQGbhGyz05eRDj npTg== X-Gm-Message-State: AOJu0Yy36p+tCG89w0ImM1RP6uEvJF7+R9pIuMhZpx+TlIYPTMl0vXhk yXYQuqEJ2dDmolHb4BayFTzfIW2NcDxyybAAmPUFhCU5aWzzoFXqS2924ksccgubwcY0mOCSN9S b X-Gm-Gg: ASbGnctEdqGVISW3rl0xFU+EiJTmwzGOSGD2Ed/2RNNf82EZ2T7CjoXAddHmc5l67IY UlHDg6DVE0FGxKnTtgk7dfGWmMqclw9vk8rnmFBJ4fsBlLbSAPAS0bvjHK1Gs70Az6RHCHkHMLl 2+SbLaNckc4LDJMj0s78YD96gy3OBzMO981YOgxu1BhQYt4q5+s5QV4HDFWzRQ320r7knm8VJVm dBkhhziNluEANkSMxHDvFwI7BONqk+aFPw/FJDBxya6L0+Gf9d197xvY9ZPulvbiXhMkP9/kI22 H9qbtr1fw6WtVUJ2SGh8ARdIuEJ3S2Q= X-Received: by 2002:a17:902:ccc5:b0:212:40e0:9562 with SMTP id d9443c01a7336-2178ae6c37bmr79441565ad.25.1734029811774; Thu, 12 Dec 2024 10:56:51 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21632c4fc62sm89822805ad.194.2024.12.12.10.56.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:56: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 16/18] user: Move 'linux-user/cpu_loop-common.h' -> 'user/cpu_loop.h' Date: Thu, 12 Dec 2024 19:53:39 +0100 Message-ID: <20241212185341.2857-17-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=philmd@linaro.org; helo=mail-pl1-x632.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 "linux-user/cpu_loop-common.h" is generic enough to be used by bsd-user, so rename it as "user/cpu_loop.h". Mechanical change running: $ sed -i -e 's,cpu_loop-common.h,user/cpu_loop.h,' \ $(git grep -l cpu_loop-common.h) Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- linux-user/cpu_loop-common.h => include/user/cpu_loop.h | 4 ++-- linux-user/aarch64/cpu_loop.c | 2 +- linux-user/alpha/cpu_loop.c | 2 +- linux-user/arm/cpu_loop.c | 2 +- linux-user/hexagon/cpu_loop.c | 2 +- linux-user/hppa/cpu_loop.c | 2 +- linux-user/i386/cpu_loop.c | 2 +- linux-user/loongarch64/cpu_loop.c | 2 +- linux-user/m68k/cpu_loop.c | 2 +- linux-user/main.c | 2 +- linux-user/microblaze/cpu_loop.c | 2 +- linux-user/mips/cpu_loop.c | 2 +- linux-user/openrisc/cpu_loop.c | 2 +- linux-user/ppc/cpu_loop.c | 2 +- linux-user/riscv/cpu_loop.c | 2 +- linux-user/s390x/cpu_loop.c | 2 +- linux-user/sh4/cpu_loop.c | 2 +- linux-user/sparc/cpu_loop.c | 2 +- linux-user/syscall.c | 2 +- linux-user/xtensa/cpu_loop.c | 2 +- 20 files changed, 21 insertions(+), 21 deletions(-) rename linux-user/cpu_loop-common.h => include/user/cpu_loop.h (95%) diff --git a/linux-user/cpu_loop-common.h b/include/user/cpu_loop.h similarity index 95% rename from linux-user/cpu_loop-common.h rename to include/user/cpu_loop.h index aca51f53238..8e2df232758 100644 --- a/linux-user/cpu_loop-common.h +++ b/include/user/cpu_loop.h @@ -17,8 +17,8 @@ * along with this program; if not, see . */ -#ifndef CPU_LOOP_COMMON_H -#define CPU_LOOP_COMMON_H +#ifndef USER_CPU_LOOP_H +#define USER_CPU_LOOP_H #include "exec/log.h" #include "special-errno.h" diff --git a/linux-user/aarch64/cpu_loop.c b/linux-user/aarch64/cpu_loop.c index 77f857a8216..c5d8a483a3f 100644 --- a/linux-user/aarch64/cpu_loop.c +++ b/linux-user/aarch64/cpu_loop.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "qemu/guest-random.h" #include "semihosting/common-semi.h" diff --git a/linux-user/alpha/cpu_loop.c b/linux-user/alpha/cpu_loop.c index b5403ed0e46..80ad536c5f2 100644 --- a/linux-user/alpha/cpu_loop.c +++ b/linux-user/alpha/cpu_loop.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop(CPUAlphaState *env) diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c index be1f11022a7..10d8561f9b9 100644 --- a/linux-user/arm/cpu_loop.c +++ b/linux-user/arm/cpu_loop.c @@ -21,7 +21,7 @@ #include "qemu.h" #include "user-internals.h" #include "elf.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "semihosting/common-semi.h" #include "exec/page-protection.h" diff --git a/linux-user/hexagon/cpu_loop.c b/linux-user/hexagon/cpu_loop.c index a1794470113..de70f736367 100644 --- a/linux-user/hexagon/cpu_loop.c +++ b/linux-user/hexagon/cpu_loop.c @@ -21,7 +21,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "internal.h" diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index 503a204460e..890e758cd1c 100644 --- a/linux-user/hppa/cpu_loop.c +++ b/linux-user/hppa/cpu_loop.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" static abi_ulong hppa_lws(CPUHPPAState *env) diff --git a/linux-user/i386/cpu_loop.c b/linux-user/i386/cpu_loop.c index e06aa23de4c..d96d5553faf 100644 --- a/linux-user/i386/cpu_loop.c +++ b/linux-user/i386/cpu_loop.c @@ -21,7 +21,7 @@ #include "qemu.h" #include "qemu/timer.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "user-mmap.h" diff --git a/linux-user/loongarch64/cpu_loop.c b/linux-user/loongarch64/cpu_loop.c index 935d5bcf2c8..0614d3de224 100644 --- a/linux-user/loongarch64/cpu_loop.c +++ b/linux-user/loongarch64/cpu_loop.c @@ -8,7 +8,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop(CPULoongArchState *env) diff --git a/linux-user/m68k/cpu_loop.c b/linux-user/m68k/cpu_loop.c index 69cdce95518..5da91b997ae 100644 --- a/linux-user/m68k/cpu_loop.c +++ b/linux-user/m68k/cpu_loop.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop(CPUM68KState *env) diff --git a/linux-user/main.c b/linux-user/main.c index 06037304cb1..b97634a32dd 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -50,7 +50,7 @@ #include "elf.h" #include "trace/control.h" #include "target_elf.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "crypto/init.h" #include "fd-trans.h" #include "signal-common.h" diff --git a/linux-user/microblaze/cpu_loop.c b/linux-user/microblaze/cpu_loop.c index ee4ba768691..87236c166f2 100644 --- a/linux-user/microblaze/cpu_loop.c +++ b/linux-user/microblaze/cpu_loop.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop(CPUMBState *env) diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c index 1331a9a2b8d..6405806eb02 100644 --- a/linux-user/mips/cpu_loop.c +++ b/linux-user/mips/cpu_loop.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "elf.h" #include "internal.h" diff --git a/linux-user/openrisc/cpu_loop.c b/linux-user/openrisc/cpu_loop.c index 1bf9542d16a..306b4f8eb43 100644 --- a/linux-user/openrisc/cpu_loop.c +++ b/linux-user/openrisc/cpu_loop.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop(CPUOpenRISCState *env) diff --git a/linux-user/ppc/cpu_loop.c b/linux-user/ppc/cpu_loop.c index e168f1ce947..2a0efaffcd6 100644 --- a/linux-user/ppc/cpu_loop.c +++ b/linux-user/ppc/cpu_loop.c @@ -21,7 +21,7 @@ #include "qemu.h" #include "qemu/timer.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" static inline uint64_t cpu_ppc_get_tb(CPUPPCState *env) diff --git a/linux-user/riscv/cpu_loop.c b/linux-user/riscv/cpu_loop.c index a72bc76da3d..3ac8bbfec1f 100644 --- a/linux-user/riscv/cpu_loop.c +++ b/linux-user/riscv/cpu_loop.c @@ -21,7 +21,7 @@ #include "qemu/error-report.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "elf.h" #include "semihosting/common-semi.h" diff --git a/linux-user/s390x/cpu_loop.c b/linux-user/s390x/cpu_loop.c index 42e4d24102e..c9124444ed2 100644 --- a/linux-user/s390x/cpu_loop.c +++ b/linux-user/s390x/cpu_loop.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" diff --git a/linux-user/sh4/cpu_loop.c b/linux-user/sh4/cpu_loop.c index 937d9fa265d..ee9eff3428a 100644 --- a/linux-user/sh4/cpu_loop.c +++ b/linux-user/sh4/cpu_loop.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop(CPUSH4State *env) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 58a2464da9f..68f1e8ecd43 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #define SPARC64_STACK_BIAS 2047 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index c54b199b6d3..1b335688f12 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -143,7 +143,7 @@ #include "special-errno.h" #include "qapi/error.h" #include "fd-trans.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #ifndef CLONE_IO #define CLONE_IO 0x80000000 /* Clone io context */ diff --git a/linux-user/xtensa/cpu_loop.c b/linux-user/xtensa/cpu_loop.c index 7564e25a966..c0fcf743e70 100644 --- a/linux-user/xtensa/cpu_loop.c +++ b/linux-user/xtensa/cpu_loop.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" static void xtensa_rfw(CPUXtensaState *env) From patchwork Thu Dec 12 18:53:40 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: 849752 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103952wry; Thu, 12 Dec 2024 10:57:27 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX0MYlcFM7K36YWSpsyschIcYAXzw4EaUaQj/Ok85JHywf2x0JAfKgq+afZp02xb6VhVRPITw==@linaro.org X-Google-Smtp-Source: AGHT+IFavGYWPezBeSqpvqZzuzgAFhMLup7At+hcqQzinUT0e5FKh0nxj2v/EJzijEEVyjmUa9+T X-Received: by 2002:a05:622a:5449:b0:467:5c17:e28a with SMTP id d75a77b69052e-467a16b5e04mr27335061cf.46.1734029847299; Thu, 12 Dec 2024 10:57:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734029847; cv=none; d=google.com; s=arc-20240605; b=CrrDJdNGMUXJ9+LlqNYMCq8gLaRKbAHDIwDQ51QbQGuHresyrTAMJTCRw69CxahclM hO+qnikPmZYoDU5eOmJhI7/tFz4sX+zlFjS5QZm7f6Y6YbTf+fAivj/Q6iLuv/CMooq+ +2scH1KrB5m9+qX4F1KlOHk4zFCSGHnYgROBBI6P6rjb8UpxJ+DcLZ4qch6T7UxiC0HX VWABQ5kT+ss6VRozv57tfS1r7EFCL3f66XBy12OIedzjwK4LJ/0jQaPqkPGmvz5/YHv3 onEpmp53cEcbK05qgOE6uGuPFXw20IjzedidAxMx6R+HxjcRtHKWgv6TkQ7zQrabu8vs OSZg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4Xzd/um0GVNgOnzI0D+rGp5GEvnFQawTaHdbkCJf8k4=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=hYZzbIeGhdPpyXH/zRCKY8zczOknQA3OaPCVj2kbeERLgJXt4bpK1rIBe/hhfm9ajN Q5JNJtc4OZO7/wA/6iF34A4Cf3fwJfH6MJJfEXnfdbUJsPY9JsdzX3uNUTCtA/mUCWYY zTXvIz1e1TYtSVSFQIpqs2/2wKnHFM025btIwMyS3TEQDjANC4PKd5KmSM2jmELRdGlU wOdFlfnCOE7T1YhnuOSZ3LYAu8mGAuZLqla0w/LfdiqxgIqfRXUACYBDyaJ/u2VJY6Ie P00sm5mR9TG4UtsrNoiF0/tHpWHIboqIves/tHJtoMRywht2J8G7ersRIzqZdhGVKjey sb4g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CyqqKBuE; 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 d75a77b69052e-467972d95c1si26024331cf.168.2024.12.12.10.57.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Dec 2024 10:57:27 -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=CyqqKBuE; 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 1tLoNE-0004VF-Cn; Thu, 12 Dec 2024 13:57:20 -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 1tLoMz-0003Rt-WA for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:57:08 -0500 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoMy-0006vb-Fx for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:57:05 -0500 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-728f1525565so1135633b3a.1 for ; Thu, 12 Dec 2024 10:57:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029823; x=1734634623; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4Xzd/um0GVNgOnzI0D+rGp5GEvnFQawTaHdbkCJf8k4=; b=CyqqKBuE6zhHUoXnOPpPoPCAoDINkBX6TEDq99LOSMxb/FkTAhNwtS1/J1kZeupg67 GoiOKGxrUwTJz0zgskNPdlTtfIxGJG/N0ewzRn2LooNja5ZIoXN9IAK+qpJVQ2jwHUFM BISljVohZDquaYVNNizGA73u2UIc7KEq0hdEoeU6gMDL/OlL38TU7WmUypSzQGOJjBvP 3BYmABErZo2EneFR2zwrtYWzkz4ad5PU6sX97oH31ncLMvythpmKjWuWeL10LQUEm3+N JGPEMnJKHwotCiqjHjnF21Cm5nrITOCbYeSQyGdyGU2l9ZbipNApiYXYl26t2hMhabww 6/BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029823; x=1734634623; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4Xzd/um0GVNgOnzI0D+rGp5GEvnFQawTaHdbkCJf8k4=; b=qY9Sn0f3466uTpZhCmjrQ2L2f0cMrUu0z152vsNyMn8RlN0Rjuj4N0uqU9bSkDw1jp 9c8MEqL9nllyGG2Mvil4xA03VilMkpEJft3a0SV0zgtDDM74rQdjKnABnUpn7ytTL5J1 CxDkcaoq+rcxsm7XT8bcPcDp3tbmWAXPllLEMMmm2ev2CzP5RALE+SxubS1vR0hEFN3L dCmPW8alXI6wbM1AQvsDwsQEqY46UkDb4rB7oCVFkaCooEuobgCUOdbjJnmIkOALnOO6 l4vXlGrdVeW3K86FTCFp7YCRjMMcBAC1om5TrXWnEIrrULRepVjyXk5AV4/rR4AA8Liq +zXw== X-Gm-Message-State: AOJu0YxEuEShNpXoxSJOfKngOpgXiISzaG5WpfsJTbKxlQNFtkL1qa3I g5Py91aDWYj1s7wXM1ri4IIMSe+ynVucUBbN6tZUWgo391peNTztZuzszzwGdrFdrzF7fp5vTIP + X-Gm-Gg: ASbGnctFXRO26imAS4YI2c19HzwIU2Ucm+tzI0P2LpPNbzOZVIa/R+M4CmAoR0KhNep U91qFO9G/kvl+9/UfAXEbxVERLnpYxDLG0TrZEzGb2ZtEEvQ4tBoSU/OmyF3BdSJcW5qIw9SgU1 JOgZcmgsBy97448GQHbwV60hykGF0VD+Y1eoHd647dghjxnNIz9sVV0M+4yXkU+AzkNP0lYG3pn 3Gke+EZpi6F73CD/w7RPU80K4OJwd6GYebfZJBwS9a5Ftexjqe7owtlAHYfXguMZvgLS+9Ev+gz p3PtPPEwz5NgjDB1q0cM0EZRADIOrbU= X-Received: by 2002:a05:6a00:39a2:b0:725:b1df:2daa with SMTP id d2e1a72fcca58-72906a747afmr2322335b3a.20.1734029822680; Thu, 12 Dec 2024 10:57:02 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-725ee10f928sm7501880b3a.32.2024.12.12.10.56.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:57:02 -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 17/18] user: Declare cpu_loop() once in 'user/cpu_loop.h' Date: Thu, 12 Dec 2024 19:53:40 +0100 Message-ID: <20241212185341.2857-18-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-pf1-x42e.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 Declare cpu_loop() once in "user/cpu_loop.h". bsd-user gets the G_NORETURN attribute. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- bsd-user/qemu.h | 2 +- include/user/cpu_loop.h | 2 ++ linux-user/user-internals.h | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 04faee459df..3eaa14f3f56 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -26,6 +26,7 @@ #include "exec/exec-all.h" #include "user/abitypes.h" +#include "user/cpu_loop.h" #include "user/page-protection.h" extern char **environ; @@ -187,7 +188,6 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg5, abi_long arg6); void gemu_log(const char *fmt, ...) G_GNUC_PRINTF(1, 2); extern __thread CPUState *thread_cpu; -void cpu_loop(CPUArchState *env); char *target_strerror(int err); int get_osversion(void); void fork_start(void); diff --git a/include/user/cpu_loop.h b/include/user/cpu_loop.h index 8e2df232758..b0d4704018d 100644 --- a/include/user/cpu_loop.h +++ b/include/user/cpu_loop.h @@ -23,6 +23,8 @@ #include "exec/log.h" #include "special-errno.h" +G_NORETURN void cpu_loop(CPUArchState *env); + void target_exception_dump(CPUArchState *env, const char *fmt, int code); #define EXCP_DUMP(env, fmt, code) \ target_exception_dump(env, fmt, code) diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h index 46ffc093f40..b9b05c1d11f 100644 --- a/linux-user/user-internals.h +++ b/linux-user/user-internals.h @@ -65,7 +65,6 @@ abi_long do_syscall(CPUArchState *cpu_env, int num, abi_long arg1, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8); extern __thread CPUState *thread_cpu; -G_NORETURN void cpu_loop(CPUArchState *env); abi_long get_errno(abi_long ret); const char *target_strerror(int err); int get_osversion(void); From patchwork Thu Dec 12 18:53:41 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: 849754 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1103983wry; Thu, 12 Dec 2024 10:57:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWejoqZmH5D2k0RaEAfowlYidhfzVmE7WnoMLXIt+0Zgb1WsEoV9RdNw+s4b1dOX9HDbXEcMg==@linaro.org X-Google-Smtp-Source: AGHT+IHLmqGXYfBxIXWZ6bNzot+qjJciz59xKjAwbQiKGG+k3TkTGGgKWxOvHz35922EkY0m3J4m X-Received: by 2002:a05:622a:4d43:b0:466:a6e5:6f0f with SMTP id d75a77b69052e-467a14ecc0cmr30696431cf.4.1734029852628; Thu, 12 Dec 2024 10:57:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734029852; cv=none; d=google.com; s=arc-20240605; b=TeQnYuafnJjwBhrCb/qI84s7Um/etjIibAtz+JTvy263sh4+8B1uIYAvzpiSWX5CNd i6o9HMKKp6gDzlx1+WSNuxSxmh1QFGy8QYmQB2Tnxig0hEkAxX+7TNACQ3N5XAoeYPuD zf+KdNlPy+IVDMfxfq/q1I/BI3n/eDdp1llGCz9IROsnok9HHoDh5xPJTV1apBHln6K7 vgk5kMED1iasbREb23sofq+fEdIalh5IIGocSTLI+TJNSxhLCsaF1etEQwh6fWruFC0f nTIqUBNVDkSLSRLu9fu80LMJerEvQbTiYfJRPFZq0bKxUcJEL0/6070awpWQjFrNwExl RbMA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZoaiN8fGbAdoZl91RstCXbOrdj9RzBIlWptTLfxPGQw=; fh=pnqwS/3OtHZ8LqG0NTMbRB51yilWjG1VtPDdq2UnsIY=; b=B/hsWYdvNzglTG657c2ki6NkzeKvNExgHC9/6Yy8VWlwas6hl0zzqUtDXUdrl6F0x9 qIzOPVEu+TJZzObN1TaJI88IUA70P+kQCjBoqYtdoTZzMt3hm546rvkxiKYVaI51yTIN kOLHmSLOVaRMWI5lF7nBv2099mQ/1f1BeDt8Yi91rEELwsEnGJw9XNZ2Ob5u58LLq7pH U69YYUoA4BIjJRWta6U+CWQcrxEwLyYWTgDYnHAZNY9sGqOGt7P8+smkF7NgX+mdR7fy zrxi13ou0TysGrhiCcRht/eAY+BQDdSw6Q2cB7ZQGWhfCA8JC8SbP8/9UtwnGVf0blX/ wCuw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HNYLi/sz"; 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 d75a77b69052e-467942a150bsi33964011cf.680.2024.12.12.10.57.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Dec 2024 10:57:32 -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="HNYLi/sz"; 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 1tLoNH-0004of-2X; Thu, 12 Dec 2024 13:57:23 -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 1tLoN6-0003T7-5W for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:57:12 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLoN4-0006wD-4H for qemu-devel@nongnu.org; Thu, 12 Dec 2024 13:57:11 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-434a736518eso12507085e9.1 for ; Thu, 12 Dec 2024 10:57:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734029828; x=1734634628; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZoaiN8fGbAdoZl91RstCXbOrdj9RzBIlWptTLfxPGQw=; b=HNYLi/szYbPQjuuFSC0A3aRyKVOkuUFuThdF3h2fjqKXs3RzgcTTdq/LrZovOvr2IO ITPSF0Bu381MPFAgZY5R46l42w/E+VWeXVghtpLl3gtdH/TsAofFhAq3LPB2i17HvjuR lS+5atKhZJzfblqjrQ12N7Q1tc31UATJVXJ4sxFUrWORYOqWBlFTaqnPViHt767Gn2mf UwifhWwpF3hLVHybg/ShiaYEnvVLSr3cby/gs+6M3w5i+eaetky+y311lzLqgWAfXkDT sN/OZH4YUVMQn1RRK2JHptNa/HweTl9JLGA0C+m48F0JK4o8CBgR1KrsclG+yAH8ZnD1 VuPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734029828; x=1734634628; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZoaiN8fGbAdoZl91RstCXbOrdj9RzBIlWptTLfxPGQw=; b=oF2jaPECk4zvov8styU2qK2v0peR7z7A8s4DL252jd3HwqRKNJVZshPhcKsk5zTUC9 3S89PdF3xS1GxQ15QdrztAIKEOtmqmbRBfGuqB14TFwWs3MzrckE4ePz6pYHuQX5+7zp wH0IEUpeycha49JGJD0PmRRoHN5rOTS4nMOJxVrK4zHiu80kGIyYzhOwazE0n/rA8tBe Gw+uPjVVrnI55l25W2qknYxPM2lvDq7apEHvmNbyYEBSSAMnIUR0RrNKb7hAZ/gZDtK7 Hff8GlL/WkBjQB7IYWmfY+etr7P1DilbFj8fXDQhIBF6iHez4Fnyu9WTG4HNJAXgqWga Ot5w== X-Gm-Message-State: AOJu0YzIV6E/y7jFUz7fs+qFssHvsXLMZOivC30+vs7i6jY+m+ZSTOxI CxF0SrEFrZ976VvVPzvuGFmaWlwhzE7WCg/NA6BaI23jvcBz/8kBNgy0WpnhIDCTjUKI3dMPoNI 0 X-Gm-Gg: ASbGncsA8LRM+AQ8z79i8LESYsUWU4MDkW7lQK3fnAV9b7RKw3tq+N1y1PhnJFEHE6m lST/3bXwShzzmpGEp4IKptu7cRxfNOkv63P0mbVk/JUbBuZ2EWkHHRNRKNjKghEMUn3af5XoO7y qbPdFdZRAc9b52RbeJ7ehktceMVFfkWyS0xG5LfgRcGFWo5TrIHPmjbuVHdatcLT/pdFGEbmWTW gicyG2anuU6BKz6J+k+/l5AOrQqp0nr0EkyMGPeJhq5I3ZcqRE1vN4Gk7AFIKTUyZFm3YkQlTdP tFPbxhUILC7bW4VvhfwDF+fBEEk8Hxo= X-Received: by 2002:a05:600c:5122:b0:434:f586:7520 with SMTP id 5b1f17b1804b1-4361c393894mr70283425e9.6.1734029827803; Thu, 12 Dec 2024 10:57:07 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436255531dasm24469585e9.8.2024.12.12.10.57.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Dec 2024 10:57:07 -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 18/18] user: Move various declarations out of 'exec/exec-all.h' Date: Thu, 12 Dec 2024 19:53:41 +0100 Message-ID: <20241212185341.2857-19-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241212185341.2857-1-philmd@linaro.org> References: <20241212185341.2857-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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 Move various declarations related to user emulation from "exec/exec-all.h" to "user/cpu_loop.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- include/exec/exec-all.h | 55 +------------------------------------ include/user/cpu_loop.h | 54 ++++++++++++++++++++++++++++++++++++ accel/tcg/user-exec.c | 1 + bsd-user/signal.c | 1 + linux-user/signal.c | 1 + target/arm/tcg/mte_helper.c | 1 + 6 files changed, 59 insertions(+), 54 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index b5ea607cf45..c4a6ad3af2d 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -22,7 +22,6 @@ #include "cpu.h" #if defined(CONFIG_USER_ONLY) -#include "exec/abi_ptr.h" #include "exec/cpu_ldst.h" #endif #include "exec/mmu-access-type.h" @@ -518,60 +517,8 @@ static inline tb_page_addr_t get_page_addr_code(CPUArchState *env, return get_page_addr_code_hostp(env, addr, NULL); } -#if defined(CONFIG_USER_ONLY) +#if !defined(CONFIG_USER_ONLY) -/** - * adjust_signal_pc: - * @pc: raw pc from the host signal ucontext_t. - * @is_write: host memory operation was write, or read-modify-write. - * - * Alter @pc as required for unwinding. Return the type of the - * guest memory access -- host reads may be for guest execution. - */ -MMUAccessType adjust_signal_pc(uintptr_t *pc, bool is_write); - -/** - * handle_sigsegv_accerr_write: - * @cpu: the cpu context - * @old_set: the sigset_t from the signal ucontext_t - * @host_pc: the host pc, adjusted for the signal - * @host_addr: the host address of the fault - * - * Return true if the write fault has been handled, and should be re-tried. - */ -bool handle_sigsegv_accerr_write(CPUState *cpu, sigset_t *old_set, - uintptr_t host_pc, abi_ptr guest_addr); - -/** - * cpu_loop_exit_sigsegv: - * @cpu: the cpu context - * @addr: the guest address of the fault - * @access_type: access was read/write/execute - * @maperr: true for invalid page, false for permission fault - * @ra: host pc for unwinding - * - * Use the TCGCPUOps hook to record cpu state, do guest operating system - * specific things to raise SIGSEGV, and jump to the main cpu loop. - */ -G_NORETURN void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, - MMUAccessType access_type, - bool maperr, uintptr_t ra); - -/** - * cpu_loop_exit_sigbus: - * @cpu: the cpu context - * @addr: the guest address of the alignment fault - * @access_type: access was read/write/execute - * @ra: host pc for unwinding - * - * Use the TCGCPUOps hook to record cpu state, do guest operating system - * specific things to raise SIGBUS, and jump to the main cpu loop. - */ -G_NORETURN void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, - MMUAccessType access_type, - uintptr_t ra); - -#else void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length); void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length); diff --git a/include/user/cpu_loop.h b/include/user/cpu_loop.h index b0d4704018d..2f93575e2f4 100644 --- a/include/user/cpu_loop.h +++ b/include/user/cpu_loop.h @@ -20,7 +20,10 @@ #ifndef USER_CPU_LOOP_H #define USER_CPU_LOOP_H +#include "exec/abi_ptr.h" +#include "exec/mmu-access-type.h" #include "exec/log.h" +#include "exec/target_long.h" #include "special-errno.h" G_NORETURN void cpu_loop(CPUArchState *env); @@ -33,4 +36,55 @@ typedef struct target_pt_regs target_pt_regs; void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs); +/** + * adjust_signal_pc: + * @pc: raw pc from the host signal ucontext_t. + * @is_write: host memory operation was write, or read-modify-write. + * + * Alter @pc as required for unwinding. Return the type of the + * guest memory access -- host reads may be for guest execution. + */ +MMUAccessType adjust_signal_pc(uintptr_t *pc, bool is_write); + +/** + * handle_sigsegv_accerr_write: + * @cpu: the cpu context + * @old_set: the sigset_t from the signal ucontext_t + * @host_pc: the host pc, adjusted for the signal + * @host_addr: the host address of the fault + * + * Return true if the write fault has been handled, and should be re-tried. + */ +bool handle_sigsegv_accerr_write(CPUState *cpu, sigset_t *old_set, + uintptr_t host_pc, abi_ptr guest_addr); + +/** + * cpu_loop_exit_sigsegv: + * @cpu: the cpu context + * @addr: the guest address of the fault + * @access_type: access was read/write/execute + * @maperr: true for invalid page, false for permission fault + * @ra: host pc for unwinding + * + * Use the TCGCPUOps hook to record cpu state, do guest operating system + * specific things to raise SIGSEGV, and jump to the main cpu loop. + */ +G_NORETURN void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, + MMUAccessType access_type, + bool maperr, uintptr_t ra); + +/** + * cpu_loop_exit_sigbus: + * @cpu: the cpu context + * @addr: the guest address of the alignment fault + * @access_type: access was read/write/execute + * @ra: host pc for unwinding + * + * Use the TCGCPUOps hook to record cpu state, do guest operating system + * specific things to raise SIGBUS, and jump to the main cpu loop. + */ +G_NORETURN void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, + MMUAccessType access_type, + uintptr_t ra); + #endif diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 815a39503f3..0561c4f6dc7 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -24,6 +24,7 @@ #include "qemu/bitops.h" #include "qemu/rcu.h" #include "exec/cpu_ldst.h" +#include "user/cpu_loop.h" #include "qemu/main-loop.h" #include "user/page-protection.h" #include "exec/page-protection.h" diff --git a/bsd-user/signal.c b/bsd-user/signal.c index edbcd461bfa..b4e1458237a 100644 --- a/bsd-user/signal.c +++ b/bsd-user/signal.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" #include "qemu.h" +#include "user/cpu_loop.h" #include "exec/page-protection.h" #include "user/page-protection.h" #include "user/tswap-target.h" diff --git a/linux-user/signal.c b/linux-user/signal.c index a191e9b26f2..087c4d270e4 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -33,6 +33,7 @@ #include "trace.h" #include "signal-common.h" #include "host-signal.h" +#include "user/cpu_loop.h" #include "user/page-protection.h" #include "user/safe-syscall.h" #include "tcg/tcg.h" diff --git a/target/arm/tcg/mte_helper.c b/target/arm/tcg/mte_helper.c index ae037dc9143..846d659ff77 100644 --- a/target/arm/tcg/mte_helper.c +++ b/target/arm/tcg/mte_helper.c @@ -25,6 +25,7 @@ #include "exec/page-protection.h" #ifdef CONFIG_USER_ONLY #include "user/page-protection.h" +#include "user/cpu_loop.h" #endif #include "exec/ram_addr.h" #include "exec/cpu_ldst.h"