From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029715; cv=none; d=zohomail.com; s=zohoarc; b=lnj+FprqIUYO3HMr63KS7Sdrou5axQlmiscTzg0txWvps0+OElySwiBb74bSMyinLrpZhw8TQe5GCAz9ks+knuruvec+hRMYqjonbY318lzfqT1AePC38Xc5O9BdiaTM3oQgGBAgOgbdAxwXxTwSH92V/v6oZeZXZ6xFIZOPXeo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029715; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=uY621Zpe5phiABfrjs1wu2fCtX/cc+LF2MmFvVEbl/U=; b=RAD3Bzz6aBiI5ahgWMktplTZ6huZnU0cLsI/2nnBnHXn9zeoDTUpv68w9gmWOthbMM5ylILW93NZsU5qCVt2Usi5XHxwzXUx9qNmmfZhjQMwh8dvQYpJDsZgLYIWhKalB4S2+GF1yUzrwACi0N6iUI1RX0Vu7CAeglY8mRIdWfo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029715255402.6519456980411; Thu, 12 Dec 2024 10:55:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:54:04 -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) 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-Google-Smtp-Source: AGHT+IF95yVjEzViHUIJFgEmelkcESNdFx72+teiAXxSXEmGO/vviLS7vjfDuNWNXVyS7FB683IA0A== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029717584116600 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=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- 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 @@ =20 /* MMU memory access macros */ =20 -#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) <=3D 32) ? \ - UINT32_MAX : ~0ul) -#define GUEST_ADDR_MAX (reserved_va ? : GUEST_ADDR_MAX_) - -#else +#if !defined(CONFIG_USER_ONLY) =20 #include "exec/hwaddr.h" =20 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" =20 #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 <=3D GUEST_ADDR_MAX; -} - -static inline bool guest_range_valid_untagged(abi_ulong start, abi_ulong l= en) -{ - return len - 1 <=3D GUEST_ADDR_MAX && start <=3D GUEST_ADDR_MAX - len = + 1; -} - -#define h2g_valid(x) \ - (HOST_LONG_BITS <=3D TARGET_VIRT_ADDR_SPACE_BITS || \ - (uintptr_t)(x) - guest_base <=3D GUEST_ADDR_MAX) - -#define h2g_nocheck(x) ({ \ - uintptr_t __ret =3D (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 */ =20 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) <=3D 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 <=3D GUEST_ADDR_MAX; +} + +static inline bool guest_range_valid_untagged(abi_ulong start, abi_ulong l= en) +{ + return len - 1 <=3D GUEST_ADDR_MAX && start <=3D GUEST_ADDR_MAX - len = + 1; +} + +#define h2g_valid(x) \ + (HOST_LONG_BITS <=3D TARGET_VIRT_ADDR_SPACE_BITS || \ + (uintptr_t)(x) - guest_base <=3D GUEST_ADDR_MAX) + +#define h2g_nocheck(x) ({ \ + uintptr_t __ret =3D (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 --=20 2.45.2 From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029715; cv=none; d=zohomail.com; s=zohoarc; b=RGuhgnSLtzn+V7P5Q6ST9QJc2p68olGHsXExadvH2YNqMOOFEKwvzOihZALzPkwFyo+CaLFYJvyPRwEJ6b4JOODfVuR/WayX47OPcNHrXT+sp6NDwlQm0KtP7HCQrG5W6Pmqno/R21JiwSngsrEusdtuxlHvUFI/2Fr6wvs9xUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029715; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=COQa0IDmzSYvfWdSQf7pgjwEYz5PX2cSNYwHo2OnbHQ=; b=biQTrgPbU0frsl9Fr8YdgoW+bo+ba/20XdIqN49Qctchb8Kv7rkC+tmbJdLrMo+28xE9xo7l0sjfwp5te14fJ19WjoVQuF5mq1gX3YITo8Vz7nId3EZI0XiyPljt+f9CmRIhW16KZolQzR/zdTwzpyMze/ygJSlwu7IPVhK9V1Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029715502380.6836195311622; Thu, 12 Dec 2024 10:55:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:54:15 -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) 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-Google-Smtp-Source: AGHT+IFQNSDMUDu1KjluxEHUpQ8TgFW6sOQJITb19SzMs2If7YWqMPatFEzqX8gHIDM4erPMDu2NjA== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029717430116600 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 = =E2=80=98abi_long=E2=80=99; did you mean =E2=80=98u_long=E2=80=99? 30 | void arm_set_mte_tcf0(CPUArchState *env, abi_long value); | ^~~~~~~~ Signed-off-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- 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 =20 +#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) --=20 2.45.2 From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029715; cv=none; d=zohomail.com; s=zohoarc; b=CiPS4bA2Shu21QlLpBSdoKZgPXQqadXZT1Vjul7F9USVsRKg9hoa7Y8HHFR3nxe18Pew6SQb/aShbjMEel8Om2BdSs2Hj/ubwP/F8ktgFvY9ebinFfybNOErvxk6FhzH3pU9mrM84EIszZJXBKbhoUREIhIGq3XsrX48QIo+py0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029715; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HazQIxFPlU3a2oysjMUdZiZcfaWSWluyVNuDTpHIcic=; b=CeSPdpbVJSJ6VfLnDQI2a4XNkppehyIqLzc3m1/auyQLlMZZuwu0NzVGH1tWQYwEa0JdIn42lXcYdivv6MYcFXCHsPf7yeZQMRLX/Cg0Q03L9fFY2Eydvbc4vYA/UdDPy+/Fygrruuw3L7Ji8xCgya8J4JAWqvm7D2ZHm5EO3lQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029715155778.0739504524278; Thu, 12 Dec 2024 10:55:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:54:27 -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) 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-Google-Smtp-Source: AGHT+IF9eQRkoasWzSOsCuqjBjOJchsppkPiVwxtqX7cI2BenpC8dZjjHVxSxItYhkeZG00J1A+63g== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029717725116600 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=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- 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-com= mon.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 @@ =20 #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" =20 static QemuEvent done_event; diff --git a/tests/unit/test-block-iothread.c b/tests/unit/test-block-iothr= ead.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" =20 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" =20 #ifdef CONFIG_PTHREAD_SET_NAME_NP #include <pthread_np.h> --=20 2.45.2 From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029715; cv=none; d=zohomail.com; s=zohoarc; b=KkUumM6NlnWG0qqmC9tlHl3ayZUcC0Ywhd7YRkNhgVafyzLiGnNpGumT9uReA+ooT1kWaceffMtIMYd7VbxtaKUMKv2805/y0YyE0bv6fN7Ao3Yijx67aW6xNEEtwhHyYqeJdTvWTtPJDjnWKtMRKHhSHaRpuly01ohKY/VMM9g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029715; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Pl4taCtFHZe8oQC4px0PP3McFaT9srtUpF3ia8zOgEk=; b=T2A4yxDmPluO86fukzvEGsJTaZd0CPGMYH83+kpV1x+AgSJKe5bCaBSJW8wiHanweGmGB8JJLJmRsO9ux6C0I4S/kmStop6ZspxEMs5wEEpV4A5ty2xcrURl7DWYKMSq6ynRLAWrnMBbbHX15tqctMOIlGQU7hKKpGE0DKr2peU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029715255313.1654846974907; Thu, 12 Dec 2024 10:55:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:54:38 -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) 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-Google-Smtp-Source: AGHT+IFx9eLiDTQfJwfgDAMUAoqCUp/MTS3FsvXzicRxBBDsxtidDJpG+pFvS7xhUIg8r3MKg2cvWQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029717536116600 Move mmap_lock(), mmap_unlock() declarations and the WITH_MMAP_LOCK_GUARD() definition to 'exec/page-protection.h'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- 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" =20 /** * cpu_loop_exit_requested: @@ -520,18 +519,6 @@ static inline tb_page_addr_t get_page_addr_code(CPUArc= hState *env, } =20 #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))) \ - =3D (mmap_lock(), 0); _mmap_lock_iter =3D=3D 0; _mmap_lock_iter = =3D 1) =20 /** * adjust_signal_pc: @@ -585,10 +572,6 @@ G_NORETURN void cpu_loop_exit_sigbus(CPUState *cpu, ta= rget_ulong addr, uintptr_t ra); =20 #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); =20 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 =20 +#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))) \ + =3D (mmap_lock(), 0); _mmap_lock_iter =3D=3D 0; _mmap_lock_iter = =3D 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 =20 #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" =20 #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" --=20 2.45.2 From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029767; cv=none; d=zohomail.com; s=zohoarc; b=V2naFirpkbg4gRds4nE2Sdu3lPpCvxE9ic8usD4MbLc0WF+dgmfFpszKVSUp1QM2wjToYBd9iM1FAsrtwV3pxDS79rkkTQa9J6pZi/RfWdyLx3zRDEzl0e2DvVuUxgk6gVLgWQI38zClMHON0y0+xhkjnjhStymAxIYTj0IJxak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029767; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BSVRLQ/NCbTr+znZaNjcUH8IYeWT9qLO5QVBWX7wORU=; b=hwNygtAkfQs4Nw6NV3RfZp5BkCvctgnEUuERpN8bwRLxgka5AbEUjBn2ukhjHz5cqmM4qWNToyNdqsTf7zfLIY6eZ5Vyc4Wc7wBES5jaaCiKKlrxQueorZnM+VDcSfP1wRHwu7iDdFuNcN4cV2Z0KMKRf3wfgGPkefluDDWATBw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029767267225.26773892461551; Thu, 12 Dec 2024 10:56:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:54:49 -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) 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-Google-Smtp-Source: AGHT+IHVXn2W0r6tSoU77aUt+fJJfO9dJ9F7xpCFOmjp8kKXPWlbXNvPPa5bMX3EM6iHOqc6KPq/qg== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029768675116600 Match with the page_protect() prototype, use a tb_page_addr_t argument instead of target_ulong. Signed-off-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- 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= ); =20 #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 =20 #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; --=20 2.45.2 From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029715; cv=none; d=zohomail.com; s=zohoarc; b=PeKqUkcKxJt1w5elqWsiPVU7lF82x1GAA8+pU0b4hvP0vkixj7fmLSNxpeIEt6QtywOrGdyahhpgJoGuVl56UbvYFgEc7vxm8e0BmkMItDwvOTqvTLVq01zmYYrItC45rWXpx7ChbZFyv11tz+vD11OHQ29fRhBnvpL2K5xPSDA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029715; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wzjyx87cr+skPITGE7mdTMDmXSYN6jRMWc7DyfPZwow=; b=BuI8ft90MVSLdYdS7KzFf7IcrpfYubKSoKJfbZKhq7fEk+sOuS7qgnnPIWwXreEKhHEBR//ZnzknGq5wDvIWHz1Uma04M8xrUTrfZB3RLzWQUJFdiymFcx0qU8UpYh8mYZMCyrrZuZXIi5/tOFEwpZT0JYn+++now9HGcae1sq0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029715547739.73515000553; Thu, 12 Dec 2024 10:55:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:55:00 -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) 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-Google-Smtp-Source: AGHT+IEpGCCOj8kx4DZKiQn/bz1/tnVJbhk9n7xObcFHKKw2JXjOt5CZWWDoG2dnZnO8c2K1b32DMw== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029717746116600 Signed-off-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- 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 =20 #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); =20 -#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) } =20 #ifdef USE_ELF_CORE_DUMP -#include "exec/translate-all.h" +#include "user/page-protection.h" =20 /* * Definitions to generate Intel SVR4-like core files. --=20 2.45.2 From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029748; cv=none; d=zohomail.com; s=zohoarc; b=HW2pQ6eDbs8NPzFdseugjkPhxaVNJbFtkgE6ZKgfNKFkNC1IV82aMDIcAteQlzr4w36gmriTg5Ycn83oVGL44OOFMemZmn2bmjl0RTpsEnIRrnRavwl2LzYUKyGsyL8tiSxZlnFOPTkskhlTQ058KVs9G9qoyRz1k3iyI2HR070= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029748; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BOxJYB9c/D0W9G+42lYaV6c+pfgO+zsH3Ru4s5NUUH0=; b=l6imzLUXiWmkIlAfECSvqpW3sGhcXM273ZStWVYkEr23E6Mp1hudgssRarqguSwRqt0eCXPzIJFi2CUfEBAgw4KkIoFdz1zkqoZSCmAsz9cuTxV+VdZBMlw3KbQvEL9VYHdKxbOt66SPFIQ9DEIAcOPgTsHCQAgNMTT7i3jo8Gc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029748201833.677984299662; Thu, 12 Dec 2024 10:55:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:55:11 -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) 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-Google-Smtp-Source: AGHT+IEoVSwNUzl8qPZi3omoUTdty7I609Vw6o3Pl9bf7M6vpfdh9xdYzYC3cU3NpazF4ZsszMDDzQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029748682116600 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=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- 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 @@ =20 #include "qemu/rcu_queue.h" #include "qemu/main-loop.h" -#include "exec/translate-all.h" #include "system/replay.h" =20 #include "exec/memory-internal.h" --=20 2.45.2 From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029757; cv=none; d=zohomail.com; s=zohoarc; b=HrIA2dNc1saTQDI452tVSsUuAEqr3PhXLyipR//Kof9NZrKJA76hciphm5hs0mvnJ2GIJGHapDvJeVcuGvRbZtQpr+m/Q/8WBJ3VMktDGycg8jol+1Ak3HKjxIVZqV4QFkHVT+vIpJCmMK+JvFtjq45caS7UC+z+tvmOeVYpu6s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029757; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Gpa7MaWk80JbZDJF1tLVqJgKe0L0noYL27xWxmaxilM=; b=Jv/rJwqZ1AkdcKlUC/V0Uq+GixwKC7nulQ0AseBT48KOkqy2FjOzoVluMAT0o4sYM/Ol+2V443GQgVxBpr3hvT8SUdbwKdWVhgqo2ggP4h7uTzQO2xokAyrZbLvg2VrSv0rB6J+OmVdrRYnx7lQcu+P0BYwvcgvRaD0y4YUs1Oo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029756947482.8935796045421; Thu, 12 Dec 2024 10:55:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:55:22 -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) 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-Google-Smtp-Source: AGHT+IFB8zxPhJitCrvNVqhB8G2wFOTAWji+InjjbMpKknt1K5wyHmkSCeo5TmD+7ST6E/PHdgbqgw== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029758788116600 "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=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- 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 =20 #include "exec/exec-all.h" -#include "exec/translate-all.h" +#include "tb-internal.h" =20 /* * 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 <http://www.gnu.org/licens= es/>. - */ -#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 @@ =20 #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" =20 __thread uintptr_t helper_retaddr; =20 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" --=20 2.45.2 From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029805; cv=none; d=zohomail.com; s=zohoarc; b=nEopG2q66c5OlBbarfq+iFG8zG4EpD3c6fMeaiJTIs/+KeVrabZnYA9kCFsIdpu0rTW14smdbb1VeyosF9APKSwpmmevufYSOn2EFLf+RmawptPa4GgyhSO4aFG1xpZWep7OQaLuJ+Se05mdYmZ7VnQX0n5I3SSyX48SsJiegro= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029805; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ziwrhan20pghgkypPdFtUixUvLCoelaBHFetr07pBgc=; b=N/0fZChk7BHh3s7XsfQeYbICpx2KhdBd8gVbwnad9CVMAxxA6Ux7k3EZ5n16VpjDvm1EYTNRh8TZQDNBIwsi88qysl3f/Mu69wLhd7/NdLyRIwyg2bpEmLjg4UZ2WzJRxUbwTB9vy5zX+DoDdla2LAFQX2CcPPyosDhrBDpznWg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029805685825.4803026790255; Thu, 12 Dec 2024 10:56:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:55:33 -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) 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-Google-Smtp-Source: AGHT+IEjVYnKYHst3x982Mj+S8+Yf9LbZFi2Xvy3Us7PwtpoPXMWd780sprz5mJY06DeBw3Cpo5qdg== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029806965116600 log_pc() is only used within cpu-exec.c, no need to expose it via "internal-target.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- 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); =20 bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc); =20 -/* 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; } =20 +/* 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. --=20 2.45.2 From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029790; cv=none; d=zohomail.com; s=zohoarc; b=SPQga5HwbLPGty3e3RsXPKemhnxikHSjvQ6Q2/Fxlyl3JnSEPsCJYWAGvwr4/fhMWywIRc3Q/tHnNPg2fnBv2rHzbo0nZU7CxMAvkCO0hYqEi506HHUz02d/54Lw7mr3r81BUHlve5zxPVnGjx2rsrE7xlhY7TTx6e6+mzoZEQQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029790; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=D1n7XC7xi+MDcynuS7YvQbch88e08UKjXYajcUgA5ak=; b=YiPDMeiUmyC7wm8vn6JEUEAqeb9Psjyb/KBvag7f9Uosn7jph+PggAYKBkFqtQI3j9YZDsq4fgtFZgoE8AlRWTuIRgda0PNVjhBoSIYiOXJLFblsLIh2yCcGsKCIVdaYtpiDQfaYP0HkSPVTW8budiV6U32++7Y8a5udswlDD5E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029790451601.1911830870256; Thu, 12 Dec 2024 10:56:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:55:45 -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) 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-Google-Smtp-Source: AGHT+IHxMrXErsgg5aA8HGY51xHibK/19ppf4Y6eZwr+JG3+GG1ZHq1hG0tqfh193adkaqF3LQ5p7Q== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029791018116600 Move declarations related to TranslationBlock out of the generic "internal-target.h" to "tb-internal.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- 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 =20 -#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 protecti= on - * 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 */ =20 -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 =20 +#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 protecti= on + * 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); =20 #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" =20 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" =20 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" =20 static void set_can_do_io(DisasContextBase *db, bool val) { --=20 2.45.2 From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029806; cv=none; d=zohomail.com; s=zohoarc; b=HFN/CM21FzClpHkMmpPzq+v/y0S8+bPoGid/j6eQ5jilBcHRMPen8ekwIPAf3RRIIZFsOiEEFvXgu/ss7xFjfZf9IRTH7LvW5QDZcNQaiT5ttCsKqKUmesGgNTDaEu7fgZtCmOlWgBN1EaZPVwPj2yu3cynF/Cd/Iih+xZM3ZgU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029806; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CdnrZGUpPexZaRp1gyb0f+RzXNxhb5NfrEmgTu8F7Mg=; b=HPM+Qr/s7k4Cg4wKsk++Vkmm2S5HF7fj22SnMcd2v6AvWrLJAxqInmTf/hlHGsm9ICyhHiVfJNH+RTR2bzcydNjCzRfSu+YzE1a9+fPHTUoaI3hb1nVHu2e2HOQtlPs5K1XjVDy+TJNcC5Zffp7e4NdhMCnNL8ypecTnK6jHQ2k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029805975424.838307776874; Thu, 12 Dec 2024 10:56:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:55:56 -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) 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-Google-Smtp-Source: AGHT+IE5bIF9VtLylFp1j+0DZ2Ndsno1rZUC7F8vX1IC/vjDv3nvLZ2NAyLsHTzaYZ/0TM+/P6mzHw== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029807026116600 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=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- 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) =20 #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); =20 int page_get_flags(target_ulong address); =20 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 =20 +#include "cpu-param.h" +#include "exec/target_long.h" #include "exec/translation-block.h" =20 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); =20 #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" =20 #include "qemu.h" =20 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" --=20 2.45.2 From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029791; cv=none; d=zohomail.com; s=zohoarc; b=H42/ltz2lI5y3WUpiGiUJ6pMuhyCp68+WeInn8ExzNo0klVrzbDd3Lmmn3NY9vpiqZFdhV1wRTy71v/rEY4YOIwIqkQk7iZn1ZA8lqipuJHy/6UYlZMfgRxC0P2hlMM33i7yj39oo7ww5t8MdCb1bzNRRgzbMiSYz3p7Gq8mXEY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029791; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rY7v3gnKlkSHCmEQoYs8O0U0xsJ45+WLP88dw8tMIX4=; b=idTVLebgpFfcpSHtGr7UTgK7PiT7ACA0O3RPfY0qaCRa5+kM/ONLeZ/HjpCyw8UrKsX1U/U4PjrEXzg6BczqWmqaMx7ErjV+oQ711KVzDtchTW7VMCFSHUmR3NRPmdU64yQx1WFelgdKShRkEzwBDEVZUZqFfST89lntpCgXcS4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029791151629.3855664761264; Thu, 12 Dec 2024 10:56:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:56:08 -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) 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-Google-Smtp-Source: AGHT+IGVriHepJXLt9Oqlkoyemt+3qI5X+c5gNt7ub/QiFf6Yux5eB90Xk6ywMjw2pELro7JQeUIoQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029793002116600 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=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- 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 @@ =20 #include "qemu-bsd.h" #include "exec/page-protection.h" +#include "user/page-protection.h" =20 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; =20 int page_get_flags(target_ulong address); =20 -/** - * 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); =20 -/** - * 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 =3D=3D 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 =20 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 @@ =20 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 =3D=3D 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); =20 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" --=20 2.45.2 From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029805; cv=none; d=zohomail.com; s=zohoarc; b=iexAM9VRDoySV5adi39jI45tGvkBmCj9VhIEmfmk+HWqMoNPnMcC74pWf4LSI6dqsObislNXO3Ze6QV8VfLGXY4+Ld8KE1CZfWDqJx/qnFllMPeKLchHG6et6ZGLbmoFZ1Qrn6ZAVYPGZKmvWZ9comc3r777pW9IUL8hDLgrXo4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029805; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8ZyQqmYchOy//62KNVupcJGjIjPSDBJu9hZW1p798Mo=; b=mb76c019cK2LOopvTqP9Dr2PpMjMchSayrJtXOb5+uvf4J1jjpVC35S8/eDI1vL5IHvB8FEowH/XWlqWzMzuLLXl9D1gX+KFzzE6AJ+EUJBbaV8w8Ta9W2QEenPVxCJnbwrzBhXK9LOV1z7Z0JFCHINBwu86pEvjRA7cOqBAGlg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029805359750.2063814767257; Thu, 12 Dec 2024 10:56:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:56:19 -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) 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-Google-Smtp-Source: AGHT+IHM57byOq8DidLWbTmPN2WQBgsCoNziLeUwN5Tnn5M4sqXtv1HJMh32t/398Ma0glSbYRgoiw== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029807021116600 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=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- 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" =20 #include "user/abitypes.h" +#include "user/page-protection.h" =20 extern char **environ; =20 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; =20 int page_get_flags(target_ulong address); =20 -/** - * 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 =3D=3D 0 is - * equivalent to testing for flags =3D=3D PAGE_VALID. - */ -bool page_check_range(target_ulong start, target_ulong last, int flags); - #endif =20 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 las= t, int flags); =20 void page_reset_target_data(target_ulong start, target_ulong last); =20 +/** + * 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 =3D=3D 0 is + * equivalent to testing for flags =3D=3D 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" =20 #include "user/abitypes.h" +#include "user/page-protection.h" =20 #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 =20 =20 /* 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 =20 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" =20 //#define DEBUG_MMU --=20 2.45.2 From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029840; cv=none; d=zohomail.com; s=zohoarc; b=VLznnlQKRhBS4Gp0MEP0x7fIFKKXPJWUV2DlRHBxbiZj62RcD0Sq4JPLiD2cFtDlj1S8FuYFy6gvsMTTz4WxvpxQw80PEFmPJfuKyChcVLGi+SZd7BpXJmyPng2IVOLhH8DUMgl2tnf8F51/yVt/iO6AO7GzDDnJbueiDzDkXZE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029840; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NYC6oRELj+5ympYW3tq1E6/ibkizwxjQsKp5dy3fobw=; b=Q+AYtUukUEJNGxpGfcXWDxCPCv2ZztPVHyItACcQiMlwpaUqu3xRwqFych6extKj4i1jV6oBYB46psU7MSHjryo8c6Vx9bFIUAQ+g6ZlzeievzZCoWvNf63UI1nlBCc2TSn94nOH4wO/pAfKZCYzCcxTfocCWDG2uawruK2pXvE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029840093339.6444561291387; Thu, 12 Dec 2024 10:57:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:56:29 -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) 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-Google-Smtp-Source: AGHT+IFkU2xkXlA8Y2CzEYBoSsiW8RBj7199k7WmkhLHeDk0U2aEGg9++ya8Sf3VjW0R/4DAYuNf1w== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029841162116600 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=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- 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; =20 #define TARGET_PAGE_ALIGN(addr) ROUND_UP((addr), TARGET_PAGE_SIZE) =20 -#if defined(CONFIG_USER_ONLY) - -int page_get_flags(target_ulong address); - -#endif - CPUArchState *cpu_copy(CPUArchState *env); =20 /* 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); =20 +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 =20 =20 /* 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" =20 #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" =20 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 <zlib.h> /* for crc32 */ +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif =20 /* 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" =20 -#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 --=20 2.45.2 From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029837; cv=none; d=zohomail.com; s=zohoarc; b=Rz2pUgGb+0wAJIYbUJDcZ3l+rr7SofUcOVotzVH1S9cUL1H2DmHzYXvJcye5jc1Oxc7OLUNtE71t30kFo8G9/ruOBb+CwgJObPuT/3RgBIo3OtTkcFue9jcBbZJF/SvsFFBFDOeh4HlMRgod/nV75vVG6XTqHLaZn172JdFr1FE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029837; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sXbrBv48FmvVxm7EUcfZTZ2JWJOTl6EXN6xCwbK7DzM=; b=bp4BovUfsdRlO0zUFeZe+Q2WQ9UJVbw7TOk373jaMUdvoosGfJEJSViESiepB/mIJFzxQ0Cjy9f/XwQ0X1brx3hwJXXvei2UX277i4J4HbCeBdKBVf3qSJ00uNsi7Wzd0xSb9DLE1cACPwwhFTa/VtzvryJ0wwKyBloRJNjuOZQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029837765902.0375292500437; Thu, 12 Dec 2024 10:57:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:56:41 -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) 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-Google-Smtp-Source: AGHT+IHeEa+zyknpO4K7xgw1SnTYMJEF4cBaeOs3elmpe1j6pEFhJfgL1AHIHemovxsyeCfLPSz6pQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029839036116600 Signed-off-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- 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) =20 -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) } } =20 -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 =3D env_archcpu(env); CPUState *cs =3D 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) } } =20 -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; =20 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) } } =20 -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 =3D env_cpu(env); TaskState *ts =3D 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) } } =20 -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] =3D regs->sepc; env->gpr[HEX_REG_SP] =3D 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) } } =20 -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 =3D 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); } =20 -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 =3D env_cpu(env); bool is64 =3D (env->features[FEAT_8000_0001_EDX] & CPUID_EXT2_LM) !=3D= 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) } } =20 -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; =20 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) } } =20 -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 =3D env_cpu(env); TaskState *ts =3D get_task_state(cpu); diff --git a/linux-user/microblaze/cpu_loop.c b/linux-user/microblaze/cpu_l= oop.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) } } =20 -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] =3D regs->r0; env->regs[1] =3D 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: } } =20 -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 =3D env_cpu(env); TaskState *ts =3D 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) } } =20 -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; =20 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) } } =20 -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; =20 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) } } =20 -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 =3D env_cpu(env); TaskState *ts =3D 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) } } =20 -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 =3D 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) } } =20 -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; =20 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) } } =20 -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 =3D 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) } } =20 -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 =3D 0; i < 16; ++i) { --=20 2.45.2 From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029852; cv=none; d=zohomail.com; s=zohoarc; b=QabBQOx3K2v9lufGzmOh5bRz6bpAXBLgupHlKisc4JQXuT+0iexNiJJxtI06t9jeJpvztEl3+3VkWLSzPjj+cX3ak3LMzuNu0fvksIw2d0EG6RmlXYrM0sQMzOiRtY6F0EcGyHMcul+lwRoCtieMkt3O9tXPGtyEq+ssztvqUbI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029852; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XxnAldCWCOu0O+NMnk+36JEDl4qw0oIa1uAJFBjrs8k=; b=jHf0MAwo9501tU6CYOquy38qc4/4Lu3n13usX3aVP2QpLvIAZg4jVsjZkRsxKK5SFqBbi+T5SONO2L5HO9RY633byjiXRQ8ZKycv7CBjjje6e/4+fDPx2ST/4BHCKndeuX00Zdr5PUtTQ9nkPNZFlJsD+biosSXQI++GZPg3Arc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029852796260.408801564446; Thu, 12 Dec 2024 10:57:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:56:53 -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) 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-Google-Smtp-Source: AGHT+IGxlnTOMDBn5XK1yLouRwAG+eqlKRuh6NafXdeDXnh5GB4tuA3jmub1t+1x65rlau/7sDfBMA== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029853147116600 "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=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- linux-user/cpu_loop-common.h =3D> 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 =3D> 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 <http://www.gnu.org/licenses/>. */ =20 -#ifndef CPU_LOOP_COMMON_H -#define CPU_LOOP_COMMON_H +#ifndef USER_CPU_LOOP_H +#define USER_CPU_LOOP_H =20 #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" =20 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" =20 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" =20 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" =20 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" =20 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" =20 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_l= oop.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" =20 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" =20 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" =20 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" =20 =20 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" =20 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" =20 #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" =20 #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" =20 static void xtensa_rfw(CPUXtensaState *env) --=20 2.45.2 From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029847; cv=none; d=zohomail.com; s=zohoarc; b=NW9an2TSgiN/KDQlcwojnxtfZYg+z085efRT4sfRKE5j8Idw1QfxqahmorNSMpRVgzBNpn5yeV1ms27Mi98Kobz72QPbGS5/kl/KnEZePhc1Rzdje7PyCrNtmslW8LKglj8YfemmUBQ2gGAjphfBWat01CiqHOm/s8tIxepLfCs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029847; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4Xzd/um0GVNgOnzI0D+rGp5GEvnFQawTaHdbkCJf8k4=; b=ffj0ASPfT3Tq/e98bcCYBRPYWGEu0pOSNuAohTVlhO8m1Ez8hukh2f+cgLjHR3jvJCZyrilITYiZ+VqjCtoPVRpC69vrskP49gb6OepTjCFu2CkUhjLDMdVuHydM6jzN74zT2By2CdNswUbO8HK9ByKawLHWF67zS1q/vC1hzIA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029847882969.1876219100601; Thu, 12 Dec 2024 10:57:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:57:04 -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) 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-Google-Smtp-Source: AGHT+IFdhp0xCerJaashwcj7KlfhXzfhC9ypAIxLzc7A5FRzAEz/MyIdtV3uQMK6qiPOfqlWPsjdOQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029849109116600 Declare cpu_loop() once in "user/cpu_loop.h". bsd-user gets the G_NORETURN attribute. Signed-off-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- 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" =20 #include "user/abitypes.h" +#include "user/cpu_loop.h" #include "user/page-protection.h" =20 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" =20 +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_l= ong 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); --=20 2.45.2 From nobody Thu May 8 02:39:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734029852; cv=none; d=zohomail.com; s=zohoarc; b=MKW/XJMF5aH3H8R6CDaPqOlWo+x/gNXPqacEOYm6w94ECrWPPNq92NzVCzY0ey/XW9MOlTcOy0qk2TW+nPsPETwCGtvMAzgcvwH+FqeP5u6RHX4lFCiN+s1sAUVNtelJuBu/3k49DatqRAmPzFnBQIND/8CAog6ElksZyJB7FOs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734029852; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZoaiN8fGbAdoZl91RstCXbOrdj9RzBIlWptTLfxPGQw=; b=M6JbaO+UxkQBr1BRWe6rvIz0/uYM/1gkzz/5MwJ5wmJI4dTRTHyA+bJYgo14Rzi+I6uluTX08m/iVHtgsYqNCtbLVOJHCSF/Xi7n2so4xEfPyUWzUzTd+0OInzh/OYvJ3PhsYKOk1g19M2UCY+Ovu3xHIZV2EhlU33gvnq+Pqhs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<philmd@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734029852864469.2164091078238; Thu, 12 Dec 2024 10:57:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; Thu, 12 Dec 2024 10:57:09 -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) 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-Google-Smtp-Source: AGHT+IFmtSaV5uAU6WSntpqzBJroIIONvvk3AgSYOZjG4xeSg/NFjpm1g5beMkkHrJjXYGtmleVkTg== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Richard Henderson <richard.henderson@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734029853373116600 Move various declarations related to user emulation from "exec/exec-all.h" to "user/cpu_loop.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> --- 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 @@ =20 #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(CPUArc= hState *env, return get_page_addr_code_hostp(env, addr, NULL); } =20 -#if defined(CONFIG_USER_ONLY) +#if !defined(CONFIG_USER_ONLY) =20 -/** - * 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); =20 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 =20 +#include "exec/abi_ptr.h" +#include "exec/mmu-access-type.h" #include "exec/log.h" +#include "exec/target_long.h" #include "special-errno.h" =20 G_NORETURN void cpu_loop(CPUArchState *env); @@ -33,4 +36,55 @@ typedef struct target_pt_regs target_pt_regs; =20 void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs); =20 +/** + * 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" --=20 2.45.2