linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jan Beulich <jbeulich@novell.com>,
	linux@sandersweb.net, Ingo Molnar <mingo@elte.hu>,
	Andi Kleen <andi-suse@firstfloor.org>,
	Arjan van de Ven <arjan@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] x86 kenel won't boot under Virtual PC
Date: Fri, 05 Sep 2008 12:08:38 -0700	[thread overview]
Message-ID: <48C183B6.6030909@goop.org> (raw)
In-Reply-To: <alpine.LFD.1.10.0809050931340.3117@nehalem.linux-foundation.org>

Linus Torvalds wrote:
> On Fri, 5 Sep 2008, Jan Beulich wrote:
>   
>> I disagree here: If I configure a 686+ kernel, I expect these NOPs to be
>> that way (and to work). If you want to run on something that's not
>> compliant, you just shouldn't configure your kernel that way.
>>     
>
> Well, if you actually do a
>
> 	git grep 'ASM_NOP[0-9]'
>
> you'll find that just the _definitions_ of those things are the bulk of it 
> BY FAR, and that there doesn't seem to be a single user that cares even 
> remotely about performance.
>   

Well, the paravirt_ops patching uses multibyte nops to pad out the
unused space in a patch site, and they're generally on hot paths
(otherwise we wouldn't bother with patching).  But even then I don't
think the particular nop chosen matters all that much, and even if it
did using the dumb redundant prefix long nops seems to be as good as or
better than the p6 nops.  The "call mcount" patching ftrace wants to do
would also be pretty common.

> So I actually think that the whole thing is a waste of time. We should 
> probably 
>
>  - pick a single set of NOP's per 32-bit/64-bit (since the good nops in 
>    32-bit aren't 64-bit instructions at all, so we do want different nops 
>    depending on _that_)
>
>    The whole static choice by microarchitecture is pure garbage.
>
>  - Probably also just declare that those default nops are single 
>    instructions, just so that we never even have to think about it from a 
>    dynamic replacement angle.
>   

Yes, that would be a good idea.

>  - Move the optimized nop definitions (K7_NOPx etc) to the only place that 
>    cares - asm/x86/kernel/alternative.c. When we do things _dynamically_, 
>    it can actually make sense to pick a nop more precisely, but for this 
>    whole static thing it's just a pain.
>   

Yep.  We could run the p6 nops with an exception handler to see if the
cpu actually supports them or not.  And if not, just fall back to
something simple and good enough.

    J

  parent reply	other threads:[~2008-09-05 19:08 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-31 18:22 [BUG] x86 kenel won't boot under Virtual PC David Sanders
2008-08-31 18:47 ` Linus Torvalds
2008-08-31 19:27   ` Arjan van de Ven
2008-08-31 19:39     ` Linus Torvalds
2008-09-05 15:38       ` David Sanders
2008-09-05 16:15         ` Jan Beulich
2008-09-05 16:39           ` Linus Torvalds
2008-09-05 18:43             ` Ingo Molnar
2008-09-05 20:06               ` H. Peter Anvin
2008-09-05 19:08             ` Jeremy Fitzhardinge [this message]
2008-09-05 20:12           ` H. Peter Anvin
2008-09-05 16:30         ` Linus Torvalds
2008-09-05 17:55           ` Andi Kleen
2008-08-31 20:03   ` David Sanders
2008-09-01 20:23     ` David Sanders
2008-09-01 22:22       ` Linus Torvalds
2008-09-02 12:08         ` David Sanders
2008-09-02 18:12           ` Linus Torvalds
2008-09-02 18:44             ` David Sanders
2008-09-03 11:09               ` Peter Zijlstra
2008-09-03 11:20                 ` David Sanders
     [not found] ` <48C1C156.9080003@zytor.com>
2008-09-07 20:07   ` David Sanders
2008-09-07 23:22     ` David Sanders
2008-09-08  1:48       ` H. Peter Anvin
2008-09-08  2:49         ` David Sanders
2008-09-08  4:04           ` H. Peter Anvin
2008-09-08  9:42             ` Andi Kleen
2008-09-08 13:25             ` David Sanders
2008-09-08 15:09             ` Linus Torvalds
2008-09-08 15:23               ` Ingo Molnar
2008-09-08 15:36                 ` H. Peter Anvin
2008-09-08 15:38                 ` David Sanders
2008-09-08 15:38                 ` H. Peter Anvin
2008-09-08 15:45               ` Andi Kleen
2008-09-08 15:43                 ` H. Peter Anvin
2008-09-08 15:50                   ` H. Peter Anvin
2008-09-08 15:50                   ` Andi Kleen
2008-09-08 15:50                     ` H. Peter Anvin
2008-09-08 15:57                       ` Andi Kleen
2008-09-08 15:54                         ` H. Peter Anvin
2008-09-08 16:07                   ` Linus Torvalds
2008-09-08 16:13                     ` H. Peter Anvin
2008-09-08 16:15                       ` H. Peter Anvin
2008-09-08 16:26                         ` David Sanders
2008-09-08 16:20                       ` Linus Torvalds
2008-09-08 16:32                         ` H. Peter Anvin
2008-09-08 17:02                           ` Ingo Molnar
2008-09-08 16:34                         ` david
2008-09-08 16:42                           ` H. Peter Anvin
2008-09-08 18:51                             ` david
2008-09-08 16:59                           ` Linus Torvalds
2008-09-08 17:00                         ` Andi Kleen
2008-09-08 17:04                           ` Linus Torvalds
2008-09-08 17:08                             ` H. Peter Anvin
2008-09-08 17:12                               ` H. Peter Anvin
2008-09-08 17:41                                 ` Linus Torvalds
2008-09-08 17:38                               ` Linus Torvalds
2008-09-08 17:59                                 ` H. Peter Anvin
2008-09-08 19:09                                 ` H. Peter Anvin
2008-09-08 22:42                                   ` Linus Torvalds
2008-09-08 17:18                             ` Andi Kleen

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=48C183B6.6030909@goop.org \
    --to=jeremy@goop.org \
    --cc=andi-suse@firstfloor.org \
    --cc=arjan@infradead.org \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@sandersweb.net \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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).