Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
i686 quirk for AMD Geode
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 26 - 50 of 133 - Collapse all  -  Translate all to Translated (View all originals) < Older  Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Krzysztof Halasa  
View profile  
 More options Nov 6, 6:05 pm
Newsgroups: fa.linux.kernel
From: Krzysztof Halasa <k...@pm.waw.pl>
Date: Fri, 06 Nov 2009 23:05:31 UTC
Local: Fri, Nov 6 2009 6:05 pm
Subject: Re: i686 quirk for AMD Geode

"Martin Schleier" <drahemm...@gmx.net> writes:
> e.g:
>  - correct use of some blackfin hi/lo macros.
>  - if certain data structures are declared as const
>    (struct seq_operations/file_operations)
>  - correct use of NR_CPUS is usually wrong
>  - complains about in_atomic() outside core kernel code
>  - warns about LINUX_VERSION_CODE, #if 0,
>    volatile or deprecated functions.
>  - informs about needless kfree/usb_free_urb checks
>  - etc...

Did the patch in question contain such problems?
--
Krzysztof Halasa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin Schleier  
View profile  
 More options Nov 6, 7:06 pm
Newsgroups: fa.linux.kernel
From: "Martin Schleier" <drahemm...@gmx.net>
Date: Sat, 07 Nov 2009 00:06:23 UTC
Local: Fri, Nov 6 2009 7:06 pm
Subject: Re: i686 quirk for AMD Geode
Sat, 07 Nov 2009 00:05:12 Krzystof Halasa

the last point:
 - etc... =>

"WARNING: externs should be avoided in .c files
#56: FILE: arch/x86/kernel/nopl_emu.c:13:
+void do_invalid_op(struct pt_regs *regs, long error_code);" ?
(or do you think that this is a formatting issue?!)

a grep will give you a header file where it is defined:
"arch/x86/include/asm/traps.h"
dotraplinkage void do_invalid_op(struct pt_regs *, long);

anyway, in case we get more followers here. I put your question back
in context of the original response. Because this discussion-branch was
not about arguing about nopl emulation, since - apparently - nothing
was/is wrong with the code itself.

Instead, we ended up here because of:

Fri, 6 Nov 2009 15:59:37 Alan Cox wrote:
"Secondly Ingo knows how to operate checkpatch and trivial style bits like
that are irrelevant to meaningful discussion about code."

And this is clearly not the case. It is the job of a Submitter
(as described in Documentations/SubmittingPatches section 4)
to check and test his patches with tools like checkpatch or sparse
before posting them.

After all this patch is going into /arch/x86 and not /drivers/staging
and this sort of "extern declaration" is prone to break one day when
void do_invalid_op(struct pt_regs *, long); declaration is modified.
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alan Cox  
View profile  
 More options Nov 6, 7:47 pm
Newsgroups: fa.linux.kernel
From: Alan Cox <a...@lxorguk.ukuu.org.uk>
Date: Sat, 07 Nov 2009 00:47:53 UTC
Local: Fri, Nov 6 2009 7:47 pm
Subject: Re: i686 quirk for AMD Geode
On Fri, 6 Nov 2009 23:18:06 +0100

Matteo Croce <technobo...@gmail.com> wrote:
> On Fri, Nov 6, 2009 at 5:44 PM, H. Peter Anvin <h...@zytor.com> wrote:
> > On 11/06/2009 06:59 AM, Matteo Croce wrote:
> >> indeed it has MMX, MMXEXT and CMOV, just lacks the long NOP instruction (NOPL).

> > MMX and MMXEXT are hardly hallmarks of i686, which leaves only cmov.

cmov is not i686 either. Its an optional extension that *should* only be
used after you test its available. So gcc "i686" isn't quite "686". There
are of course good reasons for that choice.

> yes, I did some test like gzip, bzip2, lame etc and they give more or less
> the same results of dhrystone

