From patchwork Fri Jul 7 05:33:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 13304437 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 DC577EB64D9 for ; Fri, 7 Jul 2023 05:34:14 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=b25Z6+AEJoQd/a8awTh5DGB7CXOWx8aSXaczq4e5MPU=; b=hPVDFNw8keSvD8 6G1SXmknyIJVi9MaMM6dt+g5FppYkWqpAQ7pVTU9aT9NecavUqYYHNy+sxkJiG+q3az5gx8E3vG66 f6VVuamceVYPtJnD0XO5Y/TQM09D88ZDBcYCfaBDddL2Vt2znUscNahKI3bf2nkC/enJD5o+iIQaT ERvW+wcmeGB37OUOfvbrCw0XYTWjW7GKapftSgPLqSRHSwzrvsdQT/7Dq+GNAg3pubmtW1NW1M1eh VdCQg/OIwt0KAHB6rl+dUERlhJZ+wO4zLE8S7FUCiu5zdAcxWows3D55p/vmUPZpctotVBiOXOCCQ 2ZyUfEWa2hd3FLIZZbew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qHe6K-003d7Y-0T; Fri, 07 Jul 2023 05:33:52 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qHe6H-003d6I-04 for linux-arm-kernel@lists.infradead.org; Fri, 07 Jul 2023 05:33:50 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DE846D75; Thu, 6 Jul 2023 22:34:25 -0700 (PDT) Received: from a077893.arm.com (unknown [10.163.48.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2B8CE3F740; Thu, 6 Jul 2023 22:33:38 -0700 (PDT) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org Cc: Anshuman Khandual , Catalin Marinas , Will Deacon , Ryan Roberts , Mark Rutland , Andrew Morton , David Hildenbrand , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: [RFC 0/4] arm64/mm: Clean up pte_dirty() state management Date: Fri, 7 Jul 2023 11:03:27 +0530 Message-Id: <20230707053331.510041-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230706_223349_131807_B9DCE4D7 X-CRM114-Status: UNSURE ( 9.27 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org These pte_dirty() changes make things explicitly clear, while improving the code readability. This optimizes HW dirty state transfer into SW dirty bit. This also adds a new arm64 documentation explaining overall pte dirty state management in detail. This series applies on the latest mainline kernel. Cc: Catalin Marinas Cc: Will Deacon Cc: Ryan Roberts Cc: Mark Rutland Cc: Andrew Morton Cc: David Hildenbrand Cc: Jonathan Corbet Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-doc@vger.kernel.org Anshuman Khandual (4): arm64/mm: Add SW and HW dirty state helpers arm64/mm: Call pte_sw_mkdirty() while preserving the HW dirty state arm64/mm: Add pte_preserve_hw_dirty() docs: arm64: Add help document for pte dirty state management Documentation/arch/arm64/index.rst | 1 + Documentation/arch/arm64/pte-dirty.rst | 95 ++++++++++++++++++++++++++ arch/arm64/include/asm/pgtable.h | 66 ++++++++++++++---- 3 files changed, 147 insertions(+), 15 deletions(-) create mode 100644 Documentation/arch/arm64/pte-dirty.rst