From 01695ab3b0e805a420ee0d9fa332ebb232e7c8a8 Mon Sep 17 00:00:00 2001 From: kettenis Date: Fri, 19 Aug 2016 15:47:27 +0000 Subject: [PATCH] Mark device memory as execute-never to prevent a speculative instruction fetch to access it. --- sys/arch/arm/arm/pmap7.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.20.1