Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5805069rdb; Wed, 13 Dec 2023 23:01:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFks2WJx0cw0LlwQfRMYh/kQXix2ZtjiEchBZ17cZ5SA+ZZMMibYDT0K7EOllVXUsFbiG00 X-Received: by 2002:a05:6a20:1609:b0:18a:181b:146b with SMTP id l9-20020a056a20160900b0018a181b146bmr11303788pzj.29.1702537293032; Wed, 13 Dec 2023 23:01:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702537293; cv=none; d=google.com; s=arc-20160816; b=Hp0ZtHSg0qHx+1wlUy5pby4mZKYsw1nL+OTgsGkG0LbC3GU2ukJi6XFfo2VPzDCCsF o7VBx3LPFVybV7pwIGCziKcYMmR80jRxem1eAL6ZR2KDhZH5NpaQ4w5sBALNzdHUR4P7 edc9xJsKefSlv/8E/DssDU6f3W2oVSdIGci7DpKYnM+kKgKnqJcpJyUZm1gojpdlMQyC 80q83AUayz+HgEs3iuE/Cx8GwUGx/xcbu63m4IkMiOvtWMWOHPBHlhY0f6nMvCWh1cM0 ZNnKUQXVxFh5le1MI3KaYoAGVAa+DVQBts7mtQ/OEK+EXCK4Gt6HWn0XxC3A34hSoEVY KLAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=zkm8rvAGEv0LKCXzTEOtOXNwyGIA6bwY9vczMlTOMgM=; fh=IBRY2OfN0iTWW2ZjSSKvUJynIiV/JLaiDZe55wN3MqA=; b=i767uNWVdt/rOw2aE7jbcTpMJ5O8Rgj9pb1PhnV2PQDf3mrgntDsXSC/1sKwKvYGP0 sWkcRekFJj3iFk1A18Q98P4pSDpI5VeuA0hqtUrAjYpzPmV/lnz3GKcZ2fofNz+RjWn9 H2i6eMGIG592vTkK40DClvxJrQh6LgRfh2xw53Ika1a0QOV7kox2HZGT+gOG4g8NM4v6 dYd42EiMm3gjm/IYCxSn14gLXABu89LyqYhTpTrKhenRFT/lPKjMJURKciJ5IAewhlDB dEvQZ/kno6PQXmd6yDR0B4M+kTiv41woHrDU+IkFYtHGo0zrnWVp/DQdgzfGiLoLQc0x XsRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id a23-20020a634d17000000b005c6643c12basi10473199pgb.435.2023.12.13.23.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 23:01:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E9CE38029DDF; Wed, 13 Dec 2023 23:01:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443250AbjLNHBV (ORCPT + 99 others); Thu, 14 Dec 2023 02:01:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234327AbjLNHBU (ORCPT ); Thu, 14 Dec 2023 02:01:20 -0500 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64B18B9 for ; Wed, 13 Dec 2023 23:01:26 -0800 (PST) Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4SrN5f142zz29fnb; Thu, 14 Dec 2023 14:40:38 +0800 (CST) Received: from kwepemm000003.china.huawei.com (unknown [7.193.23.66]) by mail.maildlp.com (Postfix) with ESMTPS id 5BBC4140134; Thu, 14 Dec 2023 14:41:46 +0800 (CST) Received: from huawei.com (10.175.113.32) by kwepemm000003.china.huawei.com (7.193.23.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 14 Dec 2023 14:41:45 +0800 From: Nanyong Sun To: , , , , , CC: , , , , , Subject: [PATCH 0/3] A Solution to Re-enable hugetlb vmemmap optimize on Arm Date: Thu, 14 Dec 2023 15:39:09 +0800 Message-ID: <20231214073912.1938330-1-sunnanyong@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm000003.china.huawei.com (7.193.23.66) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Dec 2023 23:01:31 -0800 (PST) HVO was previously disabled on arm64 [1] due to the lack of necessary BBM(break-before-make) logic when changing page tables. This set of patches fix this by adding necessary BBM sequence when changing page table, and supporting vmemmap page fault handling to fixup kernel address fault if vmemmap is concurrently accessed. [1] commit 060a2c92d1b6 ("arm64: mm: hugetlb: Disable HUGETLB_PAGE_OPTIMIZE_VMEMMAP") Nanyong Sun (3): mm: HVO: introduce helper function to update and flush pgtable arm64: mm: HVO: support BBM of vmemmap pgtable safely arm64: mm: Re-enable OPTIMIZE_HUGETLB_VMEMMAP arch/arm64/Kconfig | 1 + arch/arm64/include/asm/esr.h | 4 ++ arch/arm64/include/asm/mmu.h | 20 ++++++++ arch/arm64/mm/fault.c | 94 ++++++++++++++++++++++++++++++++++++ arch/arm64/mm/mmu.c | 28 +++++++++++ mm/hugetlb_vmemmap.c | 55 ++++++++++++++++----- 6 files changed, 190 insertions(+), 12 deletions(-) -- 2.25.1