Author: ian
Date: Sat Dec 30 00:20:49 2017
New Revision: 327367
URL: https://svnweb.freebsd.org/changeset/base/327367

Log:
  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.

Modified:
  head/sys/arm/allwinner/std.allwinner
  head/sys/arm/allwinner/std.allwinner_up
  head/sys/arm/altera/socfpga/std.socfpga
  head/sys/arm/arm/dump_machdep.c
  head/sys/arm/arm/elf_trampoline.c
  head/sys/arm/arm/genassym.c
  head/sys/arm/arm/machdep_boot.c
  head/sys/arm/broadcom/bcm2835/std.rpi
  head/sys/arm/conf/GENERIC
  head/sys/arm/conf/NOTES
  head/sys/arm/freescale/imx/std.imx51
  head/sys/arm/freescale/imx/std.imx53
  head/sys/arm/freescale/imx/std.imx6
  head/sys/arm/freescale/vybrid/std.vybrid
  head/sys/arm/include/vmparam.h
  head/sys/arm/mv/armada38x/std.armada38x
  head/sys/arm/mv/armadaxp/std.armadaxp
  head/sys/arm/nvidia/tegra124/std.tegra124
  head/sys/arm/rockchip/std.rk30xx
  head/sys/arm/samsung/exynos/std.exynos5250
  head/sys/arm/samsung/exynos/std.exynos5420
  head/sys/arm/ti/am335x/std.am335x
  head/sys/arm/ti/omap4/std.omap4
  head/sys/arm/xilinx/std.zynq7
  head/sys/conf/Makefile.arm

Modified: head/sys/arm/allwinner/std.allwinner
==============================================================================
--- head/sys/arm/allwinner/std.allwinner        Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/allwinner/std.allwinner        Sat Dec 30 00:20:49 2017        
(r327367)
@@ -5,9 +5,6 @@ cpu             CPU_CORTEXA
 machine        arm armv7
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-makeoptions    KERNVIRTADDR=0xc0200000
-options        KERNVIRTADDR=0xc0200000
-
 options        IPI_IRQ_START=0
 options        IPI_IRQ_END=15
 

Modified: head/sys/arm/allwinner/std.allwinner_up
==============================================================================
--- head/sys/arm/allwinner/std.allwinner_up     Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/allwinner/std.allwinner_up     Sat Dec 30 00:20:49 2017        
(r327367)
@@ -5,9 +5,6 @@ cpu             CPU_CORTEXA
 machine        arm armv7
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-makeoptions    KERNVIRTADDR=0xc0200000
-options        KERNVIRTADDR=0xc0200000
-
 files          "../allwinner/files.allwinner_up"
 files          "../allwinner/files.allwinner"
 files          "../allwinner/a10/files.a10"

Modified: head/sys/arm/altera/socfpga/std.socfpga
==============================================================================
--- head/sys/arm/altera/socfpga/std.socfpga     Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/altera/socfpga/std.socfpga     Sat Dec 30 00:20:49 2017        
(r327367)
@@ -4,9 +4,6 @@ cpu             CPU_CORTEXA
 machine                arm armv7
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-makeoptions    KERNVIRTADDR=0xc0f00000
-options                KERNVIRTADDR=0xc0f00000
-
 options                IPI_IRQ_START=0
 options                IPI_IRQ_END=15
 

Modified: head/sys/arm/arm/dump_machdep.c
==============================================================================
--- head/sys/arm/arm/dump_machdep.c     Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/arm/dump_machdep.c     Sat Dec 30 00:20:49 2017        
(r327367)
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/md_var.h>
 #include <machine/pcb.h>
 #include <machine/armreg.h>
+#include <machine/vmparam.h>   /* For KERNVIRTADDR */
 
 int do_minidump = 1;
 SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RWTUN, &do_minidump, 0,

