From nobody Sat Nov 15 15:29:54 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=1751381900; cv=none; d=zohomail.com; s=zohoarc; b=G1vW8pECT4aUKW/IRGYVCYJ0182s4hPvxmtW6Q79n5eBCTgpsU7Fap6OKOn6D+rejI9b2V0fbwGn8/IqLgM2khxCfp1RmYhwYJb3RQeal+BISpguKl7E9hPnOhl8HvZZFxk54aH5w0jKF5cETcDkKKXmy9d5vewjnzdMGQVNoFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751381900; 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=QgP4tqYRygNF/qbfEH0O4ZbQcscHGETVIN7Hvn8iOoA=; b=g4oTl/PHJZbxrJHEC58h5rD77YFAcdNuCgk4sM8SvrY6YXC9szntCTl48UNjsjJmZozLOlSCCgJsW4A7e5xZPwPKsGhetZwe8tVtOcIjMaVvcJ0J98niqqZzRM7+EM+nN1TmqJ0Qz7fXSzCg8K5YIeGBDEdd6Strt7G7fvRkgT0= 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= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1751381900887226.29748590926965; Tue, 1 Jul 2025 07:58:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uWcD0-0002TB-Cw; Tue, 01 Jul 2025 10:43:42 -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 1uWcCS-0001Xb-C3 for qemu-devel@nongnu.org; Tue, 01 Jul 2025 10:43:11 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uWcCM-000735-Jm for qemu-devel@nongnu.org; Tue, 01 Jul 2025 10:43:06 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-451d41e1ad1so38356915e9.1 for ; Tue, 01 Jul 2025 07:43:00 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a88c7fa8fasm13377364f8f.28.2025.07.01.07.42.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 01 Jul 2025 07:42:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751380977; x=1751985777; 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=QgP4tqYRygNF/qbfEH0O4ZbQcscHGETVIN7Hvn8iOoA=; b=xZ6mB6/O9wURv4AaqwfZlidY8vWllO+rwehEqIAGAXwOZnZuYtLr3US9hTRLnhrmnw /yw08lJnLiPQx+ZUgKHoz7iylkyi2ir4U16fMDuLTfmjHMMPutmRD5W+NpLDMRIOwUSX Ly9c2jqWDvSKWI1+/I55zhWbHOayH38f+cLpdQN6bz0jLsSVv8WkTc4qk6i6QEicyxdn y/kfc6grJIMfiSD4P/HSOUzOdsi0K+hEtZYLquqzrGdfn+rrt5+Qt24YdJcBqKH8OOS9 U+ffi0I+brmgBLJFLe7kZy5qp2rDFn/bqpnhyUg5iM7ZOz3aaOO3aYI9uQIQY7jy2gEi f8zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751380977; x=1751985777; 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=QgP4tqYRygNF/qbfEH0O4ZbQcscHGETVIN7Hvn8iOoA=; b=Id2QlSPOGcZhxSqIair1wd5+53yhyiCxjPqlGslLz52XADIjehf1pQ+PskkRyotEnR PYRNUq7r9oGtUrunlg4agsAUdvIONIUQLyBuVmkZbUFhi6Mkuwfef5LcwpRPzrdGjAoW ZNulgzzF1/u8rpKgbYegCpVzLnIWmyAe5InL8ieuRJ845gDljDg7Q7xsxyyraizxexnG fNGfCnB8aLT0pU25/mpx6NmfrwjRgX5ki9JMQHw8QX3hfmVkRcdOWThJ/UWdRznMowHG xYJats5yS+h6AXgosgSHt74siVwomNA8myG+yFevOfaVXireoC9It0BED1Aqae31H+A6 DnPw== X-Gm-Message-State: AOJu0YzS1NpmA4Kms7gjmkCGHfNBrvIppEszI64dJ2/rKktr6ykrhyaV ZybIz4jwEnF/S9C6kR6awUPm5S/md2bW2u/r9Fd9PgKKaz4niKIvVhuDZEZdXDX4ZyG2p1RjGw3 XsPrz X-Gm-Gg: ASbGncv0jnZR9RRm57hclyCl1eskPCYxLe1otJ0dTYlYaaXZ7lERp/iKDhwAaKjnw+I QAIx5G9V7WoUUuU9pnkQjwJsj0AqlpZHCHeA+2VUoRBgJfn4coKXwLk2XBe9+wRGxFZLSewYG+s JuqCJXbU6FvwaHHjlnaG/GKJDZXDv4beIvUgTsydD3Fypgoat791EGtHvo3Ml6U/s5f2OmBcblW 8ANZNA4esnKslh8DodnHYBpZsH9a0O1G7HO61u3iZhuxSkM+j0EJw6QrZ3of87XJPawLbXt3vPS gbEOQpgam+7DJ++u1zE8rrGFPin4ig67v3h3FJwzoRMZp9yVpbgEDxBNPBAOQJaUpfLMRkg3aYT I17N0H5vS4VjJuSIQb1WfmaFoHGOAPIfLKdT3 X-Google-Smtp-Source: AGHT+IGxmZ48PnEKW2Iuf076bEtlA53LyyCQeT3muqYLsz0zHXzQ/Te10GCglQQeN3XH89NhWjxE+A== X-Received: by 2002:a5d:5f8b:0:b0:3a5:8cc2:dabc with SMTP id ffacd0b85a97d-3a8fda359d7mr16627589f8f.5.1751380976861; Tue, 01 Jul 2025 07:42:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Julian Armistead , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 29/68] accel/hvf: Restrict internal declarations Date: Tue, 1 Jul 2025 16:39:37 +0200 Message-ID: <20250701144017.43487-30-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250701144017.43487-1-philmd@linaro.org> References: <20250701144017.43487-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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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: 1751381902307116600 Common code only needs to know whether HVF is enabled and the QOM type. Move the rest to "hvf_int.h", removing the need for COMPILING_PER_TARGET #ifdef'ry. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/system/hvf.h | 41 ---------------------------------------- include/system/hvf_int.h | 36 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 41 deletions(-) diff --git a/include/system/hvf.h b/include/system/hvf.h index 7b9384d816c..d3dcf088b3f 100644 --- a/include/system/hvf.h +++ b/include/system/hvf.h @@ -14,10 +14,6 @@ #define HVF_H =20 #include "qemu/accel.h" -#include "qemu/queue.h" -#include "exec/vaddr.h" -#include "qom/object.h" -#include "exec/vaddr.h" =20 #ifdef COMPILING_PER_TARGET # ifdef CONFIG_HVF @@ -40,41 +36,4 @@ typedef struct HVFState HVFState; DECLARE_INSTANCE_CHECKER(HVFState, HVF_STATE, TYPE_HVF_ACCEL) =20 -#ifdef COMPILING_PER_TARGET -struct hvf_sw_breakpoint { - vaddr pc; - vaddr saved_insn; - int use_count; - QTAILQ_ENTRY(hvf_sw_breakpoint) entry; -}; - -struct hvf_sw_breakpoint *hvf_find_sw_breakpoint(CPUState *cpu, - vaddr pc); -int hvf_sw_breakpoints_active(CPUState *cpu); - -int hvf_arch_insert_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint = *bp); -int hvf_arch_remove_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint = *bp); -int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type); -int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type); -void hvf_arch_remove_all_hw_breakpoints(void); - -/* - * hvf_update_guest_debug: - * @cs: CPUState for the CPU to update - * - * Update guest to enable or disable debugging. Per-arch specifics will be - * handled by calling down to hvf_arch_update_guest_debug. - */ -int hvf_update_guest_debug(CPUState *cpu); -void hvf_arch_update_guest_debug(CPUState *cpu); - -/* - * Return whether the guest supports debugging. - */ -bool hvf_arch_supports_guest_debug(AccelState *as); - -bool hvf_arch_cpu_realize(CPUState *cpu, Error **errp); - -#endif /* COMPILING_PER_TARGET */ - #endif diff --git a/include/system/hvf_int.h b/include/system/hvf_int.h index d774e58df91..ea6730f255d 100644 --- a/include/system/hvf_int.h +++ b/include/system/hvf_int.h @@ -12,6 +12,8 @@ #define HVF_INT_H =20 #include "qemu/queue.h" +#include "exec/vaddr.h" +#include "qom/object.h" =20 #ifdef __aarch64__ #include @@ -77,4 +79,38 @@ int hvf_put_registers(CPUState *); int hvf_get_registers(CPUState *); void hvf_kick_vcpu_thread(CPUState *cpu); =20 +struct hvf_sw_breakpoint { + vaddr pc; + vaddr saved_insn; + int use_count; + QTAILQ_ENTRY(hvf_sw_breakpoint) entry; +}; + +struct hvf_sw_breakpoint *hvf_find_sw_breakpoint(CPUState *cpu, + vaddr pc); +int hvf_sw_breakpoints_active(CPUState *cpu); + +int hvf_arch_insert_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint = *bp); +int hvf_arch_remove_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint = *bp); +int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type); +int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type); +void hvf_arch_remove_all_hw_breakpoints(void); + +/* + * hvf_update_guest_debug: + * @cs: CPUState for the CPU to update + * + * Update guest to enable or disable debugging. Per-arch specifics will be + * handled by calling down to hvf_arch_update_guest_debug. + */ +int hvf_update_guest_debug(CPUState *cpu); +void hvf_arch_update_guest_debug(CPUState *cpu); + +/* + * Return whether the guest supports debugging. + */ +bool hvf_arch_supports_guest_debug(AccelState *as); + +bool hvf_arch_cpu_realize(CPUState *cpu, Error **errp); + #endif --=20 2.49.0