Skip to contentSkip to conversation

More plesant User-Mode Linux build

PATCH In review Ramkumar Ramachandra 2 participants 5 messages Sep 27, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover More plesant User-Mode Linux build

Hi,

The first patch does the meat of the work of getting rid of the bloated i386-specific defconfig and replacing it with two tiny ones, and updating the Makefile/ Kconfig. SUBARCH is now auto-detected correctly, and can be overridden on the command-line. I've tested both the x86_64 kernel with an x86_64 userland, as well as the i386 kernel with an i386 userland.

The second patch is just a related "while we're there".

Thanks.

Ramkumar Ramachandra (2):
arch/um: make it work with defconfig and x86_64
um/vdso: add .gitignore for a couple of targets

 arch/um/Kconfig.common           |   5 -
 arch/um/Makefile                 |  11 +
 arch/um/configs/i386_defconfig   |  76 ++++
 arch/um/configs/x86_64_defconfig |  75 ++++
 arch/um/defconfig                | 899 ---------------------------------------
 arch/x86/um/Kconfig              |   5 +
 arch/x86/um/vdso/.gitignore      |   2 +
 7 files changed, 169 insertions(+), 904 deletions(-)
 create mode 100644 arch/um/configs/i386_defconfig
 create mode 100644 arch/um/configs/x86_64_defconfig
 delete mode 100644 arch/um/defconfig
 create mode 100644 arch/x86/um/vdso/.gitignore
Signature · 1 line
1.8.4.299.gb3e7d24.dirty
#1 lore raw

PATCH 1/2 arch/um: make it work with defconfig and x86_64

arch/um/defconfig only lists one default configuration, and that applies only to the i386 architecture. Replace it with two minimal configuration files generated using make savedefconfig:

i386_defconfig and x86_64_defconfig

The build scripts now require two updates:

1. um's Kconfig (arch/x86/um/Kconfig) should specify an ARCH_DEFCONFIG section explicitly pointing to these scripts if the required variables are set. Take care to remove the DEFCONFIG_LIST section defined in the included file arch/um/Kconfig.common.

2. um's Makefile (arch/um/Makefile) should set KBUILD_DEFCONFIG properly for the top-level Makefile to pick up. Copy the logic in arch/x86/Makefile to properly pick the defconfig file depending on the actual architecture; except we're working with $SUBARCH here, instead of $ARCH.

Now, you can do:

  $ ARCH=um make defconfig
  $ ARCH=um make

and successfully build User-Mode Linux on an x86_64 box in default configuration.

Cc Richard Weinberger <[email protected]>
Cc Jeff Dike <[email protected]>
---
 arch/um/Kconfig.common           |   5 -
 arch/um/Makefile                 |  11 +
 arch/um/configs/i386_defconfig   |  76 ++++
 arch/um/configs/x86_64_defconfig |  75 ++++
 arch/um/defconfig                | 899 ---------------------------------------
 arch/x86/um/Kconfig              |   5 +
 6 files changed, 167 insertions(+), 904 deletions(-)
 create mode 100644 arch/um/configs/i386_defconfig
 create mode 100644 arch/um/configs/x86_64_defconfig
 delete mode 100644 arch/um/defconfig
arch/um/Kconfig.common +0 -5
index 8ddea1f..21ca44c 100644
@@ -1,8 +1,3 @@
-config DEFCONFIG_LIST
-	string
-	option defconfig_list
-	default "arch/$ARCH/defconfig"
-
 config UML
 	bool
 	default y
arch/um/Makefile +11 -0
index 133f7de..48d92bb 100644
@@ -6,6 +6,17 @@
 # Licensed under the GPL
 #
 
+# select defconfig based on actual architecture
+ifeq ($(SUBARCH),x86)
+  ifeq ($(shell uname -m),x86_64)
+        KBUILD_DEFCONFIG := x86_64_defconfig
+  else
+        KBUILD_DEFCONFIG := i386_defconfig
+  endif
+else
+        KBUILD_DEFCONFIG := $(SUBARCH)_defconfig
+endif
+
 ARCH_DIR := arch/um
 OS := $(shell uname -s)
 # We require bash because the vmlinux link and loader script cpp use bash
arch/um/configs/i386_defconfig new file +76 -0

76 lines not on this page · raw message

arch/um/configs/x86_64_defconfig new file +75 -0

75 lines not on this page · raw message

arch/um/defconfig deleted +0 -899

899 lines not on this page · raw message

arch/x86/um/Kconfig +5 -0
index 14ef8d1..ed56a1c 100644
@@ -31,6 +31,11 @@ config X86_64
 	def_bool 64BIT
 	select MODULES_USE_ELF_RELA
 
+config ARCH_DEFCONFIG
+	string
+	default "arch/um/configs/i386_defconfig" if X86_32
+	default "arch/um/configs/x86_64_defconfig" if X86_64
+
 config RWSEM_XCHGADD_ALGORITHM
 	def_bool 64BIT
 
Signature · 13 lines
1.8.4.299.gb3e7d24.dirty


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#2 lore raw

Re: [PATCH 1/2] arch/um: make it work with defconfig and x86_64

Am 27.09.2013 06:14, schrieb Ramkumar Ramachandra:

Quoted 19 lines

arch/um/defconfig only lists one default configuration, and that applies only to the i386 architecture. Replace it with two minimal configuration files generated using make savedefconfig:

i386_defconfig and x86_64_defconfig

The build scripts now require two updates:

1. um's Kconfig (arch/x86/um/Kconfig) should specify an ARCH_DEFCONFIG section explicitly pointing to these scripts if the required variables are set. Take care to remove the DEFCONFIG_LIST section defined in the included file arch/um/Kconfig.common.

2. um's Makefile (arch/um/Makefile) should set KBUILD_DEFCONFIG properly for the top-level Makefile to pick up. Copy the logic in arch/x86/Makefile to properly pick the defconfig file depending on the actual architecture; except we're working with $SUBARCH here, instead of $ARCH.

Quoted 7 lines

Now, you can do:

  $ ARCH=um make defconfig
  $ ARCH=um make

and successfully build User-Mode Linux on an x86_64 box in default configuration.

I don't much like the commit message, but I will amend it myself. I.e. defconfig worked always on x86_64, you have to specify SUBARCH=x86_64. Your patch adds the handy feature that make defconfig will use the host arch automatically.

Patch queued for 3.13-rc1.

Thanks,
//richard

#3 lore raw

PATCH 2/2 um/vdso: add .gitignore for a couple of targets

In reply to Ramkumar Ramachandra
---
 arch/x86/um/vdso/.gitignore | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 arch/x86/um/vdso/.gitignore
arch/x86/um/vdso/.gitignore new file +2 -0
new file mode 100644
index 0000000..9cac6d0
@@ -0,0 +1,2 @@
+vdso-syms.lds
+vdso.lds
Signature · 13 lines
1.8.4.299.gb3e7d24.dirty


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#4 lore raw

Re: [PATCH 2/2] um/vdso: add .gitignore for a couple of targets

Am 27.09.2013 06:14, schrieb Ramkumar Ramachandra:

Quoted 14 lines
---
 arch/x86/um/vdso/.gitignore | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 arch/x86/um/vdso/.gitignore
arch/x86/um/vdso/.gitignore new file +0 -0
new file mode 100644
index 0000000..9cac6d0

arch/x86/um/vdso/.gitignore line 2

Quoted 2 lines
arch/x86/um/vdso/.gitignore new file +2 -0
@@ -0,0 +1,2 @@
+vdso-syms.lds
+vdso.lds

Queued for 3.13-rc1.

Thanks,
//richard