Make kernel option KERNVIRTADDR optional, remove it from std.<platform>

files that can use the default value.

It used to be required that the low-order bits of KERNVIRTADDR matched
the low-order bits of the physical load address for all arm platforms.
That hasn't been a requirement for armv6 platforms since FreeBSD 10.
There is no longer any relationship between load addr and KERNVIRTADDR
except that both must be aligned to a 2 MiB boundary.

This change makes the default KERNVIRTADDR value 0xc0000000, and removes the
options from all the platforms that can use the default value.  The default
is now defined in vmparam.h, and that file is now included in a few new
places that reference KERNVIRTADDR, since it may not come in via the
forced-include of opt_global.h on the compile command line.
This commit is contained in:
Ian Lepore
2017-12-30 00:20:49 +00:00
parent 9faaeffdbd
commit 2d09b07279
25 changed files with 23 additions and 53 deletions
-3
View File
@@ -5,9 +5,6 @@ cpu CPU_CORTEXA
machine arm armv7 machine arm armv7
makeoptions CONF_CFLAGS="-march=armv7a" makeoptions CONF_CFLAGS="-march=armv7a"
makeoptions KERNVIRTADDR=0xc0200000
options KERNVIRTADDR=0xc0200000
options IPI_IRQ_START=0 options IPI_IRQ_START=0
options IPI_IRQ_END=15 options IPI_IRQ_END=15
-3
View File
@@ -5,9 +5,6 @@ cpu CPU_CORTEXA
machine arm armv7 machine arm armv7
makeoptions CONF_CFLAGS="-march=armv7a" makeoptions CONF_CFLAGS="-march=armv7a"
makeoptions KERNVIRTADDR=0xc0200000
options KERNVIRTADDR=0xc0200000
files "../allwinner/files.allwinner_up" files "../allwinner/files.allwinner_up"
files "../allwinner/files.allwinner" files "../allwinner/files.allwinner"
files "../allwinner/a10/files.a10" files "../allwinner/a10/files.a10"
-3
View File
@@ -4,9 +4,6 @@ cpu CPU_CORTEXA
machine arm armv7 machine arm armv7
makeoptions CONF_CFLAGS="-march=armv7a" makeoptions CONF_CFLAGS="-march=armv7a"
makeoptions KERNVIRTADDR=0xc0f00000
options KERNVIRTADDR=0xc0f00000
options IPI_IRQ_START=0 options IPI_IRQ_START=0
options IPI_IRQ_END=15 options IPI_IRQ_END=15
+1
View File
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
#include <machine/md_var.h> #include <machine/md_var.h>
#include <machine/pcb.h> #include <machine/pcb.h>
#include <machine/armreg.h> #include <machine/armreg.h>
#include <machine/vmparam.h> /* For KERNVIRTADDR */
int do_minidump = 1; int do_minidump = 1;
SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RWTUN, &do_minidump, 0, SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RWTUN, &do_minidump, 0,
+1
View File
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include <machine/cpufunc.h> #include <machine/cpufunc.h>
#include <machine/armreg.h> #include <machine/armreg.h>
#include <machine/cpu.h> #include <machine/cpu.h>
#include <machine/vmparam.h> /* For KERNVIRTADDR */
#if __ARM_ARCH >= 6 #if __ARM_ARCH >= 6
#error "elf_trampline is not supported on ARMv6/v7 platforms" #error "elf_trampline is not supported on ARMv6/v7 platforms"
+2
View File
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
#include <machine/cpuinfo.h> #include <machine/cpuinfo.h>
#include <machine/intr.h> #include <machine/intr.h>
#include <machine/sysarch.h> #include <machine/sysarch.h>
#include <machine/vmparam.h> /* For KERNVIRTADDR */
#include <netinet/in.h> #include <netinet/in.h>
#include <netinet/in_systm.h> #include <netinet/in_systm.h>
@@ -59,6 +60,7 @@ __FBSDID("$FreeBSD$");
#include <netinet/ip_var.h> #include <netinet/ip_var.h>
ASSYM(KERNBASE, KERNBASE); ASSYM(KERNBASE, KERNBASE);
ASSYM(KERNVIRTADDR, KERNVIRTADDR);
#if __ARM_ARCH >= 6 #if __ARM_ARCH >= 6
ASSYM(CPU_ASID_KERNEL,CPU_ASID_KERNEL); ASSYM(CPU_ASID_KERNEL,CPU_ASID_KERNEL);
#endif #endif
+1
View File
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
#include <machine/machdep.h> #include <machine/machdep.h>
#include <machine/metadata.h> #include <machine/metadata.h>
#include <machine/physmem.h> #include <machine/physmem.h>
#include <machine/vmparam.h> /* For KERNVIRTADDR */
#ifdef FDT #ifdef FDT
#include <contrib/libfdt/libfdt.h> #include <contrib/libfdt/libfdt.h>
-2
View File
@@ -1,5 +1,3 @@
# $FreeBSD$ # $FreeBSD$
options KERNVIRTADDR=0xc0100000
makeoptions KERNVIRTADDR=0xc0100000
options LINUX_BOOT_ABI options LINUX_BOOT_ABI
-3
View File
@@ -25,9 +25,6 @@ options SMP_ON_UP
machine arm armv7 machine arm armv7
makeoptions CONF_CFLAGS="-march=armv7a" makeoptions CONF_CFLAGS="-march=armv7a"
makeoptions KERNVIRTADDR=0xc0000000
options KERNVIRTADDR=0xc0000000
include "std.armv7" include "std.armv7"
files "../allwinner/files.allwinner" files "../allwinner/files.allwinner"
files "../allwinner/files.allwinner_up" files "../allwinner/files.allwinner_up"
-2
View File
@@ -24,11 +24,9 @@ files "../xscale/ixp425/files.ixp425"
files "../xscale/pxa/files.pxa" files "../xscale/pxa/files.pxa"
options PHYSADDR=0x00000000 options PHYSADDR=0x00000000
options KERNVIRTADDR=0xc0000000
makeoptions LDFLAGS="-zmuldefs" makeoptions LDFLAGS="-zmuldefs"
makeoptions KERNPHYSADDR=0x00000000 makeoptions KERNPHYSADDR=0x00000000
makeoptions KERNVIRTADDR=0xc0000000
options FDT options FDT
-3
View File
@@ -3,9 +3,6 @@ machine arm armv7
cpu CPU_CORTEXA cpu CPU_CORTEXA
makeoptions CONF_CFLAGS="-march=armv7a" makeoptions CONF_CFLAGS="-march=armv7a"
options KERNVIRTADDR=0xc0100000
makeoptions KERNVIRTADDR=0xc0100000
device fdt_pinctrl device fdt_pinctrl
files "../freescale/imx/files.imx5" files "../freescale/imx/files.imx5"
-3
View File
@@ -3,9 +3,6 @@ machine arm armv7
cpu CPU_CORTEXA cpu CPU_CORTEXA
makeoptions CONF_CFLAGS="-march=armv7a" makeoptions CONF_CFLAGS="-march=armv7a"
options KERNVIRTADDR=0xc0100000
makeoptions KERNVIRTADDR=0xc0100000
device fdt_pinctrl device fdt_pinctrl
files "../freescale/imx/files.imx5" files "../freescale/imx/files.imx5"
-3
View File
@@ -3,9 +3,6 @@ machine arm armv7
cpu CPU_CORTEXA cpu CPU_CORTEXA
makeoptions CONF_CFLAGS="-march=armv7a" makeoptions CONF_CFLAGS="-march=armv7a"
options KERNVIRTADDR = 0xc2000000
makeoptions KERNVIRTADDR = 0xc2000000
options IPI_IRQ_START=0 options IPI_IRQ_START=0
options IPI_IRQ_END=15 options IPI_IRQ_END=15
-3
View File
@@ -4,7 +4,4 @@ cpu CPU_CORTEXA
machine arm armv7 machine arm armv7
makeoptions CONF_CFLAGS="-march=armv7a" makeoptions CONF_CFLAGS="-march=armv7a"
makeoptions KERNVIRTADDR=0xc0100000
options KERNVIRTADDR=0xc0100000
files "../freescale/vybrid/files.vybrid" files "../freescale/vybrid/files.vybrid"
+13
View File
@@ -74,6 +74,19 @@
#define KERNBASE 0xc0000000 #define KERNBASE 0xc0000000
#endif #endif
/*
* The virtual address the kernel is linked to run at. For armv4/5 platforms
* the low-order 30 bits of this must match the low-order bits of the physical
* address the kernel is loaded at, so the value is most often provided as a
* kernel config option in the std.platform file. For armv6/7 the kernel can
* be loaded at any 2MB boundary, and KERNVIRTADDR can also be set to any 2MB
* boundary. It is typically overridden in the std.platform file only when
* KERNBASE is also set to a lower address to provide more KVA.
*/
#ifndef KERNVIRTADDR
#define KERNVIRTADDR 0xc0000000
#endif
/* /*
* max number of non-contig chunks of physical RAM you can have * max number of non-contig chunks of physical RAM you can have
*/ */
-2
View File
@@ -5,8 +5,6 @@ cpu CPU_CORTEXA
machine arm armv7 machine arm armv7
makeoptions CONF_CFLAGS="-march=armv7a" makeoptions CONF_CFLAGS="-march=armv7a"
makeoptions KERNVIRTADDR=0xc0000000
options KERNVIRTADDR=0xc0000000
options IPI_IRQ_START=0 options IPI_IRQ_START=0
options IPI_IRQ_END=15 options IPI_IRQ_END=15
-2
View File
@@ -1,4 +1,2 @@
# $FreeBSD$ # $FreeBSD$
makeoptions KERNVIRTADDR=0xc0200000
options KERNVIRTADDR=0xc0200000
-3
View File
@@ -3,9 +3,6 @@ cpu CPU_CORTEXA
machine arm armv7 machine arm armv7
makeoptions CONF_CFLAGS="-march=armv7a" makeoptions CONF_CFLAGS="-march=armv7a"
options KERNVIRTADDR = 0xc0200000
makeoptions KERNVIRTADDR = 0xc0200000
options INTRNG options INTRNG
options IPI_IRQ_START=0 options IPI_IRQ_START=0
-3
View File
@@ -5,9 +5,6 @@ cpu CPU_CORTEXA
machine arm armv7 machine arm armv7
makeoptions CONF_CFLAGS="-march=armv7a" makeoptions CONF_CFLAGS="-march=armv7a"
makeoptions KERNVIRTADDR=0xc0400000
options KERNVIRTADDR=0xc0400000
options IPI_IRQ_START=0 options IPI_IRQ_START=0
options IPI_IRQ_END=15 options IPI_IRQ_END=15
-3
View File
@@ -4,9 +4,6 @@ cpu CPU_CORTEXA
machine arm armv7 machine arm armv7
makeoptions CONF_CFLAGS="-march=armv7a" makeoptions CONF_CFLAGS="-march=armv7a"
makeoptions KERNVIRTADDR=0xc0f00000
options KERNVIRTADDR=0xc0f00000
options IPI_IRQ_START=0 options IPI_IRQ_START=0
options IPI_IRQ_END=15 options IPI_IRQ_END=15
-3
View File
@@ -4,9 +4,6 @@ cpu CPU_CORTEXA
machine arm armv7 machine arm armv7
makeoptions CONF_CFLAGS="-march=armv7a" makeoptions CONF_CFLAGS="-march=armv7a"
makeoptions KERNVIRTADDR=0xc0f00000
options KERNVIRTADDR=0xc0f00000
options IPI_IRQ_START=0 options IPI_IRQ_START=0
options IPI_IRQ_END=15 options IPI_IRQ_END=15
-3
View File
@@ -5,7 +5,4 @@ include "../ti/std.ti"
cpu CPU_CORTEXA cpu CPU_CORTEXA
options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm
makeoptions KERNVIRTADDR=0xc0200000
options SOC_TI_AM335X options SOC_TI_AM335X
-3
View File
@@ -5,7 +5,4 @@ include "../ti/std.ti"
cpu CPU_CORTEXA cpu CPU_CORTEXA
options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm
makeoptions KERNVIRTADDR=0xc0200000
options SOC_OMAP4 options SOC_OMAP4
-3
View File
@@ -9,8 +9,5 @@ makeoptions CONF_CFLAGS="-march=armv7a"
files "../xilinx/files.zynq7" files "../xilinx/files.zynq7"
options KERNVIRTADDR=0xc0100000 # Used in ldscript.arm
makeoptions KERNVIRTADDR=0xc0100000
options IPI_IRQ_START=0 options IPI_IRQ_START=0
options IPI_IRQ_END=15 options IPI_IRQ_END=15
+5
View File
@@ -53,6 +53,11 @@ CFLAGS += -mllvm -arm-enable-ehabi
.endif .endif
.endif .endif
# "makeoptions KERNVIRTADDR=" is now optional, supply the default value.
.if empty(KERNVIRTADDR)
KERNVIRTADDR= 0xc0000000
.endif
# hack because genassym.c includes sys/bus.h which includes these. # hack because genassym.c includes sys/bus.h which includes these.
genassym.o: bus_if.h device_if.h genassym.o: bus_if.h device_if.h