From patchwork Thu Mar 13 03:45:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 873121 Delivered-To: patch@linaro.org Received: by 2002:a5d:5343:0:b0:38f:210b:807b with SMTP id t3csp271492wrv; Wed, 12 Mar 2025 20:46:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWIKr5KrNYIChsuYi9jGb9CI4QyRJxiC9hIaNA3810vKapGJsr1+yEtFvymAGQHEu6g/UjsIw==@linaro.org X-Google-Smtp-Source: AGHT+IHqzQucKHRuRNLalFF7GRzhBqh2ZEevEVyfd9dsILy2DnfWla30z/wsxdDVR2tMS6WZA5DL X-Received: by 2002:a05:620a:6505:b0:7c5:5154:cb2 with SMTP id af79cd13be357-7c55e8708a9mr1758843885a.15.1741837596786; Wed, 12 Mar 2025 20:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1741837596; cv=none; d=google.com; s=arc-20240605; b=akZ/+c+KJjXYW3zq0vW+aoPxuTMUK0BquuDX1FY8ivLeS0Rn3dzZPTxV2wDIimKFuP m17FyJXYovlKUWsE3JtCWdV82npdMA4vK3+os1+zLQ1wd6pAwFHfPltjOwkwBtQqz82S s4GEz+tKeawjonX1WIeL4vc+RYmWHrpZwR+aEC+YkHlnU4tyg5QaY4WlD1kWKRh72g4z waFuaGUskYfBxL8sy9tzl3tzpNPzVNpfPz/s3c8spRucbTUvU+spuXLLUMSoojGWkHWR xbrgc0pu24k3jJF1RTgYko0zl/NVtxgfOz5ot9t1g76vs6CITJWRAS0pwcmZKf9qHI0c Unug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aK//rMFZS5m/xTF4BT0rTuKgEK3G2LafBMbe8sULGLA=; fh=DMsE7tt1yctKFfl3yHwu1RCUVEpd9TdAG7FdasYB91k=; b=cbRB8hU9e43aWzm+wMFJvhHfQVxtG/2omBwTguBXMc1HdXKM/PuI33rF51Iy+rpz6p ewkY8/xI46ZZ1YdFhXwN+GzeZBC6k/kdIJ7TTezg1aa69bmlIXFPdXWh5IrVObVK99cw aLZyX45LOzqd/t7eW6nSXIrpQYwLO1IRw2OSQPB12HoKmFTUH05yjazMoiEGv2zrZ2Xj eZN5e3RdJlPPsuo+yTwCslCCFFggrEXWKKTmyWMzQT9nyYdWAZInvIM2pvyc5X+D/qmj NjRtzjX/taW83wuDcQSFejP3q5l4CL9TEr5CXhkBZDT+6+4OjYz0IZhf2V4dH7CBsXNn Z+ZA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jC5lTGaB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c573b728desi83158585a.44.2025.03.12.20.46.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Mar 2025 20:46:36 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jC5lTGaB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tsZWV-0004nN-Pq; Wed, 12 Mar 2025 23:46:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tsZWE-0004hR-KM for qemu-devel@nongnu.org; Wed, 12 Mar 2025 23:46:07 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tsZW0-0007oT-Ug for qemu-devel@nongnu.org; Wed, 12 Mar 2025 23:46:01 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-22337bc9ac3so9038665ad.1 for ; Wed, 12 Mar 2025 20:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741837546; x=1742442346; 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=aK//rMFZS5m/xTF4BT0rTuKgEK3G2LafBMbe8sULGLA=; b=jC5lTGaBczqXxsLMDHm5SmCR/pH5oPwBBpA3c50D7OLUpTzyRBYoxwNxQ0dlyo/dd1 ij/d7jmkrgHy70+8W/We0WwiaET8Tm8FSztXJfwnyGG/U8iGtEjuYHbtUT+dEcz1ALCY 62jnZUmNOtkWwrK8f4p4nwBHlFOoGZ76gx54PGNP93z/zY4F3uYEIyn2zNNvhYBQF8t5 MG5CWkKCDlE8JVmA2cvL7q4XRrLhdUmOn1MT1HNh4ezdoiJudMRZ3b2lGR8+2Iwrdda8 XAthbazNBbjqq9QH5TElsr74IIZw+1S+cBE+WnllFHrXrXQe55nbzFR/+tRQqO3w0zIm gWTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741837546; x=1742442346; 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=aK//rMFZS5m/xTF4BT0rTuKgEK3G2LafBMbe8sULGLA=; b=Y+GGMecYfuIvmXKrx+YB4ivCS4hlaSZwIZlPAjewy0hTFkRv8c/jCc9HvT65xxfGlg uNWnvqblbelm023zcQL3723ovY7cMXFC7V/dnenveE5yzxCPRn/pQtlgO//D0HxtnTVE PRQOZ66Dcr1ueDRty6/hs5B6H4lnF1jQpJ7ctf1X920TIAzRC2CRQ8hF7IzZwm117vee WBPeYDuz9pv6HXfOohphwr5bQ+mp16lv1QTmkw3yxM0ZlQC69QAJ3o3/2iVJB1JDjruC VAlbnvibiiw1niKTtEGQ7yyCOSEoZUal4bhquK8BCmJYlgR7T4UbQk8Zsmgi7DABTyjW fxeQ== X-Gm-Message-State: AOJu0YyDJVDMhNOIm3j5TmCUTOSqxXZ4+o3LLxdyYs6bXpxSQlBlO3RT QN1aQ+vzyJuk7TQJgou3PSgAr0GaPkA9ZvRLxrhHdQDA+kfMKjSFhOh4+zCkAjaB3cGJILCLWbn t X-Gm-Gg: ASbGncsDtVpoO3BwubwB0wCaJbC00yy36g0Dh9Y8DBDTyoQqBHn0JTxAxndwd2631o7 rVKAHPjP4cHNyrWG+u9s7lOn+/iKWrg2mMuwkE1bsDzf4yALNHF1fBmSRkNbGh/lf/wJ7DRmFwl TNH9jdIj/UgIbxXBHEgolzrkwSORTaXEVxfxtkZUNkTOzrYJDVPmjbS34yvqVtRpNMl301Mk4W8 uyd1sTw4xKI8ek/+33cFBtSPNmaJf1iv6jXXDFeY4P1Wqe3o2mrFddTrRqpn42uBuEWt7zD9eyM JRiV+D5yKFKfKXFpqZl6L/onp9Cgwnj3xGUKh045WAiJvkxOZqKCiwWZ9xuYMCEamtkwSDUrFEA T X-Received: by 2002:a05:6a00:1395:b0:736:476b:fcd3 with SMTP id d2e1a72fcca58-736eb8a2cfemr15070461b3a.24.1741837546508; Wed, 12 Mar 2025 20:45:46 -0700 (PDT) Received: from stoup.. (174-21-74-48.tukw.qwest.net. [174.21.74.48]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7371167def8sm316781b3a.90.2025.03.12.20.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Mar 2025 20:45:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, pbonzini@redhat.com, philmd@linaro.org Subject: [PATCH 25/37] common-user: Split out watchpoint-stub.c Date: Wed, 12 Mar 2025 20:45:05 -0700 Message-ID: <20250313034524.3069690-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250313034524.3069690-1-richard.henderson@linaro.org> References: <20250313034524.3069690-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Uninline the user-only stubs from hw/core/cpu.h. Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 23 ----------------------- common-user/watchpoint-stub.c | 28 ++++++++++++++++++++++++++++ common-user/meson.build | 1 + 3 files changed, 29 insertions(+), 23 deletions(-) create mode 100644 common-user/watchpoint-stub.c diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 5d11d26556..2fdb115b19 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1109,35 +1109,12 @@ static inline bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask) return false; } -#if defined(CONFIG_USER_ONLY) -static inline int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len, - int flags, CPUWatchpoint **watchpoint) -{ - return -ENOSYS; -} - -static inline int cpu_watchpoint_remove(CPUState *cpu, vaddr addr, - vaddr len, int flags) -{ - return -ENOSYS; -} - -static inline void cpu_watchpoint_remove_by_ref(CPUState *cpu, - CPUWatchpoint *wp) -{ -} - -static inline void cpu_watchpoint_remove_all(CPUState *cpu, int mask) -{ -} -#else int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len, int flags, CPUWatchpoint **watchpoint); int cpu_watchpoint_remove(CPUState *cpu, vaddr addr, vaddr len, int flags); void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWatchpoint *watchpoint); void cpu_watchpoint_remove_all(CPUState *cpu, int mask); -#endif /** * cpu_get_address_space: diff --git a/common-user/watchpoint-stub.c b/common-user/watchpoint-stub.c new file mode 100644 index 0000000000..2489fca4f3 --- /dev/null +++ b/common-user/watchpoint-stub.c @@ -0,0 +1,28 @@ +/* + * CPU watchpoint stubs + * + * Copyright (c) 2003 Fabrice Bellard + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "qemu/osdep.h" +#include "hw/core/cpu.h" + +int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len, + int flags, CPUWatchpoint **watchpoint) +{ + return -ENOSYS; +} + +int cpu_watchpoint_remove(CPUState *cpu, vaddr addr, vaddr len, int flags) +{ + return -ENOSYS; +} + +void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWatchpoint *wp) +{ +} + +void cpu_watchpoint_remove_all(CPUState *cpu, int mask) +{ +} diff --git a/common-user/meson.build b/common-user/meson.build index ac9de5b9e3..4dba482863 100644 --- a/common-user/meson.build +++ b/common-user/meson.build @@ -7,4 +7,5 @@ common_user_inc += include_directories('host/' / host_arch) user_ss.add(files( 'safe-syscall.S', 'safe-syscall-error.c', + 'watchpoint-stub.c', ))