From a1a5831d295f34eceec3ba12c199c2c070e1aaed Mon Sep 17 00:00:00 2001 From: Nicholas Mc Guire Date: Mon, 27 Oct 2014 18:28:05 +0100 Subject: x86/asm: Fix typo in arch/x86/kernel/asm_offset_64.c Drop double entry for pt_regs_bx. This seems to be a typo - resulting in a double entry in the generated include/generated/asm-offsets.h, which is not necessary. Build-tested and booted on x86 64 box to make sure it was not doing any strange magic.... after all it was in the kernel in this form for almost 10 years. Signed-off-by: Nicholas Mc Guire Cc: Jan Beulich Cc: Andy Lutomirski Cc: Linus Torvalds Link: http://lkml.kernel.org/r/20141027172805.GA19760@opentech.at Signed-off-by: Ingo Molnar --- arch/x86/kernel/asm-offsets_64.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/x86/kernel/asm-offsets_64.c') diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c index e7c798b354fa..4f9359f36bb7 100644 --- a/arch/x86/kernel/asm-offsets_64.c +++ b/arch/x86/kernel/asm-offsets_64.c @@ -47,7 +47,6 @@ int main(void) #endif #define ENTRY(entry) OFFSET(pt_regs_ ## entry, pt_regs, entry) - ENTRY(bx); ENTRY(bx); ENTRY(cx); ENTRY(dx); -- cgit v1.2.3-59-g8ed1b From 5de2b61a63f0982641eb00b9a6a9650f23487eaa Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Tue, 9 Dec 2014 16:45:17 +0100 Subject: x86/asm: Guard against building the 32/64-bit versions of the asm-offsets*.c file directly Sometimes it is helpful to build a kernel compilation unit directly, i.e.: make .../.i in order to look at compiler output. Since asm-offsets_{32,64}.c are included by asm-offsets.c and building them directly doesn't evaluate the macros used (thus making the preprocessor output not very useful), error out when an attempt is made to build them. Issue a hint for the user to build asm-offsets.c instead. Suggested-by: Michael Matz Signed-off-by: Borislav Petkov Cc: Michal Marek Cc: Linus Torvalds Link: http://lkml.kernel.org/r/1418139917-12722-1-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar --- arch/x86/kernel/asm-offsets_32.c | 4 ++++ arch/x86/kernel/asm-offsets_64.c | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'arch/x86/kernel/asm-offsets_64.c') diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c index d67c4be3e8b1..3b3b9d33ac1d 100644 --- a/arch/x86/kernel/asm-offsets_32.c +++ b/arch/x86/kernel/asm-offsets_32.c @@ -1,3 +1,7 @@ +#ifndef __LINUX_KBUILD_H +# error "Please do not build this file directly, build asm-offsets.c instead" +#endif + #include #include diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c index e7c798b354fa..4c0c596dfb95 100644 --- a/arch/x86/kernel/asm-offsets_64.c +++ b/arch/x86/kernel/asm-offsets_64.c @@ -1,3 +1,7 @@ +#ifndef __LINUX_KBUILD_H +# error "Please do not build this file directly, build asm-offsets.c instead" +#endif + #include #define __SYSCALL_64(nr, sym, compat) [nr] = 1, -- cgit v1.2.3-59-g8ed1b