Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2427419pxj; Mon, 17 May 2021 01:00:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2DXGDHTaX/DVxkiHApEBPzSLxMRpHG9RMlsF1p+6l17PvhNSdj5Ipeb4OO72Ij5ygiGXY X-Received: by 2002:a17:907:1c15:: with SMTP id nc21mr62623826ejc.49.1621238421189; Mon, 17 May 2021 01:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621238421; cv=none; d=google.com; s=arc-20160816; b=hOHDXEyagG8pUwKstfbsBfyNTs3iZhlM2ley+lX6IZ9lHzrZHBZNsubM7xQuPSSXGF mP5de7Hlf4i6XlAz3WQi7auXCWdQfn+rWctAtgOlJ/QHmi+UcDhDLlbwKYNE2o3ktAFr uAsfEVjWkL0qeIOMRRUpL6bSSTVoiNdfDSQpuIipiLA/ngg6gnM0pOUw5tdu6tCxXUBD 9qSp/6GqF9rHMJdhqVuuRBM+RmcI8pDMNsLbMyFwPkj3vckCia4W+EI6VyxDCXZIY2Ds uWvLAUTcd+1wOyh4ha0kelwDp+YD+Po6DRlLdMODdZfZQiGiZBQpTn35eNb0x8u+Yp/i /QhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=ItZt3tx/FxBZ3nzmTbj2TysT3VAu0VAkdqDcXGHZuAs=; b=l7HF8Cxal2zCzm26GK52aPqQjgkpL91QiKmdTtD4i7raVKDYfTt2i+C1bqMHXU6NlS R5sUcOExFMc6e3m6XoA7vM/EUioMk/3/MmGO++rOZziETBN77rFXF4v0d2A5TBEmI+u6 pZBqraKajpaPeOTX3zMzFnCKpfddc4UW61fNhDEAT88dEksgT2/1iIdY9n5jO/BDSq74 atVtDfqVmqxsLbZPQVbsOkTBitWtZ+TuklzQVsMKDqLU7bfpho4g7Ey0DdDTMYA0VdXG aK25t3OIOEtfYEg3bMLZqlcSxtzrcbsUwIFEfY0zUW769nLIJaL7VzOTLX+WnoGu1EFz 93Hg== ARC-Authentication-Results: i=1; mx.google.com; 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=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f10si7233680ejq.186.2021.05.17.00.59.58; Mon, 17 May 2021 01:00:21 -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; 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=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235394AbhEQHsF (ORCPT + 99 others); Mon, 17 May 2021 03:48:05 -0400 Received: from foss.arm.com ([217.140.110.172]:44090 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232909AbhEQHsE (ORCPT ); Mon, 17 May 2021 03:48:04 -0400 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-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 >