Skip to content

Commit 8947c09

Browse files
chazyRussell King
authored andcommitted
ARM: 7808/1: KVM: mm: Get rid of L_PTE_USER ref from PAGE_S2_DEVICE
THe L_PTE_USER actually has nothing to do with stage 2 mappings and the L_PTE_S2_RDWR value sets the readable bit, which was what L_PTE_USER was used for before proper handling of stage 2 memory defines. Changelog: [v3]: Drop call to kvm_set_s2pte_writable in mmu.c [v2]: Change default mappings to be r/w instead of r/o, as per Marc Zyngier's suggestion. Cc: Marc Zyngier <[email protected]> Signed-off-by: Christoffer Dall <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 4bfab20 commit 8947c09

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

arch/arm/include/asm/pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ extern pgprot_t pgprot_s2_device;
100100
#define PAGE_HYP _MOD_PROT(pgprot_kernel, L_PTE_HYP)
101101
#define PAGE_HYP_DEVICE _MOD_PROT(pgprot_hyp_device, L_PTE_HYP)
102102
#define PAGE_S2 _MOD_PROT(pgprot_s2, L_PTE_S2_RDONLY)
103-
#define PAGE_S2_DEVICE _MOD_PROT(pgprot_s2_device, L_PTE_USER | L_PTE_S2_RDONLY)
103+
#define PAGE_S2_DEVICE _MOD_PROT(pgprot_s2_device, L_PTE_S2_RDWR)
104104

105105
#define __PAGE_NONE __pgprot(_L_PTE_DEFAULT | L_PTE_RDONLY | L_PTE_XN | L_PTE_NONE)
106106
#define __PAGE_SHARED __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_XN)

arch/arm/kvm/mmu.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,6 @@ int kvm_phys_addr_ioremap(struct kvm *kvm, phys_addr_t guest_ipa,
495495

496496
for (addr = guest_ipa; addr < end; addr += PAGE_SIZE) {
497497
pte_t pte = pfn_pte(pfn, PAGE_S2_DEVICE);
498-
kvm_set_s2pte_writable(&pte);
499498

500499
ret = mmu_topup_memory_cache(&cache, 2, 2);
501500
if (ret)

0 commit comments

Comments
 (0)