Author: ian
Date: Sun Jan  7 00:04:13 2018
New Revision: 327658
URL: https://svnweb.freebsd.org/changeset/base/327658

Log:
  MFC r327367:
  
  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:
  stable/11/sys/arm/allwinner/std.allwinner
  stable/11/sys/arm/allwinner/std.allwinner_up
  stable/11/sys/arm/altera/socfpga/std.socfpga
  stable/11/sys/arm/arm/dump_machdep.c
  stable/11/sys/arm/arm/elf_trampoline.c
  stable/11/sys/arm/arm/genassym.c
  stable/11/sys/arm/arm/machdep_boot.c
  stable/11/sys/arm/broadcom/bcm2835/std.rpi
  stable/11/sys/arm/conf/NOTES
  stable/11/sys/arm/freescale/imx/std.imx51
  stable/11/sys/arm/freescale/imx/std.imx53
  stable/11/sys/arm/freescale/imx/std.imx6
  stable/11/sys/arm/freescale/vybrid/std.vybrid
  stable/11/sys/arm/include/vmparam.h
  stable/11/sys/arm/mv/armada38x/std.armada38x
  stable/11/sys/arm/mv/armadaxp/std.armadaxp
  stable/11/sys/arm/nvidia/tegra124/std.tegra124
  stable/11/sys/arm/rockchip/std.rk30xx
  stable/11/sys/arm/samsung/exynos/std.exynos5250
  stable/11/sys/arm/samsung/exynos/std.exynos5420
  stable/11/sys/arm/ti/am335x/std.am335x
  stable/11/sys/arm/ti/omap4/std.omap4
  stable/11/sys/arm/xilinx/std.zynq7
  stable/11/sys/conf/Makefile.arm
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm/allwinner/std.allwinner
==============================================================================
--- stable/11/sys/arm/allwinner/std.allwinner   Sat Jan  6 23:44:14 2018        
(r327657)
+++ stable/11/sys/arm/allwinner/std.allwinner   Sun Jan  7 00:04:13 2018        
(r327658)
@@ -5,9 +5,6 @@ cpu             CPU_CORTEXA
 machine        arm armv6
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-makeoptions    KERNVIRTADDR=0xc0200000
-options        KERNVIRTADDR=0xc0200000
-
 options        IPI_IRQ_START=0
 options        IPI_IRQ_END=15
 

Modified: stable/11/sys/arm/allwinner/std.allwinner_up
==============================================================================
--- stable/11/sys/arm/allwinner/std.allwinner_up        Sat Jan  6 23:44:14 
2018        (r327657)
+++ stable/11/sys/arm/allwinner/std.allwinner_up        Sun Jan  7 00:04:13 
2018        (r327658)
@@ -5,9 +5,6 @@ cpu             CPU_CORTEXA
 machine        arm armv6
 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: stable/11/sys/arm/altera/socfpga/std.socfpga
==============================================================================
--- stable/11/sys/arm/altera/socfpga/std.socfpga        Sat Jan  6 23:44:14 
2018        (r327657)
+++ stable/11/sys/arm/altera/socfpga/std.socfpga        Sun Jan  7 00:04:13 
2018        (r327658)
@@ -4,9 +4,6 @@ cpu             CPU_CORTEXA
 machine                arm armv6
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-makeoptions    KERNVIRTADDR=0xc0f00000
-options                KERNVIRTADDR=0xc0f00000
-
 options                IPI_IRQ_START=0
 options                IPI_IRQ_END=15
 

Modified: stable/11/sys/arm/arm/dump_machdep.c
==============================================================================
--- stable/11/sys/arm/arm/dump_machdep.c        Sat Jan  6 23:44:14 2018        
(r327657)
+++ stable/11/sys/arm/arm/dump_machdep.c        Sun Jan  7 00:04:13 2018        
(r327658)
@@ -44,6 +44,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: stable/11/sys/arm/arm/elf_trampoline.c
==============================================================================
--- stable/11/sys/arm/arm/elf_trampoline.c      Sat Jan  6 23:44:14 2018        
(r327657)
+++ stable/11/sys/arm/arm/elf_trampoline.c      Sun Jan  7 00:04:13 2018        
(r327658)
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/pte-v4.h>
 #include <machine/cpufunc.h>
 #include <machine/armreg.h>
+#include <machine/vmparam.h>   /* For KERNVIRTADDR */
 
 extern char kernel_start[];
 extern char kernel_end[];

