From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A9D87C02194 for ; Thu, 6 Feb 2025 12:31:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bet7Den/cLJCC14dyDOcWa5G2dFVQSCLG/S4sc60whA=; b=K2eajB+pJzEaK3liAzJ4PKYokH 7MxdQB4D0OS4BCbsiCcTiDdv2gWwlZzut46bmzdceeykvjHuEa0Ib6ph/xtRQTjEvLXvHpC9I2w0L A1IBPSa9jS/9prHewMWiLbTSuhSr3iZOgEL2xofTg9n1WVnQu8Vz0AmaIBZ4r5tOHuk/NC7vpa3m1 znnrVw8lNebpX6/3YNqyQgFfn+kkvkMkX9Khs7tSnVTTDb2ZrF+fofBm2Js/RMVvKqyogA8eT2Gk1 mgloq9RkcfzfoBQoDY7aLyd9A2at9Aj95e7+NUtGymBFiibTqixRo689NB1bXo1m4Hb4knNDdb61A zQGMHlTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tg12M-00000006HW6-3HRI; Thu, 06 Feb 2025 12:31:18 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tg0zv-00000006HDN-2VGp for linux-arm-kernel@lists.infradead.org; Thu, 06 Feb 2025 12:28:48 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 25C33A4361E; Thu, 6 Feb 2025 12:27:00 +0000 (UTC) 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) 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250206_042847_759937_E328DA33 X-CRM114-Status: GOOD ( 25.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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.