How does that compare to i486. Certainly the old Nat Semi geode seemed to
prefer to be fed i486 code to i586 (and wouldn't of course hack i686).
You might also want to play around with -mtune= as well as arch= before
assuming why i686 is a win

(I still btw think the patch is a good idea, it simplifies life
enormously for users with the CPU)

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Krzysztof Halasa  
View profile  
 More options Nov 7, 5:38 am
Newsgroups: fa.linux.kernel
From: Krzysztof Halasa <k...@pm.waw.pl>
Date: Sat, 07 Nov 2009 10:38:14 UTC
Local: Sat, Nov 7 2009 5:38 am
Subject: Re: i686 quirk for AMD Geode

"Martin Schleier" <drahemm...@gmx.net> writes:
>> Did the patch in question contain such problems?
> the last point:
>  - etc... =>

Yeah.

> "WARNING: externs should be avoided in .c files

Ironically, it's the only "WARNING" while the rest are "ERRORS".
OTOH I personally believe all output from checkpatch should be labeled
"WARNING"; it's not for checkpatch to decide. It's only a tool.

> #56: FILE: arch/x86/kernel/nopl_emu.c:13:
> +void do_invalid_op(struct pt_regs *regs, long error_code);" ?
> (or do you think that this is a formatting issue?!)

Actually, I think it wasn't any issue at all at this point, when it
wasn't yet established if the patch makes sense at all.

> It is the job of a Submitter
> (as described in Documentations/SubmittingPatches section 4)
> to check and test his patches with tools like checkpatch or sparse
> before posting them.

You apparently forgot what SubmittingPatches file is all about:

"This text is a collection of suggestions which can greatly increase the
chances of your change being accepted."

You know, we don't have laws for everything here. And we're not
androids specialized in producing C code. We are supposed to use some
common sense first.

> After all this patch is going into /arch/x86 and not /drivers/staging
> and this sort of "extern declaration" is prone to break one day when
> void do_invalid_op(struct pt_regs *, long); declaration is modified.

That's true, though it's the same for "staging".
--
Krzysztof Halasa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matteo Croce  
View profile  
 More options Nov 7, 6:12 am
Newsgroups: fa.linux.kernel
From: Matteo Croce <technobo...@gmail.com>
Date: Sat, 07 Nov 2009 11:12:35 UTC
Local: Sat, Nov 7 2009 6:12 am
Subject: Re: i686 quirk for AMD Geode

This one is perfect according to checkpatch.pl

The AMD Geode LX has an x86 id of 5 (i586) tought it's technically an i686:

root@alix:~# egrep '^(cpu family|model name|flags)' /proc/cpuinfo
cpu family      : 5
model name      : Geode(TM) Integrated Processor by AMD PCS
flags           : fpu de pse tsc msr cx8 sep pge cmov clflush mmx
mmxext 3dnowext 3dnow

indeed it has MMX, MMXEXT and CMOV, just lacks the long NOP instruction (NOPL).
This patch adds a quirck to promote the Geode to an i686 and emulates
the NOPL in the do_invalid_op trap, so the userspace never notices.
Emulating the NOPL has minimum performance loss, emulating a NOPL
takes 0.5 usecs
and they are rarely used in x86

Signed-off-by: Matteo Croce <technobo...@gmail.com

--- a/arch/x86/kernel/Makefile  2009-11-06 15:06:52.246223989 +0100
+++ b/arch/x86/kernel/Makefile  2009-11-06 15:07:04.294054613 +0100
@@ -89,7 +89,7 @@
 obj-$(CONFIG_HPET_TIMER)       += hpet.o

 obj-$(CONFIG_K8_NB)            += k8.o
-obj-$(CONFIG_MGEODE_LX)                += geode_32.o mfgpt_32.o
+obj-$(CONFIG_MGEODE_LX)                += geode_32.o mfgpt_32.o nopl_emu.o
 obj-$(CONFIG_DEBUG_RODATA_TEST)        += test_rodata.o
 obj-$(CONFIG_DEBUG_NX_TEST)    += test_nx.o

--- a/arch/x86/kernel/cpu/amd.c 2009-11-06 15:06:52.254223805 +0100
+++ b/arch/x86/kernel/cpu/amd.c 2009-11-06 15:07:04.294054613 +0100
@@ -138,8 +138,10 @@
        }

        if (c->x86_model == 10) {
-               /* AMD Geode LX is model 10 */
-               /* placeholder for any needed mods */
+               /* Geode only lacks the NOPL instruction to be i686,
+                  but we can emulate it in the exception handler
+                  and promote it to a class 6 cpu */
+               boot_cpu_data.x86 = 6;
                return;
        }
 }
--- a/arch/x86/kernel/entry_32.S        2009-11-06 15:06:52.258224172 +0100
+++ b/arch/x86/kernel/entry_32.S        2009-11-06 15:07:04.306230613 +0100
@@ -901,7 +901,11 @@
        RING0_INT_FRAME
        pushl $0
        CFI_ADJUST_CFA_OFFSET 4
+#ifdef CONFIG_MGEODE_LX
+       pushl $do_nopl_emu
+#else
        pushl $do_invalid_op
+#endif
        CFI_ADJUST_CFA_OFFSET 4
        jmp error_code
        CFI_ENDPROC
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
+++ b/arch/x86/kernel/nopl_emu.c        2009-11-07 11:59:17.667748571 +0100
@@ -0,0 +1,103 @@
+/*
+ *  linux/arch/x86/kernel/nopl_emu.c
+ *
+ *  Copyright (C) 2002  Willy Tarreau
+ *  Copyright (C) 2009  Matteo Croce
+ */
+
+#include <linux/linkage.h>
+#include <asm/math_emu.h>
+#include <asm/traps.h>
+
+/* This code can be used to allow the AMD Geode to hopefully correctly execute
+ * some code which was originally compiled for an i686, by emulating NOPL,
+ * the only missing i686 instruction in the CPU
+ *
+ * Willy Tarreau <wi...@meta-x.org>
+ * Matteo Croce <technobo...@gmail.com>
+ */
+
+static inline int do_1f(u8 *ip)
+{
+       int length = 3;
+       switch (*ip) {
+       case 0x84:
+               if (!ip[5])
+                       length++;
+               else
+                       return 0;
+       case 0x80:
+               if (!ip[4] && !ip[3])
+                       length += 2;
+               else
+                       return 0;
+       case 0x44:
+               if (!ip[2])
+                       length++;
+               else
+                       return 0;
+       case 0x40:
+               if (!ip[1])
+                       length++;
+               else
+                       return 0;
+       case 0x00:
+               return length;
+       }
+       return 0;
+}
+
+static inline int do_0f(u8 *ip)
+{
+       if (*ip == 0x1f)
+               return do_1f(ip + 1);
+       return 0;
+}
+
+static inline int do_66(u8 *ip)
+{
+       if (*ip == 0x90)
+               return 2;
+       if (*ip == 0x0f) {
+               int res = do_0f(ip + 1);
+               if (res)
+                       return res + 1;
+               else
+                       return 0;
+       }
+       return 0;
+}
+
+static inline int do_start(u8 *ip)
+{
+       if (*ip == 0x0f)
+               return do_0f(ip + 1);
+       if (*ip == 0x66)
+               return do_66(ip + 1);
+       return 0;
+}
+
+/* [do_nopl_emu] is called by exception 6 after an invalid opcode has been
+ * encountered. It will try to emulate it by doing nothing,
+ * and will send a SIGILL or SIGSEGV to the process if not possible.
+ * the NOPL can have variable length opcodes:
+
+bytes number   opcode
+       2       66 90
+       3       0f 1f 00
+       4       0f 1f 40 00
+       5       0f 1f 44 00 00
+       6       66 0f 1f 44 00 00
+       7       0f 1f 80 00 00 00 00
+       8       0f 1f 84 00 00 00 00 00
+       9       66 0f 1f 84 00 00 00 00 00
+*/
+void do_nopl_emu(struct pt_regs *regs, long error_code)
+{
+       int res = do_start((u8 *)instruction_pointer(regs));
+
+       if (res)
+               regs->ip += res;
+       else
+               do_invalid_op(regs, error_code);
+}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "SubmittingPatches guidelines (was: Re: i686 quirk for AMD Geode)" by Martin Schleier
Martin Schleier  
View profile  
 More options Nov 7, 8:45 am
Newsgroups: fa.linux.kernel
From: "Martin Schleier" <drahemm...@gmx.net>
Date: Sat, 07 Nov 2009 13:45:29 UTC
Local: Sat, Nov 7 2009 8:45 am
Subject: SubmittingPatches guidelines (was: Re: i686 quirk for AMD Geode)
On Sat, 07 Nov 2009 11:37:46 Krzysztof Halasa
> "Martin Schleier" <drahemm...@gmx.net> writes:
> >> Did the patch in question contain such problems?
> > the last point:
> >  - etc... =>

> Yeah.

> > "WARNING: externs should be avoided in .c files

> Ironically, it's the only "WARNING" while the rest are "ERRORS".
> OTOH I personally believe all output from checkpatch should be labeled
> "WARNING"; it's not for checkpatch to decide. It's only a tool.

Ironically, I assumed that these matters are taken somewhat serious
and everything would be fine after the respin...

But instead, all everyone (except the submitter) is barking whenever checkpatch.pl is irrelevant - because apparently it only catches formatting errors -

(BTW: I think this message should be an ERROR, because it
 can really break Randy Dulap's massive kernel compile tests)

> > #56: FILE: arch/x86/kernel/nopl_emu.c:13:
> > +void do_invalid_op(struct pt_regs *regs, long error_code);" ?
> > (or do you think that this is a formatting issue?!)

> Actually, I think it wasn't any issue at all at this point, when it
> wasn't yet established if the patch makes sense at all.

here's the quote from on which the comment was based:
| On Sat, Oct 3, 2009 at 8:21 AM, Ingo Molnar <mi...@elte.hu> wrote:
|
| Looks good, but your signoff line is missing.
|
|        Ingo

now tell me: What is the word he was using to say that the idea
needs _rethinking_ and that he's declined to merge the patch
in the foreseeable future because of these shortcomings?
I can't see them, but I would be delighted if you can
point them out to me.

The discussion whenever this feature make sense has
taken place _a bit_ earlier in the thread with a _positive_ result.
(if you look at the date: the thread started over a month ago:
 http://lkml.org/lkml/2009/10/2/464 )

so I'm not sure if everyone was aware of this,
since this might explain the _differences_.

> > It is the job of a Submitter
> > (as described in Documentations/SubmittingPatches section 4)
> > to check and test his patches with tools like checkpatch or sparse
> > before posting them.

> You apparently forgot what SubmittingPatches file is all about:

> "This text is a collection of suggestions which can greatly increase the
> chances of your change being accepted."
> You know, we don't have laws for everything here.
> And we're not androids specialized in producing C code.
> We are supposed to use some common sense first.

Ahh common sense, so checking & testing your work
before submitting it not _common sense_ anymore?

Surely it's hard for anyone new to know about this before
hitting "send". But so far everyone has stumbled across this. :\

But back to the topic about laws.
What about: "12) Sign your work" in the same SubmittingPatches file?
Have you noticed that only SubmittingPatches talks about the signed-off-by?
And we all know that every patch has to have one.
So Clearly SubmittingPatches really contains LAWs for how to do things.

The only question is if "4) Style check your changes." is a
guideline or a _more_... And there's a paragraph in Documentation/SubmitChecklist:"

5: Check your patch for general style as detailed in
   Documentation/CodingStyle.  Check for trivial violations with the
   patch style checker prior to submission (scripts/checkpatch.pl).
   [BOLD] You should be able to justify all violations that remain in
   your patch. [BOLD]"

Andy Whitcroft <a...@shadowen.org> clearly wrote that down.
(And there's no point in arguing about checkpatch.pl when you
 have to JUSTIFY ALL REMAINING VIOLATIONS, or more to the point:
 FIX THEM INSTEAD.)

And now my - head hurts - we need a lawyer to answer if this
IS or IS NOT a law before we can bang on with this.

And yes Documentation/SubmitChecklist also has the same _header_:  
"Here are some basic things that developers should do if they want to see their kernel patch submissions accepted more quickly."

I know about that and I agree: time is always an issue.
This cycle is already @ -rc6 (rc5) and given that the debating
started over a month ago it's really time to get cracking...
Thankfully v3 is already available, and even better: fixed :-).

> > After all this patch is going into /arch/x86 and not /drivers/staging
> > and this sort of "extern declaration" is prone to break one day when
> > void do_invalid_op(struct pt_regs *, long); declaration is modified.

> That's true, though it's the same for "staging".

AFAIK the only rule for staging is: it must compile (somehow).
but I'm sure we can ask greg here if there are uncertainties.

--
DSL-Preisknaller: DSL Komplettpakete von GMX schon für
16,99 Euro mtl.!* Hier klicken: http://portal.gmx.net/de/go/dsl02
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Krzysztof Halasa  
View profile  
 More options Nov 7, 5:31 pm
Newsgroups: fa.linux.kernel
From: Krzysztof Halasa <k...@pm.waw.pl>
Date: Sat, 07 Nov 2009 22:31:01 UTC
Local: Sat, Nov 7 2009 5:31 pm
Subject: Re: SubmittingPatches guidelines (was: Re: i686 quirk for AMD Geode)

"Martin Schleier" <drahemm...@gmx.net> writes:
> And now my - head hurts - we need a lawyer to answer if this
> IS or IS NOT a law before we can bang on with this.

Good luck. I have no more questions.
--
Krzysztof Halasa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "i686 quirk for AMD Geode" by H. Peter Anvin
H. Peter Anvin  
View profile  
 More options Nov 7, 9:15 pm
Newsgroups: fa.linux.kernel
From: "H. Peter Anvin" <h...@zytor.com>
Date: Sun, 08 Nov 2009 02:15:38 UTC
Local: Sat, Nov 7 2009 9:15 pm
Subject: Re: i686 quirk for AMD Geode
On 11/07/2009 03:11 AM, Matteo Croce wrote:

If we're doing to introduce a missed-instruction interpreter (which is
what this is) in the kernel, it needs to handle all the subtleties of
x86 execution correctly; in particular I believe it needs to check the
code segment limits, permissions, and mode.  Things it doesn't
understand it can SIGILL (or, if more appropriate, SIGSEGV) on, of course.

