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=-14.4 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,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 0BDE3C43460 for ; Thu, 13 May 2021 11:32:27 +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 ADBD96143E for ; Thu, 13 May 2021 11:32:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ADBD96143E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk 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:Date:Message-Id:MIME-Version: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=goJBhxu+7Qr6pusCC98ulSMmknhXHXKbnfqv31+V1p0=; b=faNNdIJSPzcY+yLuTLn1R+Lxrm kO76Dtnct5WUkdr8UdrxYnmb/JbufxR98pMIt6xM4s1v0Q5OjSIw6ruTrIK/u814NPxiOlW3luO4m JIWAqAcH/1BIKrPxB2rHj8zcCyPn+spgBWgPSrNWFX8pufNwjDUulXzAGMzNr6l4S2McCjXIrF8s1 V+KtzR71WSyEUtSyr+not+qbDE4iHz53BQB/VhCpuBqPezMc/qkMGji0YZUSLDmHBvuzQL2z6a8CK tii7sdaYYla6I2/QpUakKM92uOYZ/ZtB21wJsNscXk/gA3JjbVUzx4925fJRM5/nWgq0HSwYtMLCz xzmUd6kw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lh9XP-005Q5O-95; Thu, 13 May 2021 11:29:55 +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 1lh9XM-005Q4z-Ma for linux-arm-kernel@desiato.infradead.org; Thu, 13 May 2021 11:29:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:Reply-To:Content-ID :Content-Description:In-Reply-To:References; bh=LlrBAsqaBHLDKkJjsDDXThJXj9LgGySYv+Ol49w0cSM=; b=d6Cxq+5RNKjTI4n0bCvCuCpAZj mbVxbH/i4AQr0fLl1QhcUMifTdMhFojelZM8VvgkzLPM166FRan8FCXiC8z3Aqbr+Xo4V6Ump4Ncb kS/6P1Gv+jP6VlndGI8Iz0FpeBbJJ7GWabRO1cxZJkgalmxybqdS0YkMQK4KS98p1AtkLCbCdss5D oEY+y9b+/+5uIKN3+/mWzNjSck7Envv6OmWOi5izy62b3koaeZ8YCnPL5s6XjJBTPyyQ0TJyQf+Xl CGnhzvJQnUSouLHi5Zc3oHQh5xdR6839uikJvG7QLdPDp70D1W8DM4o09uLiwWrbogfTxK21pNuhZ Kj/Rsddw==; Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lh9XK-00BCi1-3M for linux-arm-kernel@lists.infradead.org; Thu, 13 May 2021 11:29:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version: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-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=LlrBAsqaBHLDKkJjsDDXThJXj9LgGySYv+Ol49w0cSM=; b=FHijEhHOhx4qWJ/9jY4HsV8P9o ZyhpzdLdka+B6w/PYDlTaJ9zJSQiao9t3Y6+mGn2jcYNV2BJXSZwgXE52VtdKpM6Wsfcfmz/PakI7 ph7j/M8IeH42naudrvf4yo5AgNM4ay1obnITcUQdfvGIKGJ1y+KCGSLkrfneLdO89ZNQVOIgrJZwT nG6P42fXsde4PMDX534+e512ilfOams13myeY2Te6YfhxDMKkDM/Jod+QX2ZEe3CQDrjAGf75evf1 5pAMrGlGypDKXo/57FTfQvv9Oiq5MDAGBtMQIWA2uu69PFLI+uYCqAijgIivxJS7U9O5Tz3wijBQp 8ZFgxTzA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:55876 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lh9VI-000626-0N; Thu, 13 May 2021 12:27:44 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1lh9VH-0002Lz-Pd; Thu, 13 May 2021 12:27:43 +0100 From: Russell King To: linux-arm-kernel@lists.infradead.org Cc: Anshuman Khandual , Thomas Gleixner , Allison Randal , linux-kernel@vger.kernel.org Subject: [PATCH] ARM: update __swp_entry_to_pte() to use PTE_TYPE_FAULT MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Thu, 13 May 2021 12:27:43 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210513_042950_166999_70433445 X-CRM114-Status: GOOD ( 13.30 ) 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 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) /* * It is an error for the kernel to have more swap files than we can -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel