From mboxrd@z Thu Jan 1 00:00:00 1970 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 5837D22DF89 for ; Thu, 6 Feb 2025 12:28:45 +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=1738844926; cv=none; b=dYbT8verVwKxKqo0s2UN6qXDz1mRuswyMJyb97+PTaTtbjkL2d+NkTHjlZQpVZOTGmigllNJAL7SYcTLasr3RgYYNuRimXmgxvvuSqFvoJGztsK0Rp1mCbzwQAFQUAZ8MDOHbYdpRZzRxS2I/EX9syL5wr8au6M4VzdP1lK/SlA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738844926; c=relaxed/simple; bh=Du3aRerjxPean/CYnG5U4O6ptHDlBuzv0OizfoXm9C8=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=n6GV8WEMPXqn1qDF/KxDwhmtRSF6Jg1DY0Quk5ZWK0sPwdGM8P5awTigqE+ShsdUbfdF9pXQjtVWTV9RY0hisTcZcz4zKCsJXP/7gNon1/zRlvJ5PSvkLltHDsDGqgxYQ/jIBadcN97vG6xs/7mcNS7/BtfKHVARKDuNkz876s0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=csL5T1yI; 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="csL5T1yI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C368EC4CEDD; Thu, 6 Feb 2025 12:28:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738844925; bh=Du3aRerjxPean/CYnG5U4O6ptHDlBuzv0OizfoXm9C8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=csL5T1yIthLtechzYj+crRsL+LfIawodBZVWBc83SSEoQE1RIa0QZ2oOODwqq+AXZ OOHd9mbwSk3swh7bwPKXHKN0JgX39P7WzUUL3X+emqZQWUCY+UZwisXOE2uL4F6p4N lWMBls5cGDloIlNd3Ri/xCT6lMXMuoY+nw8vvIBI6Lldzw38WnmkRnnkqsOajfrPkv /xJTyFyg72O8J0UhrvNvNnPzZ7ZSIvGqqcIh1jxmaekhqQFsC+mQuQpgDa7tY0No3y Q5yUUyWjIAdrhgLOLlDqa4BFw4hqq324rs4MU/lB/qIqX8mewboNPX74eueU2yaTo5 noWEKLgM+2gnA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tg0zr-0017aO-AA; Thu, 06 Feb 2025 12:28:43 +0000 Date: Thu, 06 Feb 2025 12:28:42 +0000 Message-ID: <86r04btfyd.wl-maz@kernel.org> From: Marc Zyngier To: Mark Rutland Cc: Mark Brown , linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, eauger@redhat.com, fweimer@redhat.com, jeremy.linton@arm.com, oliver.upton@linux.dev, pbonzini@redhat.com, stable@vger.kernel.org, tabba@google.com, wilco.dijkstra@arm.com, will@kernel.org Subject: Re: [PATCH 7/8] KVM: arm64: Mark some header functions as inline In-Reply-To: References: <20250204152100.705610-1-mark.rutland@arm.com> <20250204152100.705610-8-mark.rutland@arm.com> <86seortkve.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: mark.rutland@arm.com, broonie@kernel.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, eauger@redhat.com, fweimer@redhat.com, jeremy.linton@arm.com, oliver.upton@linux.dev, pbonzini@redhat.com, stable@vger.kernel.org, tabba@google.com, wilco.dijkstra@arm.com, will@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Thu, 06 Feb 2025 10:55:21 +0000, Mark Rutland wrote: > > On Thu, Feb 06, 2025 at 10:42:29AM +0000, Marc Zyngier wrote: > > On Thu, 06 Feb 2025 10:03:46 +0000, > > Mark Rutland wrote: > > > That said, I'm going to go with the below, adding 'inline' to > > > kvm_hyp_handle_memory_fault() and using CPP defines to alias the > > > function names: > > > > > > | static inline bool kvm_hyp_handle_memory_fault(struct kvm_vcpu *vcpu, > > > | u64 *exit_code) > > > | { > > > | if (!__populate_fault_info(vcpu)) > > > | return true; > > > | > > > | return false; > > > | } > > > | #define kvm_hyp_handle_iabt_low kvm_hyp_handle_memory_fault > > > | #define kvm_hyp_handle_watchpt_low kvm_hyp_handle_memory_fault > > > > > > I think that's clearer, and it's more alisnged with how we usually alias > > > function names in headers. Other than these two cases, __alias() is only > > > used in C files to create a sesparate exprted symbol, and it's odd to > > > use it in a header anyhow. > > > > > > Marc, please should if you'd prefer otherwise. > > > > Nah, that's fine by me. > > > > My only issue was with marking functions as inline, and yet storing > > pointers to these functions. But it looks like the compiler (GCC 12.2 > > in my case) is doing a good job noticing the weird pattern, and > > generating only one function, even if we store multiple pointers. > > That's fair -- I'm fairly certain that we do this elsewhere too, but I > can switch to __maybe_unused if we're worried that might bite us in > future? Sure, that'd be equally fine. Thanks, M. -- Without deviation from the norm, progress is not possible.