Skip to content

Commit 9038455

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Will Deacon: "A pair of small arm64 fixes for -rc6. One is a fix for the recently merged uffd-wp support (which was triggering a spurious warning) and the other is a fix to the clearing of the initial idmap pgd in some configurations Summary: - Fix spurious page-table warning when clearing PTE_UFFD_WP in a live pte - Fix clearing of the idmap pgd when using large addressing modes" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Clear the initial ID map correctly before remapping arm64: mm: Permit PTE SW bits to change in live mappings
2 parents 234458d + ecc5400 commit 9038455

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

arch/arm64/include/asm/pgtable-hwdef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
#define PTE_CONT (_AT(pteval_t, 1) << 52) /* Contiguous range */
171171
#define PTE_PXN (_AT(pteval_t, 1) << 53) /* Privileged XN */
172172
#define PTE_UXN (_AT(pteval_t, 1) << 54) /* User XN */
173+
#define PTE_SWBITS_MASK _AT(pteval_t, (BIT(63) | GENMASK(58, 55)))
173174

174175
#define PTE_ADDR_LOW (((_AT(pteval_t, 1) << (50 - PAGE_SHIFT)) - 1) << PAGE_SHIFT)
175176
#ifdef CONFIG_ARM64_PA_BITS_52

arch/arm64/kernel/pi/map_kernel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static void __init remap_idmap_for_lpa2(void)
173173
* Don't bother with the FDT, we no longer need it after this.
174174
*/
175175
memset(init_idmap_pg_dir, 0,
176-
(u64)init_idmap_pg_dir - (u64)init_idmap_pg_end);
176+
(u64)init_idmap_pg_end - (u64)init_idmap_pg_dir);
177177

178178
create_init_idmap(init_idmap_pg_dir, mask);
179179
dsb(ishst);

arch/arm64/mm/mmu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ bool pgattr_change_is_safe(u64 old, u64 new)
124124
* The following mapping attributes may be updated in live
125125
* kernel mappings without the need for break-before-make.
126126
*/
127-
pteval_t mask = PTE_PXN | PTE_RDONLY | PTE_WRITE | PTE_NG;
127+
pteval_t mask = PTE_PXN | PTE_RDONLY | PTE_WRITE | PTE_NG |
128+
PTE_SWBITS_MASK;
128129

129130
/* creating or taking down mappings is always safe */
130131
if (!pte_valid(__pte(old)) || !pte_valid(__pte(new)))

0 commit comments

Comments
 (0)