From: kettenis Date: Fri, 19 Aug 2016 15:47:27 +0000 (+0000) Subject: Mark device memory as execute-never to prevent a speculative instruction fetch X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=01695ab3b0e805a420ee0d9fa332ebb232e7c8a8;p=openbsd Mark device memory as execute-never to prevent a speculative instruction fetch to access it. --- diff --git a/sys/arch/arm/arm/pmap7.c b/sys/arch/arm/arm/pmap7.c index 5d765a2a0a0..51b68bf75a4 100644 --- a/sys/arch/arm/arm/pmap7.c +++ b/sys/arch/arm/arm/pmap7.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap7.c,v 1.40 2016/08/19 13:56:08 kettenis Exp $ */ +/* $OpenBSD: pmap7.c,v 1.41 2016/08/19 15:47:27 kettenis Exp $ */ /* $NetBSD: pmap.c,v 1.147 2004/01/18 13:03:50 scw Exp $ */ /* @@ -1421,7 +1421,7 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot) l2b->l2b_occupancy++; if (pa & PMAP_DEVICE) - cache_mode = L2_B; + cache_mode = L2_B | L2_V7_S_XN; else if (pa & PMAP_NOCACHE) cache_mode = L2_V7_S_TEX(1);