From patchwork Sun May 4 05:28:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 887172 Delivered-To: patch@linaro.org Received: by 2002:a5d:430f:0:b0:38f:210b:807b with SMTP id h15csp1492323wrq; Sat, 3 May 2025 22:34:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWHhfZx5mmHxOM+L7BU2wVLLDuwzw118Sl+Gi15t8YV6Rng84MEH3lGcsPaYVEW9jMuvJTINQ==@linaro.org X-Google-Smtp-Source: AGHT+IEsrJjiG0C8xW7rn8sPtVPmbeIQ4m5upiBRh8A4B6ZXlYfTYxOmvxtxQ39elE7aMSCqHmBH X-Received: by 2002:ac8:7d0c:0:b0:48c:3b37:8b2b with SMTP id d75a77b69052e-48d593b7295mr75801951cf.0.1746336888608; Sat, 03 May 2025 22:34:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1746336888; cv=none; d=google.com; s=arc-20240605; b=QlB4O3dowo4CBUobAYRd+FHLIjO91XNn4rgGc8RYnwbtAhWA0uznggOgKvrRgpdvzy UhIBe0xXsXTQVjlk4vwgXg4V7MfSZjSorlE7Fhu4zbImTj+Uqu9Jdh2s1IxxIl2NYTQ5 rSkKkWf0bAX8AWeq3abYcZIbnwtyA8efou2m0EG1p8WfyybDk0EwtnBSvvid38YXQVTQ c8mVkfxvIPlzUzojrxdMh3OhPVP7fdkNG/oj0hXMiiAp0wn10q18uBvhsEMeJvlUcDnf hMj4unc0b/z6BXhvNktySGvTjS2JfnTdQ+XJmqr+tEFasCVQhlHSLbdJulSh5dSpEdMh ouNQ== 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=Ktcl5OZ+t3GMcQQ7Jgx3PtMsJ0l/J5yPLlaHDm/4GNI=; fh=02AUoSaH/mYMQTzo2+A6j8m/qDfXAxVzTrBZ7wPvRqc=; b=UAw0rw3NsQLe4o09SMyMpvE+jcLvXUkkB7iVi6DLDl0SgH9c5OQkxciceypj91AtfD TKRBhJK2pR2m4JaIxAF7/NV6JgBLCfH6A0wqRHSF08b9raR5rboHJuyEsNTsImIsuVSa hPP0MwXmRgYjMqkNJtlQ11OgUrUhK2FIeQoT49wy8a7u5mkJQA755elDVjxhSiq/FUIJ siLBjgzVWFBJd/lal/JSTfAf3EQeJjyPsTYuW9EyO8YlkGCzWux22D8k16wrNyOPY1V2 KBWxzeb/is1aC84IqeCIMYpyHkBGQMOejyiI/t/UEIetlfsxNxjatzndZAgeQj4VAKYf 7M/g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZDyZvs2y; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-48b98832c95si60458441cf.458.2025.05.03.22.34.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 03 May 2025 22:34:48 -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=ZDyZvs2y; 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 1uBRux-000247-Lh; Sun, 04 May 2025 01:29:35 -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 1uBRuq-0001zf-Rq for qemu-devel@nongnu.org; Sun, 04 May 2025 01:29:29 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uBRuo-0004H9-MJ for qemu-devel@nongnu.org; Sun, 04 May 2025 01:29:28 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-736ad42dfd6so2821200b3a.3 for ; Sat, 03 May 2025 22:29:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746336565; x=1746941365; 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=Ktcl5OZ+t3GMcQQ7Jgx3PtMsJ0l/J5yPLlaHDm/4GNI=; b=ZDyZvs2yzcuvnTXrWPA3sCqH7ofZo73M8X4tPPzAaDk1cOsqsRnvu7AXC4xM2dXwZP SFE/tYY0mzlWbe+bNxlWLyH0Jiws2YyH05Y3uSEiqRqq2Pxo0CGXtpd49U9Fx9lcMTNH +yqEdDKcstIN1zfEUvlgSW/VnvfU5f5ttEFzEmOwzB+KT14l2RKVg/+G+x7WPhmuR9id Jwu70Nw4Hq9ixzsJcuVMZT1S3djPxuc6MAwiTnYHbJZLKn+poKypQsRXMj5dqTBx6RSv BJrfvAhfNwyxd0H+ePh0ytKBvMnQQPHRCxOYGCocbWe4wN30ptg3tvbLAYmGQwpQRzGM u+iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746336565; x=1746941365; 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=Ktcl5OZ+t3GMcQQ7Jgx3PtMsJ0l/J5yPLlaHDm/4GNI=; b=VlD52zUZ0ayo9FcnzLqEfGETIxzXVSE8exqej2zTYqLtXLDL8SH4bWfacfihO9d72R ZjrYmUKKnGpKwgqdmKaBHxIhyhhJ52loxSjzFJPMSKCoKy2O2yAKnFKNzhIasu6AC6bG zM3XqwzPylIU6XIu62RXSrJgSjjdQgjN/CXO03h6jiEj3SbDpJE1e6vmeXMd8LyhX7Zi gcZKmrlSTafZfaMI03l+6pia9zKO9qgyH4dPUXh2+o11KrZlrPo5fOUjskkyARcPDHw/ X5QkECkPP08Ij8Y49zUIM+zaDjtKoXUYlFrfN/2Mah3MPGbEn9a9SkMgylc+AybDo9p+ Z9HA== X-Gm-Message-State: AOJu0YxExMmsAc88juyixtkVOrpFJD0/ev9P1zUvma7tkd3VxciB/l8r u3nhyP4ucsNHqLBTH6EbhqfsmOZygJEXmXbZv7/u05MiCeazNGtW3zDKeqRmo9O1oA5JLqwr3vB ngLc= X-Gm-Gg: ASbGncsBnP9WcoMpZ8sTxoYNBMYj8CGweU90OKQBaee7sWTDqKy3t5KussnVLFQ9QC1 0jVxLMIGbed9kvFAq2qqjaX/xM0gIFUFGOaSYQeo66Jn9vJbQp0bMNsUeJd7qJo61McT93QwRBg Hdafle5CpBQ9tMaEaKDF+gZC7yKcbH4695r703pmIHTimy+J0I5GpEgvDH6g8afXNNx2/Zl4LqZ ksPFTJK3j5XaHDwNus84ig0q0NTq76S7jH4XRruboyAdyihtO1Vrn2sYa0w5F8Iy3a/4VWO9lek 2Vd9AqjOq3QEgQpB0E3gztjojC39NsVzd46Qavmh X-Received: by 2002:a05:6a00:1384:b0:740:596b:eaf4 with SMTP id d2e1a72fcca58-740673f2464mr7015748b3a.16.1746336564975; Sat, 03 May 2025 22:29:24 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-740590207e3sm4400511b3a.94.2025.05.03.22.29.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 May 2025 22:29:24 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paolo Bonzini , qemu-arm@nongnu.org, anjo@rev.ng, kvm@vger.kernel.org, richard.henderson@linaro.org, Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , alex.bennee@linaro.org, Pierrick Bouvier Subject: [PATCH v4 05/40] target/arm: move kvm stubs and remove CONFIG_KVM from kvm_arm.h Date: Sat, 3 May 2025 22:28:39 -0700 Message-ID: <20250504052914.3525365-6-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250504052914.3525365-1-pierrick.bouvier@linaro.org> References: <20250504052914.3525365-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x42f.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 Add a forward decl for struct kvm_vcpu_init to avoid pulling all kvm headers. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- target/arm/kvm_arm.h | 83 +------------------------------------------ target/arm/kvm-stub.c | 77 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 82 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 05c3de8cd46..7b9c7c4a148 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -94,7 +94,7 @@ void kvm_arm_cpu_post_load(ARMCPU *cpu); */ void kvm_arm_reset_vcpu(ARMCPU *cpu); -#ifdef CONFIG_KVM +struct kvm_vcpu_init; /** * kvm_arm_create_scratch_host_vcpu: * @cpus_to_try: array of QEMU_KVM_ARM_TARGET_* values (terminated with @@ -221,85 +221,4 @@ int kvm_arm_set_irq(int cpu, int irqtype, int irq, int level); void kvm_arm_enable_mte(Object *cpuobj, Error **errp); -#else - -/* - * It's safe to call these functions without KVM support. - * They should either do nothing or return "not supported". - */ -static inline bool kvm_arm_aarch32_supported(void) -{ - return false; -} - -static inline bool kvm_arm_pmu_supported(void) -{ - return false; -} - -static inline bool kvm_arm_sve_supported(void) -{ - return false; -} - -static inline bool kvm_arm_mte_supported(void) -{ - return false; -} - -/* - * These functions should never actually be called without KVM support. - */ -static inline void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu) -{ - g_assert_not_reached(); -} - -static inline void kvm_arm_add_vcpu_properties(ARMCPU *cpu) -{ - g_assert_not_reached(); -} - -static inline int kvm_arm_get_max_vm_ipa_size(MachineState *ms, bool *fixed_ipa) -{ - g_assert_not_reached(); -} - -static inline int kvm_arm_vgic_probe(void) -{ - g_assert_not_reached(); -} - -static inline void kvm_arm_pmu_set_irq(ARMCPU *cpu, int irq) -{ - g_assert_not_reached(); -} - -static inline void kvm_arm_pmu_init(ARMCPU *cpu) -{ - g_assert_not_reached(); -} - -static inline void kvm_arm_pvtime_init(ARMCPU *cpu, uint64_t ipa) -{ - g_assert_not_reached(); -} - -static inline void kvm_arm_steal_time_finalize(ARMCPU *cpu, Error **errp) -{ - g_assert_not_reached(); -} - -static inline uint32_t kvm_arm_sve_get_vls(ARMCPU *cpu) -{ - g_assert_not_reached(); -} - -static inline void kvm_arm_enable_mte(Object *cpuobj, Error **errp) -{ - g_assert_not_reached(); -} - -#endif - #endif diff --git a/target/arm/kvm-stub.c b/target/arm/kvm-stub.c index 965a486b320..2b73d0598c1 100644 --- a/target/arm/kvm-stub.c +++ b/target/arm/kvm-stub.c @@ -22,3 +22,80 @@ bool write_list_to_kvmstate(ARMCPU *cpu, int level) { g_assert_not_reached(); } + +/* + * It's safe to call these functions without KVM support. + * They should either do nothing or return "not supported". + */ +bool kvm_arm_aarch32_supported(void) +{ + return false; +} + +bool kvm_arm_pmu_supported(void) +{ + return false; +} + +bool kvm_arm_sve_supported(void) +{ + return false; +} + +bool kvm_arm_mte_supported(void) +{ + return false; +} + +/* + * These functions should never actually be called without KVM support. + */ +void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu) +{ + g_assert_not_reached(); +} + +void kvm_arm_add_vcpu_properties(ARMCPU *cpu) +{ + g_assert_not_reached(); +} + +int kvm_arm_get_max_vm_ipa_size(MachineState *ms, bool *fixed_ipa) +{ + g_assert_not_reached(); +} + +int kvm_arm_vgic_probe(void) +{ + g_assert_not_reached(); +} + +void kvm_arm_pmu_set_irq(ARMCPU *cpu, int irq) +{ + g_assert_not_reached(); +} + +void kvm_arm_pmu_init(ARMCPU *cpu) +{ + g_assert_not_reached(); +} + +void kvm_arm_pvtime_init(ARMCPU *cpu, uint64_t ipa) +{ + g_assert_not_reached(); +} + +void kvm_arm_steal_time_finalize(ARMCPU *cpu, Error **errp) +{ + g_assert_not_reached(); +} + +uint32_t kvm_arm_sve_get_vls(ARMCPU *cpu) +{ + g_assert_not_reached(); +} + +void kvm_arm_enable_mte(Object *cpuobj, Error **errp) +{ + g_assert_not_reached(); +}