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 9EEF4D3E79C for ; Thu, 11 Dec 2025 08:15:41 +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=vAL0V5mYm1ZkEzwp1qaDOGJQnYkDuSdOg3YyZgyK10w=; b=3Q/aU8sPSO3PQ1bwW9xX1v/0iO 55y/TQmTp5Ok/uUeRUJZl8opYcV77ZNbQjy5PQkdqtaVW9YuI6j285rM58od2i8tVA4EWUqaBOD9e W65K4MEK+ii2RgtVQ+fMNknWtkyMjEOVrQ6HAzmaQMEDU7M8G7SOoOh5fahwX8qTMkACTbiomwij7 gk55o/H5pTevNJRvTgVTSsL3U2u0WTuVtP8zcaj69jzyswutn0hwXQlN1DK2mjFVvlCVW8gNZsKYH GONGdJtx9P9NRa7b3r985R0HjP3lX2fIw1E90SoCuX2vhROPa6Bx7T3Ekx6PS0xaEVxc9569hKFCt JmznY00Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vTbpn-0000000GMpT-08TB; Thu, 11 Dec 2025 08:15:35 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vTbpk-0000000GMp2-1Paz for linux-arm-kernel@lists.infradead.org; Thu, 11 Dec 2025 08:15:33 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 3BA8743A5F; Thu, 11 Dec 2025 08:15:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 149AFC4CEFB; Thu, 11 Dec 2025 08:15:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1765440931; bh=uisW3lsr1R5kreh20aN9ry1a7WqtATsZX41vyRxxghQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FXTY+io2OtXnTyuHOadUOc7ReXqmtOFWxhlLQU4dltyAQ0v1yIvk+mcyJt6kEGvux QkWzpnG5piXbgTht5YNFuG0mQrRHYbiCDXTVMtzamKBrZGfGvWcZOJhdypvKOti9mT Cqt/8V8R0I55DBVXHsTS8q68AL2WgdwDZ9mv8aOae9mcl86JUyej+pAfDDYoonJBdY vKG2t0wMg32jjlWozq6wcVmNdMexE6m/D+/TfyzuTdR+3o1jFTzUnhKPSd6lRUpziQ atYinPEGfmVf5QmglpSqURT8KGQYLdfMPCMHy9f5EVTA2haL3n8aEDVVL41f5UUB4E liSp/aYWsD/yA== 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.98.2) (envelope-from ) id 1vTbpg-0000000BwTn-2jnn; Thu, 11 Dec 2025 08:15:28 +0000 Date: Thu, 11 Dec 2025 08:15:28 +0000 Message-ID: <86zf7po2n3.wl-maz@kernel.org> From: Marc Zyngier To: Alexandru Elisei Cc: oupton@kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, qperret@google.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Subject: Re: [PATCH 2/2] KVM: arm64: Remove extra argument for __pvkm_host_{share,unshare}_hyp() In-Reply-To: <20251210132102.137631-3-alexandru.elisei@arm.com> References: <20251210132102.137631-1-alexandru.elisei@arm.com> <20251210132102.137631-3-alexandru.elisei@arm.com> 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/30.1 (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: alexandru.elisei@arm.com, oupton@kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, qperret@google.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev 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-20251211_001532_419261_9FBC7AD5 X-CRM114-Status: GOOD ( 18.77 ) 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 Wed, 10 Dec 2025 13:21:02 +0000, Alexandru Elisei wrote: > > __pvkm_host_share_hyp() and __pkvm_host_unshare_hyp() both have one > parameter, the pfn, not two. Even though correctness isn't impacted because > the SMCCC handlers pass the first argument and ignore the second one, let's > call the functions with the proper number of arguments. > > Signed-off-by: Alexandru Elisei > --- > arch/arm64/kvm/mmu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c > index 7cc964af8d30..6c6abcd8e89e 100644 > --- a/arch/arm64/kvm/mmu.c > +++ b/arch/arm64/kvm/mmu.c > @@ -497,7 +497,7 @@ static int share_pfn_hyp(u64 pfn) > this->count = 1; > rb_link_node(&this->node, parent, node); > rb_insert_color(&this->node, &hyp_shared_pfns); > - ret = kvm_call_hyp_nvhe(__pkvm_host_share_hyp, pfn, 1); > + ret = kvm_call_hyp_nvhe(__pkvm_host_share_hyp, pfn); > unlock: > mutex_unlock(&hyp_shared_pfns_lock); > Yeah, we lost all form of type-checking when everything was hastily converted to SMCCC to avoid function pointers. Somehow, I feel that the cure was worse than the disease. I wish we'd reintroduce some form of compile-time checks, maybe by having generated stubs? Thanks, M. -- Without deviation from the norm, progress is not possible.