From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3C44C43460 for ; Mon, 17 May 2021 07:49:22 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C1800611EE for ; Mon, 17 May 2021 07:49:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1800611EE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XGCt+8eu3XsAclrsDsJnrur4aYtRcSWuJNQqD4mDFJ4=; b=LFhq9d0EkfJKGqqA6SnQ5J9/a VUldFimkYTtztR7/jZaS1A58ru67dOS95WhrzklsbceRXNZcLor9J4HV2zcQAVV9zWmcut9zGTmT/ RN7j/HMgRSKQ/OC8NP0LRwiLf+e8OoNRtqSlzreQ8eNKdbunqKCM9aIOfCO1yQ0SFEiZtkL07Z/oj ZiJpWzWCgEGmtGust93rqgRdwefIib2velK1gXA6t2Y9s/DDaYi+yEs0gJ2I1sDN42gFaMQNbFh7g EI0PttrWZByR4AxCsrx7QGo2cNqCln0ERDgcNAmHZNJpqvkktRwamqDnwhqYc3iEjpqg8+mOEWK4+ k2Ks6MNkg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liXxq-00E5J2-UA; Mon, 17 May 2021 07:46:59 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liXxn-00E5Ia-CC for linux-arm-kernel@desiato.infradead.org; Mon, 17 May 2021 07:46:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=ItZt3tx/FxBZ3nzmTbj2TysT3VAu0VAkdqDcXGHZuAs=; b=5BIPAXnQdX1/9gN3XqED+fT/nE /C7vJrA6w7GY+rNFzpqY0l9GVw26vSk6tiRoMLmOlkRQgapgGA6+0LWkNB/ZrSiEq6E0yiTDuwt8G +rQel6pxJf5nyZQ8ZwRsMCq6i2epCLforJ9Ni8U11S0tspkjUBwolO9L6YkXo0ATjPIbVOxMWTfjB mzZXmRfYWYAzUfclnzvOM2FXjmd37Y9VfNjxSCQcaSkSaHR8ZWjAZXjmMcDt+t+SHczEfcf4iQobn VfP/FPCYOWC9VJ74ucnIszYlvjmTy36rGiyCjJvnzkqCZXPzd2ft/sVT7VdMBli9DdisQ1TbUMRC4 m8KHYeyg==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liXxk-00DYdZ-Iy for linux-arm-kernel@lists.infradead.org; Mon, 17 May 2021 07:46:53 +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 6E2E51042; Mon, 17 May 2021 00:46:48 -0700 (PDT) Received: from [192.168.0.130] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D152C3F719; Mon, 17 May 2021 00:46:46 -0700 (PDT) Subject: Re: [PATCH] ARM: update __swp_entry_to_pte() to use PTE_TYPE_FAULT To: Russell King , linux-arm-kernel@lists.infradead.org Cc: Thomas Gleixner , Allison Randal , linux-kernel@vger.kernel.org References: From: Anshuman Khandual Message-ID: Date: Mon, 17 May 2021 13:17:29 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_004652_707928_C8AE89B5 X-CRM114-Status: GOOD ( 19.91 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 5/13/21 4:57 PM, Russell King wrote: > Swap entries use a faulting PTE which have the least two significant > bits as zero. Due to this, the use of PTE_TYPE_FAULT was overlooked, > but really should have been included in __swp_entry_to_pte(). > > Convert this macro to use PTE_TYPE_FAULT to properly document what is > going on here, and use __pte() to convert the swp_entry_t to a pte_t. > > This results in no change to the resulting kernel text. > > Signed-off-by: Russell King > --- > arch/arm/include/asm/pgtable.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h > index c02f24400369..c43e07d6046d 100644 > --- a/arch/arm/include/asm/pgtable.h > +++ b/arch/arm/include/asm/pgtable.h > @@ -303,7 +303,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) > #define __swp_entry(type,offset) ((swp_entry_t) { ((type) << __SWP_TYPE_SHIFT) | ((offset) << __SWP_OFFSET_SHIFT) }) > > #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) > -#define __swp_entry_to_pte(swp) ((pte_t) { (swp).val }) > +#define __swp_entry_to_pte(swp) __pte((swp).val | PTE_TYPE_FAULT) LGTM and FWIW.. Reviewed-by: Anshuman Khandual > > /* > * It is an error for the kernel to have more swap files than we can > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel