Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1761802rwn; Fri, 9 Sep 2022 03:48:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR6mfsJJ3VqyEUYfuZrj4uNSaxF8fMzulIZ1+UbEV9mXIxHHXvahBCPd+ao52U/4kf84fQCL X-Received: by 2002:a17:907:3f24:b0:777:a10f:f155 with SMTP id hq36-20020a1709073f2400b00777a10ff155mr4525051ejc.466.1662720508512; Fri, 09 Sep 2022 03:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662720508; cv=none; d=google.com; s=arc-20160816; b=btrg5uF3WIGDfMqr6hYlkqK3EUxDxvcvf+6Tp3jx8DR0RL1UZg28/3rcGY7+rkeI4T cKz4ye2j2NVw9FU74BYC54ExL4cxOsZDK8QAhn7pDpDkrRXhL7fepbcvIQqfjX+H2v15 Slq/p2iWXvm7uofm2cBWjZUGNziHe1KKZHGOliOUvsw5Dn62zUTZ2rwxlbJrJ94i2KPs HDuwH6IYRVRX1R7RANPYDsT+O9yW4d1NnI7xZRJmkw2wBoZNV2DDegNeze/iwCtHWNNv 4Lt5CAGfu/6Ghkoe1RuJvprOPAWgOKwupzp6DzbB6nIwYBxETk9Nb2KuA77w4xDAjHe6 Z8rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=gNzaPZG1mLQyJyRsZVtVFOttl8uuZk01rBnRTGZpE+s=; b=U4ePCjZ07S8Nte7OdtX4+JyXe8w9uC7yygdyho76yL1+CojEIamY4b8SAQRtt0fiI5 18fBNZqsCd4TV7bSoq7P2tfjnWoTjZ1VxYx6TYjoSt0m8HKUvfm2T96W3oKUOFWJ0QET rm3DSHj1Q0I7YS+Ni02dr70ycmxJcI9zQUZBIRoOzlcCT6ESx53zy6kg989EDYSBqV1y bjJSNmgK0yP8bN2+LOA00/cKqyb6C+vikg3ypOW9oydGKMafqcxztjRPAyM7zILBnQPO m0POJEnm2VPBFbKhk4Yk8nhzqCSO7EaQ3EKC6fJW958pemXaUVsmqVBo9BJWez2QhqXD wJXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=uk4H9WhH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l8-20020a056402254800b0045114a45852si160808edb.536.2022.09.09.03.48.03; Fri, 09 Sep 2022 03:48:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=uk4H9WhH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230199AbiIIKI3 (ORCPT + 99 others); Fri, 9 Sep 2022 06:08:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230374AbiIIKIP (ORCPT ); Fri, 9 Sep 2022 06:08:15 -0400 Received: from out2.migadu.com (out2.migadu.com [IPv6:2001:41d0:2:aacc::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4824EA611; Fri, 9 Sep 2022 03:08:11 -0700 (PDT) Date: Fri, 9 Sep 2022 11:07:59 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1662718090; 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=gNzaPZG1mLQyJyRsZVtVFOttl8uuZk01rBnRTGZpE+s=; b=uk4H9WhHFnTUkmuLpAFALPIaa+FU2UKVZ2XPdSwdnhtmtIobV8lxEqLkVO7Y7jbn01QNbB 1IXt1sYeBb3Il0++CysKXgK+Hj0N/NTHW8+zOLFKdpKtjUJ+HWy/8ou2g7YtsfTllff+lu 2L610rpZepsKnUQVPIxZalH6CRJXp8U= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: David Matlack Cc: Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Will Deacon , Quentin Perret , Ricardo Koller , Reiji Watanabe , Ben Gardon , Paolo Bonzini , Gavin Shan , Peter Xu , Sean Christopherson , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 02/14] KVM: arm64: Tear down unlinked stage-2 subtree after break-before-make Message-ID: References: <20220830194132.962932-1-oliver.upton@linux.dev> <20220830194132.962932-3-oliver.upton@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 07, 2022 at 01:57:17PM -0700, David Matlack wrote: > On Tue, Aug 30, 2022 at 07:41:20PM +0000, Oliver Upton wrote: > [...] > > > > +static int stage2_map_walk_leaf(u64 addr, u64 end, u32 level, kvm_pte_t *ptep, > > + struct stage2_map_data *data); > > + > > static int stage2_map_walk_table_pre(u64 addr, u64 end, u32 level, > > kvm_pte_t *ptep, > > struct stage2_map_data *data) > > { > > - if (data->anchor) > > Should @anchor and @childp be removed from struct stage2_map_data? This > commit removes the only remaining references to them. Yup, I'll toss those in the next spin. > > - return 0; > > + struct kvm_pgtable_mm_ops *mm_ops = data->mm_ops; > > + kvm_pte_t *childp = kvm_pte_follow(*ptep, mm_ops); > > + struct kvm_pgtable *pgt = data->mmu->pgt; > > + int ret; > > > > if (!stage2_leaf_mapping_allowed(addr, end, level, data)) > > return 0; > > > > - data->childp = kvm_pte_follow(*ptep, data->mm_ops); > > kvm_clear_pte(ptep); > > > > /* > [...] > > static int stage2_map_walker(u64 addr, u64 end, u32 level, kvm_pte_t *ptep, > > enum kvm_pgtable_walk_flags flag, void * const arg) > > @@ -883,11 +849,9 @@ static int stage2_map_walker(u64 addr, u64 end, u32 level, kvm_pte_t *ptep, > > return stage2_map_walk_table_pre(addr, end, level, ptep, data); > > case KVM_PGTABLE_WALK_LEAF: > > return stage2_map_walk_leaf(addr, end, level, ptep, data); > > - case KVM_PGTABLE_WALK_TABLE_POST: > > - return stage2_map_walk_table_post(addr, end, level, ptep, data); > > kvm_pgtable_stage2_set_owner() still uses stage2_map_walker() with > KVM_PGTABLE_WALK_TABLE_POST. Good catch, I'll drop the TABLE_POST flag there as well. Appreciate the reviews on the series. -- Thanks, Oliver