Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6475803rdb; Thu, 14 Dec 2023 22:17:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IFgkYxqyMVlOVwGrn0hTFzE2BGA3h9NFgokJ8CpwyTdZnlCBzc0u6DhPIgnSlVmun9wih8Q X-Received: by 2002:a05:6870:ab8c:b0:203:6790:99e3 with SMTP id gs12-20020a056870ab8c00b00203679099e3mr541722oab.26.1702621028837; Thu, 14 Dec 2023 22:17:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702621028; cv=none; d=google.com; s=arc-20160816; b=dg8xe3C9/p0WYg4FFjEYcgKZEyXqwF5ISZDP/jmJDfENqrge3bXlIGb/CkkcyQLosW qetL6Nrb/Yy0jrOydBUgzdbzH8Imc9Gi26qYAi+z28NloT3MH9zwqbo0QwnQ48MS+t/y T5VMTfW8ih/ffYs016j9RxxHzP9/GBNB0u1gGEKpwTtnfM25C3OPgVP4hgY0+tLs/Rom jT42yYZ44TuPtPYMJV0RKv2Sx5xgjljkjfLgp9RddJrENecTUw+4nb3i8jY1I4i+2Jal Rk3dv/h6Pu3twoQo9uhLVWhs6q+iWaHwwcA4ettXl1VDGCh1mRxdFji4iu6vNMoYiP5O bAsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=PF8pS91LY8P+Md1/XWJx/pmCyLXYBnJ6SYzwgbP1Q/I=; fh=icd2uChT6EoVgAAZpLAG7nOw8QOor4drhnvQNWulUy0=; b=AM3IBLzRlDDn2a+9OTahoNqDToWhtp1wg6IUEsG6SyQ20mmUFTUZ2483KjI/0v/zdb nyBajCwWWEU7mwEIh3ydrVjx6egwhfLq4ZqSDDsQugDtrM5XiYOpDtZ0wBghPEJ5WEaN Ga6O8rSPMb33OxC1uUZEmCFUI2mxnvnVQjxeEoJi+ajMU2YSInl97mgZqweo2NqteEvh VlVPZXy5dTCwL+Uz47ckbTkpu4k8Y/D9nJQFmF3BwhDmNZn4JmUwaszCc5WMu0nf2KzY eyDwjF5CoHmhpqdgX1z72rpEWfYAykjzHvgVyqUFbUlVeK7dsn3qS0wUheraKTfW8vVc aoxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-477-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-477-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k3-20020a6568c3000000b005b8fb1da631si12498149pgt.897.2023.12.14.22.17.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 22:17:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-477-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-477-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-477-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 478552852D4 for ; Fri, 15 Dec 2023 06:17:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44748C8C7; Fri, 15 Dec 2023 06:17:02 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B819746B for ; Fri, 15 Dec 2023 06:16:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SrzWk3jPJzZdTJ; Fri, 15 Dec 2023 14:16:50 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id 5EFBC180068; Fri, 15 Dec 2023 14:16:55 +0800 (CST) Received: from [10.174.177.243] (10.174.177.243) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 15 Dec 2023 14:16:54 +0800 Message-ID: Date: Fri, 15 Dec 2023 14:16:54 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] mm: HVO: introduce helper function to update and flush pgtable Content-Language: en-US To: Nanyong Sun , , , , , , CC: , , , References: <20231214073912.1938330-1-sunnanyong@huawei.com> <20231214073912.1938330-2-sunnanyong@huawei.com> From: Kefeng Wang In-Reply-To: <20231214073912.1938330-2-sunnanyong@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm100001.china.huawei.com (7.185.36.93) On 2023/12/14 15:39, Nanyong Sun wrote: > Add pmd/pte update and tlb flush helper function to update page > table. This refactoring patch is designed to facilitate each > architecture to implement its own special logic in preparation > for the arm64 architecture to follow the necessary break-before-make > sequence when updating page tables. > > Signed-off-by: Nanyong Sun > --- > mm/hugetlb_vmemmap.c | 55 ++++++++++++++++++++++++++++++++++---------- > 1 file changed, 43 insertions(+), 12 deletions(-) > > diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c > index 87818ee7f01d..49e8b351def3 100644 > --- a/mm/hugetlb_vmemmap.c > +++ b/mm/hugetlb_vmemmap.c > @@ -45,6 +45,37 @@ struct vmemmap_remap_walk { > unsigned long flags; > }; > > +#ifndef vmemmap_update_pmd > +static inline void vmemmap_update_pmd(unsigned long start, > + pmd_t *pmd, pte_t *pgtable) pgtable -> ptep > +{ > + pmd_populate_kernel(&init_mm, pmd, pgtable); > +} > +#endif > + > +#ifndef vmemmap_update_pte > +static inline void vmemmap_update_pte(unsigned long addr, > + pte_t *pte, pte_t entry) pte -> ptep entry -> pte > +{ > + set_pte_at(&init_mm, addr, pte, entry); > +} > +#endif