Modified: stable/11/sys/arm/arm/genassym.c
==============================================================================
--- stable/11/sys/arm/arm/genassym.c    Sat Jan  6 23:44:14 2018        
(r327657)
+++ stable/11/sys/arm/arm/genassym.c    Sun Jan  7 00:04:13 2018        
(r327658)
@@ -49,6 +49,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>
@@ -57,6 +58,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: stable/11/sys/arm/arm/machdep_boot.c
==============================================================================
--- stable/11/sys/arm/arm/machdep_boot.c        Sat Jan  6 23:44:14 2018        
(r327657)
+++ stable/11/sys/arm/arm/machdep_boot.c        Sun Jan  7 00:04:13 2018        
(r327658)
@@ -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: stable/11/sys/arm/broadcom/bcm2835/std.rpi
==============================================================================
--- stable/11/sys/arm/broadcom/bcm2835/std.rpi  Sat Jan  6 23:44:14 2018        
(r327657)
+++ stable/11/sys/arm/broadcom/bcm2835/std.rpi  Sun Jan  7 00:04:13 2018        
(r327658)
@@ -1,5 +1,3 @@
 # $FreeBSD$
 
-options                KERNVIRTADDR=0xc0100000
-makeoptions    KERNVIRTADDR=0xc0100000
 options                LINUX_BOOT_ABI

Modified: stable/11/sys/arm/conf/NOTES
==============================================================================
--- stable/11/sys/arm/conf/NOTES        Sat Jan  6 23:44:14 2018        
(r327657)
+++ stable/11/sys/arm/conf/NOTES        Sun Jan  7 00:04:13 2018        
(r327658)
@@ -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: stable/11/sys/arm/freescale/imx/std.imx51
==============================================================================
--- stable/11/sys/arm/freescale/imx/std.imx51   Sat Jan  6 23:44:14 2018        
(r327657)
+++ stable/11/sys/arm/freescale/imx/std.imx51   Sun Jan  7 00:04:13 2018        
(r327658)
@@ -3,9 +3,6 @@ machine         arm     armv6
 cpu            CPU_CORTEXA
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-options                KERNVIRTADDR=0xc0100000
-makeoptions    KERNVIRTADDR=0xc0100000
-
 device         fdt_pinctrl
 
 files "../freescale/imx/files.imx5"

Modified: stable/11/sys/arm/freescale/imx/std.imx53
==============================================================================
--- stable/11/sys/arm/freescale/imx/std.imx53   Sat Jan  6 23:44:14 2018        
(r327657)
+++ stable/11/sys/arm/freescale/imx/std.imx53   Sun Jan  7 00:04:13 2018        
(r327658)
@@ -3,9 +3,6 @@ machine         arm     armv6
 cpu            CPU_CORTEXA
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-options                KERNVIRTADDR=0xc0100000
-makeoptions    KERNVIRTADDR=0xc0100000
-
 device         fdt_pinctrl
 
 files "../freescale/imx/files.imx5"

Modified: stable/11/sys/arm/freescale/imx/std.imx6
==============================================================================
--- stable/11/sys/arm/freescale/imx/std.imx6    Sat Jan  6 23:44:14 2018        
(r327657)
+++ stable/11/sys/arm/freescale/imx/std.imx6    Sun Jan  7 00:04:13 2018        
(r327658)
@@ -3,9 +3,6 @@ machine         arm     armv6
 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: stable/11/sys/arm/freescale/vybrid/std.vybrid
==============================================================================
--- stable/11/sys/arm/freescale/vybrid/std.vybrid       Sat Jan  6 23:44:14 
2018        (r327657)
+++ stable/11/sys/arm/freescale/vybrid/std.vybrid       Sun Jan  7 00:04:13 
2018        (r327658)
@@ -4,7 +4,4 @@ cpu             CPU_CORTEXA
 machine                arm armv6
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-makeoptions    KERNVIRTADDR=0xc0100000
-options                KERNVIRTADDR=0xc0100000
-
 files          "../freescale/vybrid/files.vybrid"

Modified: stable/11/sys/arm/include/vmparam.h
==============================================================================
--- stable/11/sys/arm/include/vmparam.h Sat Jan  6 23:44:14 2018        
(r327657)
+++ stable/11/sys/arm/include/vmparam.h Sun Jan  7 00:04:13 2018        
(r327658)
@@ -73,6 +73,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: stable/11/sys/arm/mv/armada38x/std.armada38x
==============================================================================
--- stable/11/sys/arm/mv/armada38x/std.armada38x        Sat Jan  6 23:44:14 
2018        (r327657)
+++ stable/11/sys/arm/mv/armada38x/std.armada38x        Sun Jan  7 00:04:13 
2018        (r327658)
@@ -5,8 +5,6 @@ cpu             CPU_CORTEXA
 machine                arm     armv6
 
 makeoptions    CONF_CFLAGS="-march=armv7a"
-makeoptions    KERNVIRTADDR=0xc0000000
 
-options         KERNVIRTADDR=0xc0000000
 options                IPI_IRQ_START=0
 options                IPI_IRQ_END=15

Modified: stable/11/sys/arm/mv/armadaxp/std.armadaxp
==============================================================================
--- stable/11/sys/arm/mv/armadaxp/std.armadaxp  Sat Jan  6 23:44:14 2018        
(r327657)
+++ stable/11/sys/arm/mv/armadaxp/std.armadaxp  Sun Jan  7 00:04:13 2018        
(r327658)
@@ -1,4 +1,2 @@
 # $FreeBSD$
 
