-/* $OpenBSD: pmap.c,v 1.95 2023/04/13 15:23:22 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.96 2023/04/16 11:14:26 kettenis Exp $ */
/*
* Copyright (c) 2008-2009,2014-2016 Dale Rahn <drahn@dalerahn.com>
*
vp1 = (struct pmapvp1 *)pt1pa;
pmap_kernel()->pm_vp.l1 = (struct pmapvp1 *)va;
pmap_kernel()->pm_privileged = 1;
+ pmap_kernel()->pm_guarded = ATTR_GP;
pmap_kernel()->pm_asid = 0;
pmap_tramp.pm_vp.l1 = (struct pmapvp1 *)va + 1;
pmap_tramp.pm_privileged = 1;
+ pmap_tramp.pm_guarded = ATTR_GP;
pmap_tramp.pm_asid = 0;
/* Mark ASID 0 as in-use. */
access_bits = ap_bits_user[pted->pted_pte & PROT_MASK];
#ifndef SMALL_KERNEL
- if (pm == pmap_kernel())
- access_bits |= ATTR_GP;
+ access_bits |= pm->pm_guarded;
#endif
pte = (pted->pted_pte & PTE_RPGN) | attr | access_bits | L3_P;
-/* $OpenBSD: pmap.h,v 1.22 2023/02/16 20:32:39 miod Exp $ */
+/* $OpenBSD: pmap.h,v 1.23 2023/04/16 11:14:26 kettenis Exp $ */
/*
* Copyright (c) 2008,2009,2014 Dale Rahn <drahn@dalerahn.com>
*
} pm_vp;
uint64_t pm_pt0pa;
uint64_t pm_asid;
+ uint64_t pm_guarded;
int have_4_level_pt;
int pm_privileged;
int pm_refs; /* ref count */