Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp583626pxj; Thu, 13 May 2021 11:50:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLb/YPv63Cdhr7pyiF+TNMuE2G1a6RPOzDtUgjYdBm7G0Fqjd3yUfrIw185loEHYFzvf+4 X-Received: by 2002:a9d:6a18:: with SMTP id g24mr35234710otn.368.1620931813055; Thu, 13 May 2021 11:50:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620931813; cv=none; d=google.com; s=arc-20160816; b=raEn0m1c8zt8KUQw4+O3BFre0MBahWzs67ACPYZ227SVOi1ZeqLRcwKLTpey29865l BTg22IFA6ZYC4J1EUreU/LjZNZ0N+pA/NwlMjyc6Fioaa0mutEDF6YlIH0A0YnksVhp1 iY9umLBsFVmlh0pLA6fhzQVXtwZkEZpJKiEo6GVMaFWgdy+YzoWFJXFaf2cDGcJILein Kywlc/0cobCGL76Jm4dtWTfjuBXecQ1f8TXCUHfjINrTu48GcOZ4kcqa3vnCP1nO8tnv TGZJP97hvSHS4EMsroLRlTQWfgIc85LA0sQ+diAsjL2LnJS9jor393qD1Fa06hMl11cH 6CAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:sender:message-id:content-transfer-encoding :content-disposition:mime-version:subject:cc:to:from:dkim-signature; bh=LlrBAsqaBHLDKkJjsDDXThJXj9LgGySYv+Ol49w0cSM=; b=PW+aPgn91ttTA9YFITZbEyXwYJ0vE2UZw0lAHIxOafn178F3sT1kiXLvD+iYJSKUx4 8j5DsW6VDHVE32cm3Bd3J5bIvnsB3Rlb2b/VsnhA1cGcAEf5C5z/99q7MJybbZEfVV9w q2n16eLYqU5702G1597E8WGvH0yT2YmcFAv7ug962h/0EHxmbPT8BXALlFHNVuYyeKNt wr96taT6jzIjuKtDaUHYx0xkT8yiaFhS4WHN+04vmTuemjEy3DV+Tty2z2e7lNCW8V5x j791bD7aVH/k+VJ/4nyYrbBi9x/o3oDvZK20nN/HC0L15fqY45TIvQxU2I92j5GCt/4U oI8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=FHijEhHO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v50si3639097otb.47.2021.05.13.11.49.59; Thu, 13 May 2021 11:50:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=FHijEhHO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233274AbhEML26 (ORCPT + 99 others); Thu, 13 May 2021 07:28:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231961AbhEML25 (ORCPT ); Thu, 13 May 2021 07:28:57 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C283C061574 for ; Thu, 13 May 2021 04:27:48 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Thu, 13 May 2021 12:27:43 +0100 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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