Modified: head/sys/arm/arm/elf_trampoline.c
==============================================================================
--- head/sys/arm/arm/elf_trampoline.c   Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/arm/elf_trampoline.c   Sat Dec 30 00:20:49 2017        
(r327367)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/cpufunc.h>
 #include <machine/armreg.h>
 #include <machine/cpu.h>
+#include <machine/vmparam.h>   /* For KERNVIRTADDR */
 
 #if __ARM_ARCH >= 6
 #error "elf_trampline is not supported on ARMv6/v7 platforms"

Modified: head/sys/arm/arm/genassym.c
==============================================================================
--- head/sys/arm/arm/genassym.c Fri Dec 29 23:58:05 2017        (r327366)
+++ head/sys/arm/arm/genassym.c Sat Dec 30 00:20:49 2017        (r327367)
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/cpuinfo.h>
 #include <machine/intr.h>
 #include <machine/sysarch.h>
+#include <machine/vmparam.h>   /* For KERNVIRTADDR */
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
@@ -59,6 +60,7 @@ __FBSDID("$FreeBSD$");
 #include <netinet/ip_var.h>
 
 ASSYM(KERNBASE, KERNBASE);
+ASSYM(KERNVIRTADDR, KERNVIRTADDR);
 #if __ARM_ARCH >= 6
 ASSYM(CPU_ASID_KERNEL,CPU_ASID_KERNEL);
 #endif

Modified: head/sys/arm/arm/machdep_boot.c
==============================================================================
--- head/sys/arm/arm/machdep_boot.c     Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/arm/machdep_boot.c     Sat Dec 30 00:20:49 2017        
(r327367)
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/machdep.h>
 #include <machine/metadata.h>
 #include <machine/physmem.h>
+#include <machine/vmparam.h>   /* For KERNVIRTADDR */
 
 #ifdef FDT
 #include <contrib/libfdt/libfdt.h>

Modified: head/sys/arm/broadcom/bcm2835/std.rpi
==============================================================================
--- head/sys/arm/broadcom/bcm2835/std.rpi       Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/broadcom/bcm2835/std.rpi       Sat Dec 30 00:20:49 2017        
(r327367)
@@ -1,5 +1,3 @@
 # $FreeBSD$
 
-options                KERNVIRTADDR=0xc0100000
-makeoptions    KERNVIRTADDR=0xc0100000
 options                LINUX_BOOT_ABI

Modified: head/sys/arm/conf/GENERIC
==============================================================================
--- head/sys/arm/conf/GENERIC   Fri Dec 29 23:58:05 2017        (r327366)
+++ head/sys/arm/conf/GENERIC   Sat Dec 30 00:20:49 2017        (r327367)
@@ -25,9 +25,6 @@ options       SMP_ON_UP
 machine        arm armv7
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-makeoptions    KERNVIRTADDR=0xc0000000
-options        KERNVIRTADDR=0xc0000000
-
 include        "std.armv7"
 files          "../allwinner/files.allwinner"
 files          "../allwinner/files.allwinner_up"

Modified: head/sys/arm/conf/NOTES
==============================================================================
--- head/sys/arm/conf/NOTES     Fri Dec 29 23:58:05 2017        (r327366)
+++ head/sys/arm/conf/NOTES     Sat Dec 30 00:20:49 2017        (r327367)
@@ -24,11 +24,9 @@ files        "../xscale/ixp425/files.ixp425"
 files  "../xscale/pxa/files.pxa"
 
 options        PHYSADDR=0x00000000
-options        KERNVIRTADDR=0xc0000000
 
 makeoptions    LDFLAGS="-zmuldefs"
 makeoptions    KERNPHYSADDR=0x00000000
-makeoptions    KERNVIRTADDR=0xc0000000
 
 options        FDT
 

Modified: head/sys/arm/freescale/imx/std.imx51
==============================================================================
--- head/sys/arm/freescale/imx/std.imx51        Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/freescale/imx/std.imx51        Sat Dec 30 00:20:49 2017        
(r327367)
@@ -3,9 +3,6 @@ machine         arm     armv7
 cpu            CPU_CORTEXA
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-options                KERNVIRTADDR=0xc0100000
-makeoptions    KERNVIRTADDR=0xc0100000
-
 device         fdt_pinctrl
 
 files "../freescale/imx/files.imx5"

