diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2021-05-13 12:53:17 +0200 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2021-06-07 13:55:30 +0200 |
commit | d619f90fae23a31eda3a06e762a17dcdc7fbd4e8 (patch) | |
tree | e1bdbcc213f4f3a3e6c9e290736fe49c4672746c | |
parent | Linux 5.13-rc1 (diff) | |
download | linux-d619f90fae23a31eda3a06e762a17dcdc7fbd4e8.tar.xz linux-d619f90fae23a31eda3a06e762a17dcdc7fbd4e8.zip |
ARM: update __swp_entry_to_pte() to use PTE_TYPE_FAULT
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 image.
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | arch/arm/include/asm/pgtable.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index d63a5bb6bd0c..cd1f84bb40ae 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h @@ -306,7 +306,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 |