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 6A1FDC27C79 for ; Thu, 20 Jun 2024 11:38:56 +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:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FJqdR9rzNWqWOQFsT2WQhJ/oRdJkZ1gFNdqbFk5E9yU=; b=NV87XATOm2NsH5ec2NO79QdT/K GIxV5wI9dN39+hNZQPjawKtf4ZLvlzU6Pq6iJkBg+MfU2TvveOhG+TWzuubqXTWmdJ16m4Emfkmb5 ZDO08o1KGCTH8Vso6guMw+yolNm8/MLf3ZnW4NLDqpy60FDerNEcqytjF7/f1tNrD4lrAZIZECjnC Dwc/jFGHnZy7Fcu+ZZ6bKLNgO+Txjd0+ckEMrDMzr3NybNxtPdfy/m/nltmlMSUvizKeg35pYeqCu 5xtK9HZiagg+WsXEwtYXrPUDIutsv/cDjJRnCt31xeoC7B73YT7F8lVmSAH2MeBuS3o667ylcBa2g UsNo+kuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKG7j-00000004osz-3i6n; Thu, 20 Jun 2024 11:38:39 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKG6q-00000004oSf-3DwG for linux-arm-kernel@lists.infradead.org; Thu, 20 Jun 2024 11:37:53 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 508D8CE028A; Thu, 20 Jun 2024 11:37:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BB5BC32781; Thu, 20 Jun 2024 11:37:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718883460; bh=7Bq8zOBLE3RaLVh77HyqeG7aK9VtXXSgvxiQB9pjHmU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Kg5ms+NUfHJmWjOtFBau4YwLhhjITB2a31C9s4oU4VOaIvuOPaeoMqhtOmhBpHzdm zWWy/+RCxVJAy5NviLAtoIFxYlgcSnHxsOenCkivlE2HOsDRPx65NfVqwyCDxVE8vy 1dB67DxvP6SoNz8uYsjwYvwqItplx5al8Zt2/oQDiwCyAgpA9xUB+X5aNfze+Mlaxf fF4ZPgBH+in4af75Xp156y2ZWnwRZwokqk+CGW28dMJBZw+nlO8BceCMIva5aeX2Lq jA+jfi/tbcthdXhEWD4xbjj0QPOYIFXqAITX4X/eEuP4hpjBOXlxYML93xLrXAcxDG W48jJFod54E0w== Date: Thu, 20 Jun 2024 12:37:35 +0100 From: Will Deacon To: =?iso-8859-1?Q?Pierre-Cl=E9ment?= Tosi Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Marc Zyngier , Oliver Upton , Suzuki K Poulose , Vincent Donnefort Subject: Re: [PATCH v5 2/8] KVM: arm64: Fix __pkvm_init_switch_pgd call ABI Message-ID: <20240620113735.GB4625@willie-the-truck> References: <20240610063244.2828978-1-ptosi@google.com> <20240610063244.2828978-3-ptosi@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240610063244.2828978-3-ptosi@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240620_043745_438912_F35D20A7 X-CRM114-Status: GOOD ( 13.47 ) 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 Mon, Jun 10, 2024 at 07:32:31AM +0100, Pierre-Clément Tosi wrote: > Fix the mismatch between the (incorrect) C signature, C call site, and > asm implementation by aligning all three on an API passing the > parameters (pgd and SP) separately, instead of as a bundled struct. > > Remove the now unnecessary memory accesses while the MMU is off from the > asm, which simplifies the C caller (as it does not need to convert a VA > struct pointer to PA) and makes the code slightly more robust by > offsetting the struct fields from C and properly expressing the call to > the C compiler (e.g. type checker and kCFI). > > Fixes: f320bc742bc2 ("KVM: arm64: Prepare the creation of s1 mappings at EL2") > Signed-off-by: Pierre-Clément Tosi > --- > arch/arm64/include/asm/kvm_hyp.h | 4 ++-- > arch/arm64/kvm/hyp/nvhe/hyp-init.S | 24 +++++++++++++----------- > arch/arm64/kvm/hyp/nvhe/setup.c | 4 ++-- > 3 files changed, 17 insertions(+), 15 deletions(-) Acked-by: Will Deacon Will