Personally I think the easiest is to verify that the code segment is
flat 32 bits or even more specifically CS == USER_CS, and SIGILL otherwise.

        -hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andres Salomon  
View profile  
 More options Nov 8, 11:10 am
Newsgroups: fa.linux.kernel
From: Andres Salomon <dilin...@collabora.co.uk>
Date: Sun, 08 Nov 2009 16:10:20 UTC
Local: Sun, Nov 8 2009 11:10 am
Subject: Re: i686 quirk for AMD Geode
See comment below.  BTW, how does this affect performance on LXs?
Do you have any hard numbers for common tasks?

On Sat, 7 Nov 2009 12:11:55 +0100

Matteo Croce <technobo...@gmail.com> wrote:

[...]

If you're going to update this, you also need to make sure that you're
not breaking things that check it.  For example,
arch/x86/include/asm/geode.h has an is_geode_lx check that expects
boot_cpu_data.x86 to be 5.  Please be sure to update all these places
when creating a patch like this.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pavel Machek  
View profile  
 More options Nov 8, 12:35 pm
Newsgroups: fa.linux.kernel
From: Pavel Machek <pa...@ucw.cz>
Date: Sun, 08 Nov 2009 17:35:54 UTC
Local: Sun, Nov 8 2009 12:35 pm
Subject: Re: i686 quirk for AMD Geode
Hi!

> The AMD Geode LX has an x86 id of 5 (i586) tought it's technically an i686:

It is not.

> root@alix:~# egrep '^(cpu family|model name|flags)' /proc/cpuinfo
> cpu family      : 5
> model name      : Geode(TM) Integrated Processor by AMD PCS
> flags           : fpu de pse tsc msr cx8 sep pge cmov clflush mmx
> mmxext 3dnowext 3dnow

> indeed it has MMX, MMXEXT and CMOV, just lacks the long NOP instruction (NOPL).
> This patch adds a quirck to promote the Geode to an i686 and emulates
> the NOPL in the do_invalid_op trap, so the userspace never notices.
> Emulating the NOPL has minimum performance loss, emulating a NOPL
> takes 0.5 usecs
> and they are rarely used in x86

NOP should be fast, so this is bad idea.
                                                                Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pavel Machek  
View profile  
 More options Nov 8, 12:37 pm
Newsgroups: fa.linux.kernel
From: Pavel Machek <pa...@ucw.cz>
Date: Sun, 08 Nov 2009 17:37:28 UTC
Local: Sun, Nov 8 2009 12:37 pm
Subject: Re: i686 quirk for AMD Geode
On Fri 2009-11-06 23:18:06, Matteo Croce wrote:

Teach gcc that geodelx exists? No need to break kernel for that... and
you probably can gain even bigger gains.
                                                                        Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matteo Croce  
View profile  
 More options Nov 8, 12:47 pm
Newsgroups: fa.linux.kernel
From: Matteo Croce <technobo...@gmail.com>
Date: Sun, 08 Nov 2009 17:47:19 UTC
Local: Sun, Nov 8 2009 12:47 pm
Subject: Re: i686 quirk for AMD Geode

Gcc 4.4 already knows about it, just sucks at optimizing:

# CFLAGS='-march=geode' ./dry.c
gcc -c -O3 -march=geode ./dry.c -o dry1.o
gcc -DPASS2 -O3 -march=geode ./dry.c dry1.o  -o dry2

Dhrystone Benchmark, Version C, Version 2.2
Program compiled without 'register' attribute
Using times(), HZ=100

Trying 5000000 runs through Dhrystone:
Microseconds for one run through Dhrystone:        1.4
Dhrystones per Second:                          719424
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matteo Croce  
View profile  
 More options Nov 8, 1:05 pm
Newsgroups: fa.linux.kernel
From: Matteo Croce <technobo...@gmail.com>
Date: Sun, 08 Nov 2009 18:05:07 UTC
Local: Sun, Nov 8 2009 1:05 pm
Subject: Re: i686 quirk for AMD Geode

True, but also remove the duplicate function is_geode in the NAND driver
and use the identical one defined in geode.h:

--- a/drivers/mtd/nand/cs553x_nand.c    2009-11-08 18:58:14.835043214 +0100
+++ b/drivers/mtd/nand/cs553x_nand.c    2009-11-08 19:00:07.914117831 +0100
@@ -30,6 +30,7 @@

 #include <asm/msr.h>
 #include <asm/io.h>
+#include <asm/geode.h>

 #define NR_CS553X_CONTROLLERS  4

@@ -260,23 +261,6 @@
        return err;
 }

-static int is_geode(void)
-{
-       /* These are the CPUs which will have a CS553[56] companion chip */
-       if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
-           boot_cpu_data.x86 == 5 &&
-           boot_cpu_data.x86_model == 10)
-               return 1; /* Geode LX */
-
-       if ((boot_cpu_data.x86_vendor == X86_VENDOR_NSC ||
-            boot_cpu_data.x86_vendor == X86_VENDOR_CYRIX) &&
-           boot_cpu_data.x86 == 5 &&
-           boot_cpu_data.x86_model == 5)
-               return 1; /* Geode GX (née GX2) */
-
-       return 0;
-}
-

 #ifdef CONFIG_MTD_PARTITIONS
 static const char *part_probes[] = { "cmdlinepart", NULL };
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pavel Machek  
View profile  
 More options Nov 8, 1:10 pm
Newsgroups: fa.linux.kernel
From: Pavel Machek <pa...@ucw.cz>
Date: Sun, 08 Nov 2009 18:10:41 UTC
Local: Sun, Nov 8 2009 1:10 pm
Subject: Re: i686 quirk for AMD Geode
On Sun 2009-11-08 18:40:06, Matteo Croce wrote:

Good. So there's really no point in breaking kernel.

> # CFLAGS='-march=geode' ./dry.c
> gcc -c -O3 -march=geode ./dry.c -o dry1.o
> gcc -DPASS2 -O3 -march=geode ./dry.c dry1.o  -o dry2

> Dhrystone Benchmark, Version C, Version 2.2
> Program compiled without 'register' attribute
> Using times(), HZ=100

> Trying 5000000 runs through Dhrystone:
> Microseconds for one run through Dhrystone:        1.4
> Dhrystones per Second:                          719424

..fix gcc to genereta code at least as good as for i686 and you are
done...?

                                                                        Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matteo Croce  
View profile  
 More options Nov 8, 1:13 pm
Newsgroups: fa.linux.kernel
From: Matteo Croce <technobo...@gmail.com>
Date: Sun, 08 Nov 2009 18:13:36 UTC
Local: Sun, Nov 8 2009 1:13 pm
Subject: Re: i686 quirk for AMD Geode

This is on my TODO list, but better to discuss it in the GCC mailing list,
the kernel should use -march=geode and GCC should generate the best code
for the AMD Geode, actually the i686 one
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matteo Croce  
View profile  
 More options Nov 8, 1:23 pm
Newsgroups: fa.linux.kernel
From: Matteo Croce <technobo...@gmail.com>
Date: Sun, 08 Nov 2009 18:23:32 UTC
Local: Sun, Nov 8 2009 1:23 pm
Subject: Re: i686 quirk for AMD Geode

Right, but what if is_geode_lx() is called befor the x86.id change takes effect?
Maybe something like this?

--- a/arch/x86/include/asm/geode.h 2009-11-08 19:13:43.531117343 +0100
+++ b/arch/x86/include/asm/geode.h      2009-11-08 19:19:42.130618023 +0100
@@ -177,7 +177,7 @@
 static inline int is_geode_lx(void)
 {
        return ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) &&
-               (boot_cpu_data.x86 == 5) &&
+               (boot_cpu_data.x86 == 5 || boot_cpu_data.x86 == 6) &&
                (boot_cpu_data.x86_model == 10));
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matteo Croce  
View profile  
 More options Nov 8, 1:43 pm
Newsgroups: fa.linux.kernel
From: Matteo Croce <technobo...@gmail.com>
Date: Sun, 08 Nov 2009 18:43:22 UTC
Local: Sun, Nov 8 2009 1:43 pm
Subject: Re: i686 quirk for AMD Geode
On Fri, Nov 6, 2009 at 5:44 PM, H. Peter Anvin <h...@zytor.com> wrote:

> On 11/06/2009 06:59 AM, Matteo Croce wrote:
>> indeed it has MMX, MMXEXT and CMOV, just lacks the long NOP instruction (NOPL).

> MMX and MMXEXT are hardly hallmarks of i686, which leaves only cmov.
> I'm somewhat wondering about the general value of this patch; is i686
> code really that much faster on Geode that it's worth it?

>        -hpa

> --
> H. Peter Anvin, Intel Open Source Technology Center
> I work for Intel.  I don't speak on their behalf.

There is a small advantage, but considering that GCC isn't much geode aware yet
there is stil room for improvement IMHO:

root@alix:/usr/src/dist# ll
totale 257M
-rwxr-xr-x 1 1000 src  93K  8 nov  2009 bzip2-i586
-rwxr-xr-x 1 1000 src  93K  8 nov  2009 bzip2-i686
-rwxr-xr-x 1 1000 src  60K  8 nov  2009 gzip-i586
-rwxr-xr-x 1 1000 src  60K  8 nov  2009 gzip-i686
-rw-r--r-- 1 1000 src 256M  8 nov  2009 linux-2.6.31.5.tar
-rwxr-xr-x 1 1000 src  90K  8 nov  2009 lzma-i586
-rwxr-xr-x 1 1000 src  94K  8 nov  2009 lzma-i686
root@alix:/usr/src/dist# time cat linux-2.6.31.5.tar >/dev/null

real    0m10.168s
user    0m0.030s
sys     0m1.390s
root@alix:/usr/src/dist# time ./gzip-i586 -9 < linux-2.6.31.5.tar >/dev/null

real    5m22.331s
user    5m10.820s
sys     0m11.170s
root@alix:/usr/src/dist# time ./gzip-i686 -9 < linux-2.6.31.5.tar >/dev/null

real    5m3.737s
user    4m51.880s
sys     0m11.510s
root@alix:/usr/src/dist# time ./bzip2-i586 -9 < linux-2.6.31.5.tar >/dev/null

real    9m16.539s
user    9m4.410s
sys     0m11.760s
root@alix:/usr/src/dist# time ./bzip2-i686 -9 < linux-2.6.31.5.tar >/dev/null

real    8m48.682s
user    8m34.950s
sys     0m13.260s
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andres Salomon  
View profile  
 More options Nov 8, 1:46 pm
Newsgroups: fa.linux.kernel
From: Andres Salomon <dilin...@collabora.co.uk>
Date: Sun, 08 Nov 2009 18:46:45 UTC
Local: Sun, Nov 8 2009 1:46 pm
Subject: Re: i686 quirk for AMD Geode
On Sun, 8 Nov 2009 19:04:35 +0100

Matteo Croce <technobo...@gmail.com> wrote:

[...]

I think the nand driver needs a bit more love than this.  The cs553x is
available for non-geode platforms, so a cs553x driver should not be
checking for the existence of a specific CPU.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andres Salomon  
View profile  
 More options Nov 8, 1:48 pm
Newsgroups: fa.linux.kernel
From: Andres Salomon <dilin...@collabora.co.uk>
Date: Sun, 08 Nov 2009 18:48:20 UTC
Local: Sun, Nov 8 2009 1:48 pm
Subject: Re: i686 quirk for AMD Geode
On Sun, 8 Nov 2009 19:22:47 +0100

Yeah, that looks better.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pavel Machek  
View profile  
 More options Nov 8, 2:36 pm
Newsgroups: fa.linux.kernel
From: Pavel Machek <pa...@ucw.cz>
Date: Sun, 08 Nov 2009 19:36:40 UTC
Local: Sun, Nov 8 2009 2:36 pm
Subject: Re: i686 quirk for AMD Geode
On Sun 2009-11-08 20:29:55, Sven-Haegar Koch wrote:

So hack your distribution to use libc6-686 if you know that it is
safe... (that is no NOPL usage there). Still no need to break
/proc/cpuinfo.
                                                                        Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sven-Haegar Koch  
View profile  
 More options Nov 8, 2:38 pm
Newsgroups: fa.linux.kernel
From: Sven-Haegar Koch <hae...@sdinet.de>
Date: Sun, 08 Nov 2009 19:38:40 UTC
Local: Sun, Nov 8 2009 2:38 pm
Subject: Re: i686 quirk for AMD Geode

But no standard distribution will be made available in a geode special
version - not enough machines in the marekt. So I think it is better to
be able to use the i686 specific things they already support, like
libc6-686 from debian for example.

c'ya
sven

--
The lights are fading out, once more...


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matteo Croce  
View profile  
 More options Nov 8, 2:47 pm
Newsgroups: fa.linux.kernel
From: Matteo Croce <technobo...@gmail.com>
Date: Sun, 08 Nov 2009 19:47:08 UTC
Local: Sun, Nov 8 2009 2:47 pm
Subject: Re: i686 quirk for AMD Geode

That's exactly the patch point
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matteo Croce  
View profile  
 More options Nov 8, 2:47 pm
Newsgroups: fa.linux.kernel
From: Matteo Croce <technobo...@gmail.com>
Date: Sun, 08 Nov 2009 19:47:54 UTC
Local: Sun, Nov 8 2009 2:47 pm
Subject: Re: i686 quirk for AMD Geode

Better to be sure that a NOPL whouldn't SIGILL your program, isn't it?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pavel Machek  
View profile  
 More options Nov 8, 2:51 pm
Newsgroups: fa.linux.kernel
From: Pavel Machek <pa...@ucw.cz>
Date: Sun, 08 Nov 2009 19:51:10 UTC
Local: Sun, Nov 8 2009 2:51 pm
Subject: Re: i686 quirk for AMD Geode

> >> > > Teach gcc that geodelx exists? No need to break kernel for that... and
> >> > > you probably can gain even bigger gains.

> > But no standard distribution will be made available in a geode special
> > version - not enough machines in the marekt. So I think it is better to
> > be able to use the i686 specific things they already support, like
> > libc6-686 from debian for example.

> That's exactly the patch point

Not quite.

Your cpu is not 686; stop trying to pretend it is.

Now, maybe it is good idea to run libc6-686 on it. If you can
guarantee it contains no NOPL, fix whatever code is responsible for
selecting libc to use libc6-686 to use that. (Bonus points for
renaming libc6-686 to something more suitable. libc6-cmov?)

                                                                        Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pavel Machek  
View profile  
 More options Nov 8, 2:52 pm
Newsgroups: fa.linux.kernel
From: Pavel Machek <pa...@ucw.cz>
Date: Sun, 08 Nov 2009 19:52:19 UTC
Local: Sun, Nov 8 2009 2:52 pm
Subject: Re: i686 quirk for AMD Geode

> >> But no standard distribution will be made available in a geode special
> >> version - not enough machines in the marekt. So I think it is better to
> >> be able to use the i686 specific things they already support, like
> >> libc6-686 from debian for example.

> > So hack your distribution to use libc6-686 if you know that it is
> > safe... (that is no NOPL usage there). Still no need to break
> > /proc/cpuinfo.

> Better to be sure that a NOPL whouldn't SIGILL your program, isn't
> it?

SIGILL is easier to debug than NOPL mysteriously taking 100x time it
should, sorry.
                                                                        Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 26 - 50 of 133 < Older  Newer >
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google