linux-um archives
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: "Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Borislav Petkov" <borislav.petkov@amd.com>,
	"Toralf Förster" <toralf.foerster@gmx.de>,
	user-mode-linux-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86, hweight: Fix UML boot crash
Date: Sun, 30 May 2010 22:17:38 +0200	[thread overview]
Message-ID: <20100530201738.GB2498@liondog.tnic> (raw)
In-Reply-To: <20100530193956.GA2498@liondog.tnic>

> > This bothers me, because it really feels like something is fundamentally
> > broken in UML tryingto track the upstream architecture, and this is just
> > a bandage.
> 
> First of all, scratch that patch. It is indeed dumb idea to sprinkle UML
> special cases in x86 just because they include it.
> 
> Which begs the question why _is_ UML sucking in x86 stuff and can anyone
> provide us with some sensible reasons? Because if there aren't any, it
> is their includes that should be fixed. Let me see what I can do to
> redirect hweight stuff properly...

Ok, AFAICT UML is sucking in the includes of the sub-architecture the
UML "guest" is running on. See below¹ for the whole gcc string make
executes. Among the switches is

"-I/home/boris/kernel/linux-2.6/arch/x86/include"

so there will be no untangling today. Instead, we could do another
bandaid which is confined to UML include space only and redirect
arch_hweight.h includes to the generic ones. Check this out, it seems to
work here:

--
From: Borislav Petkov <bp@alien8.de>
Date: Sun, 30 May 2010 22:11:32 +0200
Subject: [PATCH] um, hweight: Fix UML boot crash

Obviously UML cannot stomach callee reg-saving trickery
introduced with d61931d89be506372d01a90d1755f6d0a9fafe2d
(x86: Add optimized popcnt variants) and oopses during boot:
http://marc.info/?l=linux-kernel&m=127522065202435&w=2

Redirect arch_hweight.h include from the x86 portion to the generic
arch_hweight.h which is a fallback to the software hweight routines.

LKML-Reference: <201005271944.09541.toralf.foerster@gmx.de>
Signed-off-by: Borislav Petkov <bp@alien8.de>
---
 arch/um/include/asm/arch_hweight.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
 create mode 100644 arch/um/include/asm/arch_hweight.h

diff --git a/arch/um/include/asm/arch_hweight.h b/arch/um/include/asm/arch_hweight.h
new file mode 100644
index 0000000..c656cf4
--- /dev/null
+++ b/arch/um/include/asm/arch_hweight.h
@@ -0,0 +1,6 @@
+#ifndef _ASM_UM_HWEIGHT_H
+#define _ASM_UM_HWEIGHT_H
+
+#include <asm-generic/bitops/arch_hweight.h>
+
+#endif
-- 
1.7.1









¹ gcc -Wp,-MD,arch/um/sys-x86_64/.delay.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.4.4/include -I/home/boris/kernel/linux-2.6/arch/um/include -Iinclude  -include include/generated/autoconf.h -D__KERNEL__ -I/home/boris/kernel/linux-2.6/arch/um/sys-x86_64 -m64 -I/home/boris/kernel/linux-2.6/arch/x86/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -D__arch_um__ -DSUBARCH=\"x86_64\" -I/home/boris/kernel/linux-2.6/arch/um/include/shared -I/home/boris/kernel/linux-2.6/arch/um/sys-x86_64/shared -I/home/boris/kernel/linux-2.6/arch/um/include/shared/skas -Dvmap=kernel_vmap -Din6addr_loopback=kernel_in6addr_loopback -Din6addr_any=kernel_in6addr_any -fno-builtin -m64 -funit-at-a-time -D_LARGEFILE64_SOURCE -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask -Dmktime=kernel_mktime -Wframe-larger-than=2048 -fno-stack-protector -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-dwarf2-cfi-asm -fconserve-stack   -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(delay)"  -D"KBUILD_MODNAME=KBUILD_STR(delay)"  -c -o arch/um/sys-x86_64/delay.o arch/um/sys-x86_64/delay.c


-- 
Regards/Gruss,
    Boris.


  reply	other threads:[~2010-05-30 20:17 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-27 17:44 current git kernel crashes UML system during boot Toralf Förster
2010-05-30 11:39 ` Geert Uytterhoeven
2010-05-30 11:57   ` Geert Uytterhoeven
2010-05-30 15:02     ` Borislav Petkov
2010-05-30 15:18       ` Geert Uytterhoeven
2010-05-30 15:46         ` Borislav Petkov
2010-05-30 15:28       ` Toralf Förster
2010-05-30 17:03         ` [PATCH] x86, hweight: Fix UML boot crash Borislav Petkov
2010-05-30 18:36           ` H. Peter Anvin
2010-05-30 19:39             ` Borislav Petkov
2010-05-30 20:17               ` Borislav Petkov [this message]
2010-05-30 21:09                 ` H. Peter Anvin
2010-06-12 13:34                   ` [uml-devel] " Paolo Giarrusso
2010-06-12 14:18                     ` Borislav Petkov
2010-06-12 16:01                       ` Paolo Giarrusso
2010-06-12 16:34                         ` Borislav Petkov
2010-06-12 18:37                           ` Geert Uytterhoeven
2010-06-13  6:58                             ` Borislav Petkov
2010-05-31 13:55                 ` Toralf Förster
2010-05-31 14:10                   ` Borislav Petkov
2010-05-31 14:36                     ` Toralf Förster
2010-06-14  9:49                     ` Toralf Förster
2010-06-14 10:26                       ` [uml-devel] " Paolo Giarrusso
2010-06-14 12:54                         ` Toralf Förster
2010-06-14 13:00                       ` Borislav Petkov
2010-06-14 13:44                         ` Toralf Förster
2010-06-14 14:39                           ` Geert Uytterhoeven
2010-06-14 15:11                             ` Toralf Förster
2010-06-14 15:20                               ` H. Peter Anvin
2010-05-31 14:25                   ` [uml-devel] " Boaz Harrosh
2010-05-31  2:32               ` Jeff Dike
2010-05-31 13:51                 ` Borislav Petkov
2010-05-31 15:56                   ` Jeff Dike
2010-05-31 16:29                     ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100530201738.GB2498@liondog.tnic \
    --to=bp@alien8.de \
    --cc=borislav.petkov@amd.com \
    --cc=geert@linux-m68k.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=toralf.foerster@gmx.de \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox