diff mbox series

[RFC,3/3] arm64: add a new config option KTEST_RUNNABLE

Message ID 20181213122910.24193-4-anders.roxell@linaro.org
State New
Headers show
Series Make allmodconfig boot in qemu-arm64 | expand

Commit Message

Anders Roxell Dec. 13, 2018, 12:29 p.m. UTC
With this new config option, we can boot a allmodconfig kernel in qemu.
Config options SERIAL_AMBA_PL011, SERIAL_AMBA_PL011_CONSOLE, UNIX needs
to be enabled in order to get a console. Options like CPU_BIG_ENDIAN,
CMDLINE_FORCE, CMDLINE_OVERRIDE and HVC_DCC needs to be disabled.

Co-developed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

---
 arch/arm64/Kconfig      | 8 ++++++++
 drivers/tty/hvc/Kconfig | 1 +
 init/Kconfig            | 1 +
 3 files changed, 10 insertions(+)

-- 
2.19.2

Comments

Mark Brown Dec. 13, 2018, 3:18 p.m. UTC | #1
On Thu, Dec 13, 2018 at 01:29:10PM +0100, Anders Roxell wrote:

> With this new config option, we can boot a allmodconfig kernel in qemu.

> Config options SERIAL_AMBA_PL011, SERIAL_AMBA_PL011_CONSOLE, UNIX needs

> to be enabled in order to get a console. Options like CPU_BIG_ENDIAN,

> CMDLINE_FORCE, CMDLINE_OVERRIDE and HVC_DCC needs to be disabled.


Does ktest really not run with BIG_ENDIAN?  

> +config KTEST_RUNNABLE

> +	bool "Test build kernels that run in qemu for ktest"

> +	select SERIAL_AMBA_PL011

> +	select SERIAL_AMBA_PL011_CONSOLE

> +	select UNIX


The opposite angle for my question on patch 1 I guess but is this really
a generic thing for running ktest?  It seems like it's specific to qemu
(and other systems which have the PL011 as the console serial port).
Mark Rutland Jan. 7, 2019, 2:39 p.m. UTC | #2
On Thu, Dec 13, 2018 at 03:18:23PM +0000, Mark Brown wrote:
> On Thu, Dec 13, 2018 at 01:29:10PM +0100, Anders Roxell wrote:

> 

> > With this new config option, we can boot a allmodconfig kernel in qemu.

> > Config options SERIAL_AMBA_PL011, SERIAL_AMBA_PL011_CONSOLE, UNIX needs

> > to be enabled in order to get a console. Options like CPU_BIG_ENDIAN,

> > CMDLINE_FORCE, CMDLINE_OVERRIDE and HVC_DCC needs to be disabled.

> 

> Does ktest really not run with BIG_ENDIAN?  

> 

> > +config KTEST_RUNNABLE

> > +	bool "Test build kernels that run in qemu for ktest"

> > +	select SERIAL_AMBA_PL011

> > +	select SERIAL_AMBA_PL011_CONSOLE

> > +	select UNIX

> 

> The opposite angle for my question on patch 1 I guess but is this really

> a generic thing for running ktest?  It seems like it's specific to qemu

> (and other systems which have the PL011 as the console serial port).


This is definitely platform-specific rather than ktest specific.

If I wanted to run ktest in a kvmtool VM, I would not need PL011 at all,
since that uses 8250 and virtio-console.

Thanks,
Mark.
Mark Rutland Jan. 7, 2019, 2:43 p.m. UTC | #3
Hi,

As a general thing, please Cc LAKML on patches for arm64.

On Thu, Dec 13, 2018 at 01:29:10PM +0100, Anders Roxell wrote:
> With this new config option, we can boot a allmodconfig kernel in qemu.

> Config options SERIAL_AMBA_PL011, SERIAL_AMBA_PL011_CONSOLE, UNIX needs

> to be enabled in order to get a console. Options like CPU_BIG_ENDIAN,

> CMDLINE_FORCE, CMDLINE_OVERRIDE and HVC_DCC needs to be disabled.

> 

> Co-developed-by: Arnd Bergmann <arnd@arndb.de>

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

> ---

>  arch/arm64/Kconfig      | 8 ++++++++

>  drivers/tty/hvc/Kconfig | 1 +

>  init/Kconfig            | 1 +

>  3 files changed, 10 insertions(+)

> 

> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig

> index 1f52362f8d99..bb17ccb7bab2 100644

> --- a/arch/arm64/Kconfig

> +++ b/arch/arm64/Kconfig

> @@ -292,6 +292,12 @@ config ARCH_SUPPORTS_UPROBES

>  config ARCH_PROC_KCORE_TEXT

>  	def_bool y

>  

> +config KTEST_RUNNABLE

> +	bool "Test build kernels that run in qemu for ktest"

> +	select SERIAL_AMBA_PL011

