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 195E4C0015E for ; Thu, 13 Jul 2023 12:17:51 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tSp7QBWuz6DApx9bvaFY594Pm1L0EdVqTUG7Y2U7Rc8=; b=VMRw5oDAqpuLIW PmSvgyiFKz7700Pf4bqrW0W1hSUnYpPxs2TUGm6FHblzBhsIQalZpzWClRonF0G9gc52Hg1Y1sWoV taIgu7Dna2lNfD1WYYEI6W3jy9W/pgTTtOL6WGS3HHe33ITJdXK/81BLmz1sTs7Ojf8SYg2Gb/+Tw OAg71p4GHtRnFlnVnjs9gEKuJWRiCFnDmLzzL3eRlwhjLUvl6gQVxQKZZRHZt+7H+A1U+bamnx/5H 5Vlsa28bNcIV71kZLNiF5QAO+QylHIl/nH3GOYi95oPGt4tOrAlyEOtoDBBA0JXvd+breS2TJh4Mn HhgOA9WPNrZ4b0kRK0pQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJvG4-003CyV-2Q; Thu, 13 Jul 2023 12:17:20 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qJvG2-003Cxl-1x for linux-arm-kernel@lists.infradead.org; Thu, 13 Jul 2023 12:17:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689250637; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I9Ye8KfETUuRbXwbLJ8cBLC8vHqrIxM24kzSIqos1xM=; b=HdHsZPAR1gXLz8oWJFvTBqekuurEDIvr5bvh+xrLWlI2XD2unSwWI4iumuH/yhUwWWTLku +g9Q6DLfAgzxjNLj1yiUp89YSCLyP7IyydgIKT9O64yUyMj2A6RBAT92qjvp9CndXjGfDX ww9wESvB3DRnFSmZ/TJ7JqwAGs68ee8= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-668-Wkcus7sJMJWGnReNvQNQxw-1; Thu, 13 Jul 2023 08:17:16 -0400 X-MC-Unique: Wkcus7sJMJWGnReNvQNQxw-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3fc00d7d62cso3402575e9.2 for ; Thu, 13 Jul 2023 05:17:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689250635; x=1691842635; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=I9Ye8KfETUuRbXwbLJ8cBLC8vHqrIxM24kzSIqos1xM=; b=W4Tx3P+NJWTUjshRAJFf0g+WXgVl5+FhIZf6CgBfq9NJQRLrlDqHHPZX/RSV4QRv8r 2PKw6LJIgxvrd4sah/ZYpxG/mf4BRaj8oB67Ls/1suiAV9ducLBe1xv6s/AZl3N2H4l7 Oq5LnCE4i1lYK6TlGU1ODZ2/bbNfaa0S6zJYAKUGAyWtnWtDQz4l4TGp3kCP8GzoaFnF O6BSQ/Mf1uz3JYzobCHSU1gr+71vGARpYfho6uilYvG1L+4USP6ciAc8Xsny6oqy0g4A YHiF4igWwAsS8+DcMOzPGuc0WTG3GqJsAP90s96HLlvoefGwD3SBBINsiHyfINfRaUjo VElg== X-Gm-Message-State: ABy/qLZb+Oq482yK8lXRwnRmgNF1rNe11Xd4hwVTidjTmQHAR69FviNT IEAhj6b4Ul1n7F7X0aTCJB2G/4C4++mfm9r03QzTyfE/pNdUnvSvxUiThVtCtTFwixC46rB+hmf J4SnkI+cyJGHYlVweKXkGn8nFT7R+Do1olU+qnCnfX58= X-Received: by 2002:a05:600c:20c4:b0:3fb:e054:903f with SMTP id y4-20020a05600c20c400b003fbe054903fmr1237409wmm.36.1689250635418; Thu, 13 Jul 2023 05:17:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlH4K1xzW6AnUhVBZ0m3bhe20kl+YjcL/Vw7G0f9UZ/hZUDowjjuFLDR26UZuruzxrGYqelQkQ== X-Received: by 2002:a05:600c:20c4:b0:3fb:e054:903f with SMTP id y4-20020a05600c20c400b003fbe054903fmr1237397wmm.36.1689250635215; Thu, 13 Jul 2023 05:17:15 -0700 (PDT) Received: from ?IPV6:2003:cb:c717:6100:2da7:427e:49a5:e07? (p200300cbc71761002da7427e49a50e07.dip0.t-ipconnect.de. [2003:cb:c717:6100:2da7:427e:49a5:e07]) by smtp.gmail.com with ESMTPSA id z14-20020a05600c220e00b003fbacc853ccsm7630178wml.18.2023.07.13.05.17.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Jul 2023 05:17:14 -0700 (PDT) Message-ID: <68392d51-ef9d-e687-f659-983bf2ba237b@redhat.com> Date: Thu, 13 Jul 2023 14:17:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] arm64/mm: Add pte_rdonly() helper To: Anshuman Khandual , linux-arm-kernel@lists.infradead.org Cc: Catalin Marinas , Will Deacon , Mark Rutland , linux-kernel@vger.kernel.org References: <20230713092004.693749-1-anshuman.khandual@arm.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20230713092004.693749-1-anshuman.khandual@arm.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230713_051718_739753_0B7D24C3 X-CRM114-Status: GOOD ( 15.53 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 13.07.23 11:20, Anshuman Khandual wrote: > This replaces open coding PTE_RDONLY check with a new helper pte_rdonly(). > No functional change is intended here. > > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Mark Rutland > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual > --- > This applies on v6.5-rc1 > > arch/arm64/include/asm/pgtable.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h > index 171d6d7f8087..72c2e8431360 100644 > --- a/arch/arm64/include/asm/pgtable.h > +++ b/arch/arm64/include/asm/pgtable.h > @@ -103,6 +103,7 @@ static inline pteval_t __phys_to_pte_val(phys_addr_t phys) > #define pte_young(pte) (!!(pte_val(pte) & PTE_AF)) > #define pte_special(pte) (!!(pte_val(pte) & PTE_SPECIAL)) > #define pte_write(pte) (!!(pte_val(pte) & PTE_WRITE)) > +#define pte_rdonly(pte) (!!(pte_val(pte) & PTE_RDONLY)) > #define pte_user(pte) (!!(pte_val(pte) & PTE_USER)) > #define pte_user_exec(pte) (!(pte_val(pte) & PTE_UXN)) > #define pte_cont(pte) (!!(pte_val(pte) & PTE_CONT)) > @@ -120,7 +121,7 @@ static inline pteval_t __phys_to_pte_val(phys_addr_t phys) > (__boundary - 1 < (end) - 1) ? __boundary : (end); \ > }) > > -#define pte_hw_dirty(pte) (pte_write(pte) && !(pte_val(pte) & PTE_RDONLY)) > +#define pte_hw_dirty(pte) (pte_write(pte) && !pte_rdonly(pte)) > #define pte_sw_dirty(pte) (!!(pte_val(pte) & PTE_DIRTY)) > #define pte_dirty(pte) (pte_sw_dirty(pte) || pte_hw_dirty(pte)) > Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel