From nobody Wed Dec 17 10:44:57 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 249D58632C; Fri, 21 Mar 2025 00:11:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742515864; cv=none; b=ExK4YDiT0/GBpBBAZqJX+SrSPUuroHgKptld/IhDPqj8b32L7Fnq8Gb14BaC3KtFztlfhZg7EbNrvG+9r96934+FKBh+eWSD0KIW4S9z+XurmA84rSskOkxNaokk31BSjEPUEFcSeTQD3OkCrgadGkdvHjOvBypc6sh3aanDkLc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742515864; c=relaxed/simple; bh=+uERNQF5UkjKJBIpV+9hBTi9ouGANfThGnrWNdRyna8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mY4aChzzygpOiFPaxyE6njV9lXigroZxT59cbNouGLRUgxvdSIREyhc7QCtvetgeWtr4xkRtr+i2t9mva5qzhVyZb4ojr8RuKLjAZQ4MPYLWlAIxqd/vnCO1/O+uV8FgLMJomty8TrYxKP351pI4luTGl46Tm/RnvLrOZSjjtLo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=F8S3gr5P; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="F8S3gr5P" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26242C4CEE3; Fri, 21 Mar 2025 00:11:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1742515863; bh=+uERNQF5UkjKJBIpV+9hBTi9ouGANfThGnrWNdRyna8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=F8S3gr5PwtAC5hSbUeJ/K3U5dIpa4pg2htivIvDBWxSoOuz5IrAkqSpcvtiE1uJ26 97FnAnD4iNlJl1aZCalDKIZ5lyEbUEA3n9ix45XTTAeTWNK9vsLKgZPyWKP1XtMGvV jBTEn0Sek55J4sIW8nvKZa97AZuqBv5z2cQXyMef6grLVLhDkBol0zabdd27T79tC3 hb5jUuYNaAdS3eTeFgOsxG5pS7W5nyxaIW6EKHpEVJjWwdVQs2yinA8WVxKYUq9lie ZZh6T7jLcGLqWp/P8eixRwv1Eo/gyoyJudHbeQy2oAIH3kDYjm3v6KMNgSv3JoK5ZB as53jAehQFlzA== From: Mark Brown Date: Fri, 21 Mar 2025 00:10:16 +0000 Subject: [PATCH 6.13 v2 7/8] KVM: arm64: Mark some header functions as inline Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250321-stable-sve-6-13-v2-7-3150e3370c40@kernel.org> References: <20250321-stable-sve-6-13-v2-0-3150e3370c40@kernel.org> In-Reply-To: <20250321-stable-sve-6-13-v2-0-3150e3370c40@kernel.org> To: Greg Kroah-Hartman , Marc Zyngier , Oliver Upton , Joey Gouly , Suzuki K Poulose , Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Mark Brown , Mark Rutland , Fuad Tabba X-Mailer: b4 0.15-dev-1b0d6 X-Developer-Signature: v=1; a=openpgp-sha256; l=5610; i=broonie@kernel.org; h=from:subject:message-id; bh=0qUpq6HUams3FaMMmSJsBH+0qO7zI5hxVkBdLHdk9A0=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBn3K55VPHBeL6JKvE3OIrGqmvuqxvT41L548sKB9el 5KeKjwyJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZ9yueQAKCRAk1otyXVSH0Op8B/ 9uxDvN+BUuP7crmTFMHZCKTh9etu9wie6uka9BnDi6OGoAXhbbgK1wKZrHGJyHkCmaaex+w+ELovOl djfD7M3ksoO9ZxTd5LJ4MI0Z89f4QjUOJVjMc5iJdGODq3s4OLCmsp/fMyIuJ14CRsZWMb+YnQ0fBh Mmcq6oDCD8Pqw7HjO745qJEimCu6z03S4QxncrXqp6VPm6J9CljM5XYSFgrMs8xvk8EOfgNgUH6yGm Anc20JZ71E0dYYo4i40k+Z41/leiEUW7H1f4ocNbkGx/Z+dJ7gEUbL8x8XWFtpKzw2anU29JPhkVtG 3GQIPP94YDz/5lBA0VHkVuiqt2Tn5b X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB From: Mark Rutland [ Upstream commit f9dd00de1e53a47763dfad601635d18542c3836d ] The shared hyp switch header has a number of static functions which might not be used by all files that include the header, and when unused they will provoke compiler warnings, e.g. | In file included from arch/arm64/kvm/hyp/nvhe/hyp-main.c:8: | ./arch/arm64/kvm/hyp/include/hyp/switch.h:703:13: warning: 'kvm_hyp_handl= e_dabt_low' defined but not used [-Wunused-function] | 703 | static bool kvm_hyp_handle_dabt_low(struct kvm_vcpu *vcpu, u64 *e= xit_code) | | ^~~~~~~~~~~~~~~~~~~~~~~ | ./arch/arm64/kvm/hyp/include/hyp/switch.h:682:13: warning: 'kvm_hyp_handl= e_cp15_32' defined but not used [-Wunused-function] | 682 | static bool kvm_hyp_handle_cp15_32(struct kvm_vcpu *vcpu, u64 *ex= it_code) | | ^~~~~~~~~~~~~~~~~~~~~~ | ./arch/arm64/kvm/hyp/include/hyp/switch.h:662:13: warning: 'kvm_hyp_handl= e_sysreg' defined but not used [-Wunused-function] | 662 | static bool kvm_hyp_handle_sysreg(struct kvm_vcpu *vcpu, u64 *exi= t_code) | | ^~~~~~~~~~~~~~~~~~~~~ | ./arch/arm64/kvm/hyp/include/hyp/switch.h:458:13: warning: 'kvm_hyp_handl= e_fpsimd' defined but not used [-Wunused-function] | 458 | static bool kvm_hyp_handle_fpsimd(struct kvm_vcpu *vcpu, u64 *exi= t_code) | | ^~~~~~~~~~~~~~~~~~~~~ | ./arch/arm64/kvm/hyp/include/hyp/switch.h:329:13: warning: 'kvm_hyp_handl= e_mops' defined but not used [-Wunused-function] | 329 | static bool kvm_hyp_handle_mops(struct kvm_vcpu *vcpu, u64 *exit_= code) | | ^~~~~~~~~~~~~~~~~~~ Mark these functions as 'inline' to suppress this warning. This shouldn't result in any functional change. At the same time, avoid the use of __alias() in the header and alias kvm_hyp_handle_iabt_low() and kvm_hyp_handle_watchpt_low() to kvm_hyp_handle_memory_fault() using CPP, matching the style in the rest of the kernel. For consistency, kvm_hyp_handle_memory_fault() is also marked as 'inline'. Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Tested-by: Mark Brown Acked-by: Will Deacon Cc: Catalin Marinas Cc: Fuad Tabba Cc: Marc Zyngier Cc: Oliver Upton Reviewed-by: Oliver Upton Link: https://lore.kernel.org/r/20250210195226.1215254-8-mark.rutland@arm.c= om Signed-off-by: Marc Zyngier Signed-off-by: Mark Brown --- arch/arm64/kvm/hyp/include/hyp/switch.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/arch/arm64/kvm/hyp/include/hyp/switch.h b/arch/arm64/kvm/hyp/i= nclude/hyp/switch.h index e330a7825b56f14ccb144810bc0d31f7f400fb22..300ec597cf1257954019f50cce4= 4d662d6420790 100644 --- a/arch/arm64/kvm/hyp/include/hyp/switch.h +++ b/arch/arm64/kvm/hyp/include/hyp/switch.h @@ -326,7 +326,7 @@ static inline bool __populate_fault_info(struct kvm_vcp= u *vcpu) return __get_fault_info(vcpu->arch.fault.esr_el2, &vcpu->arch.fault); } =20 -static bool kvm_hyp_handle_mops(struct kvm_vcpu *vcpu, u64 *exit_code) +static inline bool kvm_hyp_handle_mops(struct kvm_vcpu *vcpu, u64 *exit_co= de) { *vcpu_pc(vcpu) =3D read_sysreg_el2(SYS_ELR); arm64_mops_reset_regs(vcpu_gp_regs(vcpu), vcpu->arch.fault.esr_el2); @@ -404,7 +404,7 @@ static void kvm_hyp_save_fpsimd_host(struct kvm_vcpu *v= cpu) * If FP/SIMD is not implemented, handle the trap and inject an undefined * instruction exception to the guest. Similarly for trapped SVE accesses. */ -static bool kvm_hyp_handle_fpsimd(struct kvm_vcpu *vcpu, u64 *exit_code) +static inline bool kvm_hyp_handle_fpsimd(struct kvm_vcpu *vcpu, u64 *exit_= code) { bool sve_guest; u8 esr_ec; @@ -595,7 +595,7 @@ static bool handle_ampere1_tcr(struct kvm_vcpu *vcpu) return true; } =20 -static bool kvm_hyp_handle_sysreg(struct kvm_vcpu *vcpu, u64 *exit_code) +static inline bool kvm_hyp_handle_sysreg(struct kvm_vcpu *vcpu, u64 *exit_= code) { if (cpus_have_final_cap(ARM64_WORKAROUND_CAVIUM_TX2_219_TVM) && handle_tx2_tvm(vcpu)) @@ -615,7 +615,7 @@ static bool kvm_hyp_handle_sysreg(struct kvm_vcpu *vcpu= , u64 *exit_code) return false; } =20 -static bool kvm_hyp_handle_cp15_32(struct kvm_vcpu *vcpu, u64 *exit_code) +static inline bool kvm_hyp_handle_cp15_32(struct kvm_vcpu *vcpu, u64 *exit= _code) { if (static_branch_unlikely(&vgic_v3_cpuif_trap) && __vgic_v3_perform_cpuif_access(vcpu) =3D=3D 1) @@ -624,19 +624,18 @@ static bool kvm_hyp_handle_cp15_32(struct kvm_vcpu *v= cpu, u64 *exit_code) return false; } =20 -static bool kvm_hyp_handle_memory_fault(struct kvm_vcpu *vcpu, u64 *exit_c= ode) +static inline bool kvm_hyp_handle_memory_fault(struct kvm_vcpu *vcpu, + u64 *exit_code) { if (!__populate_fault_info(vcpu)) return true; =20 return false; } -static bool kvm_hyp_handle_iabt_low(struct kvm_vcpu *vcpu, u64 *exit_code) - __alias(kvm_hyp_handle_memory_fault); -static bool kvm_hyp_handle_watchpt_low(struct kvm_vcpu *vcpu, u64 *exit_co= de) - __alias(kvm_hyp_handle_memory_fault); +#define kvm_hyp_handle_iabt_low kvm_hyp_handle_memory_fault +#define kvm_hyp_handle_watchpt_low kvm_hyp_handle_memory_fault =20 -static bool kvm_hyp_handle_dabt_low(struct kvm_vcpu *vcpu, u64 *exit_code) +static inline bool kvm_hyp_handle_dabt_low(struct kvm_vcpu *vcpu, u64 *exi= t_code) { if (kvm_hyp_handle_memory_fault(vcpu, exit_code)) return true; --=20 2.39.5