From 960bf034a5224117584e38bc930e1d381bdc960b Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Fri, 24 Mar 2017 19:48:02 +0000 Subject: Simplify ASID allocation code considerably by allocating an ASID up front when a pmap is created and freeing it when the pmap is destroyed. This diff relies on the fill 16-bit ASID space being implemented in the processor. While this is documented as an optional feature in the ARMv8 architecture reference manual, all ARMv8 processors seen in the wild so far implement the full 16-bit space. This change incorporates changes by drahn@ to allocate an empty page table for the lower half of the address space for the kernel. ok drahn@, patrick@ --- sys/arch/arm64/include/cpufunc.h | 3 ++- sys/arch/arm64/include/pcb.h | 3 +-- sys/arch/arm64/include/pmap.h | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'sys/arch/arm64/include') diff --git a/sys/arch/arm64/include/cpufunc.h b/sys/arch/arm64/include/cpufunc.h index e827430394d..6473ceb3e15 100644 --- a/sys/arch/arm64/include/cpufunc.h +++ b/sys/arch/arm64/include/cpufunc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpufunc.h,v 1.1 2017/02/06 19:23:45 patrick Exp $ */ +/* $OpenBSD: cpufunc.h,v 1.2 2017/03/24 19:48:01 kettenis Exp $ */ /*- * Copyright (c) 2014 Andrew Turner * All rights reserved. @@ -43,6 +43,7 @@ void cpu_setttb(vaddr_t); void cpu_tlb_flush(void); void cpu_tlb_flush_asid(vaddr_t); void cpu_tlb_flush_all_asid(vaddr_t); +void cpu_tlb_flush_asid_all(vaddr_t); void cpu_icache_sync_range(vaddr_t, vsize_t); void cpu_idcache_wbinv_range(vaddr_t, vsize_t); void cpu_dcache_wbinv_range(vaddr_t, vsize_t); diff --git a/sys/arch/arm64/include/pcb.h b/sys/arch/arm64/include/pcb.h index b1b1b9b43eb..c242aab93ac 100644 --- a/sys/arch/arm64/include/pcb.h +++ b/sys/arch/arm64/include/pcb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcb.h,v 1.2 2017/01/10 13:13:12 patrick Exp $ */ +/* $OpenBSD: pcb.h,v 1.3 2017/03/24 19:48:01 kettenis Exp $ */ /* * Copyright (c) 2016 Dale Rahn * @@ -38,7 +38,6 @@ struct pcb { caddr_t pcb_onfault; // On fault handler struct fpreg pcb_fpstate; // Floating Point state */ struct cpu_info *pcb_fpcpu; - paddr_t pcb_pagedir; // ttbr0 void *pcb_tcb; }; diff --git a/sys/arch/arm64/include/pmap.h b/sys/arch/arm64/include/pmap.h index 413bdaf53c1..7bd09ce59ae 100644 --- a/sys/arch/arm64/include/pmap.h +++ b/sys/arch/arm64/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.3 2017/03/16 20:15:07 kettenis Exp $ */ +/* $OpenBSD: pmap.h,v 1.4 2017/03/24 19:48:01 kettenis Exp $ */ /* * Copyright (c) 2008,2009,2014 Dale Rahn * @@ -70,7 +70,6 @@ struct pmap { uint64_t pm_pt0pa; int have_4_level_pt; int pm_asid; - int pm_active; int pm_refs; /* ref count */ struct pmap_statistics pm_stats; /* pmap statistics */ }; -- cgit v1.2.3