From patchwork Thu Dec 14 07:39:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nanyong Sun X-Patchwork-Id: 13492435 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05ECBC4332F for ; Thu, 14 Dec 2023 06:41:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2DD058D009A; Thu, 14 Dec 2023 01:41:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 28BF98D0098; Thu, 14 Dec 2023 01:41:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1526B8D009A; Thu, 14 Dec 2023 01:41:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 05B9D8D0098 for ; Thu, 14 Dec 2023 01:41:55 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id DAA3BA1DF3 for ; Thu, 14 Dec 2023 06:41:54 +0000 (UTC) X-FDA: 81564478548.07.542C8DD Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf22.hostedemail.com (Postfix) with ESMTP id 69D2BC000E for ; Thu, 14 Dec 2023 06:41:51 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=none; spf=pass (imf22.hostedemail.com: domain of sunnanyong@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=sunnanyong@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702536113; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=zkm8rvAGEv0LKCXzTEOtOXNwyGIA6bwY9vczMlTOMgM=; b=DOwIc70G7dga3z6z0CDgPfHbFXlEXhAWjdJmmAM0qQvBZEMNAxBOI8DsEKhOGnLOkZawTy QvRgo5EcsEF/V1r/dDqucik3POqaOJWWIR6bSBquGcNtCrURhBL12vdEqiCHIZq0czKPnk s0eabISndt0F+EVMjELHrKr8XjZLTNo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702536113; a=rsa-sha256; cv=none; b=JsNeu+N4MFBhxRwMyKnEP/kNsTPUp/ebuEBj75j2BPSWqwcais0vCteUMwfycPBqsCH78w zdjdRoPOGHSWLPlPof0eQXrFgRQwbDx+AyAG9lvWEoc9DvgJjIB8HtrSiUSvsBVs9IBnNX 5phRfIxHSaKyBxVRBON4GjlrNt3KCb8= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=none; spf=pass (imf22.hostedemail.com: domain of sunnanyong@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=sunnanyong@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com 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 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-Stat-Signature: 55ucee818nhmdgz79kndbhon8cqnmyhb X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 69D2BC000E X-Rspam-User: X-HE-Tag: 1702536111-556235 X-HE-Meta: U2FsdGVkX1/VkCAaVV7RVV/gnN0LrEnY6Vdz1Om/7YGAYa20iiMhOIQweidtiOall34IsUK9j5my3VXyjYdwwLku+WOw0qEYAvvKvgsQGYT/Og42XU4LRrtNsuenYSht93eOrG7Qz+rdI3ijud0nnphDiQrJKFbVIk4xetPHbMrojT5BIDmEnMM46kMTvc2u0+rVKUaZR8d32ThcGmCZT0AkEJ4IffPanEwK2sqsLSWb1JXtA0vNrY/beCgDP0yfmRyFCxn4QiZngvcZKCOWU0oaiI+a+TmBHEIVVK2NTYzgUorXMAwXxEQw4Xhyb3KfeUCXCajHaoZD0+gsdYO9O9Bx+pxbTcPF9ci8nRaer/WVhMc0DezaE2xFZIAQ/irX/wnqKSr7J+7xtF3HMXl+9nja5AwKfK4BB50sjIi5YI2DHITLaxtXMEsoBwrSGAbfZiz5uMAZ/R69kPGrWxj8KSSrfz4Rcualz586alZEOOQld0HbRPisx3nyNzp0Ig+YQB747Nq48MDe7dI9rdOaQ7R/m4IY5/6NktPhqfFjpg4ZB0jLEKX2szZxILjE5H8QMQULtHabg7Cx84TEYtnny/004z/LnBWzEvO1xwpc2RG+Df8FHmMmun1mme9yvLhH+MGNMThYA2n5pGp/3tdg1Ixw0M/RheHL29P31gkVPitrYgTArWYUls63wvPPKwbF5b4h8R6n05qeW1ygdbuYtSWKgaJavj0lvC9/1m0n0cxSVCEFLOsivkpMIISvEj1boTKr1jyQfbyrVYjEH3znBddS/Rvx6sVJ4bNn10duaZl6ub6to0qxDKshGWZzhZBD6YKfFCaqM0FUCE27e8+Xq5hHvsdqa6GzKnQVW5FctQiSFwgJiSTHzuARZvPzbjDUhGV3jE+3cYUFXPD5PafOWJMotWsz+gf9AAP5YmCtI0mI9PNrMER9ehE9GY0JSlxWqJ1/hQJ4B0fMkQDis5A 7bt/CyN+ jSbHcglSz7DdUlCUmOT6mHDYhvnVCq82r0tQ1h0y8smB6rNLbe9v3kz1qRjMfmBszcJi28jreSj09pYeqprRDNurPxMZV4fhhYsREMFmqcUvO5/OEzszlornZ6w== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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(-)