+ m32r-fix-pte_to_pgoff.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     m32r: fix pte_to_pgoff(),  pgoff_to_pte() and __swp_type() macros
has been added to the -mm tree.  Its filename is
     m32r-fix-pte_to_pgoff.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: m32r: fix pte_to_pgoff(),  pgoff_to_pte() and __swp_type() macros
From: Hirokazu Takata <takata@xxxxxxxxxxxxxx>

This patch is required to handle file-mapped or swapped-out pages
correctly.

- Fix pte_to_pgoff() and pgoff_to_pte() macros not to include
  _PAGE_PROTNONE bit of PTE.
  Mask value for { ACCESSED, N, (R, W, X), L, G } is not 0xef but 0x7f.
- Fix __swp_type() macro for MAX_SWAPFILES_SHIFT(=5), which is defined
  in include/linux/swap.h.

* M32R TLB format

     [0]    [1:19]           [20:23]       [24:31]
     +-----------------------+----+-------------+
     |          VPN          |0000|    ASID     |
     +-----------------------+----+-------------+
     +-+---------------------+----+-+---+-+-+-+-+
     |0         PPN          |0000|N|AC |L|G|V| |
     +-+---------------------+----+-+---+-+-+-+-+
                                ||   RWX     | |
* software bits in PTE          ||           | +-- _PAGE_FILE | _PAGE_DIRTY
                                ||           +---- _PAGE_PRESENT
                                |+---------------- _PAGE_ACCESSED
                                +----------------- _PAGE_PROTNONE

Signed-off-by: Hitoshi Yamamoto <hitoshiy@xxxxxxxxxxxxxx>
Signed-off-by: Hirokazu Takata <takata@xxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/asm-m32r/pgtable-2level.h |    4 ++--
 include/asm-m32r/pgtable.h        |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff -puN include/asm-m32r/pgtable-2level.h~m32r-fix-pte_to_pgoff include/asm-m32r/pgtable-2level.h
--- a/include/asm-m32r/pgtable-2level.h~m32r-fix-pte_to_pgoff
+++ a/include/asm-m32r/pgtable-2level.h
@@ -71,8 +71,8 @@ static inline pmd_t *pmd_offset(pgd_t * 
 #define pfn_pmd(pfn, prot)	__pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
 
 #define PTE_FILE_MAX_BITS	29
-#define pte_to_pgoff(pte)	(((pte_val(pte) >> 2) & 0xef) | (((pte_val(pte) >> 10)) << 7))
-#define pgoff_to_pte(off)	((pte_t) { (((off) & 0xef) << 2) | (((off) >> 7) << 10) | _PAGE_FILE })
+#define pte_to_pgoff(pte)	(((pte_val(pte) >> 2) & 0x7f) | (((pte_val(pte) >> 10)) << 7))
+#define pgoff_to_pte(off)	((pte_t) { (((off) & 0x7f) << 2) | (((off) >> 7) << 10) | _PAGE_FILE })
 
 #endif /* __KERNEL__ */
 #endif /* _ASM_M32R_PGTABLE_2LEVEL_H */
diff -puN include/asm-m32r/pgtable.h~m32r-fix-pte_to_pgoff include/asm-m32r/pgtable.h
--- a/include/asm-m32r/pgtable.h~m32r-fix-pte_to_pgoff
+++ a/include/asm-m32r/pgtable.h
@@ -366,7 +366,7 @@ static inline void pmd_set(pmd_t * pmdp,
 #define pte_unmap_nested(pte)	do { } while (0)
 
 /* Encode and de-code a swap entry */
-#define __swp_type(x)			(((x).val >> 2) & 0x3f)
+#define __swp_type(x)			(((x).val >> 2) & 0x1f)
 #define __swp_offset(x)			((x).val >> 10)
 #define __swp_entry(type, offset)	\
 	((swp_entry_t) { ((type) << 2) | ((offset) << 10) })
_

Patches currently in -mm which might be from takata@xxxxxxxxxxxxxx are

origin.patch
m32r-fix-switch_to-macro-to-push-pop-frame-pointer-if.patch
m32r-fix-switch_to-macro-to-push-pop-frame-pointer-if-fix.patch
m32r-fix-tme_handler-to-check-_page_present-bit.patch
m32r-fix-pte_to_pgoff.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux