From patchwork Wed Apr 30 14:58:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 886053 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:38f:210b:807b with SMTP id g4csp899028wrq; Wed, 30 Apr 2025 08:01:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXhongfauV+gis8/IDWPXKu9DlxmbSD6zfZG6CYLTl13aXMZBgaMEH2LQTr0atvz6JxEs2fPg==@linaro.org X-Google-Smtp-Source: AGHT+IGiyth6NXXzndsj8h19KZ67cO+0BnE+f/ly6If+I/akdk3Y/HcK7iptv2B0/PjA4XZU5gFp X-Received: by 2002:a05:6102:26ce:b0:4c5:1c0b:4ee9 with SMTP id ada2fe7eead31-4dad4a61489mr2048449137.22.1746025284398; Wed, 30 Apr 2025 08:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1746025284; cv=none; d=google.com; s=arc-20240605; b=QdMMGL07U518NjdKf43+TEyvdQRelUcf03B+9cHQQiXdefaKeId3NauWdcCjFTDt/S OHUskH9g3H2YfhtoHpWrd4jpkxGePbYDweEBIIH59j9MIEXi8UNM8zWQm4bsmjN+ctzn 2+tffmrFpRWnNum2n+78agA4EBAvnNrrfNIvYc4R8oKZiA8gRID+NoqQaZJR7NQKpTCA 2fFoDdRABhOJIlF4C/4tXbhc9y8r4WqYJtj8Mp4FGDp43IGqQUF8LfC6w1iuLRLdpw+g +M3RPeCEiWklq+7T3W1cj/d2wwqEMYRT7MHdtXxkt0FfTWdR+LrzOda+X6DyYZjKI34F Kp0A== 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=lgiqh7bhRD5cMq/BEBKsGo2haYh+WuQTB6qucvXC4NY=; fh=T8RHNXuETE6pPT/3lIjz35HWFTO082WWvkWbd1S+hc8=; b=cF6KFrHCQul3Z/IFHepHM6y5tgmQIjWBpbhJq+gqI3u8ZVuAgoWNw1MQIEu878yRG4 7VSD6z8q3V/kAgx1dFjSqCkzUQK9G8sjJB6/0fyxymfVaasaVDOumE546iuNJII/blDj OGMYbbd6oNw16EIXlV4IWbKLC8DOseFJQNlpVQwFY04UaBqqTFLsAUgA1PjdVU5mdU0A c8KjnTrtWzhSSjAp7UrGvbvzdgw2hpzczIV2UcyG2jIiPY+aWxrRk3OmUXTyujS9eIWD Q4/otEf2zcyWyzosI0+ledwzguCPz2PBbgdbssj9iwgOg/T6xX1hc1hCOivPf5a6UK2b fX2A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vg92JdSm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4dad4296dd5si449045137.571.2025.04.30.08.01.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Apr 2025 08:01:24 -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=Vg92JdSm; 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 1uA8ts-0002HH-AZ; Wed, 30 Apr 2025 10:59:04 -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 1uA8tl-0002Be-TW for qemu-devel@nongnu.org; Wed, 30 Apr 2025 10:58:58 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uA8tj-0002eT-Ey for qemu-devel@nongnu.org; Wed, 30 Apr 2025 10:58:57 -0400 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-3014678689aso6265a91.0 for ; Wed, 30 Apr 2025 07:58:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746025134; x=1746629934; 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=lgiqh7bhRD5cMq/BEBKsGo2haYh+WuQTB6qucvXC4NY=; b=Vg92JdSmGs+zCSOszLETlz1D8zmkjKlmISgfnAImNf8H4SoRngxqKfJcKerEtSw5d/ OTmWuPiCHdmUUQabHK21YYNO+/cTFm1agetWXdQ6KXArJmprQcb8oli40H5XvSNM7n7A nZJl5BtN+tNkinv03kqE95fdXkDnCNGr6JrjAvkq26hic+N0frPmCyp/rJcoMCulLh8O y3X/niRMLmWwsn2AZhmpA6NPs31eU3eTdUxESC42QvIkfKMOZ77cifUleWRKnbabv4hq YKI+H7lfXZ+6ooY+cdlDCzcM8bTVEf2dnReDJD0pJZ27mQIenQQPjFu1hoo3xFYxLts8 Jtog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746025134; x=1746629934; 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=lgiqh7bhRD5cMq/BEBKsGo2haYh+WuQTB6qucvXC4NY=; b=vmO3AvZ/2hs5H2yRvwSmkCjyvy1WF0v/nCR2XUN0tFsqLGVi4i3ve0bv4qZpJljL6K xWMr3oWgb35ZBOO9NpsnXSxXkGjx1n0Ems/lhAQI1wMtcKnkRa7FAGAnY2/YEeRGSqmJ H9aigb7R5hXKdVG90PG3D7S5CN1oHWjPP7Cr1vEIYq/vJwazx5CnwJXjPYw/A78YzsCD YyIpA0tzpTTK/0a6D/TbnaiLO1zoVInfKNHZDt+0u5mRL0MJu09eXfc9k712PvHms0JA EepABRKLsAH6T7sQu5ocgtIx5jLS7v8cAis8L2kc67v3i/39GuUuKG/cvhUbhAnXeS0G FW0Q== X-Gm-Message-State: AOJu0YwRetPsWT9fFEbu4wSOr6w6+lR5u6sPDPzG5Q5sL68D3vti+nDb 8skmS4LcdSS3aqBfOiUpkI2xNNBYeusSR+dG3ju0KXPeYZz+QqIftF38htVLjy8JvisgtoZMbKa t X-Gm-Gg: ASbGncuZZcT/+7y2CHQL+QXYb1XbVkYxbYqHiYX4U3rsWAovBDK5tSRWoKbLCgvjiSn mXVOXEAKCotLF2dNvHqFrpnbuDSIazjk43cbc6miPNFkTnsiA/Gfk3KDLjg6t8zxqcYyN+QQgU5 +loUKlJLuuBI3q0zTsE46KL2ICEVmflC/oRjNjxihg+CtB/MFP3Lr0w58mtTOHuguVNKznZu6R2 yDkzw7r0eb8xwXExrrDYlxiv3F+RRfdJ6MYvLVmsM+8NByFBdu9CwVShQqkAi5qAEvEo8Y2U1+j YRr7NNnLVoubl6Q+PTHpowDPF9GHOI463JoOrt6Q X-Received: by 2002:a17:90b:514c:b0:309:fffd:c15a with SMTP id 98e67ed59e1d1-30a343ecc28mr4110169a91.13.1746025134157; Wed, 30 Apr 2025 07:58:54 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30a34a5bd78sm1705652a91.42.2025.04.30.07.58.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Apr 2025 07:58:53 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Paolo Bonzini , kvm@vger.kernel.org, Peter Maydell , =?utf-8?q?Ph?= =?utf-8?q?ilippe_Mathieu-Daud=C3=A9?= , alex.bennee@linaro.org, richard.henderson@linaro.org, anjo@rev.ng, Pierrick Bouvier Subject: [PATCH v2 04/12] target/arm: move kvm stubs and remove CONFIG_KVM from kvm_arm.h Date: Wed, 30 Apr 2025 07:58:29 -0700 Message-ID: <20250430145838.1790471-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250430145838.1790471-1-pierrick.bouvier@linaro.org> References: <20250430145838.1790471-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x1033.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. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- 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(); +}