Modified: head/sys/arm/freescale/imx/std.imx53
==============================================================================
--- head/sys/arm/freescale/imx/std.imx53        Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/freescale/imx/std.imx53        Sat Dec 30 00:20:49 2017        
(r327367)
@@ -3,9 +3,6 @@ machine         arm     armv7
 cpu            CPU_CORTEXA
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-options                KERNVIRTADDR=0xc0100000
-makeoptions    KERNVIRTADDR=0xc0100000
-
 device         fdt_pinctrl
 
 files "../freescale/imx/files.imx5"

Modified: head/sys/arm/freescale/imx/std.imx6
==============================================================================
--- head/sys/arm/freescale/imx/std.imx6 Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/freescale/imx/std.imx6 Sat Dec 30 00:20:49 2017        
(r327367)
@@ -3,9 +3,6 @@ machine         arm     armv7
 cpu            CPU_CORTEXA
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-options                KERNVIRTADDR            = 0xc2000000
-makeoptions    KERNVIRTADDR            = 0xc2000000
-
 options                IPI_IRQ_START=0
 options                IPI_IRQ_END=15
 

Modified: head/sys/arm/freescale/vybrid/std.vybrid
==============================================================================
--- head/sys/arm/freescale/vybrid/std.vybrid    Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/freescale/vybrid/std.vybrid    Sat Dec 30 00:20:49 2017        
(r327367)
@@ -4,7 +4,4 @@ cpu             CPU_CORTEXA
 machine                arm armv7
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-makeoptions    KERNVIRTADDR=0xc0100000
-options                KERNVIRTADDR=0xc0100000
-
 files          "../freescale/vybrid/files.vybrid"

Modified: head/sys/arm/include/vmparam.h
==============================================================================
--- head/sys/arm/include/vmparam.h      Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/include/vmparam.h      Sat Dec 30 00:20:49 2017        
(r327367)
@@ -75,6 +75,19 @@
 #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
  */
 

Modified: head/sys/arm/mv/armada38x/std.armada38x
==============================================================================
--- head/sys/arm/mv/armada38x/std.armada38x     Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/mv/armada38x/std.armada38x     Sat Dec 30 00:20:49 2017        
(r327367)
@@ -5,8 +5,6 @@ cpu             CPU_CORTEXA
 machine                arm     armv7
 
 makeoptions    CONF_CFLAGS="-march=armv7a"
-makeoptions    KERNVIRTADDR=0xc0000000
 
-options         KERNVIRTADDR=0xc0000000
 options                IPI_IRQ_START=0
 options                IPI_IRQ_END=15

Modified: head/sys/arm/mv/armadaxp/std.armadaxp
==============================================================================
--- head/sys/arm/mv/armadaxp/std.armadaxp       Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/mv/armadaxp/std.armadaxp       Sat Dec 30 00:20:49 2017        
(r327367)
@@ -1,4 +1,2 @@
 # $FreeBSD$
 
-makeoptions    KERNVIRTADDR=0xc0200000
-options                KERNVIRTADDR=0xc0200000

Modified: head/sys/arm/nvidia/tegra124/std.tegra124
==============================================================================
--- head/sys/arm/nvidia/tegra124/std.tegra124   Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/nvidia/tegra124/std.tegra124   Sat Dec 30 00:20:49 2017        
(r327367)
@@ -3,9 +3,6 @@ cpu             CPU_CORTEXA
 machine                arm     armv7
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-options                KERNVIRTADDR            = 0xc0200000
-makeoptions    KERNVIRTADDR            = 0xc0200000
-
 options                INTRNG
 
 options                IPI_IRQ_START=0

