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 69F67C433FE for ; Wed, 9 Nov 2022 23:02:13 +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=x4TuhSIYiVb44iOoBWs4HsQiUpQWBXOkpEVfNvM2GGQ=; b=K0f7qteuP1yfZk 01FQGeGMkQrcreBIeXgpkcKCfMNGuRfdLdIxwgvw8Z+ipoGMhzzb/6g9Of0nFgJ44AY/uvySZJ94n WX0olm663fiwOOevw2IkSDJEQ9rkXkW9K8P4IGK/FkUlIjqmS1zkzdSJhD8T7dSnSC08YDt/1CJzl uPzBY3QgiiIBjKuEuyHi5mZCkDjngcmGgqWcCKWPCwdlOmmEncnFbps6njQLYS//s6upi//hgZmtx cX0Yx8AlMjWFiHdYFaR4nPNskJyM9EBZaDrsBqkdbQkUwdxvDwKyk4Jb2Uo5RwjVvcrdn1R8iirDc FFVoQoHxRUgmtB+1v6Bw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1osu4G-000Uly-Ty; Wed, 09 Nov 2022 23:01:13 +0000 Received: from out2.migadu.com ([188.165.223.204]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1osu3y-000UVh-VK for linux-arm-kernel@lists.infradead.org; Wed, 09 Nov 2022 23:00:56 +0000 Date: Wed, 9 Nov 2022 23:00:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1668034845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OAL3R3TEKZCss1R/iPyj1G2fURtMnDVaBxLRl/VPrsA=; b=vhUPHWUBXtfmpqLpsM84/OLlBTCq9M8Uf/LpS1LM+w+HDLUEHKKf+Cgmc8whr/XLEJ77qV OWYRu6RjKo1hKaOnTiT9M5Jj+L412Cz5b0pi1zQSzL2BC85JmGgitQo9fXiyjEoJ1EYAV0 M45hAyalGoHztvrdpdPiMXbwvkA6N9Q= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Ben Gardon Cc: Marc Zyngier , James Morse , Alexandru Elisei , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Reiji Watanabe , Ricardo Koller , David Matlack , Quentin Perret , Gavin Shan , Peter Xu , Will Deacon , Sean Christopherson , kvmarm@lists.linux.dev Subject: Re: [PATCH v5 10/14] KVM: arm64: Split init and set for table PTE Message-ID: References: <20221107215644.1895162-1-oliver.upton@linux.dev> <20221107215644.1895162-11-oliver.upton@linux.dev> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221109_150055_459822_26A2A8A5 X-CRM114-Status: GOOD ( 17.16 ) 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 On Wed, Nov 09, 2022 at 02:26:26PM -0800, Ben Gardon wrote: > On Mon, Nov 7, 2022 at 1:58 PM Oliver Upton wrote: > > > > Create a helper to initialize a table and directly call > > smp_store_release() to install it (for now). Prepare for a subsequent > > change that generalizes PTE writes with a helper. > > > > Signed-off-by: Oliver Upton > > --- > > arch/arm64/kvm/hyp/pgtable.c | 20 ++++++++++---------- > > 1 file changed, 10 insertions(+), 10 deletions(-) > > > > diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c > > index a34e2050f931..f4dd77c6c97d 100644 > > --- a/arch/arm64/kvm/hyp/pgtable.c > > +++ b/arch/arm64/kvm/hyp/pgtable.c > > @@ -136,16 +136,13 @@ static void kvm_clear_pte(kvm_pte_t *ptep) > > WRITE_ONCE(*ptep, 0); > > } > > > > -static void kvm_set_table_pte(kvm_pte_t *ptep, kvm_pte_t *childp, > > - struct kvm_pgtable_mm_ops *mm_ops) > > +static kvm_pte_t kvm_init_table_pte(kvm_pte_t *childp, struct kvm_pgtable_mm_ops *mm_ops) > > { > > - kvm_pte_t old = *ptep, pte = kvm_phys_to_pte(mm_ops->virt_to_phys(childp)); > > + kvm_pte_t pte = kvm_phys_to_pte(mm_ops->virt_to_phys(childp)); > > > > pte |= FIELD_PREP(KVM_PTE_TYPE, KVM_PTE_TYPE_TABLE); > > pte |= KVM_PTE_VALID; > > - > > - WARN_ON(kvm_pte_valid(old)); > > Is there any reason to drop this warning? It is (eventually) superseded by a WARN() when a PTE isn't locked in stage2_make_pte(), but that isn't obvious in this patch alone. -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel