Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/aarch64 AA64 is not MIPS.
details: https://anonhg.NetBSD.org/src/rev/a1226ae6058b
branches: trunk
changeset: 945929:a1226ae6058b
user: skrll <skrll%NetBSD.org@localhost>
date: Tue Nov 10 07:51:19 2020 +0000
description:
AA64 is not MIPS.
Change all KSEG references to directmap
diffstat:
sys/arch/aarch64/aarch64/aarch64_machdep.c | 16 ++++++++--------
sys/arch/aarch64/aarch64/genassym.cf | 6 +++---
sys/arch/aarch64/aarch64/pmap.c | 26 +++++++++++++-------------
sys/arch/aarch64/aarch64/pmap_page.S | 18 +++++++++---------
sys/arch/aarch64/aarch64/pmapboot.c | 6 +++---
sys/arch/aarch64/include/asan.h | 4 ++--
sys/arch/aarch64/include/vmparam.h | 18 +++++++++---------
7 files changed, 47 insertions(+), 47 deletions(-)
diffs (truncated from 305 to 300 lines):
diff -r d30541a868df -r a1226ae6058b sys/arch/aarch64/aarch64/aarch64_machdep.c
--- a/sys/arch/aarch64/aarch64/aarch64_machdep.c Tue Nov 10 07:40:30 2020 +0000
+++ b/sys/arch/aarch64/aarch64/aarch64_machdep.c Tue Nov 10 07:51:19 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.53 2020/10/22 07:31:15 skrll Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.54 2020/11/10 07:51:19 skrll Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.53 2020/10/22 07:31:15 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.54 2020/11/10 07:51:19 skrll Exp $");
#include "opt_arm_debug.h"
#include "opt_cpuoptions.h"
@@ -150,8 +150,8 @@
vaddr_t data_start = (vaddr_t)__data_start;
vaddr_t rodata_start = (vaddr_t)__rodata_start;
- /* add KSEG mappings of whole memory */
- const pt_entry_t ksegattr =
+ /* add direct mappings of whole memory */
+ const pt_entry_t dmattr =
LX_BLKPAG_ATTR_NORMAL_WB |
LX_BLKPAG_AP_RW |
LX_BLKPAG_PXN |
@@ -164,7 +164,7 @@
(uint64_t)bootconfig.dram[blk].pages * PAGE_SIZE);
pmapboot_enter_range(AARCH64_PA_TO_KVA(start), start,
- end - start, ksegattr, printf);
+ end - start, dmattr, printf);
}
aarch64_dcache_wbinv_all();
@@ -216,7 +216,7 @@
*
* 0xffff_bfff_ffff_ffff End of direct mapped
* 0xffff_0000_0000_0000 Start of direct mapped
- * = AARCH64_KSEG_START
+ * = AARCH64_DIRECTMAP_START
*
* Hole: 0xfffe_ffff_ffff_ffff
* 0x0001_0000_0000_0000
@@ -605,9 +605,9 @@
*handled = true;
if ((v < data_start) && (prot & VM_PROT_WRITE))
return EFAULT;
- } else if (IN_RANGE(v, AARCH64_KSEG_START, AARCH64_KSEG_END)) {
+ } else if (IN_RANGE(v, AARCH64_DIRECTMAP_START, AARCH64_DIRECTMAP_END)) {
/*
- * if defined PMAP_MAP_POOLPAGE, direct mapped address (KSEG)
+ * if defined PMAP_MAP_POOLPAGE, direct mapped address
* will be appeared as kvm(3) address.
*/
paddr_t pa = AARCH64_KVA_TO_PA(v);
diff -r d30541a868df -r a1226ae6058b sys/arch/aarch64/aarch64/genassym.cf
--- a/sys/arch/aarch64/aarch64/genassym.cf Tue Nov 10 07:40:30 2020 +0000
+++ b/sys/arch/aarch64/aarch64/genassym.cf Tue Nov 10 07:51:19 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.31 2020/09/15 09:28:20 ryo Exp $
+# $NetBSD: genassym.cf,v 1.32 2020/11/10 07:51:19 skrll Exp $
#-
# Copyright (c) 2014 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -70,8 +70,8 @@
define VM_MAX_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS
define VM_KERNEL_IO_ADDRESS VM_KERNEL_IO_ADDRESS
define VM_KERNEL_IO_SIZE VM_KERNEL_IO_SIZE
-define AARCH64_KSEG_START AARCH64_KSEG_START
-define AARCH64_KSEG_MASK AARCH64_KSEG_MASK
+define AARCH64_DIRECTMAP_START AARCH64_DIRECTMAP_START
+define AARCH64_DIRECTMAP_MASK AARCH64_DIRECTMAP_MASK
define UPAGES UPAGES
define USPACE (UPAGES * PAGE_SIZE)
diff -r d30541a868df -r a1226ae6058b sys/arch/aarch64/aarch64/pmap.c
--- a/sys/arch/aarch64/aarch64/pmap.c Tue Nov 10 07:40:30 2020 +0000
+++ b/sys/arch/aarch64/aarch64/pmap.c Tue Nov 10 07:51:19 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.95 2020/11/07 08:33:50 skrll Exp $ */
+/* $NetBSD: pmap.c,v 1.96 2020/11/10 07:51:19 skrll Exp $ */
/*
* Copyright (c) 2017 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.95 2020/11/07 08:33:50 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.96 2020/11/10 07:51:19 skrll Exp $");
#include "opt_arm_debug.h"
#include "opt_ddb.h"
@@ -282,8 +282,8 @@
#define IN_RANGE(va,sta,end) (((sta) <= (va)) && ((va) < (end)))
-#define IN_KSEG_ADDR(va) \
- IN_RANGE((va), AARCH64_KSEG_START, AARCH64_KSEG_END)
+#define IN_DIRECTMAP_ADDR(va) \
+ IN_RANGE((va), AARCH64_DIRECTMAP_START, AARCH64_DIRECTMAP_END)
#ifdef MODULAR
#define IN_MODULE_VA(va) IN_RANGE((va), module_start, module_end)
@@ -631,7 +631,7 @@
PMAP_COUNT(pdp_alloc);
PMAP_PAGE_INIT(VM_PAGE_TO_PP(pg));
} else {
- /* uvm_pageboot_alloc() returns AARCH64 KSEG address */
+ /* uvm_pageboot_alloc() returns AARCH64 direct mapping address */
pg = NULL;
pa = AARCH64_KVA_TO_PA(
uvm_pageboot_alloc(Ln_TABLE_SIZE));
@@ -790,10 +790,10 @@
/* kernel text/data/bss are definitely linear mapped */
pa = KERN_VTOPHYS(va);
goto mapped;
- } else if (IN_KSEG_ADDR(va)) {
+ } else if (IN_DIRECTMAP_ADDR(va)) {
/*
- * also KSEG is linear mapped, but areas that have no
- * physical memory haven't been mapped.
+ * also direct mapping is linear mapped, but areas that
+ * have no physical memory haven't been mapped.
* fast lookup by using the S1E1R/PAR_EL1 registers.
*/
register_t s = daif_disable(DAIF_I|DAIF_F);
@@ -1261,7 +1261,7 @@
KDASSERT((va & PGOFSET) == 0);
KDASSERT((size & PGOFSET) == 0);
- KDASSERT(!IN_KSEG_ADDR(va));
+ KDASSERT(!IN_DIRECTMAP_ADDR(va));
KDASSERT(IN_RANGE(va, VM_MIN_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS));
_pmap_remove(kpm, va, va + size, true, NULL);
@@ -1319,7 +1319,7 @@
pm, sva, eva, prot);
KASSERT_PM_ADDR(pm, sva);
- KASSERT(!IN_KSEG_ADDR(sva));
+ KASSERT(!IN_DIRECTMAP_ADDR(sva));
/* PROT_EXEC requires implicit PROT_READ */
if (prot & VM_PROT_EXECUTE)
@@ -1766,7 +1766,7 @@
va, pa, prot, flags);
KASSERT_PM_ADDR(pm, va);
- KASSERT(!IN_KSEG_ADDR(va));
+ KASSERT(!IN_DIRECTMAP_ADDR(va));
#ifdef PMAPCOUNTERS
PMAP_COUNT(mappings);
@@ -2115,7 +2115,7 @@
struct pv_entry *pv, *pvtmp;
KASSERT_PM_ADDR(pm, sva);
- KASSERT(!IN_KSEG_ADDR(sva));
+ KASSERT(!IN_DIRECTMAP_ADDR(sva));
pm_lock(pm);
_pmap_remove(pm, sva, eva, false, &pvtofree);
@@ -2263,7 +2263,7 @@
PMAP_COUNT(unwire);
KASSERT_PM_ADDR(pm, va);
- KASSERT(!IN_KSEG_ADDR(va));
+ KASSERT(!IN_DIRECTMAP_ADDR(va));
pm_lock(pm);
ptep = _pmap_pte_lookup_l3(pm, va);
diff -r d30541a868df -r a1226ae6058b sys/arch/aarch64/aarch64/pmap_page.S
--- a/sys/arch/aarch64/aarch64/pmap_page.S Tue Nov 10 07:40:30 2020 +0000
+++ b/sys/arch/aarch64/aarch64/pmap_page.S Tue Nov 10 07:51:19 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap_page.S,v 1.4 2018/09/26 16:55:34 ryo Exp $ */
+/* $NetBSD: pmap_page.S,v 1.5 2020/11/10 07:51:19 skrll Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,15 +33,15 @@
#include "assym.h"
-RCSID("$NetBSD: pmap_page.S,v 1.4 2018/09/26 16:55:34 ryo Exp $");
+RCSID("$NetBSD: pmap_page.S,v 1.5 2020/11/10 07:51:19 skrll Exp $");
/* LINTSTUB: void pmap_zero_page(paddr_t pa); */
ENTRY(pmap_zero_page)
/* convert to direct mapped */
-#if ((AARCH64_KSEG_MASK & 0x0000ffffffffffff) == 0)
- movk x0, #(AARCH64_KSEG_START >> 48), lsl #48
+#if ((AARCH64_DIRECTMAP_MASK & 0x0000ffffffffffff) == 0)
+ movk x0, #(AARCH64_DIRECTMAP_START >> 48), lsl #48
#else
- mov x1, #AARCH64_KSEG_START
+ mov x1, #AARCH64_DIRECTMAP_START
orr x0, x0, x1
#endif
@@ -71,11 +71,11 @@
/* LINTSTUB: void pmap_copy_page(paddr_t src_pa, paddr_t dst_pa); */
ENTRY(pmap_copy_page)
/* convert to direct mapped */
-#if ((AARCH64_KSEG_MASK & 0x0000ffffffffffff) == 0)
- movk x0, #(AARCH64_KSEG_START >> 48), lsl #48
- movk x1, #(AARCH64_KSEG_START >> 48), lsl #48
+#if ((AARCH64_DIRECTMAP_MASK & 0x0000ffffffffffff) == 0)
+ movk x0, #(AARCH64_DIRECTMAP_START >> 48), lsl #48
+ movk x1, #(AARCH64_DIRECTMAP_START >> 48), lsl #48
#else
- mov x2, #AARCH64_KSEG_START
+ mov x2, #AARCH64_DIRECTMAP_START
orr x0, x0, x2
orr x1, x1, x2
#endif
diff -r d30541a868df -r a1226ae6058b sys/arch/aarch64/aarch64/pmapboot.c
--- a/sys/arch/aarch64/aarch64/pmapboot.c Tue Nov 10 07:40:30 2020 +0000
+++ b/sys/arch/aarch64/aarch64/pmapboot.c Tue Nov 10 07:51:19 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmapboot.c,v 1.11 2020/11/07 08:48:11 skrll Exp $ */
+/* $NetBSD: pmapboot.c,v 1.12 2020/11/10 07:51:19 skrll Exp $ */
/*
* Copyright (c) 2018 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmapboot.c,v 1.11 2020/11/07 08:48:11 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmapboot.c,v 1.12 2020/11/10 07:51:19 skrll Exp $");
#include "opt_arm_debug.h"
#include "opt_ddb.h"
@@ -70,7 +70,7 @@
* 'clrprot' specified by bit of VM_PROT_{READ,WRITE,EXECUTE}
* will be dropped from a pte entry.
*
- * require KSEG(cached) mappings because TLB entries are already cached on.
+ * require direct (cached) mappings because TLB entries are already cached on.
*/
int
pmapboot_protect(vaddr_t sva, vaddr_t eva, vm_prot_t clrprot)
diff -r d30541a868df -r a1226ae6058b sys/arch/aarch64/include/asan.h
--- a/sys/arch/aarch64/include/asan.h Tue Nov 10 07:40:30 2020 +0000
+++ b/sys/arch/aarch64/include/asan.h Tue Nov 10 07:51:19 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: asan.h,v 1.13 2020/09/20 15:30:11 skrll Exp $ */
+/* $NetBSD: asan.h,v 1.14 2020/11/10 07:51:19 skrll Exp $ */
/*
* Copyright (c) 2018-2020 Maxime Villard, m00nbsd.net
@@ -43,7 +43,7 @@
#define __MD_KERNMEM_BASE 0xFFFF000000000000 /* kern mem base address */
#define __MD_SHADOW_SIZE (1ULL << (__MD_VIRTUAL_SHIFT - KASAN_SHADOW_SCALE_SHIFT))
-#define KASAN_MD_SHADOW_START (AARCH64_KSEG_END)
+#define KASAN_MD_SHADOW_START (AARCH64_DIRECTMAP_END)
#define KASAN_MD_SHADOW_END (KASAN_MD_SHADOW_START + __MD_SHADOW_SIZE)
static bool __md_early __read_mostly = true;
diff -r d30541a868df -r a1226ae6058b sys/arch/aarch64/include/vmparam.h
--- a/sys/arch/aarch64/include/vmparam.h Tue Nov 10 07:40:30 2020 +0000
+++ b/sys/arch/aarch64/include/vmparam.h Tue Nov 10 07:51:19 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.16 2020/10/06 13:42:03 christos Exp $ */
+/* $NetBSD: vmparam.h,v 1.17 2020/11/10 07:51:19 skrll Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -127,7 +127,7 @@
/*
* kernel virtual space layout:
- * 0xffff_0000_0000_0000 - 64T KSEG(direct mapping)
+ * 0xffff_0000_0000_0000 - 64T direct mapping
* 0xffff_4000_0000_0000 - 32T (KASAN SHADOW MAP)
* 0xffff_6000_0000_0000 - 32T (not used)
* 0xffff_8000_0000_0000 - 1G EFI_RUNTIME
@@ -168,13 +168,13 @@
* Since we have the address space, we map all of physical memory (RAM)
* using block page table entries.
*/
-#define AARCH64_KSEG_MASK ((vaddr_t) 0xffff000000000000L)
-#define AARCH64_KSEG_SIZE (1UL << 46) /* 64TB */
-#define AARCH64_KSEG_START AARCH64_KSEG_MASK
-#define AARCH64_KSEG_END (AARCH64_KSEG_START + AARCH64_KSEG_SIZE)
-#define AARCH64_KVA_P(va) (((vaddr_t) (va) & AARCH64_KSEG_MASK) != 0)
-#define AARCH64_PA_TO_KVA(pa) ((vaddr_t) ((pa) | AARCH64_KSEG_START))
-#define AARCH64_KVA_TO_PA(va) ((paddr_t) ((va) & ~AARCH64_KSEG_MASK))
+#define AARCH64_DIRECTMAP_MASK ((vaddr_t) 0xffff000000000000L)
+#define AARCH64_DIRECTMAP_SIZE (1UL << 46) /* 64TB */
+#define AARCH64_DIRECTMAP_START AARCH64_DIRECTMAP_MASK
+#define AARCH64_DIRECTMAP_END (AARCH64_DIRECTMAP_START + AARCH64_DIRECTMAP_SIZE)
+#define AARCH64_KVA_P(va) (((vaddr_t) (va) & AARCH64_DIRECTMAP_MASK) != 0)
Home |
Main Index |
Thread Index |
Old Index