Modified: head/sys/arm/rockchip/std.rk30xx
==============================================================================
--- head/sys/arm/rockchip/std.rk30xx    Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/rockchip/std.rk30xx    Sat Dec 30 00:20:49 2017        
(r327367)
@@ -5,9 +5,6 @@ cpu             CPU_CORTEXA
 machine                arm armv7
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-makeoptions    KERNVIRTADDR=0xc0400000
-options                KERNVIRTADDR=0xc0400000
-
 options                IPI_IRQ_START=0
 options                IPI_IRQ_END=15
 

Modified: head/sys/arm/samsung/exynos/std.exynos5250
==============================================================================
--- head/sys/arm/samsung/exynos/std.exynos5250  Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/samsung/exynos/std.exynos5250  Sat Dec 30 00:20:49 2017        
(r327367)
@@ -4,9 +4,6 @@ cpu             CPU_CORTEXA
 machine                arm armv7
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-makeoptions    KERNVIRTADDR=0xc0f00000
-options                KERNVIRTADDR=0xc0f00000
-
 options                IPI_IRQ_START=0
 options                IPI_IRQ_END=15
 

Modified: head/sys/arm/samsung/exynos/std.exynos5420
==============================================================================
--- head/sys/arm/samsung/exynos/std.exynos5420  Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/samsung/exynos/std.exynos5420  Sat Dec 30 00:20:49 2017        
(r327367)
@@ -4,9 +4,6 @@ cpu             CPU_CORTEXA
 machine                arm armv7
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-makeoptions    KERNVIRTADDR=0xc0f00000
-options                KERNVIRTADDR=0xc0f00000
-
 options                IPI_IRQ_START=0
 options                IPI_IRQ_END=15
 

Modified: head/sys/arm/ti/am335x/std.am335x
==============================================================================
--- head/sys/arm/ti/am335x/std.am335x   Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/ti/am335x/std.am335x   Sat Dec 30 00:20:49 2017        
(r327367)
@@ -5,7 +5,4 @@ include         "../ti/std.ti"
 
 cpu            CPU_CORTEXA
 
-options                KERNVIRTADDR=0xc0200000         # Used in ldscript.arm
-makeoptions    KERNVIRTADDR=0xc0200000
-
 options                SOC_TI_AM335X

Modified: head/sys/arm/ti/omap4/std.omap4
==============================================================================
--- head/sys/arm/ti/omap4/std.omap4     Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/ti/omap4/std.omap4     Sat Dec 30 00:20:49 2017        
(r327367)
@@ -5,7 +5,4 @@ include         "../ti/std.ti"
 
 cpu            CPU_CORTEXA
 
-options                KERNVIRTADDR=0xc0200000         # Used in ldscript.arm
-makeoptions    KERNVIRTADDR=0xc0200000
-
 options                SOC_OMAP4

Modified: head/sys/arm/xilinx/std.zynq7
==============================================================================
--- head/sys/arm/xilinx/std.zynq7       Fri Dec 29 23:58:05 2017        
(r327366)
+++ head/sys/arm/xilinx/std.zynq7       Sat Dec 30 00:20:49 2017        
(r327367)
@@ -9,8 +9,5 @@ makeoptions     CONF_CFLAGS="-march=armv7a"
 
 files          "../xilinx/files.zynq7"
 
-options                KERNVIRTADDR=0xc0100000         # Used in ldscript.arm
-makeoptions    KERNVIRTADDR=0xc0100000
-
 options                IPI_IRQ_START=0
 options                IPI_IRQ_END=15

Modified: head/sys/conf/Makefile.arm
==============================================================================
--- head/sys/conf/Makefile.arm  Fri Dec 29 23:58:05 2017        (r327366)
+++ head/sys/conf/Makefile.arm  Sat Dec 30 00:20:49 2017        (r327367)
@@ -53,6 +53,11 @@ CFLAGS += -mllvm -arm-enable-ehabi
 .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.
 genassym.o: bus_if.h device_if.h
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to