> +	select SERIAL_AMBA_PL011_CONSOLE

> +	select UNIX

> +


As Mark Brown points out, the PL011 bits are platform-specific, and
don't directly relate to ktest.

The UNIX part is simply because that can be built as a module.

Is it possible to use an allyesconfig rather than an allmodconfig? That
would leave all relevant options built-in.

> diff --git a/drivers/tty/hvc/Kconfig b/drivers/tty/hvc/Kconfig

> index 4293c172e120..44e23c2388bd 100644

> --- a/drivers/tty/hvc/Kconfig

> +++ b/drivers/tty/hvc/Kconfig

> @@ -82,6 +82,7 @@ config HVC_UDBG

>  config HVC_DCC

>         bool "ARM JTAG DCC console"

>         depends on ARM || ARM64

> +	depends on !KTEST_RUNNABLE

>         select HVC_DRIVER

>         help

>           This console uses the JTAG DCC on ARM to create a console under the HVC


... this is just a hack around the DCC driver being dodgy.

We should fix that to only probe if explicitly requested at run-time via
a command line argument.

Thanks,
Mark.
Mark Brown Jan. 7, 2019, 5:55 p.m. UTC | #4
On Mon, Jan 07, 2019 at 02:43:57PM +0000, Mark Rutland wrote:

> Is it possible to use an allyesconfig rather than an allmodconfig? That

> would leave all relevant options built-in.


The allyesconfig would make it more difficult to apply this approach to
real hardware which is part of the goal here - the idea was to come up
with a way of making runnable configurations which are likely to be
usable with random userspace testsuites in order to avoid needing ever
expanding combinations of builds.
Mark Rutland Jan. 7, 2019, 5:59 p.m. UTC | #5
On Mon, Jan 07, 2019 at 05:55:31PM +0000, Mark Brown wrote:
> On Mon, Jan 07, 2019 at 02:43:57PM +0000, Mark Rutland wrote:

> 

> > Is it possible to use an allyesconfig rather than an allmodconfig? That

> > would leave all relevant options built-in.

> 

> The allyesconfig would make it more difficult to apply this approach to

> real hardware which is part of the goal here - the idea was to come up

> with a way of making runnable configurations which are likely to be

> usable with random userspace testsuites in order to avoid needing ever

> expanding combinations of builds.


Ok.

Is it somehow possible to fuse defconfig with an allmodconfig, with
defconfig's CONFIG_FOO=y taking precedence over allmodconfig's
CONFIG_FOO=m?

IIUC, that would give you the necessary platform bits, at least for
anything supported by defconfig. That would also happen to get
CONFIG_UNIX=y, too.

Thanks,
Mark.
diff mbox series

Patch

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 1f52362f8d99..bb17ccb7bab2 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -292,6 +292,12 @@  config ARCH_SUPPORTS_UPROBES
 config ARCH_PROC_KCORE_TEXT
 	def_bool y
 
+config KTEST_RUNNABLE
+	bool "Test build kernels that run in qemu for ktest"
+	select SERIAL_AMBA_PL011
+	select SERIAL_AMBA_PL011_CONSOLE
+	select UNIX
+
 source "arch/arm64/Kconfig.platforms"
 
 menu "Kernel Features"
@@ -773,6 +779,7 @@  config ARM64_PA_BITS
 
 config CPU_BIG_ENDIAN
        bool "Build big-endian kernel"
+	depends on !KTEST_RUNNABLE
        help
          Say Y if you plan on running a kernel in big-endian mode.
 
@@ -1381,6 +1388,7 @@  config CMDLINE
 
 config CMDLINE_FORCE
 	bool "Always use the default kernel command string"
+	depends on !KTEST_RUNNABLE
 	help
 	  Always use the default kernel command string, even if the boot
 	  loader passes other arguments to the kernel.
diff --git a/drivers/tty/hvc/Kconfig b/drivers/tty/hvc/Kconfig
index 4293c172e120..44e23c2388bd 100644
--- a/drivers/tty/hvc/Kconfig
+++ b/drivers/tty/hvc/Kconfig
@@ -82,6 +82,7 @@  config HVC_UDBG
 config HVC_DCC
        bool "ARM JTAG DCC console"
        depends on ARM || ARM64
+	depends on !KTEST_RUNNABLE
        select HVC_DRIVER
        help
          This console uses the JTAG DCC on ARM to create a console under the HVC
diff --git a/init/Kconfig b/init/Kconfig
index b633716e48f5..3ea5297b7305 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1844,6 +1844,7 @@  config CMDLINE_PREPEND
 config CMDLINE_OVERRIDE
 	bool "Built-in command line overrides boot loader arguments"
 	depends on CMDLINE_BOOL
+	depends on !KTEST_RUNNABLE
 	help
 	  Set this option to 'Y' to have the kernel ignore the boot loader
 	  command line, and use ONLY the built-in command line. In this case