-makeoptions    KERNVIRTADDR=0xc0200000
-options                KERNVIRTADDR=0xc0200000

Modified: stable/11/sys/arm/nvidia/tegra124/std.tegra124
==============================================================================
--- stable/11/sys/arm/nvidia/tegra124/std.tegra124      Sat Jan  6 23:44:14 
2018        (r327657)
+++ stable/11/sys/arm/nvidia/tegra124/std.tegra124      Sun Jan  7 00:04:13 
2018        (r327658)
@@ -3,9 +3,6 @@ cpu             CPU_CORTEXA
 machine                arm     armv6
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-options                KERNVIRTADDR            = 0xc0200000
-makeoptions    KERNVIRTADDR            = 0xc0200000
-
 options                INTRNG
 
 options                IPI_IRQ_START=0

Modified: stable/11/sys/arm/rockchip/std.rk30xx
==============================================================================
--- stable/11/sys/arm/rockchip/std.rk30xx       Sat Jan  6 23:44:14 2018        
(r327657)
+++ stable/11/sys/arm/rockchip/std.rk30xx       Sun Jan  7 00:04:13 2018        
(r327658)
@@ -5,9 +5,6 @@ cpu             CPU_CORTEXA
 machine                arm armv6
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-makeoptions    KERNVIRTADDR=0xc0400000
-options                KERNVIRTADDR=0xc0400000
-
 options                IPI_IRQ_START=0
 options                IPI_IRQ_END=15
 

Modified: stable/11/sys/arm/samsung/exynos/std.exynos5250
==============================================================================
--- stable/11/sys/arm/samsung/exynos/std.exynos5250     Sat Jan  6 23:44:14 
2018        (r327657)
+++ stable/11/sys/arm/samsung/exynos/std.exynos5250     Sun Jan  7 00:04:13 
2018        (r327658)
@@ -4,9 +4,6 @@ cpu             CPU_CORTEXA
 machine                arm armv6
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-makeoptions    KERNVIRTADDR=0xc0f00000
-options                KERNVIRTADDR=0xc0f00000
-
 options                IPI_IRQ_START=0
 options                IPI_IRQ_END=15
 

Modified: stable/11/sys/arm/samsung/exynos/std.exynos5420
==============================================================================
--- stable/11/sys/arm/samsung/exynos/std.exynos5420     Sat Jan  6 23:44:14 
2018        (r327657)
+++ stable/11/sys/arm/samsung/exynos/std.exynos5420     Sun Jan  7 00:04:13 
2018        (r327658)
@@ -4,9 +4,6 @@ cpu             CPU_CORTEXA
 machine                arm armv6
 makeoptions    CONF_CFLAGS="-march=armv7a"
 
-makeoptions    KERNVIRTADDR=0xc0f00000
-options                KERNVIRTADDR=0xc0f00000
-
 options                IPI_IRQ_START=0
 options                IPI_IRQ_END=15
 

Modified: stable/11/sys/arm/ti/am335x/std.am335x
==============================================================================
--- stable/11/sys/arm/ti/am335x/std.am335x      Sat Jan  6 23:44:14 2018        
(r327657)
+++ stable/11/sys/arm/ti/am335x/std.am335x      Sun Jan  7 00:04:13 2018        
(r327658)
@@ -3,7 +3,4 @@
 files          "../ti/am335x/files.am335x"
 include                "../ti/std.ti"
 
-options                KERNVIRTADDR=0xc0200000         # Used in ldscript.arm
-makeoptions    KERNVIRTADDR=0xc0200000
-
 options                SOC_TI_AM335X

Modified: stable/11/sys/arm/ti/omap4/std.omap4
==============================================================================
--- stable/11/sys/arm/ti/omap4/std.omap4        Sat Jan  6 23:44:14 2018        
(r327657)
+++ stable/11/sys/arm/ti/omap4/std.omap4        Sun Jan  7 00:04:13 2018        
(r327658)
@@ -3,7 +3,4 @@
 files          "../ti/omap4/files.omap4"
 include                "../ti/std.ti"
 
-options                KERNVIRTADDR=0xc0200000         # Used in ldscript.arm
-makeoptions    KERNVIRTADDR=0xc0200000
-
 options                SOC_OMAP4

Modified: stable/11/sys/arm/xilinx/std.zynq7
==============================================================================
--- stable/11/sys/arm/xilinx/std.zynq7  Sat Jan  6 23:44:14 2018        
(r327657)
+++ stable/11/sys/arm/xilinx/std.zynq7  Sun Jan  7 00:04:13 2018        
(r327658)
@@ -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: stable/11/sys/conf/Makefile.arm
==============================================================================
--- stable/11/sys/conf/Makefile.arm     Sat Jan  6 23:44:14 2018        
(r327657)
+++ stable/11/sys/conf/Makefile.arm     Sun Jan  7 00:04:13 2018        
(r327658)
@@ -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-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to