]> git.baikalelectronics.ru Git - kernel.git/commit
csky: Fixup swapon
authorGuo Ren <guoren@linux.alibaba.com>
Wed, 13 Jan 2021 07:28:16 +0000 (15:28 +0800)
committerGuo Ren <guoren@linux.alibaba.com>
Sat, 27 Feb 2021 08:32:54 +0000 (16:32 +0800)
commita360d2c09957667e4da19e975939e18a7b023274
tree5dda8ecb8de623c77f775fb9b778e6523410372f
parent0a9e8f4a54d515ca22b38ddb757e72d7444462a3
csky: Fixup swapon

Current csky's swappon is broken by wrong swap PTE entry format.
Now redesign the new format for abiv1 & abiv2 and make swappon +
zram work properly on csky machines.

C-SKY PTE has VALID, DIRTY to emulate PRESENT, READ, WRITE, EXEC
attributes. GLOBAL bit is shared by two pages in the same tlb
entry. So we need to keep GLOBAL, VALID, PRESENT zero in swp_pte.

To distinguish PAGE_NONE and swp_pte, we need to use an additional
bit (abiv1 is _PAGE_READ, abiv2 is _PAGE_WRITE).

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Cc: Arnd Bergmann <arnd@arndb.de>
arch/csky/abiv1/inc/abi/pgtable-bits.h
arch/csky/abiv2/inc/abi/pgtable-bits.h
arch/csky/include/asm/pgtable.h