linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/
@ 2015-06-03 16:59 Ingo Molnar
  2015-06-03 16:59 ` [PATCH 1/7] x86/asm/entry: Move entry_64.S and entry_32.S to arch/x86/entry/ Ingo Molnar
                   ` (8 more replies)
  0 siblings, 9 replies; 26+ messages in thread
From: Ingo Molnar @ 2015-06-03 16:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andy Lutomirski, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, H. Peter Anvin, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner

So the x86 syscall/irq/etc. entry code is scattered in
over 40 files all over the x86 architecture, making it
hard to get a good overview of the code and its current
status.

Move all the files to arch/x86/entry/.

This first step is as-is, no file names were changed - but the next
step will be to organize things in a bit more maintainable fashion.

If there are no fundamental objections then I'll commit this to
tip:x86/asm. (I've drained most of the pending patches to these
files - but porting them should be easy in any case.)

Thanks,

    Ingo

=========>

Ingo Molnar (7):
  x86/asm/entry: Move entry_64.S and entry_32.S to arch/x86/entry/
  x86/asm/entry: Move the compat syscall entry code to arch/x86/entry/
  x86/asm/entry, x86/vdso: Move the vDSO code to arch/x86/entry/vdso/
  x86/asm/entry: Move the 'thunk' functions to arch/x86/entry/
  x86/asm/entry: Move arch/x86/include/asm/calling.h to arch/x86/entry/
  x86/asm/entry: Move the arch/x86/syscalls/ definitions to arch/x86/entry/syscalls/
  x86/asm/entry: Move the vsyscall code to arch/x86/entry/vsyscall/

 MAINTAINERS                                           |  2 +-
 arch/x86/Kbuild                                       |  5 ++++-
 arch/x86/Makefile                                     |  4 ++--
 arch/x86/entry/Makefile                               | 10 ++++++++++
 arch/x86/{include/asm => entry}/calling.h             |  0
 arch/x86/{kernel => entry}/entry_32.S                 |  0
 arch/x86/{kernel => entry}/entry_64.S                 |  2 +-
 arch/x86/{ia32 => entry}/ia32entry.S                  |  2 +-
 arch/x86/{kernel => entry}/syscall_32.c               |  0
 arch/x86/{kernel => entry}/syscall_64.c               |  0
 arch/x86/{ => entry}/syscalls/Makefile                |  4 ++--
 arch/x86/{ => entry}/syscalls/syscall_32.tbl          |  0
 arch/x86/{ => entry}/syscalls/syscall_64.tbl          |  0
 arch/x86/{ => entry}/syscalls/syscallhdr.sh           |  0
 arch/x86/{ => entry}/syscalls/syscalltbl.sh           |  0
 arch/x86/{lib => entry}/thunk_32.S                    |  0
 arch/x86/{lib => entry}/thunk_64.S                    |  2 +-
 arch/x86/{ => entry}/vdso/.gitignore                  |  0
 arch/x86/{ => entry}/vdso/Makefile                    |  0
 arch/x86/{ => entry}/vdso/checkundef.sh               |  0
 arch/x86/{ => entry}/vdso/vclock_gettime.c            |  0
 arch/x86/{ => entry}/vdso/vdso-layout.lds.S           |  0
 arch/x86/{ => entry}/vdso/vdso-note.S                 |  0
 arch/x86/{ => entry}/vdso/vdso.lds.S                  |  0
 arch/x86/{ => entry}/vdso/vdso2c.c                    |  0
 arch/x86/{ => entry}/vdso/vdso2c.h                    |  0
 arch/x86/{ => entry}/vdso/vdso32-setup.c              |  0
 arch/x86/{ => entry}/vdso/vdso32/.gitignore           |  0
 arch/x86/{ => entry}/vdso/vdso32/int80.S              |  0
 arch/x86/{ => entry}/vdso/vdso32/note.S               |  0
 arch/x86/{ => entry}/vdso/vdso32/sigreturn.S          |  0
 arch/x86/{ => entry}/vdso/vdso32/syscall.S            |  0
 arch/x86/{ => entry}/vdso/vdso32/sysenter.S           |  0
 arch/x86/{ => entry}/vdso/vdso32/vclock_gettime.c     |  0
 arch/x86/{ => entry}/vdso/vdso32/vdso-fakesections.c  |  0
 arch/x86/{ => entry}/vdso/vdso32/vdso32.lds.S         |  0
 arch/x86/{ => entry}/vdso/vdsox32.lds.S               |  0
 arch/x86/{ => entry}/vdso/vgetcpu.c                   |  0
 arch/x86/{ => entry}/vdso/vma.c                       |  0
 arch/x86/entry/vsyscall/Makefile                      |  7 +++++++
 arch/x86/{kernel => entry/vsyscall}/vsyscall_64.c     |  0
 arch/x86/{kernel => entry/vsyscall}/vsyscall_emu_64.S |  0
 arch/x86/{kernel => entry/vsyscall}/vsyscall_gtod.c   |  0
 arch/x86/{kernel => entry/vsyscall}/vsyscall_trace.h  |  2 +-
 arch/x86/ia32/Makefile                                |  2 +-
 arch/x86/kernel/Makefile                              |  5 +----
 arch/x86/lib/Makefile                                 |  1 -
 scripts/checksyscalls.sh                              |  2 +-
 48 files changed, 33 insertions(+), 17 deletions(-)
 create mode 100644 arch/x86/entry/Makefile
 rename arch/x86/{include/asm => entry}/calling.h (100%)
 rename arch/x86/{kernel => entry}/entry_32.S (100%)
 rename arch/x86/{kernel => entry}/entry_64.S (99%)
 rename arch/x86/{ia32 => entry}/ia32entry.S (99%)
 rename arch/x86/{kernel => entry}/syscall_32.c (100%)
 rename arch/x86/{kernel => entry}/syscall_64.c (100%)
 rename arch/x86/{ => entry}/syscalls/Makefile (95%)
 rename arch/x86/{ => entry}/syscalls/syscall_32.tbl (100%)
 rename arch/x86/{ => entry}/syscalls/syscall_64.tbl (100%)
 rename arch/x86/{ => entry}/syscalls/syscallhdr.sh (100%)
 rename arch/x86/{ => entry}/syscalls/syscalltbl.sh (100%)
 rename arch/x86/{lib => entry}/thunk_32.S (100%)
 rename arch/x86/{lib => entry}/thunk_64.S (98%)
 rename arch/x86/{ => entry}/vdso/.gitignore (100%)
 rename arch/x86/{ => entry}/vdso/Makefile (100%)
 rename arch/x86/{ => entry}/vdso/checkundef.sh (100%)
 rename arch/x86/{ => entry}/vdso/vclock_gettime.c (100%)
 rename arch/x86/{ => entry}/vdso/vdso-layout.lds.S (100%)
 rename arch/x86/{ => entry}/vdso/vdso-note.S (100%)
 rename arch/x86/{ => entry}/vdso/vdso.lds.S (100%)
 rename arch/x86/{ => entry}/vdso/vdso2c.c (100%)
 rename arch/x86/{ => entry}/vdso/vdso2c.h (100%)
 rename arch/x86/{ => entry}/vdso/vdso32-setup.c (100%)
 rename arch/x86/{ => entry}/vdso/vdso32/.gitignore (100%)
 rename arch/x86/{ => entry}/vdso/vdso32/int80.S (100%)
 rename arch/x86/{ => entry}/vdso/vdso32/note.S (100%)
 rename arch/x86/{ => entry}/vdso/vdso32/sigreturn.S (100%)
 rename arch/x86/{ => entry}/vdso/vdso32/syscall.S (100%)
 rename arch/x86/{ => entry}/vdso/vdso32/sysenter.S (100%)
 rename arch/x86/{ => entry}/vdso/vdso32/vclock_gettime.c (100%)
 rename arch/x86/{ => entry}/vdso/vdso32/vdso-fakesections.c (100%)
 rename arch/x86/{ => entry}/vdso/vdso32/vdso32.lds.S (100%)
 rename arch/x86/{ => entry}/vdso/vdsox32.lds.S (100%)
 rename arch/x86/{ => entry}/vdso/vgetcpu.c (100%)
 rename arch/x86/{ => entry}/vdso/vma.c (100%)
 create mode 100644 arch/x86/entry/vsyscall/Makefile
 rename arch/x86/{kernel => entry/vsyscall}/vsyscall_64.c (100%)
 rename arch/x86/{kernel => entry/vsyscall}/vsyscall_emu_64.S (100%)
 rename arch/x86/{kernel => entry/vsyscall}/vsyscall_gtod.c (100%)
 rename arch/x86/{kernel => entry/vsyscall}/vsyscall_trace.h (89%)

-- 
2.1.4


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 1/7] x86/asm/entry: Move entry_64.S and entry_32.S to arch/x86/entry/
  2015-06-03 16:59 [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/ Ingo Molnar
@ 2015-06-03 16:59 ` Ingo Molnar
  2015-06-03 16:59 ` [PATCH 2/7] x86/asm/entry: Move the compat syscall entry code " Ingo Molnar
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 26+ messages in thread
From: Ingo Molnar @ 2015-06-03 16:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andy Lutomirski, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, H. Peter Anvin, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner

Create a new directory hierarchy for the low level x86 entry code:

    arch/x86/entry/*

This will host all the low level glue that is currently scattered
all across arch/x86/.

Start with entry_64.S and entry_32.S.

Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/Kbuild                       | 3 +++
 arch/x86/entry/Makefile               | 4 ++++
 arch/x86/{kernel => entry}/entry_32.S | 0
 arch/x86/{kernel => entry}/entry_64.S | 0
 arch/x86/kernel/Makefile              | 2 +-
 5 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/x86/Kbuild b/arch/x86/Kbuild
index 3942f74c92d7..b9b816277e72 100644
--- a/arch/x86/Kbuild
+++ b/arch/x86/Kbuild
@@ -1,3 +1,6 @@
+
+obj-y += entry/
+
 obj-$(CONFIG_KVM) += kvm/
 
 # Xen paravirtualization support
diff --git a/arch/x86/entry/Makefile b/arch/x86/entry/Makefile
new file mode 100644
index 000000000000..fa7e0cf6d3c4
--- /dev/null
+++ b/arch/x86/entry/Makefile
@@ -0,0 +1,4 @@
+#
+# Makefile for the x86 low level entry code
+#
+obj-y			:= entry_$(BITS).o
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/entry/entry_32.S
similarity index 100%
rename from arch/x86/kernel/entry_32.S
rename to arch/x86/entry/entry_32.S
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/entry/entry_64.S
similarity index 100%
rename from arch/x86/kernel/entry_64.S
rename to arch/x86/entry/entry_64.S
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 9bcd0b56ca17..9d3ee054453d 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -22,7 +22,7 @@ KASAN_SANITIZE_dumpstack_$(BITS).o := n
 
 CFLAGS_irq.o := -I$(src)/../include/asm/trace
 
-obj-y			:= process_$(BITS).o signal.o entry_$(BITS).o
+obj-y			:= process_$(BITS).o signal.o
 obj-y			+= traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
 obj-y			+= time.o ioport.o ldt.o dumpstack.o nmi.o
 obj-y			+= setup.o x86_init.o i8259.o irqinit.o jump_label.o
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 2/7] x86/asm/entry: Move the compat syscall entry code to arch/x86/entry/
  2015-06-03 16:59 [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/ Ingo Molnar
  2015-06-03 16:59 ` [PATCH 1/7] x86/asm/entry: Move entry_64.S and entry_32.S to arch/x86/entry/ Ingo Molnar
@ 2015-06-03 16:59 ` Ingo Molnar
  2015-06-03 17:04   ` Andy Lutomirski
  2015-06-03 16:59 ` [PATCH 3/7] x86/asm/entry, x86/vdso: Move the vDSO code to arch/x86/entry/vdso/ Ingo Molnar
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 26+ messages in thread
From: Ingo Molnar @ 2015-06-03 16:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andy Lutomirski, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, H. Peter Anvin, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner

Move the ia32entry.S file over into arch/x86/entry/.

Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/entry/Makefile              | 5 ++++-
 arch/x86/{ia32 => entry}/ia32entry.S | 0
 arch/x86/ia32/Makefile               | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/x86/entry/Makefile b/arch/x86/entry/Makefile
index fa7e0cf6d3c4..4a626594fa79 100644
--- a/arch/x86/entry/Makefile
+++ b/arch/x86/entry/Makefile
@@ -1,4 +1,7 @@
 #
 # Makefile for the x86 low level entry code
 #
-obj-y			:= entry_$(BITS).o
+obj-y				:= entry_$(BITS).o
+
+obj-$(CONFIG_IA32_EMULATION)	+= ia32entry.o
+
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/entry/ia32entry.S
similarity index 100%
rename from arch/x86/ia32/ia32entry.S
rename to arch/x86/entry/ia32entry.S
diff --git a/arch/x86/ia32/Makefile b/arch/x86/ia32/Makefile
index bb635c641869..cd4339bae066 100644
--- a/arch/x86/ia32/Makefile
+++ b/arch/x86/ia32/Makefile
@@ -2,7 +2,7 @@
 # Makefile for the ia32 kernel emulation subsystem.
 #
 
-obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_signal.o
+obj-$(CONFIG_IA32_EMULATION) := sys_ia32.o ia32_signal.o
 
 obj-$(CONFIG_IA32_AOUT) += ia32_aout.o
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 3/7] x86/asm/entry, x86/vdso: Move the vDSO code to arch/x86/entry/vdso/
  2015-06-03 16:59 [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/ Ingo Molnar
  2015-06-03 16:59 ` [PATCH 1/7] x86/asm/entry: Move entry_64.S and entry_32.S to arch/x86/entry/ Ingo Molnar
  2015-06-03 16:59 ` [PATCH 2/7] x86/asm/entry: Move the compat syscall entry code " Ingo Molnar
@ 2015-06-03 16:59 ` Ingo Molnar
  2015-06-03 17:05   ` Andy Lutomirski
  2015-06-03 16:59 ` [PATCH 4/7] x86/asm/entry: Move the 'thunk' functions to arch/x86/entry/ Ingo Molnar
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 26+ messages in thread
From: Ingo Molnar @ 2015-06-03 16:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andy Lutomirski, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, H. Peter Anvin, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner

Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 MAINTAINERS                                          | 2 +-
 arch/x86/Kbuild                                      | 2 +-
 arch/x86/Makefile                                    | 2 +-
 arch/x86/entry/Makefile                              | 2 ++
 arch/x86/{ => entry}/vdso/.gitignore                 | 0
 arch/x86/{ => entry}/vdso/Makefile                   | 0
 arch/x86/{ => entry}/vdso/checkundef.sh              | 0
 arch/x86/{ => entry}/vdso/vclock_gettime.c           | 0
 arch/x86/{ => entry}/vdso/vdso-layout.lds.S          | 0
 arch/x86/{ => entry}/vdso/vdso-note.S                | 0
 arch/x86/{ => entry}/vdso/vdso.lds.S                 | 0
 arch/x86/{ => entry}/vdso/vdso2c.c                   | 0
 arch/x86/{ => entry}/vdso/vdso2c.h                   | 0
 arch/x86/{ => entry}/vdso/vdso32-setup.c             | 0
 arch/x86/{ => entry}/vdso/vdso32/.gitignore          | 0
 arch/x86/{ => entry}/vdso/vdso32/int80.S             | 0
 arch/x86/{ => entry}/vdso/vdso32/note.S              | 0
 arch/x86/{ => entry}/vdso/vdso32/sigreturn.S         | 0
 arch/x86/{ => entry}/vdso/vdso32/syscall.S           | 0
 arch/x86/{ => entry}/vdso/vdso32/sysenter.S          | 0
 arch/x86/{ => entry}/vdso/vdso32/vclock_gettime.c    | 0
 arch/x86/{ => entry}/vdso/vdso32/vdso-fakesections.c | 0
 arch/x86/{ => entry}/vdso/vdso32/vdso32.lds.S        | 0
 arch/x86/{ => entry}/vdso/vdsox32.lds.S              | 0
 arch/x86/{ => entry}/vdso/vgetcpu.c                  | 0
 arch/x86/{ => entry}/vdso/vma.c                      | 0
 26 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index f8e0afb708b4..68c0cc365432 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10892,7 +10892,7 @@ M:	Andy Lutomirski <luto@amacapital.net>
 L:	linux-kernel@vger.kernel.org
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/vdso
 S:	Maintained
-F:	arch/x86/vdso/
+F:	arch/x86/entry/vdso/
 
 XC2028/3028 TUNER DRIVER
 M:	Mauro Carvalho Chehab <mchehab@osg.samsung.com>
diff --git a/arch/x86/Kbuild b/arch/x86/Kbuild
index b9b816277e72..1538562cc720 100644
--- a/arch/x86/Kbuild
+++ b/arch/x86/Kbuild
@@ -14,7 +14,7 @@ obj-y += kernel/
 obj-y += mm/
 
 obj-y += crypto/
-obj-y += vdso/
+
 obj-$(CONFIG_IA32_EMULATION) += ia32/
 
 obj-y += platform/
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 43e8328a23e4..90b1c3bfec46 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -244,7 +244,7 @@ PHONY += install
 
 PHONY += vdso_install
 vdso_install:
-	$(Q)$(MAKE) $(build)=arch/x86/vdso $@
+	$(Q)$(MAKE) $(build)=arch/x86/entry/vdso $@
 
 archclean:
 	$(Q)rm -rf $(objtree)/arch/i386
diff --git a/arch/x86/entry/Makefile b/arch/x86/entry/Makefile
index 4a626594fa79..c97532492ef5 100644
--- a/arch/x86/entry/Makefile
+++ b/arch/x86/entry/Makefile
@@ -3,5 +3,7 @@
 #
 obj-y				:= entry_$(BITS).o
 
+obj-y				+= vdso/
+
 obj-$(CONFIG_IA32_EMULATION)	+= ia32entry.o
 
diff --git a/arch/x86/vdso/.gitignore b/arch/x86/entry/vdso/.gitignore
similarity index 100%
rename from arch/x86/vdso/.gitignore
rename to arch/x86/entry/vdso/.gitignore
diff --git a/arch/x86/vdso/Makefile b/arch/x86/entry/vdso/Makefile
similarity index 100%
rename from arch/x86/vdso/Makefile
rename to arch/x86/entry/vdso/Makefile
diff --git a/arch/x86/vdso/checkundef.sh b/arch/x86/entry/vdso/checkundef.sh
similarity index 100%
rename from arch/x86/vdso/checkundef.sh
rename to arch/x86/entry/vdso/checkundef.sh
diff --git a/arch/x86/vdso/vclock_gettime.c b/arch/x86/entry/vdso/vclock_gettime.c
similarity index 100%
rename from arch/x86/vdso/vclock_gettime.c
rename to arch/x86/entry/vdso/vclock_gettime.c
diff --git a/arch/x86/vdso/vdso-layout.lds.S b/arch/x86/entry/vdso/vdso-layout.lds.S
similarity index 100%
rename from arch/x86/vdso/vdso-layout.lds.S
rename to arch/x86/entry/vdso/vdso-layout.lds.S
diff --git a/arch/x86/vdso/vdso-note.S b/arch/x86/entry/vdso/vdso-note.S
similarity index 100%
rename from arch/x86/vdso/vdso-note.S
rename to arch/x86/entry/vdso/vdso-note.S
diff --git a/arch/x86/vdso/vdso.lds.S b/arch/x86/entry/vdso/vdso.lds.S
similarity index 100%
rename from arch/x86/vdso/vdso.lds.S
rename to arch/x86/entry/vdso/vdso.lds.S
diff --git a/arch/x86/vdso/vdso2c.c b/arch/x86/entry/vdso/vdso2c.c
similarity index 100%
rename from arch/x86/vdso/vdso2c.c
rename to arch/x86/entry/vdso/vdso2c.c
diff --git a/arch/x86/vdso/vdso2c.h b/arch/x86/entry/vdso/vdso2c.h
similarity index 100%
rename from arch/x86/vdso/vdso2c.h
rename to arch/x86/entry/vdso/vdso2c.h
diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/entry/vdso/vdso32-setup.c
similarity index 100%
rename from arch/x86/vdso/vdso32-setup.c
rename to arch/x86/entry/vdso/vdso32-setup.c
diff --git a/arch/x86/vdso/vdso32/.gitignore b/arch/x86/entry/vdso/vdso32/.gitignore
similarity index 100%
rename from arch/x86/vdso/vdso32/.gitignore
rename to arch/x86/entry/vdso/vdso32/.gitignore
diff --git a/arch/x86/vdso/vdso32/int80.S b/arch/x86/entry/vdso/vdso32/int80.S
similarity index 100%
rename from arch/x86/vdso/vdso32/int80.S
rename to arch/x86/entry/vdso/vdso32/int80.S
diff --git a/arch/x86/vdso/vdso32/note.S b/arch/x86/entry/vdso/vdso32/note.S
similarity index 100%
rename from arch/x86/vdso/vdso32/note.S
rename to arch/x86/entry/vdso/vdso32/note.S
diff --git a/arch/x86/vdso/vdso32/sigreturn.S b/arch/x86/entry/vdso/vdso32/sigreturn.S
similarity index 100%
rename from arch/x86/vdso/vdso32/sigreturn.S
rename to arch/x86/entry/vdso/vdso32/sigreturn.S
diff --git a/arch/x86/vdso/vdso32/syscall.S b/arch/x86/entry/vdso/vdso32/syscall.S
similarity index 100%
rename from arch/x86/vdso/vdso32/syscall.S
rename to arch/x86/entry/vdso/vdso32/syscall.S
diff --git a/arch/x86/vdso/vdso32/sysenter.S b/arch/x86/entry/vdso/vdso32/sysenter.S
similarity index 100%
rename from arch/x86/vdso/vdso32/sysenter.S
rename to arch/x86/entry/vdso/vdso32/sysenter.S
diff --git a/arch/x86/vdso/vdso32/vclock_gettime.c b/arch/x86/entry/vdso/vdso32/vclock_gettime.c
similarity index 100%
rename from arch/x86/vdso/vdso32/vclock_gettime.c
rename to arch/x86/entry/vdso/vdso32/vclock_gettime.c
diff --git a/arch/x86/vdso/vdso32/vdso-fakesections.c b/arch/x86/entry/vdso/vdso32/vdso-fakesections.c
similarity index 100%
rename from arch/x86/vdso/vdso32/vdso-fakesections.c
rename to arch/x86/entry/vdso/vdso32/vdso-fakesections.c
diff --git a/arch/x86/vdso/vdso32/vdso32.lds.S b/arch/x86/entry/vdso/vdso32/vdso32.lds.S
similarity index 100%
rename from arch/x86/vdso/vdso32/vdso32.lds.S
rename to arch/x86/entry/vdso/vdso32/vdso32.lds.S
diff --git a/arch/x86/vdso/vdsox32.lds.S b/arch/x86/entry/vdso/vdsox32.lds.S
similarity index 100%
rename from arch/x86/vdso/vdsox32.lds.S
rename to arch/x86/entry/vdso/vdsox32.lds.S
diff --git a/arch/x86/vdso/vgetcpu.c b/arch/x86/entry/vdso/vgetcpu.c
similarity index 100%
rename from arch/x86/vdso/vgetcpu.c
rename to arch/x86/entry/vdso/vgetcpu.c
diff --git a/arch/x86/vdso/vma.c b/arch/x86/entry/vdso/vma.c
similarity index 100%
rename from arch/x86/vdso/vma.c
rename to arch/x86/entry/vdso/vma.c
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 4/7] x86/asm/entry: Move the 'thunk' functions to arch/x86/entry/
  2015-06-03 16:59 [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/ Ingo Molnar
                   ` (2 preceding siblings ...)
  2015-06-03 16:59 ` [PATCH 3/7] x86/asm/entry, x86/vdso: Move the vDSO code to arch/x86/entry/vdso/ Ingo Molnar
@ 2015-06-03 16:59 ` Ingo Molnar
  2015-06-03 16:59 ` [PATCH 5/7] x86/asm/entry: Move arch/x86/include/asm/calling.h " Ingo Molnar
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 26+ messages in thread
From: Ingo Molnar @ 2015-06-03 16:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andy Lutomirski, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, H. Peter Anvin, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner

These are all calling x86 entry code functions, so move them close
to other entry code.

Change lib-y to obj-y: there's no real difference between the two
as we don't really drop any of them during the linking stage, and
obj-y is the more common approach for core kernel object code.

Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/entry/Makefile            | 3 +--
 arch/x86/{lib => entry}/thunk_32.S | 0
 arch/x86/{lib => entry}/thunk_64.S | 0
 arch/x86/lib/Makefile              | 1 -
 4 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/entry/Makefile b/arch/x86/entry/Makefile
index c97532492ef5..9df72c8a0ac2 100644
--- a/arch/x86/entry/Makefile
+++ b/arch/x86/entry/Makefile
@@ -1,8 +1,7 @@
 #
 # Makefile for the x86 low level entry code
 #
-obj-y				:= entry_$(BITS).o
-
+obj-y				:= entry_$(BITS).o thunk_$(BITS).o
 obj-y				+= vdso/
 
 obj-$(CONFIG_IA32_EMULATION)	+= ia32entry.o
diff --git a/arch/x86/lib/thunk_32.S b/arch/x86/entry/thunk_32.S
similarity index 100%
rename from arch/x86/lib/thunk_32.S
rename to arch/x86/entry/thunk_32.S
diff --git a/arch/x86/lib/thunk_64.S b/arch/x86/entry/thunk_64.S
similarity index 100%
rename from arch/x86/lib/thunk_64.S
rename to arch/x86/entry/thunk_64.S
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 982989d282ff..f2587888d987 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -17,7 +17,6 @@ clean-files := inat-tables.c
 obj-$(CONFIG_SMP) += msr-smp.o cache-smp.o
 
 lib-y := delay.o misc.o cmdline.o
-lib-y += thunk_$(BITS).o
 lib-y += usercopy_$(BITS).o usercopy.o getuser.o putuser.o
 lib-y += memcpy_$(BITS).o
 lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 5/7] x86/asm/entry: Move arch/x86/include/asm/calling.h to arch/x86/entry/
  2015-06-03 16:59 [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/ Ingo Molnar
                   ` (3 preceding siblings ...)
  2015-06-03 16:59 ` [PATCH 4/7] x86/asm/entry: Move the 'thunk' functions to arch/x86/entry/ Ingo Molnar
@ 2015-06-03 16:59 ` Ingo Molnar
  2015-06-03 16:59 ` [PATCH 6/7] x86/asm/entry: Move the arch/x86/syscalls/ definitions to arch/x86/entry/syscalls/ Ingo Molnar
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 26+ messages in thread
From: Ingo Molnar @ 2015-06-03 16:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andy Lutomirski, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, H. Peter Anvin, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner

asm/calling.h is private to the entry code, make this more apparent
by moving it to the new arch/x86/entry/ directory.

Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/{include/asm => entry}/calling.h | 0
 arch/x86/entry/entry_64.S                 | 2 +-
 arch/x86/entry/ia32entry.S                | 2 +-
 arch/x86/entry/thunk_64.S                 | 2 +-
 4 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/calling.h b/arch/x86/entry/calling.h
similarity index 100%
rename from arch/x86/include/asm/calling.h
rename to arch/x86/entry/calling.h
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index 4ad79e946f5a..f7380ea75777 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -28,7 +28,7 @@
 #include <asm/segment.h>
 #include <asm/cache.h>
 #include <asm/errno.h>
-#include <asm/calling.h>
+#include "calling.h"
 #include <asm/asm-offsets.h>
 #include <asm/msr.h>
 #include <asm/unistd.h>
diff --git a/arch/x86/entry/ia32entry.S b/arch/x86/entry/ia32entry.S
index 2be23c734db5..f16767417385 100644
--- a/arch/x86/entry/ia32entry.S
+++ b/arch/x86/entry/ia32entry.S
@@ -4,7 +4,7 @@
  * Copyright 2000-2002 Andi Kleen, SuSE Labs.
  */		 
 
-#include <asm/calling.h>
+#include "calling.h"
 #include <asm/asm-offsets.h>
 #include <asm/current.h>
 #include <asm/errno.h>
diff --git a/arch/x86/entry/thunk_64.S b/arch/x86/entry/thunk_64.S
index 10f555e435e1..3e95681b4e2d 100644
--- a/arch/x86/entry/thunk_64.S
+++ b/arch/x86/entry/thunk_64.S
@@ -6,7 +6,7 @@
  * Subject to the GNU public license, v.2. No warranty of any kind.
  */
 #include <linux/linkage.h>
-#include <asm/calling.h>
+#include "calling.h"
 #include <asm/asm.h>
 
 	/* rdi:	arg1 ... normal C conventions. rax is saved/restored. */
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 6/7] x86/asm/entry: Move the arch/x86/syscalls/ definitions to arch/x86/entry/syscalls/
  2015-06-03 16:59 [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/ Ingo Molnar
                   ` (4 preceding siblings ...)
  2015-06-03 16:59 ` [PATCH 5/7] x86/asm/entry: Move arch/x86/include/asm/calling.h " Ingo Molnar
@ 2015-06-03 16:59 ` Ingo Molnar
  2015-06-03 16:59 ` [PATCH 7/7] x86/asm/entry: Move the vsyscall code to arch/x86/entry/vsyscall/ Ingo Molnar
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 26+ messages in thread
From: Ingo Molnar @ 2015-06-03 16:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andy Lutomirski, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, H. Peter Anvin, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner

The build time generated syscall definitions are entry code related, move
them into the arch/x86/entry/ directory.

Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/Makefile                            | 2 +-
 arch/x86/{ => entry}/syscalls/Makefile       | 4 ++--
 arch/x86/{ => entry}/syscalls/syscall_32.tbl | 0
 arch/x86/{ => entry}/syscalls/syscall_64.tbl | 0
 arch/x86/{ => entry}/syscalls/syscallhdr.sh  | 0
 arch/x86/{ => entry}/syscalls/syscalltbl.sh  | 0
 scripts/checksyscalls.sh                     | 2 +-
 7 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 90b1c3bfec46..118e6debc483 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -181,7 +181,7 @@ archscripts: scripts_basic
 # Syscall table generation
 
 archheaders:
-	$(Q)$(MAKE) $(build)=arch/x86/syscalls all
+	$(Q)$(MAKE) $(build)=arch/x86/entry/syscalls all
 
 archprepare:
 ifeq ($(CONFIG_KEXEC_FILE),y)
diff --git a/arch/x86/syscalls/Makefile b/arch/x86/entry/syscalls/Makefile
similarity index 95%
rename from arch/x86/syscalls/Makefile
rename to arch/x86/entry/syscalls/Makefile
index a55abb9f6c5e..57aa59fd140c 100644
--- a/arch/x86/syscalls/Makefile
+++ b/arch/x86/entry/syscalls/Makefile
@@ -1,5 +1,5 @@
-out := $(obj)/../include/generated/asm
-uapi := $(obj)/../include/generated/uapi/asm
+out := $(obj)/../../include/generated/asm
+uapi := $(obj)/../../include/generated/uapi/asm
 
 # Create output directory if not already present
 _dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)') \
diff --git a/arch/x86/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl
similarity index 100%
rename from arch/x86/syscalls/syscall_32.tbl
rename to arch/x86/entry/syscalls/syscall_32.tbl
diff --git a/arch/x86/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl
similarity index 100%
rename from arch/x86/syscalls/syscall_64.tbl
rename to arch/x86/entry/syscalls/syscall_64.tbl
diff --git a/arch/x86/syscalls/syscallhdr.sh b/arch/x86/entry/syscalls/syscallhdr.sh
similarity index 100%
rename from arch/x86/syscalls/syscallhdr.sh
rename to arch/x86/entry/syscalls/syscallhdr.sh
diff --git a/arch/x86/syscalls/syscalltbl.sh b/arch/x86/entry/syscalls/syscalltbl.sh
similarity index 100%
rename from arch/x86/syscalls/syscalltbl.sh
rename to arch/x86/entry/syscalls/syscalltbl.sh
diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh
index 5b3add31f9f1..2c9082ba6137 100755
--- a/scripts/checksyscalls.sh
+++ b/scripts/checksyscalls.sh
@@ -212,5 +212,5 @@ EOF
     )
 }
 
-(ignore_list && syscall_list $(dirname $0)/../arch/x86/syscalls/syscall_32.tbl) | \
+(ignore_list && syscall_list $(dirname $0)/../arch/x86/entry/syscalls/syscall_32.tbl) | \
 $* -E -x c - > /dev/null
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 7/7] x86/asm/entry: Move the vsyscall code to arch/x86/entry/vsyscall/
  2015-06-03 16:59 [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/ Ingo Molnar
                   ` (5 preceding siblings ...)
  2015-06-03 16:59 ` [PATCH 6/7] x86/asm/entry: Move the arch/x86/syscalls/ definitions to arch/x86/entry/syscalls/ Ingo Molnar
@ 2015-06-03 16:59 ` Ingo Molnar
  2015-06-03 17:03 ` [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/ H. Peter Anvin
  2015-06-03 17:07 ` Andy Lutomirski
  8 siblings, 0 replies; 26+ messages in thread
From: Ingo Molnar @ 2015-06-03 16:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andy Lutomirski, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, H. Peter Anvin, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner

The vsyscall code is entry code too, so move it to arch/x86/entry/vsyscall/.

Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/entry/Makefile                               | 6 ++++--
 arch/x86/{kernel => entry}/syscall_32.c               | 0
 arch/x86/{kernel => entry}/syscall_64.c               | 0
 arch/x86/entry/vsyscall/Makefile                      | 7 +++++++
 arch/x86/{kernel => entry/vsyscall}/vsyscall_64.c     | 0
 arch/x86/{kernel => entry/vsyscall}/vsyscall_emu_64.S | 0
 arch/x86/{kernel => entry/vsyscall}/vsyscall_gtod.c   | 0
 arch/x86/{kernel => entry/vsyscall}/vsyscall_trace.h  | 2 +-
 arch/x86/kernel/Makefile                              | 3 ---
 9 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/arch/x86/entry/Makefile b/arch/x86/entry/Makefile
index 9df72c8a0ac2..b93cce1c6bb2 100644
--- a/arch/x86/entry/Makefile
+++ b/arch/x86/entry/Makefile
@@ -1,8 +1,10 @@
 #
 # Makefile for the x86 low level entry code
 #
-obj-y				:= entry_$(BITS).o thunk_$(BITS).o
+obj-y				:= entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o
+
 obj-y				+= vdso/
+obj-y				+= vsyscall/
 
-obj-$(CONFIG_IA32_EMULATION)	+= ia32entry.o
+obj-$(CONFIG_IA32_EMULATION)	+= ia32entry.o syscall_32.o
 
diff --git a/arch/x86/kernel/syscall_32.c b/arch/x86/entry/syscall_32.c
similarity index 100%
rename from arch/x86/kernel/syscall_32.c
rename to arch/x86/entry/syscall_32.c
diff --git a/arch/x86/kernel/syscall_64.c b/arch/x86/entry/syscall_64.c
similarity index 100%
rename from arch/x86/kernel/syscall_64.c
rename to arch/x86/entry/syscall_64.c
diff --git a/arch/x86/entry/vsyscall/Makefile b/arch/x86/entry/vsyscall/Makefile
new file mode 100644
index 000000000000..a9f4856f622a
--- /dev/null
+++ b/arch/x86/entry/vsyscall/Makefile
@@ -0,0 +1,7 @@
+#
+# Makefile for the x86 low level vsyscall code
+#
+obj-y					:= vsyscall_gtod.o
+
+obj-$(CONFIG_X86_VSYSCALL_EMULATION)	+= vsyscall_64.o vsyscall_emu_64.o
+
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/entry/vsyscall/vsyscall_64.c
similarity index 100%
rename from arch/x86/kernel/vsyscall_64.c
rename to arch/x86/entry/vsyscall/vsyscall_64.c
diff --git a/arch/x86/kernel/vsyscall_emu_64.S b/arch/x86/entry/vsyscall/vsyscall_emu_64.S
similarity index 100%
rename from arch/x86/kernel/vsyscall_emu_64.S
rename to arch/x86/entry/vsyscall/vsyscall_emu_64.S
diff --git a/arch/x86/kernel/vsyscall_gtod.c b/arch/x86/entry/vsyscall/vsyscall_gtod.c
similarity index 100%
rename from arch/x86/kernel/vsyscall_gtod.c
rename to arch/x86/entry/vsyscall/vsyscall_gtod.c
diff --git a/arch/x86/kernel/vsyscall_trace.h b/arch/x86/entry/vsyscall/vsyscall_trace.h
similarity index 89%
rename from arch/x86/kernel/vsyscall_trace.h
rename to arch/x86/entry/vsyscall/vsyscall_trace.h
index a8b2edec54fe..9dd7359a38a8 100644
--- a/arch/x86/kernel/vsyscall_trace.h
+++ b/arch/x86/entry/vsyscall/vsyscall_trace.h
@@ -24,6 +24,6 @@ TRACE_EVENT(emulate_vsyscall,
 #endif
 
 #undef TRACE_INCLUDE_PATH
-#define TRACE_INCLUDE_PATH ../../arch/x86/kernel
+#define TRACE_INCLUDE_PATH ../../arch/x86/entry/vsyscall/
 #define TRACE_INCLUDE_FILE vsyscall_trace
 #include <trace/define_trace.h>
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 9d3ee054453d..01663ee5f1b7 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -31,9 +31,6 @@ obj-y			+= probe_roms.o
 obj-$(CONFIG_X86_32)	+= i386_ksyms_32.o
 obj-$(CONFIG_X86_64)	+= sys_x86_64.o x8664_ksyms_64.o
 obj-$(CONFIG_X86_64)	+= mcount_64.o
-obj-y			+= syscall_$(BITS).o vsyscall_gtod.o
-obj-$(CONFIG_IA32_EMULATION)	+= syscall_32.o
-obj-$(CONFIG_X86_VSYSCALL_EMULATION)	+= vsyscall_64.o vsyscall_emu_64.o
 obj-$(CONFIG_X86_ESPFIX64)	+= espfix_64.o
 obj-$(CONFIG_SYSFS)	+= ksysfs.o
 obj-y			+= bootflag.o e820.o
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/
  2015-06-03 16:59 [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/ Ingo Molnar
                   ` (6 preceding siblings ...)
  2015-06-03 16:59 ` [PATCH 7/7] x86/asm/entry: Move the vsyscall code to arch/x86/entry/vsyscall/ Ingo Molnar
@ 2015-06-03 17:03 ` H. Peter Anvin
  2015-06-03 17:11   ` Ingo Molnar
  2015-06-03 17:07 ` Andy Lutomirski
  8 siblings, 1 reply; 26+ messages in thread
From: H. Peter Anvin @ 2015-06-03 17:03 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel
  Cc: Andy Lutomirski, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, Linus Torvalds, Oleg Nesterov, Thomas Gleixner

On 06/03/2015 09:59 AM, Ingo Molnar wrote:
> So the x86 syscall/irq/etc. entry code is scattered in
> over 40 files all over the x86 architecture, making it
> hard to get a good overview of the code and its current
> status.
> 
> Move all the files to arch/x86/entry/.
> 
> This first step is as-is, no file names were changed - but the next
> step will be to organize things in a bit more maintainable fashion.
> 
> If there are no fundamental objections then I'll commit this to
> tip:x86/asm. (I've drained most of the pending patches to these
> files - but porting them should be easy in any case.)

I would prefer if it was made a separate topic.

I like the patch set (and you can add my Acked-by:) *except* 7/7, and
the reason for that is that it really isn't entry code, it is user space
code.

I also dislike deep directory hierarchies in general, unless it really
be avoided, like boot/ or realmode/.

	-hpa



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 2/7] x86/asm/entry: Move the compat syscall entry code to arch/x86/entry/
  2015-06-03 16:59 ` [PATCH 2/7] x86/asm/entry: Move the compat syscall entry code " Ingo Molnar
@ 2015-06-03 17:04   ` Andy Lutomirski
  2015-06-03 17:11     ` Ingo Molnar
  0 siblings, 1 reply; 26+ messages in thread
From: Andy Lutomirski @ 2015-06-03 17:04 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, H. Peter Anvin, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner

On Wed, Jun 3, 2015 at 9:59 AM, Ingo Molnar <mingo@kernel.org> wrote:
> Move the ia32entry.S file over into arch/x86/entry/.

I think we should also rename it to compat_entry.S or something.
ia32entry sounds suspiciously like 32-bit code.

--Andy

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/7] x86/asm/entry, x86/vdso: Move the vDSO code to arch/x86/entry/vdso/
  2015-06-03 16:59 ` [PATCH 3/7] x86/asm/entry, x86/vdso: Move the vDSO code to arch/x86/entry/vdso/ Ingo Molnar
@ 2015-06-03 17:05   ` Andy Lutomirski
  0 siblings, 0 replies; 26+ messages in thread
From: Andy Lutomirski @ 2015-06-03 17:05 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, H. Peter Anvin, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner

2015-06-03 9:59 GMT-07:00 Ingo Molnar <mingo@kernel.org>:
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: H. Peter Anvin <hpa@zytor.com>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Andy Lutomirski <luto@amacapital.net>
> Cc: Denys Vlasenko <dvlasenk@redhat.com>
> Cc: Brian Gerst <brgerst@gmail.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Ingo Molnar <mingo@kernel.org>

I'm with hpa here.  The vdso isn't really entry code.

--Andy

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/
  2015-06-03 16:59 [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/ Ingo Molnar
                   ` (7 preceding siblings ...)
  2015-06-03 17:03 ` [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/ H. Peter Anvin
@ 2015-06-03 17:07 ` Andy Lutomirski
  2015-06-03 17:08   ` Andy Lutomirski
  8 siblings, 1 reply; 26+ messages in thread
From: Andy Lutomirski @ 2015-06-03 17:07 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, H. Peter Anvin, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner

On Wed, Jun 3, 2015 at 9:59 AM, Ingo Molnar <mingo@kernel.org> wrote:
> So the x86 syscall/irq/etc. entry code is scattered in
> over 40 files all over the x86 architecture, making it
> hard to get a good overview of the code and its current
> status.
>
> Move all the files to arch/x86/entry/.
>
> This first step is as-is, no file names were changed - but the next
> step will be to organize things in a bit more maintainable fashion.

Sort of like this?

https://git.kernel.org/cgit/linux/kernel/git/luto/linux.git/commit/?h=x86/entry&id=d9e37f908e8788c6d50959257f95e279ebdc821d

/me cringes at the impending rebase.

Anyway, I like this series except patch 7.

--Andy

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/
  2015-06-03 17:07 ` Andy Lutomirski
@ 2015-06-03 17:08   ` Andy Lutomirski
  2015-06-03 17:13     ` Ingo Molnar
  0 siblings, 1 reply; 26+ messages in thread
From: Andy Lutomirski @ 2015-06-03 17:08 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, H. Peter Anvin, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner

On Wed, Jun 3, 2015 at 10:07 AM, Andy Lutomirski <luto@amacapital.net> wrote:
> On Wed, Jun 3, 2015 at 9:59 AM, Ingo Molnar <mingo@kernel.org> wrote:
>> So the x86 syscall/irq/etc. entry code is scattered in
>> over 40 files all over the x86 architecture, making it
>> hard to get a good overview of the code and its current
>> status.
>>
>> Move all the files to arch/x86/entry/.
>>
>> This first step is as-is, no file names were changed - but the next
>> step will be to organize things in a bit more maintainable fashion.
>
> Sort of like this?
>
> https://git.kernel.org/cgit/linux/kernel/git/luto/linux.git/commit/?h=x86/entry&id=d9e37f908e8788c6d50959257f95e279ebdc821d
>
> /me cringes at the impending rebase.
>
> Anyway, I like this series except patch 7.
>

I can't count.  I mean all except patch 3 (the vdso one), not 7.

Although arch/x86/entry might be less of a mouthful.

> --Andy



-- 
Andy Lutomirski
AMA Capital Management, LLC

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/
  2015-06-03 17:03 ` [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/ H. Peter Anvin
@ 2015-06-03 17:11   ` Ingo Molnar
  2015-06-03 17:13     ` Andy Lutomirski
  0 siblings, 1 reply; 26+ messages in thread
From: Ingo Molnar @ 2015-06-03 17:11 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: linux-kernel, Andy Lutomirski, Denys Vlasenko, Brian Gerst,
	Peter Zijlstra, Borislav Petkov, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner


* H. Peter Anvin <hpa@zytor.com> wrote:

> I like the patch set (and you can add my Acked-by:) *except* 7/7, and the reason 
> for that is that it really isn't entry code, it is user space code.

Well, I think arch/x86/entry/ should be a broader category for all things entry 
code: and the vsyscall code is closely related to the syscall entry/exit code so 
it's in a better place there than just being in the generic arch/x86/kernel/ 
directory.

I kept it separate in arch/x86/entry/vsyscall/ so it doesn't mix with other entry 
code.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 2/7] x86/asm/entry: Move the compat syscall entry code to arch/x86/entry/
  2015-06-03 17:04   ` Andy Lutomirski
@ 2015-06-03 17:11     ` Ingo Molnar
  0 siblings, 0 replies; 26+ messages in thread
From: Ingo Molnar @ 2015-06-03 17:11 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: linux-kernel, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, H. Peter Anvin, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner


* Andy Lutomirski <luto@amacapital.net> wrote:

> On Wed, Jun 3, 2015 at 9:59 AM, Ingo Molnar <mingo@kernel.org> wrote:
> > Move the ia32entry.S file over into arch/x86/entry/.
> 
> I think we should also rename it to compat_entry.S or something.
> ia32entry sounds suspiciously like 32-bit code.

Absolutely, I alluded to that in the 0/7 description, but wanted to get the 
'plain' movement done as a first step.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/
  2015-06-03 17:08   ` Andy Lutomirski
@ 2015-06-03 17:13     ` Ingo Molnar
  2015-06-03 18:02       ` H. Peter Anvin
  0 siblings, 1 reply; 26+ messages in thread
From: Ingo Molnar @ 2015-06-03 17:13 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: linux-kernel, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, H. Peter Anvin, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner


* Andy Lutomirski <luto@amacapital.net> wrote:

> On Wed, Jun 3, 2015 at 10:07 AM, Andy Lutomirski <luto@amacapital.net> wrote:
> > On Wed, Jun 3, 2015 at 9:59 AM, Ingo Molnar <mingo@kernel.org> wrote:
> >> So the x86 syscall/irq/etc. entry code is scattered in
> >> over 40 files all over the x86 architecture, making it
> >> hard to get a good overview of the code and its current
> >> status.
> >>
> >> Move all the files to arch/x86/entry/.
> >>
> >> This first step is as-is, no file names were changed - but the next
> >> step will be to organize things in a bit more maintainable fashion.
> >
> > Sort of like this?
> >
> > https://git.kernel.org/cgit/linux/kernel/git/luto/linux.git/commit/?h=x86/entry&id=d9e37f908e8788c6d50959257f95e279ebdc821d
> >
> > /me cringes at the impending rebase.
> >
> > Anyway, I like this series except patch 7.
> >
> 
> I can't count.  I mean all except patch 3 (the vdso one), not 7.
> 
> Although arch/x86/entry might be less of a mouthful.

So see my reply to hpa: it makes sense to collect all things system calls and 
other entry code in a single place, instead of having it scattered all around.

Its internal organization is kept intact, so the vDSO code isn't mixed with other 
bits.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/
  2015-06-03 17:11   ` Ingo Molnar
@ 2015-06-03 17:13     ` Andy Lutomirski
  2015-06-03 17:16       ` Ingo Molnar
  0 siblings, 1 reply; 26+ messages in thread
From: Andy Lutomirski @ 2015-06-03 17:13 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: H. Peter Anvin, linux-kernel, Denys Vlasenko, Brian Gerst,
	Peter Zijlstra, Borislav Petkov, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner

On Wed, Jun 3, 2015 at 10:11 AM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * H. Peter Anvin <hpa@zytor.com> wrote:
>
>> I like the patch set (and you can add my Acked-by:) *except* 7/7, and the reason
>> for that is that it really isn't entry code, it is user space code.
>
> Well, I think arch/x86/entry/ should be a broader category for all things entry
> code: and the vsyscall code is closely related to the syscall entry/exit code so
> it's in a better place there than just being in the generic arch/x86/kernel/
> directory.
>
> I kept it separate in arch/x86/entry/vsyscall/ so it doesn't mix with other entry
> code.

...and my reading comprehension is way off this morning.  You already
called it arch/x86/entry, so there was no reason for me to suggest
that :)

Anyway, arch/x86/entry/vdso isn't so bad.  It's just a bit odd sounding to me.

--Andy

>
> Thanks,
>
>         Ingo



-- 
Andy Lutomirski
AMA Capital Management, LLC

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/
  2015-06-03 17:13     ` Andy Lutomirski
@ 2015-06-03 17:16       ` Ingo Molnar
  2015-06-03 17:21         ` Ingo Molnar
  2015-06-03 17:22         ` Andy Lutomirski
  0 siblings, 2 replies; 26+ messages in thread
From: Ingo Molnar @ 2015-06-03 17:16 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: H. Peter Anvin, linux-kernel, Denys Vlasenko, Brian Gerst,
	Peter Zijlstra, Borislav Petkov, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner


* Andy Lutomirski <luto@amacapital.net> wrote:

> On Wed, Jun 3, 2015 at 10:11 AM, Ingo Molnar <mingo@kernel.org> wrote:
> >
> > * H. Peter Anvin <hpa@zytor.com> wrote:
> >
> >> I like the patch set (and you can add my Acked-by:) *except* 7/7, and the reason
> >> for that is that it really isn't entry code, it is user space code.
> >
> > Well, I think arch/x86/entry/ should be a broader category for all things entry
> > code: and the vsyscall code is closely related to the syscall entry/exit code so
> > it's in a better place there than just being in the generic arch/x86/kernel/
> > directory.
> >
> > I kept it separate in arch/x86/entry/vsyscall/ so it doesn't mix with other entry
> > code.
> 
> ...and my reading comprehension is way off this morning.  You already called it 
> arch/x86/entry, so there was no reason for me to suggest that :)
> 
> Anyway, arch/x86/entry/vdso isn't so bad.  It's just a bit odd sounding to me.

We could make it arch/x86/sys/? Sounds a bit too generic though.

Didn't want to limit it to system calls only, because there's various other entry 
methods (irqs, traps, NMI, etc.) that we want to handle in a coherent fashion. 
[ Which you are intimately aware of ;-) ]

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/
  2015-06-03 17:16       ` Ingo Molnar
@ 2015-06-03 17:21         ` Ingo Molnar
  2015-06-03 17:23           ` Andy Lutomirski
  2015-06-03 17:22         ` Andy Lutomirski
  1 sibling, 1 reply; 26+ messages in thread
From: Ingo Molnar @ 2015-06-03 17:21 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: H. Peter Anvin, linux-kernel, Denys Vlasenko, Brian Gerst,
	Peter Zijlstra, Borislav Petkov, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner


* Ingo Molnar <mingo@kernel.org> wrote:

> 
> * Andy Lutomirski <luto@amacapital.net> wrote:
> 
> > On Wed, Jun 3, 2015 at 10:11 AM, Ingo Molnar <mingo@kernel.org> wrote:
> > >
> > > * H. Peter Anvin <hpa@zytor.com> wrote:
> > >
> > >> I like the patch set (and you can add my Acked-by:) *except* 7/7, and the reason
> > >> for that is that it really isn't entry code, it is user space code.
> > >
> > > Well, I think arch/x86/entry/ should be a broader category for all things entry
> > > code: and the vsyscall code is closely related to the syscall entry/exit code so
> > > it's in a better place there than just being in the generic arch/x86/kernel/
> > > directory.
> > >
> > > I kept it separate in arch/x86/entry/vsyscall/ so it doesn't mix with other entry
> > > code.
> > 
> > ...and my reading comprehension is way off this morning.  You already called it 
> > arch/x86/entry, so there was no reason for me to suggest that :)
> > 
> > Anyway, arch/x86/entry/vdso isn't so bad.  It's just a bit odd sounding to me.
> 
> We could make it arch/x86/sys/? Sounds a bit too generic though.
> 
> Didn't want to limit it to system calls only, because there's various other 
> entry methods (irqs, traps, NMI, etc.) that we want to handle in a coherent 
> fashion. [ Which you are intimately aware of ;-) ]

Another tweak would be to move the kernel side entry code into 
arch/x86/entry/system/ or so, to create the following organization:

    arch/x86/entry:            all things entry methods

    arch/x86/entry/system/:    system/kernel mode entry code
    arch/x86/entry/vdso/:      user mode entry code
    arch/x86/entry/vsyscall/:  [legacy vsyscall entry code]

    arch/x86/entry/syscalls/:  build-time syscall table generation code

My primary goal is to have them all close to each other, so that we can have 
better structure, more coherency and easier overview. The names are negotiable, 
the concept is not ;-)

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/
  2015-06-03 17:16       ` Ingo Molnar
  2015-06-03 17:21         ` Ingo Molnar
@ 2015-06-03 17:22         ` Andy Lutomirski
  2015-06-03 18:04           ` H. Peter Anvin
  1 sibling, 1 reply; 26+ messages in thread
From: Andy Lutomirski @ 2015-06-03 17:22 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: H. Peter Anvin, linux-kernel, Denys Vlasenko, Brian Gerst,
	Peter Zijlstra, Borislav Petkov, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner

On Wed, Jun 3, 2015 at 10:16 AM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Andy Lutomirski <luto@amacapital.net> wrote:
>
>> On Wed, Jun 3, 2015 at 10:11 AM, Ingo Molnar <mingo@kernel.org> wrote:
>> >
>> > * H. Peter Anvin <hpa@zytor.com> wrote:
>> >
>> >> I like the patch set (and you can add my Acked-by:) *except* 7/7, and the reason
>> >> for that is that it really isn't entry code, it is user space code.
>> >
>> > Well, I think arch/x86/entry/ should be a broader category for all things entry
>> > code: and the vsyscall code is closely related to the syscall entry/exit code so
>> > it's in a better place there than just being in the generic arch/x86/kernel/
>> > directory.
>> >
>> > I kept it separate in arch/x86/entry/vsyscall/ so it doesn't mix with other entry
>> > code.
>>
>> ...and my reading comprehension is way off this morning.  You already called it
>> arch/x86/entry, so there was no reason for me to suggest that :)
>>
>> Anyway, arch/x86/entry/vdso isn't so bad.  It's just a bit odd sounding to me.
>
> We could make it arch/x86/sys/? Sounds a bit too generic though.
>
> Didn't want to limit it to system calls only, because there's various other entry
> methods (irqs, traps, NMI, etc.) that we want to handle in a coherent fashion.
> [ Which you are intimately aware of ;-) ]
>

I'm convinced.  If "entry" means entry into code provided by the
kernel as opposed to entry via hardware-provided entry mechanism, then
the vdso is indeed a pile of entries into the kernel.

--Andy

> Thanks,
>
>         Ingo



-- 
Andy Lutomirski
AMA Capital Management, LLC

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/
  2015-06-03 17:21         ` Ingo Molnar
@ 2015-06-03 17:23           ` Andy Lutomirski
  2015-06-03 17:29             ` Ingo Molnar
  0 siblings, 1 reply; 26+ messages in thread
From: Andy Lutomirski @ 2015-06-03 17:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: H. Peter Anvin, linux-kernel, Denys Vlasenko, Brian Gerst,
	Peter Zijlstra, Borislav Petkov, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner

On Wed, Jun 3, 2015 at 10:21 AM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Ingo Molnar <mingo@kernel.org> wrote:
>
>>
>> * Andy Lutomirski <luto@amacapital.net> wrote:
>>
>> > On Wed, Jun 3, 2015 at 10:11 AM, Ingo Molnar <mingo@kernel.org> wrote:
>> > >
>> > > * H. Peter Anvin <hpa@zytor.com> wrote:
>> > >
>> > >> I like the patch set (and you can add my Acked-by:) *except* 7/7, and the reason
>> > >> for that is that it really isn't entry code, it is user space code.
>> > >
>> > > Well, I think arch/x86/entry/ should be a broader category for all things entry
>> > > code: and the vsyscall code is closely related to the syscall entry/exit code so
>> > > it's in a better place there than just being in the generic arch/x86/kernel/
>> > > directory.
>> > >
>> > > I kept it separate in arch/x86/entry/vsyscall/ so it doesn't mix with other entry
>> > > code.
>> >
>> > ...and my reading comprehension is way off this morning.  You already called it
>> > arch/x86/entry, so there was no reason for me to suggest that :)
>> >
>> > Anyway, arch/x86/entry/vdso isn't so bad.  It's just a bit odd sounding to me.
>>
>> We could make it arch/x86/sys/? Sounds a bit too generic though.
>>
>> Didn't want to limit it to system calls only, because there's various other
>> entry methods (irqs, traps, NMI, etc.) that we want to handle in a coherent
>> fashion. [ Which you are intimately aware of ;-) ]
>
> Another tweak would be to move the kernel side entry code into
> arch/x86/entry/system/ or so, to create the following organization:
>
>     arch/x86/entry:            all things entry methods
>
>     arch/x86/entry/system/:    system/kernel mode entry code
>     arch/x86/entry/vdso/:      user mode entry code
>     arch/x86/entry/vsyscall/:  [legacy vsyscall entry code]
>
>     arch/x86/entry/syscalls/:  build-time syscall table generation code
>
> My primary goal is to have them all close to each other, so that we can have
> better structure, more coherency and easier overview. The names are negotiable,
> the concept is not ;-)

I think I like the approach in the patches you sent better.

Once this is in, I'll rebase my code movement change and send it,
although I probably won't call the result arch/x86/entry/entry.c :)
And then it'll be back to grumbling at context tracking.

--Andy

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/
  2015-06-03 17:23           ` Andy Lutomirski
@ 2015-06-03 17:29             ` Ingo Molnar
  0 siblings, 0 replies; 26+ messages in thread
From: Ingo Molnar @ 2015-06-03 17:29 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: H. Peter Anvin, linux-kernel, Denys Vlasenko, Brian Gerst,
	Peter Zijlstra, Borislav Petkov, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner


* Andy Lutomirski <luto@amacapital.net> wrote:

> On Wed, Jun 3, 2015 at 10:21 AM, Ingo Molnar <mingo@kernel.org> wrote:
> >
> > * Ingo Molnar <mingo@kernel.org> wrote:
> >
> >>
> >> * Andy Lutomirski <luto@amacapital.net> wrote:
> >>
> >> > On Wed, Jun 3, 2015 at 10:11 AM, Ingo Molnar <mingo@kernel.org> wrote:
> >> > >
> >> > > * H. Peter Anvin <hpa@zytor.com> wrote:
> >> > >
> >> > >> I like the patch set (and you can add my Acked-by:) *except* 7/7, and the reason
> >> > >> for that is that it really isn't entry code, it is user space code.
> >> > >
> >> > > Well, I think arch/x86/entry/ should be a broader category for all things entry
> >> > > code: and the vsyscall code is closely related to the syscall entry/exit code so
> >> > > it's in a better place there than just being in the generic arch/x86/kernel/
> >> > > directory.
> >> > >
> >> > > I kept it separate in arch/x86/entry/vsyscall/ so it doesn't mix with other entry
> >> > > code.
> >> >
> >> > ...and my reading comprehension is way off this morning.  You already called it
> >> > arch/x86/entry, so there was no reason for me to suggest that :)
> >> >
> >> > Anyway, arch/x86/entry/vdso isn't so bad.  It's just a bit odd sounding to me.
> >>
> >> We could make it arch/x86/sys/? Sounds a bit too generic though.
> >>
> >> Didn't want to limit it to system calls only, because there's various other
> >> entry methods (irqs, traps, NMI, etc.) that we want to handle in a coherent
> >> fashion. [ Which you are intimately aware of ;-) ]
> >
> > Another tweak would be to move the kernel side entry code into
> > arch/x86/entry/system/ or so, to create the following organization:
> >
> >     arch/x86/entry:            all things entry methods
> >
> >     arch/x86/entry/system/:    system/kernel mode entry code
> >     arch/x86/entry/vdso/:      user mode entry code
> >     arch/x86/entry/vsyscall/:  [legacy vsyscall entry code]
> >
> >     arch/x86/entry/syscalls/:  build-time syscall table generation code
> >
> > My primary goal is to have them all close to each other, so that we can have
> > better structure, more coherency and easier overview. The names are negotiable,
> > the concept is not ;-)
> 
> I think I like the approach in the patches you sent better.

Ok.

> Once this is in, I'll rebase my code movement change and send it,

Sounds good to me!

> although I probably won't call the result arch/x86/entry/entry.c :)

A few naming suggestions:

   arch/x86/entry/core.c
   arch/x86/entry/sys.c
   arch/x86/entry/kernel.c

;-)

Note ... I'd love to split up the various entry methods into separate files - but 
will do that only on top of your C based bits.

And once that is done, the names of those files will be obvious and clean:

   arch/x86/entry/syscall.c
   arch/x86/entry/irq.c
   arch/x86/entry/traps.c
   arch/x86/entry/nmi.c
   arch/x86/entry/et.c

> And then it'll be back to grumbling at context tracking.

Uh oh ...

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/
  2015-06-03 17:13     ` Ingo Molnar
@ 2015-06-03 18:02       ` H. Peter Anvin
  2015-06-05  7:37         ` Ingo Molnar
  0 siblings, 1 reply; 26+ messages in thread
From: H. Peter Anvin @ 2015-06-03 18:02 UTC (permalink / raw)
  To: Ingo Molnar, Andy Lutomirski
  Cc: linux-kernel, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, Linus Torvalds, Oleg Nesterov, Thomas Gleixner

On 06/03/2015 10:13 AM, Ingo Molnar wrote:
>>>
>>> Anyway, I like this series except patch 7.
>>>
>> I can't count.  I mean all except patch 3 (the vdso one), not 7.
>>

Same here... erk.

>> Although arch/x86/entry might be less of a mouthful.
> 
> So see my reply to hpa: it makes sense to collect all things system calls and 
> other entry code in a single place, instead of having it scattered all around.
> 
> Its internal organization is kept intact, so the vDSO code isn't mixed with other 
> bits.

That really doesn't change the fact that it is a completely different
beast, and putting it under entry/ is actively misleading.  Having vdso/
as a separate top level is a good thing, I believe.

I really dislike deep hierarchies, as I said, because my experience has
been that they are more confusing than they are helpful, especially over
time.  The arch-example of badness is of course arch/x86/kernel, which
is a total catch-all, but

	-hpa


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/
  2015-06-03 17:22         ` Andy Lutomirski
@ 2015-06-03 18:04           ` H. Peter Anvin
  2015-06-03 18:18             ` H. Peter Anvin
  0 siblings, 1 reply; 26+ messages in thread
From: H. Peter Anvin @ 2015-06-03 18:04 UTC (permalink / raw)
  To: Andy Lutomirski, Ingo Molnar
  Cc: linux-kernel, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, Linus Torvalds, Oleg Nesterov, Thomas Gleixner

On 06/03/2015 10:22 AM, Andy Lutomirski wrote:
> 
> I'm convinced.  If "entry" means entry into code provided by the
> kernel as opposed to entry via hardware-provided entry mechanism, then
> the vdso is indeed a pile of entries into the kernel.
> 

No, it isn't.  It is user space code provided by the kernel.  It is a
very different beast, and this is highly and unnecessarily confusing.  I
am thrilled we finally have managed to get the vdso code separated out,
this just muddles the situation.

	-hpa



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/
  2015-06-03 18:04           ` H. Peter Anvin
@ 2015-06-03 18:18             ` H. Peter Anvin
  0 siblings, 0 replies; 26+ messages in thread
From: H. Peter Anvin @ 2015-06-03 18:18 UTC (permalink / raw)
  To: Andy Lutomirski, Ingo Molnar
  Cc: linux-kernel, Denys Vlasenko, Brian Gerst, Peter Zijlstra,
	Borislav Petkov, Linus Torvalds, Oleg Nesterov, Thomas Gleixner

On 06/03/2015 11:04 AM, H. Peter Anvin wrote:
> On 06/03/2015 10:22 AM, Andy Lutomirski wrote:
>>
>> I'm convinced.  If "entry" means entry into code provided by the
>> kernel as opposed to entry via hardware-provided entry mechanism, then
>> the vdso is indeed a pile of entries into the kernel.
>>
> 
> No, it isn't.  It is user space code provided by the kernel.  It is a
> very different beast, and this is highly and unnecessarily confusing.  I
> am thrilled we finally have managed to get the vdso code separated out,
> this just muddles the situation.
> 

So let me clarify this: vdso code is really a kind of system calls, that
just happen to be executed in user space, thus *bypassing* kernel entry.
 We don't want to put all the system call code (or even the x86-specific
ones) in entry/ as that would completely eliminate the point and we have
once again re-invented the kernel/ catch-all.

	-hpa


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/
  2015-06-03 18:02       ` H. Peter Anvin
@ 2015-06-05  7:37         ` Ingo Molnar
  0 siblings, 0 replies; 26+ messages in thread
From: Ingo Molnar @ 2015-06-05  7:37 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Andy Lutomirski, linux-kernel, Denys Vlasenko, Brian Gerst,
	Peter Zijlstra, Borislav Petkov, Linus Torvalds, Oleg Nesterov,
	Thomas Gleixner


* H. Peter Anvin <hpa@zytor.com> wrote:

> I really dislike deep hierarchies, as I said, because my experience has been 
> that they are more confusing than they are helpful, especially over time.  The 
> arch-example of badness is of course arch/x86/kernel, which is a total 
> catch-all, but

Well, directory hierarchy can certainly be overdone, but in general the Linux 
kernel has the exact opposite problem: too shallow directory organization due to 
two decades of organic growth.

We've been actively working over the last two years to improve the source code 
hierarchy gradually: kernel/rcu/, kernel/locking/, kernel/events/, kernel/sched/ 
and kernel/time/ are all examples of that process. It worked out pretty well IMHO.

This series actively depopulates various catch-all places such as arch/x86/kernel/ 
and arch/x86/lib/ and moves related code closer to each other.

The purpose of arch/x86/entry/ is:

 - implementation of the high level runtime interfaces to enter/exit (call) the 
   Linux kernel, both for hardware and for software defined ABIs.

Each of the files moved directly relate to these interfaces. It's not limited to 
kernel mode entries alone.

We could rename it to arch/x86/abi/, although that would be somewhat confusing I 
suspect because it's too generic a name?

Anyway, I pushed this out as it's a step forward and to not hold up ongoing asm 
work - we'll see how it works out in practice!

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2015-06-05  7:37 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-03 16:59 [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/ Ingo Molnar
2015-06-03 16:59 ` [PATCH 1/7] x86/asm/entry: Move entry_64.S and entry_32.S to arch/x86/entry/ Ingo Molnar
2015-06-03 16:59 ` [PATCH 2/7] x86/asm/entry: Move the compat syscall entry code " Ingo Molnar
2015-06-03 17:04   ` Andy Lutomirski
2015-06-03 17:11     ` Ingo Molnar
2015-06-03 16:59 ` [PATCH 3/7] x86/asm/entry, x86/vdso: Move the vDSO code to arch/x86/entry/vdso/ Ingo Molnar
2015-06-03 17:05   ` Andy Lutomirski
2015-06-03 16:59 ` [PATCH 4/7] x86/asm/entry: Move the 'thunk' functions to arch/x86/entry/ Ingo Molnar
2015-06-03 16:59 ` [PATCH 5/7] x86/asm/entry: Move arch/x86/include/asm/calling.h " Ingo Molnar
2015-06-03 16:59 ` [PATCH 6/7] x86/asm/entry: Move the arch/x86/syscalls/ definitions to arch/x86/entry/syscalls/ Ingo Molnar
2015-06-03 16:59 ` [PATCH 7/7] x86/asm/entry: Move the vsyscall code to arch/x86/entry/vsyscall/ Ingo Molnar
2015-06-03 17:03 ` [RFC PATCH 0/7] x86/entry: Create a home for the x86 entry code in arch/x86/entry/ H. Peter Anvin
2015-06-03 17:11   ` Ingo Molnar
2015-06-03 17:13     ` Andy Lutomirski
2015-06-03 17:16       ` Ingo Molnar
2015-06-03 17:21         ` Ingo Molnar
2015-06-03 17:23           ` Andy Lutomirski
2015-06-03 17:29             ` Ingo Molnar
2015-06-03 17:22         ` Andy Lutomirski
2015-06-03 18:04           ` H. Peter Anvin
2015-06-03 18:18             ` H. Peter Anvin
2015-06-03 17:07 ` Andy Lutomirski
2015-06-03 17:08   ` Andy Lutomirski
2015-06-03 17:13     ` Ingo Molnar
2015-06-03 18:02       ` H. Peter Anvin
2015-06-05  7:37         ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).