Re: [uml-devel] [RFC] Get rid of SUBARCH

2013-08-21 Thread Sam Ravnborg
> 
> > The series touches also m68k, sh, mips and unicore32.
> > These architectures magically select a cross compiler if ARCH != SUBARCH.
> > Do really need that behavior?
> 
> This does remove functionality.
> It allows to build a kernel using e.g. "make ARCH=m68k".
> 
> Perhaps this can be moved to generic code? Most (not all!) cross-toolchains
> are called $ARCH-{unknown-,}linux{,-gnu}.
> Exceptions are e.g. am33_2.0-linux and bfin-uclinux.

Today you can specify CROSS_COMPILE in Kconfig.
With this we should be able to remove these hacks.

Sam

--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] [RFC] Get rid of SUBARCH

2013-08-21 Thread Rob Landley
On 08/21/2013 07:07:33 AM, Geert Uytterhoeven wrote:
> On Wed, Aug 21, 2013 at 10:19 AM, Richard Weinberger   
> wrote:
> > This series is an attempt to remove the SUBARCH make parameter.
> > It as introduced at the times of Linux 2.5 for UML to tell the UML
> > build system what the real architecture is.
> >
> > But we actually don't need SUBARCH, we can store this information
> > in the .config file.
> 
> Haha, now you have OS_ARCH (shouldn't that be called HOST_ARCH?)  
> instead,
> which is available only for UM?
> 
> > The series touches also m68k, sh, mips and unicore32.
> > These architectures magically select a cross compiler if ARCH !=  
> SUBARCH.
> > Do really need that behavior?
> 
> This does remove functionality.
> It allows to build a kernel using e.g. "make ARCH=m68k".

   make ARCH=m68k CROSS_COMPILE=m68k-
   make ARCH=arm CROSS_COMPILE=armv5l-
   make ARCH=sparc CROSS_COMPILE=sparc-
   make ARCH=ppc CROSS_COMPILE=powerpc-
   make ARCH=sh CROSS_COMPILE=sh4-
   make ARCH=mips CROSS_COMPILE=mipsel-
   make ARCH=x86 CROSS_COMPILE=i686-
   make ARCH=alpha CROSS_COMPILE=alpha-

Works the same way on all the targets I've tried so far. You specify  
the architecture, you specify the cross compiler prefix, you feed it a  
config file, you build.

(If a target supplies its own default cross compiler prefix I just have  
to override it with what mine's called anyway...)

> Perhaps this can be moved to generic code? Most (not all!)  
> cross-toolchains
> are called $ARCH-{unknown-,}linux{,-gnu}.
> Exceptions are e.g. am33_2.0-linux and bfin-uclinux.

The linaro toolchain is arm-linux-gnueabihf- and the one on kernel.org  
is arm-unknown-linux-gnueabi- and the one I build is armv5l- (because  
the FSF's  
$ARCH-unknown-gnu-format-tuple-all-hail-stallman-gnu-gnu-gnu-dammit-gcc  
is just nuts: why would I say -linux- in a linux-to-linux toolchain? Do  
windows toolchains say -windows-?)

Other toolchain sources use other prefixes (-unknown- is often  
-$VENDORNAME-), and then of course there's llvm... which is why you  
specify CROSS_COMPILE= on the make command line.

Rob
--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] [PATCH 8/8] Makefile: Remove SUBARCH

2013-08-21 Thread Richard Weinberger
As all users of SUBARCH have been removed we can finally get
rid of it.

Signed-off-by: Richard Weinberger 
---
 Makefile | 15 +++
 arch/um/Makefile |  2 +-
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/Makefile b/Makefile
index a5a55f4..48bd8fe 100644
--- a/Makefile
+++ b/Makefile
@@ -159,13 +159,7 @@ VPATH  := $(srctree)$(if 
$(KBUILD_EXTMOD),:$(KBUILD_EXTMOD))
 export srctree objtree VPATH
 
 
-# SUBARCH tells the usermode build what the underlying arch is.  That is set
-# first, and if a usermode build is happening, the "ARCH=um" on the command
-# line overrides the setting of ARCH below.  If a native build is happening,
-# then ARCH is assigned, getting whatever value it gets normally, and 
-# SUBARCH is subsequently ignored.
-
-SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
+ARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
  -e s/sun4u/sparc64/ \
  -e s/arm.*/arm/ -e s/sa110/arm/ \
  -e s/s390x/s390/ -e s/parisc64/parisc/ \
@@ -192,7 +186,6 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e 
s/x86_64/x86/ \
 # "make" in the configured kernel build directory always uses that.
 # Default value for CROSS_COMPILE is not to prefix executables
 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
-ARCH   ?= $(SUBARCH)
 CROSS_COMPILE  ?= $(CONFIG_CROSS_COMPILE:"%"=%)
 
 # Architecture as present in compile.h
@@ -1314,11 +1307,9 @@ endif #ifeq ($(mixed-targets),1)
 PHONY += checkstack kernelrelease kernelversion image_name
 
 # UML needs a little special treatment here.  It wants to use the host
-# toolchain, so needs $(SUBARCH) passed to checkstack.pl.  Everyone
-# else wants $(ARCH), including people doing cross-builds, which means
-# that $(SUBARCH) doesn't work here.
+# toolchain, so needs $(OS_ARCH) passed to checkstack.pl.
 ifeq ($(ARCH), um)
-CHECKSTACK_ARCH := $(SUBARCH)
+CHECKSTACK_ARCH := $(OS_ARCH)
 else
 CHECKSTACK_ARCH := $(ARCH)
 endif
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 5bc7892..c1b6a9b 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -156,4 +156,4 @@ endef
 include/generated/user_constants.h: $(HOST_DIR)/um/user-offsets.s
$(call filechk,gen-asm-offsets)
 
-export USER_CFLAGS CFLAGS_NO_HARDENING OS DEV_NULL_PATH
+export USER_CFLAGS CFLAGS_NO_HARDENING OS OS_ARCH DEV_NULL_PATH
-- 
1.8.1.4


--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] [PATCH 5/8] sh: Do not use SUBARCH

2013-08-21 Thread Richard Weinberger
Forces the user to specify CROSS_COMPILE at compile time instead
of automatically selecting more or less randomly a cross compiler.

Signed-off-by: Richard Weinberger 
---
 arch/sh/Makefile | 5 -
 1 file changed, 5 deletions(-)

diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index aed701c..8772d11 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -9,11 +9,6 @@
 # License.  See the file "COPYING" in the main directory of this archive
 # for more details.
 #
-ifneq ($(SUBARCH),$(ARCH))
-  ifeq ($(CROSS_COMPILE),)
-CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux-  
$(UTS_MACHINE)-linux-gnu-  $(UTS_MACHINE)-unknown-linux-gnu-)
-  endif
-endif
 
 isa-y  := any
 isa-$(CONFIG_SH_DSP)   := sh
-- 
1.8.1.4


--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] [PATCH 6/8] mips: Do not use SUBARCH

2013-08-21 Thread Richard Weinberger
Forces the user to specify CROSS_COMPILE at compile time instead
of automatically selecting more or less randomly a cross compiler.

Signed-off-by: Richard Weinberger 
---
 arch/mips/Makefile | 6 --
 1 file changed, 6 deletions(-)

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 37f9ef3..514fea6 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -42,12 +42,6 @@ tool-archpref= $(64bit-tool-archpref)
 UTS_MACHINE:= mips64
 endif
 
-ifneq ($(SUBARCH),$(ARCH))
-  ifeq ($(CROSS_COMPILE),)
-CROSS_COMPILE := $(call cc-cross-prefix, $(tool-archpref)-linux-  
$(tool-archpref)-linux-gnu-  $(tool-archpref)-unknown-linux-gnu-)
-  endif
-endif
-
 ifdef CONFIG_FUNCTION_GRAPH_TRACER
   ifndef KBUILD_MCOUNT_RA_ADDRESS
 ifeq ($(call cc-option-yn,-mmcount-ra-address), y)
-- 
1.8.1.4


--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] [RFC] Get rid of SUBARCH

2013-08-21 Thread Thorsten Glaser
On Wed, 21 Aug 2013, Richard Weinberger wrote:

> The series touches also m68k, sh, mips and unicore32.
> These architectures magically select a cross compiler if ARCH != SUBARCH.
> Do really need that behavior?

Not precisely that, but it’s very common in m68k land
to just cross-build kernels with

$ make ARCH=m68k menuconfig
$ make ARCH=m68k

Maybe a generalising of that feature, and making it
independent of SUBARCH (which can then die)?

bye,
//mirabilos
-- 
[16:04:33] bkix: "veni vidi violini"
[16:04:45] bkix: "ich kam, sah und vergeigte"...

--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] [RFC] Get rid of SUBARCH

2013-08-21 Thread Richard Weinberger
Am 21.08.2013 14:07, schrieb Geert Uytterhoeven:
> On Wed, Aug 21, 2013 at 10:19 AM, Richard Weinberger  wrote:
>> This series is an attempt to remove the SUBARCH make parameter.
>> It as introduced at the times of Linux 2.5 for UML to tell the UML
>> build system what the real architecture is.
>>
>> But we actually don't need SUBARCH, we can store this information
>> in the .config file.
> 
> Haha, now you have OS_ARCH (shouldn't that be called HOST_ARCH?) instead,
> which is available only for UM?

We have already OS (which is always "Linux"), so OS_ARCH is IMHO a good choice.
UML always needs to know what the underlying arch is.

OS_ARCH is not only visible to arch/um/ because of that code in the global 
Makefile:

# UML needs a little special treatment here.  It wants to use the host
# toolchain, so needs $(SUBARCH) passed to checkstack.pl.  Everyone
# else wants $(ARCH), including people doing cross-builds, which means
# that $(SUBARCH) doesn't work here.
ifeq ($(ARCH), um)
CHECKSTACK_ARCH := $(SUBARCH)
else
CHECKSTACK_ARCH := $(ARCH)
endif

scripts/tags.sh also needs some work. V2 will contain a patch for that.

>> The series touches also m68k, sh, mips and unicore32.
>> These architectures magically select a cross compiler if ARCH != SUBARCH.
>> Do really need that behavior?
> 
> This does remove functionality.
> It allows to build a kernel using e.g. "make ARCH=m68k".

If this functionality is expected and has users I'll happily keep that.

> Perhaps this can be moved to generic code? Most (not all!) cross-toolchains
> are called $ARCH-{unknown-,}linux{,-gnu}.
> Exceptions are e.g. am33_2.0-linux and bfin-uclinux.

Sounds good.

>> [PATCH 1/8] um: Create defconfigs for i386 and x86_64
>> [PATCH 3/8] um: Remove old defconfig
> 
> Why not merge these two, so git copy/rename detection will show only the real
> changes?

Will do.

Thanks,
//richard

--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] [PATCH 3/8] um: Remove old defconfig

2013-08-21 Thread Richard Weinberger
The old unified defconfig is no longer needed.

Signed-off-by: Richard Weinberger 
---
 arch/um/defconfig | 901 --
 1 file changed, 901 deletions(-)
 delete mode 100644 arch/um/defconfig

diff --git a/arch/um/defconfig b/arch/um/defconfig
deleted file mode 100644
index 08107a7..000
--- a/arch/um/defconfig
+++ /dev/null
@@ -1,901 +0,0 @@
-#
-# Automatically generated file; DO NOT EDIT.
-# User Mode Linux/i386 3.3.0 Kernel Configuration
-#
-CONFIG_DEFCONFIG_LIST="arch/$ARCH/defconfig"
-CONFIG_UML=y
-CONFIG_MMU=y
-CONFIG_NO_IOMEM=y
-# CONFIG_TRACE_IRQFLAGS_SUPPORT is not set
-CONFIG_LOCKDEP_SUPPORT=y
-# CONFIG_STACKTRACE_SUPPORT is not set
-CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_GENERIC_BUG=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_HZ=100
-
-#
-# UML-specific options
-#
-
-#
-# Host processor type and features
-#
-# CONFIG_M486 is not set
-# CONFIG_M586 is not set
-# CONFIG_M586TSC is not set
-# CONFIG_M586MMX is not set
-CONFIG_M686=y
-# CONFIG_MPENTIUMII is not set
-# CONFIG_MPENTIUMIII is not set
-# CONFIG_MPENTIUMM is not set
-# CONFIG_MPENTIUM4 is not set
-# CONFIG_MK6 is not set
-# CONFIG_MK7 is not set
-# CONFIG_MK8 is not set
-# CONFIG_MCRUSOE is not set
-# CONFIG_MEFFICEON is not set
-# CONFIG_MWINCHIPC6 is not set
-# CONFIG_MWINCHIP3D is not set
-# CONFIG_MELAN is not set
-# CONFIG_MGEODEGX1 is not set
-# CONFIG_MGEODE_LX is not set
-# CONFIG_MCYRIXIII is not set
-# CONFIG_MVIAC3_2 is not set
-# CONFIG_MVIAC7 is not set
-# CONFIG_MCORE2 is not set
-# CONFIG_MATOM is not set
-# CONFIG_X86_GENERIC is not set
-CONFIG_X86_INTERNODE_CACHE_SHIFT=5
-CONFIG_X86_CMPXCHG=y
-CONFIG_X86_L1_CACHE_SHIFT=5
-CONFIG_X86_XADD=y
-CONFIG_X86_PPRO_FENCE=y
-CONFIG_X86_WP_WORKS_OK=y
-CONFIG_X86_INVLPG=y
-CONFIG_X86_BSWAP=y
-CONFIG_X86_POPAD_OK=y
-CONFIG_X86_USE_PPRO_CHECKSUM=y
-CONFIG_X86_TSC=y
-CONFIG_X86_CMPXCHG64=y
-CONFIG_X86_CMOV=y
-CONFIG_X86_MINIMUM_CPU_FAMILY=5
-CONFIG_CPU_SUP_INTEL=y
-CONFIG_CPU_SUP_CYRIX_32=y
-CONFIG_CPU_SUP_AMD=y
-CONFIG_CPU_SUP_CENTAUR=y
-CONFIG_CPU_SUP_TRANSMETA_32=y
-CONFIG_CPU_SUP_UMC_32=y
-CONFIG_UML_X86=y
-# CONFIG_64BIT is not set
-CONFIG_X86_32=y
-# CONFIG_X86_64 is not set
-# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_3_LEVEL_PGTABLES is not set
-CONFIG_ARCH_HAS_SC_SIGNALS=y
-CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA=y
-CONFIG_GENERIC_HWEIGHT=y
-# CONFIG_STATIC_LINK is not set
-CONFIG_SELECT_MEMORY_MODEL=y
-CONFIG_FLATMEM_MANUAL=y
-CONFIG_FLATMEM=y
-CONFIG_FLAT_NODE_MEM_MAP=y
-CONFIG_PAGEFLAGS_EXTENDED=y
-CONFIG_SPLIT_PTLOCK_CPUS=4
-# CONFIG_COMPACTION is not set
-# CONFIG_PHYS_ADDR_T_64BIT is not set
-CONFIG_ZONE_DMA_FLAG=0
-CONFIG_VIRT_TO_BUS=y
-# CONFIG_KSM is not set
-CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
-CONFIG_NEED_PER_CPU_KM=y
-# CONFIG_CLEANCACHE is not set
-CONFIG_TICK_ONESHOT=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-CONFIG_LD_SCRIPT_DYN=y
-CONFIG_BINFMT_ELF=y
-CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
-CONFIG_HAVE_AOUT=y
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_MISC=m
-CONFIG_HOSTFS=y
-# CONFIG_HPPFS is not set
-CONFIG_MCONSOLE=y
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_KERNEL_STACK_ORDER=0
-# CONFIG_MMAPPER is not set
-CONFIG_NO_DMA=y
-
-#
-# General setup
-#
-CONFIG_EXPERIMENTAL=y
-CONFIG_BROKEN_ON_SMP=y
-CONFIG_INIT_ENV_ARG_LIMIT=128
-CONFIG_CROSS_COMPILE=""
-CONFIG_LOCALVERSION=""
-CONFIG_LOCALVERSION_AUTO=y
-CONFIG_DEFAULT_HOSTNAME="(none)"
-CONFIG_SWAP=y
-CONFIG_SYSVIPC=y
-CONFIG_SYSVIPC_SYSCTL=y
-CONFIG_POSIX_MQUEUE=y
-CONFIG_POSIX_MQUEUE_SYSCTL=y
-CONFIG_BSD_PROCESS_ACCT=y
-# CONFIG_BSD_PROCESS_ACCT_V3 is not set
-# CONFIG_FHANDLE is not set
-# CONFIG_TASKSTATS is not set
-# CONFIG_AUDIT is not set
-CONFIG_HAVE_GENERIC_HARDIRQS=y
-
-#
-# IRQ subsystem
-#
-CONFIG_GENERIC_HARDIRQS=y
-CONFIG_GENERIC_IRQ_SHOW=y
-
-#
-# RCU Subsystem
-#
-CONFIG_TINY_RCU=y
-# CONFIG_PREEMPT_RCU is not set
-# CONFIG_RCU_TRACE is not set
-# CONFIG_TREE_RCU_TRACE is not set
-CONFIG_IKCONFIG=y
-CONFIG_IKCONFIG_PROC=y
-CONFIG_LOG_BUF_SHIFT=14
-CONFIG_CGROUPS=y
-# CONFIG_CGROUP_DEBUG is not set
-CONFIG_CGROUP_FREEZER=y
-CONFIG_CGROUP_DEVICE=y
-CONFIG_CPUSETS=y
-CONFIG_PROC_PID_CPUSET=y
-CONFIG_CGROUP_CPUACCT=y
-CONFIG_RESOURCE_COUNTERS=y
-CONFIG_CGROUP_MEMCG=y
-CONFIG_CGROUP_MEMCG_SWAP=y
-# CONFIG_CGROUP_MEMCG_SWAP_ENABLED is not set
-# CONFIG_CGROUP_MEMCG_KMEM is not set
-CONFIG_CGROUP_SCHED=y
-CONFIG_FAIR_GROUP_SCHED=y
-# CONFIG_CFS_BANDWIDTH is not set
-# CONFIG_RT_GROUP_SCHED is not set
-CONFIG_BLK_CGROUP=y
-# CONFIG_DEBUG_BLK_CGROUP is not set
-# CONFIG_CHECKPOINT_RESTORE is not set
-CONFIG_NAMESPACES=y
-CONFIG_UTS_NS=y
-CONFIG_IPC_NS=y
-# CONFIG_USER_NS is not set
-# CONFIG_PID_NS is not set
-CONFIG_NET_NS=y
-# CONFIG_SCHED_AUTOGROUP is not set
-CONFIG_MM_OWNER=y
-CONFIG_SYSFS_DEPRECATED=y
-# CONFIG_SYSFS_DEPRECATED_V2 is not set
-# CONFIG_RELAY is not set
-# CONFIG_BLK_DEV_INITRD is not set
-CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_SYSCTL=y
-CONFIG_ANON_INODES=y
-# CONFIG

[uml-devel] [PATCH 2/8] um: Do not use SUBARCH

2013-08-21 Thread Richard Weinberger
>From now on UML does no longer depend on SUBARCH and will
never silently change CONFIG_64BIT.

"make defconfig ARCH=um" produces now a .config with is suitable
for your host arch.

"make i386_defconfig ARCH=um" replaces "make defconfig ARCH=um SUBARCH=i386"
"and make x86_64_defconfig ARCH=um" replaces "make defconfig ARCH=um 
SUBARCH=x86_64"

Finally a "make ARCH=um" will produce an UML as described in your .config and 
you
don't have to worry about setting the correct SUBARCH.

This patch is based on: https://lkml.org/lkml/2013/7/4/396

Cc: Ramkumar Ramachandra 
Signed-off-by: Richard Weinberger 
---
 arch/um/Kconfig.common |  4 
 arch/um/Makefile   | 21 +++--
 arch/x86/Makefile.um   |  2 +-
 arch/x86/um/Kconfig|  6 +++---
 4 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common
index bceee66..a7ef0b4 100644
--- a/arch/um/Kconfig.common
+++ b/arch/um/Kconfig.common
@@ -58,7 +58,3 @@ config GENERIC_BUG
 config HZ
int
default 100
-
-config SUBARCH
-   string
-   option env="SUBARCH"
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 133f7de..5bc7892 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -8,6 +8,8 @@
 
 ARCH_DIR := arch/um
 OS := $(shell uname -s)
+OS_ARCH := $(shell uname -m)
+
 # We require bash because the vmlinux link and loader script cpp use bash
 # features.
 SHELL := /bin/bash
@@ -20,15 +22,14 @@ core-y  += $(ARCH_DIR)/kernel/  
\
 
 MODE_INCLUDE   += -I$(srctree)/$(ARCH_DIR)/include/shared/skas
 
-HEADER_ARCH:= $(SUBARCH)
-
-# Additional ARCH settings for x86
-ifeq ($(SUBARCH),i386)
-HEADER_ARCH := x86
-endif
-ifeq ($(SUBARCH),x86_64)
-HEADER_ARCH := x86
-   KBUILD_CFLAGS += -mcmodel=large
+# Currently we support only i386 and x86_64, if you port UML to another arch
+# add another if branch...
+ifeq ($(OS_ARCH),x86_64)
+   HEADER_ARCH := x86
+   KBUILD_DEFCONFIG := x86_64_defconfig
+else
+   HEADER_ARCH := x86
+   KBUILD_DEFCONFIG := i386_defconfig
 endif
 
 HOST_DIR := arch/$(HEADER_ARCH)
@@ -155,4 +156,4 @@ endef
 include/generated/user_constants.h: $(HOST_DIR)/um/user-offsets.s
$(call filechk,gen-asm-offsets)
 
-export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS DEV_NULL_PATH
+export USER_CFLAGS CFLAGS_NO_HARDENING OS DEV_NULL_PATH
diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um
index 36b62bc..91d088c 100644
--- a/arch/x86/Makefile.um
+++ b/arch/x86/Makefile.um
@@ -40,7 +40,7 @@ else
 
 START := 0x6000
 
-KBUILD_CFLAGS += -fno-builtin -m64 
+KBUILD_CFLAGS += -fno-builtin -m64 -mcmodel=large
 
 CHECKFLAGS  += -m64 -D__x86_64__
 KBUILD_AFLAGS += -m64
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
index 14ef8d1..bb6df67 100644
--- a/arch/x86/um/Kconfig
+++ b/arch/x86/um/Kconfig
@@ -1,4 +1,4 @@
-mainmenu "User Mode Linux/$SUBARCH $KERNELVERSION Kernel Configuration"
+mainmenu "User Mode Linux $KERNELVERSION Kernel Configuration"
 
 source "arch/um/Kconfig.common"
 
@@ -15,8 +15,8 @@ config UML_X86
select GENERIC_FIND_FIRST_BIT
 
 config 64BIT
-   bool "64-bit kernel" if SUBARCH = "x86"
-   default SUBARCH != "i386"
+   bool "64-bit kernel"
+   default n
 
 config X86_32
def_bool !64BIT
-- 
1.8.1.4


--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] [RFC] Get rid of SUBARCH

2013-08-21 Thread Richard Weinberger
This series is an attempt to remove the SUBARCH make parameter.
It as introduced at the times of Linux 2.5 for UML to tell the UML
build system what the real architecture is.

But we actually don't need SUBARCH, we can store this information
in the .config file.
i386_defconfig will produce a kernel for x86, and x86_64_defconfig
for x86_64. There is no need to specify SUBARCH.
With this patchset applied you can build UML always with "make linux ARCH=um"
and it will produce the an image for the architecture specified in your .config.
Currenlty "make linux ARCH=um" will alter your .config to match the detected 
SUBARCH
whith sucks and causes problems on automated build systems.

The series touches also m68k, sh, mips and unicore32.
These architectures magically select a cross compiler if ARCH != SUBARCH.
Do really need that behavior?

[PATCH 1/8] um: Create defconfigs for i386 and x86_64
[PATCH 2/8] um: Do not use SUBARCH
[PATCH 3/8] um: Remove old defconfig
[PATCH 4/8] m68k: Do not use SUBARCH
[PATCH 5/8] sh: Do not use SUBARCH
[PATCH 6/8] mips: Do not use SUBARCH
[PATCH 7/8] unicore32: Do not use SUBARCH
[PATCH 8/8] Makefile: Remove SUBARCH

Thanks,
//richard

--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] [PATCH 1/8] um: Create defconfigs for i386 and x86_64

2013-08-21 Thread Richard Weinberger
Instead of having one defconfig for both i386 and x86_64
we have now two.
This is the first step to get rid of SUBARCH.

This patch is based on: https://lkml.org/lkml/2013/7/4/396

Cc: Ramkumar Ramachandra 
Signed-off-by: Richard Weinberger 
---
 arch/um/configs/i386_defconfig   | 954 +++
 arch/um/configs/x86_64_defconfig | 943 ++
 2 files changed, 1897 insertions(+)
 create mode 100644 arch/um/configs/i386_defconfig
 create mode 100644 arch/um/configs/x86_64_defconfig

diff --git a/arch/um/configs/i386_defconfig b/arch/um/configs/i386_defconfig
new file mode 100644
index 000..488ac2a
--- /dev/null
+++ b/arch/um/configs/i386_defconfig
@@ -0,0 +1,954 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# User Mode Linux 3.9.0-rc6 Kernel Configuration
+#
+CONFIG_DEFCONFIG_LIST="arch/$ARCH/defconfig"
+CONFIG_UML=y
+CONFIG_MMU=y
+CONFIG_NO_IOMEM=y
+# CONFIG_TRACE_IRQFLAGS_SUPPORT is not set
+CONFIG_LOCKDEP_SUPPORT=y
+# CONFIG_STACKTRACE_SUPPORT is not set
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_BUG=y
+CONFIG_HZ=100
+
+#
+# UML-specific options
+#
+
+#
+# Host processor type and features
+#
+# CONFIG_M486 is not set
+# CONFIG_M586 is not set
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+CONFIG_M686=y
+# CONFIG_MPENTIUMII is not set
+# CONFIG_MPENTIUMIII is not set
+# CONFIG_MPENTIUMM is not set
+# CONFIG_MPENTIUM4 is not set
+# CONFIG_MK6 is not set
+# CONFIG_MK7 is not set
+# CONFIG_MK8 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MEFFICEON is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MELAN is not set
+# CONFIG_MGEODEGX1 is not set
+# CONFIG_MGEODE_LX is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MVIAC3_2 is not set
+# CONFIG_MVIAC7 is not set
+# CONFIG_MPSC is not set
+# CONFIG_MCORE2 is not set
+# CONFIG_MATOM is not set
+# CONFIG_GENERIC_CPU is not set
+# CONFIG_X86_GENERIC is not set
+CONFIG_X86_INTERNODE_CACHE_SHIFT=5
+CONFIG_X86_L1_CACHE_SHIFT=5
+# CONFIG_X86_PPRO_FENCE is not set
+CONFIG_X86_USE_PPRO_CHECKSUM=y
+CONFIG_X86_TSC=y
+CONFIG_X86_CMPXCHG64=y
+CONFIG_X86_CMOV=y
+CONFIG_X86_MINIMUM_CPU_FAMILY=5
+CONFIG_CPU_SUP_INTEL=y
+CONFIG_CPU_SUP_AMD=y
+CONFIG_CPU_SUP_CENTAUR=y
+CONFIG_CPU_SUP_TRANSMETA_32=y
+CONFIG_UML_X86=y
+# CONFIG_64BIT is not set
+CONFIG_X86_32=y
+# CONFIG_X86_64 is not set
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_3_LEVEL_PGTABLES is not set
+CONFIG_ARCH_HAS_SC_SIGNALS=y
+CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA=y
+CONFIG_GENERIC_HWEIGHT=y
+# CONFIG_STATIC_LINK is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_COMPACTION is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+# CONFIG_KSM is not set
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+CONFIG_CROSS_MEMORY_ATTACH=y
+CONFIG_NEED_PER_CPU_KM=y
+# CONFIG_CLEANCACHE is not set
+# CONFIG_FRONTSWAP is not set
+CONFIG_LD_SCRIPT_DYN=y
+CONFIG_BINFMT_ELF=y
+CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
+CONFIG_HAVE_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_MISC=m
+CONFIG_COREDUMP=y
+CONFIG_HOSTFS=y
+# CONFIG_HPPFS is not set
+CONFIG_MCONSOLE=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_KERNEL_STACK_ORDER=1
+# CONFIG_MMAPPER is not set
+CONFIG_NO_DMA=y
+CONFIG_IRQ_WORK=y
+
+#
+# General setup
+#
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=128
+CONFIG_CROSS_COMPILE=""
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_DEFAULT_HOSTNAME="(none)"
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_POSIX_MQUEUE_SYSCTL=y
+# CONFIG_FHANDLE is not set
+# CONFIG_AUDIT is not set
+CONFIG_HAVE_GENERIC_HARDIRQS=y
+
+#
+# IRQ subsystem
+#
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_SHOW=y
+# CONFIG_ALWAYS_USE_PERSISTENT_CLOCK is not set
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+
+#
+# Timers subsystem
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+
+#
+# CPU/Task time and stats accounting
+#
+CONFIG_TICK_CPU_ACCOUNTING=y
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+# CONFIG_TASKSTATS is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_TINY_RCU=y
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_RCU_STALL_COMMON is not set
+# CONFIG_TREE_RCU_TRACE is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_CGROUPS=y
+# CONFIG_CGROUP_DEBUG is not set
+CONFIG_CGROUP_FREEZER=y
+CONFIG_CGROUP_DEVICE=y
+CONFIG_CPUSETS=y
+CONFIG_PROC_PID_CPUSET=y
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_RESOURCE_COUNTERS=y
+# CONFIG_MEMCG is not set
+CONFIG_CGROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_CFS_BANDWIDTH is not set
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_BLK_CGROUP=y
+# CONFIG_DEBUG_BLK_CGROUP is not set
+# CONFIG_CHECKPOINT_RESTORE is not set
+CONFIG_NAMESPACES=y
+CONFIG_UTS_NS=y
+CONFIG_IPC_NS=y
+# CONFIG_USER_NS i

Re: [uml-devel] [RFC] Get rid of SUBARCH

2013-08-21 Thread H. Peter Anvin
If ARCH doesn't match uname for some definition of match?

Thorsten Glaser  wrote:
>On Wed, 21 Aug 2013, Richard Weinberger wrote:
>
>> The series touches also m68k, sh, mips and unicore32.
>> These architectures magically select a cross compiler if ARCH !=
>SUBARCH.
>> Do really need that behavior?
>
>Not precisely that, but it’s very common in m68k land
>to just cross-build kernels with
>
>$ make ARCH=m68k menuconfig
>$ make ARCH=m68k
>
>Maybe a generalising of that feature, and making it
>independent of SUBARCH (which can then die)?
>
>bye,
>//mirabilos

-- 
Sent from my mobile phone. Please excuse brevity and lack of formatting.

--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] [PATCH 7/8] unicore32: Do not use SUBARCH

2013-08-21 Thread Richard Weinberger
Forces the user to specify CROSS_COMPILE at compile time instead
of automatically selecting more or less randomly a cross compiler

Signed-off-by: Richard Weinberger 
---
 arch/unicore32/Makefile | 5 -
 1 file changed, 5 deletions(-)

diff --git a/arch/unicore32/Makefile b/arch/unicore32/Makefile
index b6f5c4c..fae00c8 100644
--- a/arch/unicore32/Makefile
+++ b/arch/unicore32/Makefile
@@ -10,11 +10,6 @@
 #
 # Copyright (C) 2002~2010 by Guan Xue-tao
 #
-ifneq ($(SUBARCH),$(ARCH))
-   ifeq ($(CROSS_COMPILE),)
-   CROSS_COMPILE := $(call cc-cross-prefix, unicore32-linux-)
-   endif
-endif
 
 LDFLAGS_vmlinux:= -p --no-undefined -X
 
-- 
1.8.1.4


--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] [RFC] Get rid of SUBARCH

2013-08-21 Thread Geert Uytterhoeven
On Wed, Aug 21, 2013 at 10:19 AM, Richard Weinberger  wrote:
> This series is an attempt to remove the SUBARCH make parameter.
> It as introduced at the times of Linux 2.5 for UML to tell the UML
> build system what the real architecture is.
>
> But we actually don't need SUBARCH, we can store this information
> in the .config file.

Haha, now you have OS_ARCH (shouldn't that be called HOST_ARCH?) instead,
which is available only for UM?

> The series touches also m68k, sh, mips and unicore32.
> These architectures magically select a cross compiler if ARCH != SUBARCH.
> Do really need that behavior?

This does remove functionality.
It allows to build a kernel using e.g. "make ARCH=m68k".

Perhaps this can be moved to generic code? Most (not all!) cross-toolchains
are called $ARCH-{unknown-,}linux{,-gnu}.
Exceptions are e.g. am33_2.0-linux and bfin-uclinux.

> [PATCH 1/8] um: Create defconfigs for i386 and x86_64
> [PATCH 3/8] um: Remove old defconfig

Why not merge these two, so git copy/rename detection will show only the real
changes?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] [PATCH 4/8] m68k: Do not use SUBARCH

2013-08-21 Thread Richard Weinberger
Forces the user to specify CROSS_COMPILE at compile time instead
of automatically selecting more or less randomly a cross compiler.

Signed-off-by: Richard Weinberger 
---
 arch/m68k/Makefile | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index 7f7830f..3bd6355 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -16,13 +16,6 @@
 
 KBUILD_DEFCONFIG := multi_defconfig
 
-ifneq ($(SUBARCH),$(ARCH))
-   ifeq ($(CROSS_COMPILE),)
-   CROSS_COMPILE := $(call cc-cross-prefix, \
-   m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
-   endif
-endif
-
 #
 #  Enable processor type. Ordering of these is important - we want to
 #  use the minimum processor type of the range we support. The logic
-- 
1.8.1.4


--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel