diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-08-21 18:28:01 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-08-21 18:28:01 +0200 |
commit | b4cb19235eb84f5e08539a10fcdd671a06494e94 (patch) | |
tree | d758dc8dd8009fa7405a04769a53c28c6cd41b3d /sys/src | |
parent | 6280c0f17bf3919cf6c2506fec6edfa0a7ec10fe (diff) |
bcm: set XN bits for kernel device mappings
Diffstat (limited to 'sys/src')
-rw-r--r-- | sys/src/9/bcm/arm.h | 1 | ||||
-rw-r--r-- | sys/src/9/bcm/mmu.c | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/sys/src/9/bcm/arm.h b/sys/src/9/bcm/arm.h index f730a3885..45f47f2ab 100644 --- a/sys/src/9/bcm/arm.h +++ b/sys/src/9/bcm/arm.h @@ -290,6 +290,7 @@ #define L1wralloc (1<<12) /* L1 TEX */ #define L1sharable (1<<16) +#define L1noexec (1<<4) #define L2wralloc (1<<6) /* L2 TEX (small pages) */ #define L2sharable (1<<10) diff --git a/sys/src/9/bcm/mmu.c b/sys/src/9/bcm/mmu.c index 8d23e84ae..851cb6c5e 100644 --- a/sys/src/9/bcm/mmu.c +++ b/sys/src/9/bcm/mmu.c @@ -51,12 +51,12 @@ mmuinit(void *a) */ va = soc.virtio; for(pa = soc.physio; pa < soc.physio+soc.iosize; pa += MiB){ - l1[L1X(va)] = pa|Dom0|L1AP(Krw)|Section; + l1[L1X(va)] = pa|Dom0|L1AP(Krw)|Section|L1noexec; va += MiB; } pa = soc.armlocal; if(pa) - l1[L1X(va)] = pa|Dom0|L1AP(Krw)|Section; + l1[L1X(va)] = pa|Dom0|L1AP(Krw)|Section|L1noexec; /* * double map exception vectors near top of virtual memory @@ -326,7 +326,7 @@ mmukmap(uintptr va, uintptr pa, usize size) return 0; pte = pte0; for(n = 0; n < size; n += MiB){ - *pte++ = (pa+n)|Dom0|L1AP(Krw)|Section; + *pte++ = (pa+n)|Dom0|L1AP(Krw)|Section|L1noexec; mmuinvalidateaddr(va+n); } cachedwbtlb(pte0, (uintptr)pte - (uintptr)pte0); |