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 E437AC4332F for ; Thu, 10 Nov 2022 10:43:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To: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=SVR9ZJEBvtaNDMvWSTgSGTvUI1fPh2d5kQHmwgSen/k=; b=mCcD/XIs0K/6wz cPJxlflGXfEc7xPd7KYnuiEWNu2ziSrAqT3zTNn4GQg1Bzf5U6QHw9Zr88SD1+0679ycavefe44w7 r+ixvwDtK6wcd3QF5KpayGY89vn50o6AIRH/diVsib2Je0ihz4WY9CwAgJDOH33wbkW/eOR8su45i PU8HCBF84U3ziik+zhFs1C5muKP92GFeormhxKW5hLM6hd4M7hUaVjlLTBy9obLIBR1b5xBsRdloV S1doVecRCRyah/Ryh6WyY6mm+yhRnv3HYhlgaDy5Qp+7gnz+gjwtWaQO7XiBcw5l/OO00W+aqfolN /zTi8ZgoVjhqtHX7s+jg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ot50v-0055xQ-1Z; Thu, 10 Nov 2022 10:42:29 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ot50r-0055vA-PV for linux-arm-kernel@lists.infradead.org; Thu, 10 Nov 2022 10:42:27 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id A1518CE2160; Thu, 10 Nov 2022 10:42:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D25F6C433D7; Thu, 10 Nov 2022 10:42:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668076941; bh=r+qt6kAors3KYeKH/GVRE9wZe3RSl+L32qhSytiS8Bk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eSp07hYtumWj2FerpC9vH+x5PZLqC8d5feD+U9WC4WPn85pMm4fhLJ3zTp5DzdVWK bNt0NNT9T1tzqYGdQ+FFRYrdSiXkmTR/CHowxVjTogFw9KRQMFq1nV7a1eT5QuPYC0 W409e7B+YYgBDK9de6SpCMq7aoLNCN2HIzBdE2vBjGuqHH2Ut+OFBwc1tH36WIV3UT Cs4fbzqegdE5AJl/dNzIzOFDaRCWCTe79BWO//6i3J9VNI4Z9tfP5Nm8EMACCllStA tM3P/oKuI0adtPUXxiPjEjmDugWUgZL1NEk9E81xjHRnyrgEddM0L4tpw+urnF5iCs Kq+bbIW9YQEdg== Date: Thu, 10 Nov 2022 10:42:15 +0000 From: Will Deacon To: Oliver Upton Cc: Marc Zyngier , James Morse , Alexandru Elisei , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Quentin Perret , kvmarm@lists.linux.dev, Fuad Tabba , Vincent Donnefort Subject: Re: [PATCH 1/2] KVM: arm64: Clean out the odd handling of completer_addr Message-ID: <20221110104215.GA26282@willie-the-truck> References: <20221028083448.1998389-1-oliver.upton@linux.dev> <20221028083448.1998389-2-oliver.upton@linux.dev> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221028083448.1998389-2-oliver.upton@linux.dev> 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-20221110_024226_026576_B5D74618 X-CRM114-Status: GOOD ( 23.00 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Oliver, On Fri, Oct 28, 2022 at 08:34:47AM +0000, Oliver Upton wrote: > The layout of struct pkvm_mem_transition is a bit weird; the destination > address for the transition is actually stashed in the initiator address > context. Even weirder so, that address is thrown inside a union and > return from helpers by use of an out pointer. > > Rip out the whole mess and move the destination address into the > destination context sub-struct. No functional change intended. > > Signed-off-by: Oliver Upton > --- > arch/arm64/kvm/hyp/nvhe/mem_protect.c | 70 ++++++++++----------------- > 1 file changed, 25 insertions(+), 45 deletions(-) > > diff --git a/arch/arm64/kvm/hyp/nvhe/mem_protect.c b/arch/arm64/kvm/hyp/nvhe/mem_protect.c > index 1e78acf9662e..3636a24e1b34 100644 > --- a/arch/arm64/kvm/hyp/nvhe/mem_protect.c > +++ b/arch/arm64/kvm/hyp/nvhe/mem_protect.c > @@ -393,17 +393,12 @@ struct pkvm_mem_transition { > enum pkvm_component_id id; > /* Address in the initiator's address space */ > u64 addr; > - > - union { > - struct { > - /* Address in the completer's address space */ > - u64 completer_addr; > - } host; > - }; > } initiator; > > struct { > enum pkvm_component_id id; > + /* Address in the completer's address space */ > + u64 addr; > } completer; > }; I'm reasonably sure we'll end up putting this back like we had it as we gain support for guest-initiatied transitions, where we have to walk the guest stage-2 page-table to figure out the physical address of the memory being shared, which is the host (completer's) IPA thanks to the identity mapping there. So here's what I'll do: I'll post a v6 of the EL2 state series, and I'll include this at the end (before the RFC patch) and let Marc decide whether to go ahead with it. I do agree that it cleans things up for now but, as above, I think that's likely to be a short-lived change. Sound reasonable? Cheers, Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel