From: Geert Uytterhoeven <geert@linux-m68k.org>
To: "Borislav Petkov" <bp@alien8.de>,
"Paolo Giarrusso" <p.giarrusso@gmail.com>,
"H. Peter Anvin" <hpa@zytor.com>,
"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, "Jeff Dike" <jdike@addtoit.com>
Subject: Re: [uml-devel] [PATCH] x86, hweight: Fix UML boot crash
Date: Sat, 12 Jun 2010 20:37:39 +0200 [thread overview]
Message-ID: <AANLkTinMHWI0xGRW-clKm5O91c0QdMG5tDNf3jvUB8Ij@mail.gmail.com> (raw)
In-Reply-To: <20100612163444.GC28572@liondog.tnic>
On Sat, Jun 12, 2010 at 18:34, Borislav Petkov <bp@alien8.de> wrote:
> From: Paolo Giarrusso <p.giarrusso@gmail.com>
> Date: Sat, Jun 12, 2010 at 06:01:44PM +0200
>
>> >> First, ARCH_HWEIGHT_CFLAGS should IMHO be shared with UML. I.e., moved
>> >> to arch/x86/Kconfig.cpu (which was born as Kconfig code shared with
>> >> UML), or copied in UML (it's not defined, as far as I can see).
>> >> Otherwise it just can't work. And I think that's it.
>>
>> Just to be sure: by "that's it" I meant "this is the problem".
>> You didn't answer here - did you see it? What do you think? Can you
>> try the one-line fix at some point?
>> Just to make it clear: I've not been actively developing UML (or
>> almost anything in kernel space) for ages (~4 years), so it's unlikely
>> that I'll try fixing this. It just happens that things on the UML
>> front stayed mostly the same, so I thought that my knowledge of the
>> code is still useful.
>
> Cool :). However, according to Geert, this doesn't fix it:
>
> http://marc.info/?l=linux-kernel&m=127522065202435&w=2
>
> It could be related to the -mregparm being broken on 32-bit UML since
> Geert's UML "guest" is 32-bit. However, even if we fix this, it won't
No, guest and host are both x86_64.
> be used since, as you said, UML doesn't do alternatives. Which means
> that it doesn't make sense fixing it until there are no alternatives -
> instead, we should simply fall back to the software hweight* stuff and
> be done with it.
>
>> > In that case, fixing this is either by rerouting the includes
>> > (easiest, already in -tip) or adding alternatives support (harder,
>> > needs volunteers :)).
>>
>> Well, even doing just nothing should work, if you fix the trivial
>> thing above (which at least for 64bit should work).
>
> See above.
>
>> >> A third note is that UML links with glibc, so it can have a different
>> >> calling convention from the kernel. Say, on x86 32bit regparm doesn't
>> >> work (in fact, -mregparm is set in arch/x86/Makefile and not in
>> >> arch/x86/Makefile_32.cpu). And since popcnt is supported on 32bit, it
>> >> might in theory make a difference for that case. But maybe those flags
>> >> are simply fine, I didn't recheck the possible calling conventions.
>>
>> > If this is also the case, the -fcall-saved-* stuff won't work on UML and
>> > yet another way of doing "call *func" from within asm("...") and making
>> > sure the callee doesn't clobber caller's regs will be needed for UML.
>>
>> Hmpf... anyway, 64bit should be fine since there's just one calling
>> convention, everywhere, and already regparm'ed.
>
> Right, as I said, this would leave 32-bit broken which doesn't cut it
> either for a subset of people using UML.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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
next prev parent reply other threads:[~2010-06-12 18:37 UTC|newest]
Thread overview: 48+ 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
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 [this message]
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
[not found] ` <tip-cc7f0a7b3004a4ca0bfef0e1ca79f2e0da6ca1b0@git.kernel.org>
2010-06-09 22:43 ` [tip:x86/urgent] " H. Peter Anvin
2010-06-10 5:32 ` Geert Uytterhoeven
2010-06-10 6:26 ` H. Peter Anvin
2010-06-09 8:04 ` [PATCH resend] um, " Boaz Harrosh
2010-06-09 8:09 ` [uml-devel] " Boaz Harrosh
2010-06-09 8:46 ` Geert Uytterhoeven
2010-06-09 9:08 ` Boaz Harrosh
2010-06-09 9:32 ` Américo Wang
2010-06-09 18:29 ` H. Peter Anvin
2010-06-14 16:08 ` Boaz Harrosh
2010-06-14 16:41 ` H. Peter Anvin
2010-06-14 18:18 ` Boaz Harrosh
2010-06-09 16:39 ` Boaz Harrosh
2010-06-10 23:43 ` [tip:x86/urgent] um, hweight: Fix UML boot crash due to x86 optimized hweight tip-bot for 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=AANLkTinMHWI0xGRW-clKm5O91c0QdMG5tDNf3jvUB8Ij@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=borislav.petkov@amd.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=p.giarrusso@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).