linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Pentium 4 and 2.4/2.5
@ 2000-11-04 23:36 Frank Davis
  2000-11-07  3:41 ` Andre Hedrick
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Frank Davis @ 2000-11-04 23:36 UTC (permalink / raw)
  To: linux-kernel

Hello,
  I noticed that Pentium 4 isn't an config option in 2.4.0-test10. Is
someone working on a patch for the the kernel (if needed) to support the
Pentium 4 after 2.4.0 is released?

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-04 23:36 Pentium 4 and 2.4/2.5 Frank Davis
@ 2000-11-07  3:41 ` Andre Hedrick
  2000-11-07 12:13   ` Alan Cox
  2000-11-07  4:01 ` Robert M. Love
  2000-11-07 12:04 ` Alan Cox
  2 siblings, 1 reply; 20+ messages in thread
From: Andre Hedrick @ 2000-11-07  3:41 UTC (permalink / raw)
  To: Frank Davis; +Cc: linux-kernel


Not to worry, some of us are working with the 'I' guys to do proper P4
detection.

Cheers,

On Sat, 4 Nov 2000, Frank Davis wrote:

> Hello,
>   I noticed that Pentium 4 isn't an config option in 2.4.0-test10. Is
> someone working on a patch for the the kernel (if needed) to support the
> Pentium 4 after 2.4.0 is released?
> 
> Regards,
> Frank
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> Please read the FAQ at http://www.tux.org/lkml/
> 

Andre Hedrick
CTO Timpanogas Research Group
EVP Linux Development, TRG
Linux ATA Development

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-04 23:36 Pentium 4 and 2.4/2.5 Frank Davis
  2000-11-07  3:41 ` Andre Hedrick
@ 2000-11-07  4:01 ` Robert M. Love
  2000-11-07 12:04 ` Alan Cox
  2 siblings, 0 replies; 20+ messages in thread
From: Robert M. Love @ 2000-11-07  4:01 UTC (permalink / raw)
  To: Frank Davis; +Cc: linux-kernel

On Sat, 4 Nov 2000, Frank Davis hissed:
>   I noticed that Pentium 4 isn't an config option in 2.4.0-test10. Is
> someone working on a patch for the the kernel (if needed) to support the
> Pentium 4 after 2.4.0 is released?

from what i have read of the Pentium IV, the linux kernel will not need
any patches to run successfully.

that being said, a lot of oppurtunity exists for optimization, i bet. some
686-core optimizations may need to be rethought, but there is at least
some things we can better do to take advantage of the P4.  if nothing
else, the new pipeline size and cache-

-- 
Robert M. Love
rml@ufl.edu
rml@tech9.net

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-04 23:36 Pentium 4 and 2.4/2.5 Frank Davis
  2000-11-07  3:41 ` Andre Hedrick
  2000-11-07  4:01 ` Robert M. Love
@ 2000-11-07 12:04 ` Alan Cox
  2 siblings, 0 replies; 20+ messages in thread
From: Alan Cox @ 2000-11-07 12:04 UTC (permalink / raw)
  To: Frank Davis; +Cc: linux-kernel

>   I noticed that Pentium 4 isn't an config option in 2.4.0-test10. Is
> someone working on a patch for the the kernel (if needed) to support the
> Pentium 4 after 2.4.0 is released?

And also for 2.2. 2.2.18pre18/19 should ident the CPU fine. A contributed patch
should also report the caches correctly in 2.2.18pre20 once I release it.

The big 2.4 issue is that 2.4 won't work with a CPU running at 2GHz or higher
(2.2.18 will be the first 2.2 kernel handling this). The changes have yet to be
pushed into 2.4. Thus judging by Intels noises so far it will only be early
PIV processors that work ;)

Alan

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-07  3:41 ` Andre Hedrick
@ 2000-11-07 12:13   ` Alan Cox
  2000-11-07 21:06     ` Lyle Coder
  2000-11-08 17:26     ` Linus Torvalds
  0 siblings, 2 replies; 20+ messages in thread
From: Alan Cox @ 2000-11-07 12:13 UTC (permalink / raw)
  To: Andre Hedrick; +Cc: Frank Davis, linux-kernel

> Not to worry, some of us are working with the 'I' guys to do proper P4
> detection.

Be careful with the intel patches. The ones I've seen so far tried to call the
cpu 'if86' breaking several tools that do cpu model checking off uname. They
didnt fix the 2GHz CPU limit, they use 'rep nop' in the locks which is
explicitly 'undefined behaviour' for non intel processors and they use the
TSC without checking it had one.

Hopefully they have improved since

Alan

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-07 12:13   ` Alan Cox
@ 2000-11-07 21:06     ` Lyle Coder
  2000-11-07 21:48       ` Alan Cox
  2000-11-08 17:26     ` Linus Torvalds
  1 sibling, 1 reply; 20+ messages in thread
From: Lyle Coder @ 2000-11-07 21:06 UTC (permalink / raw)
  To: Andre Hedrick, Alan Cox; +Cc: Frank Davis, linux-kernel

Alan,
are you saying that rep;nop is not needed in the spinlocks? (because they
are for P4)

Thanks
Lyle
----- Original Message -----
From: "Alan Cox" <alan@lxorguk.ukuu.org.uk>
To: "Andre Hedrick" <andre@linux-ide.org>
Cc: "Frank Davis" <fdavis112@juno.com>; <linux-kernel@vger.kernel.org>
Sent: Tuesday, November 07, 2000 4:13 AM
Subject: Re: Pentium 4 and 2.4/2.5


> > Not to worry, some of us are working with the 'I' guys to do proper P4
> > detection.
>
> Be careful with the intel patches. The ones I've seen so far tried to call
the
> cpu 'if86' breaking several tools that do cpu model checking off uname.
They
> didnt fix the 2GHz CPU limit, they use 'rep nop' in the locks which is
> explicitly 'undefined behaviour' for non intel processors and they use the
> TSC without checking it had one.
>
> Hopefully they have improved since
>
> Alan
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> Please read the FAQ at http://www.tux.org/lkml/
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-07 21:06     ` Lyle Coder
@ 2000-11-07 21:48       ` Alan Cox
  2000-11-08 17:31         ` Linus Torvalds
  0 siblings, 1 reply; 20+ messages in thread
From: Alan Cox @ 2000-11-07 21:48 UTC (permalink / raw)
  To: Lyle Coder; +Cc: Andre Hedrick, Alan Cox, Frank Davis, linux-kernel

> are you saying that rep;nop is not needed in the spinlocks? (because they
> are for P4)

rep;nop is a magic instruction on the PIV and possibly some PIII series CPUs
[not sure]. As far as I can make out it naps momentarily or until bus
activity thus saving power on spinlocks.

The problem is 'rep nop' is not defined on other cpus so we can only really use
it on the PIII/PIV kernel builds

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-07 12:13   ` Alan Cox
  2000-11-07 21:06     ` Lyle Coder
@ 2000-11-08 17:26     ` Linus Torvalds
  2000-11-08 17:50       ` Alan Cox
  1 sibling, 1 reply; 20+ messages in thread
From: Linus Torvalds @ 2000-11-08 17:26 UTC (permalink / raw)
  To: linux-kernel

In article <E13t7dG-0007KT-00@the-village.bc.nu>,
Alan Cox  <alan@lxorguk.ukuu.org.uk> wrote:
>
>Be careful with the intel patches. The ones I've seen so far tried to call the
>cpu 'if86' breaking several tools that do cpu model checking off uname. They
>didnt fix the 2GHz CPU limit, they use 'rep nop' in the locks which is
>explicitly 'undefined behaviour' for non intel processors and they use the
>TSC without checking it had one.

"rep nop" is definitely not undefined behaviour except in some older
Intel manuals. 

Do you actually know of a CPU where it doesn't work? Every single
intel-compatible CPU I know of has the rep prefixes as no-ops if they
aren't used (lock -> ILL being a later, documented, addition), and the
way the prefixes work it almost has to be that way.

As prefixes they can't be part of the instruction, because you can
legally have other prefixes in between the rep and the real instruction,
which means that any sane implementation will just set a flag when it
sees the prefix, and an instruction that doesn't care will just ignore
the flag.  So you'd almost have to do _extra_ work to make "rep nop"
fail, even if it used to be specified as "undefined". 

Standard 2.4.x will definitely be using "rep nop" unless somebody can
show me a CPU where it doesn't work (and even then I probably won't care
unless that CPU is also SMP-capable).  It's documented by intel these
days, and it works on all CPU's I've ever heard of, and it even makes
sense to me (*).

(*) Well..  More sense than _some_ instruction set extensions I've seen. 
After all, "repeat no-op" for a longer delay sounds almost logical. 
Certainly better than that IV == 15 thing, ugh ;)

Also, at least part of the reason Intel removed the TSC check was that
Linux actually seems to get the extended CPU capability flags wrong,
overwriting the _real_ capability flags which in turn caused the TSC
check on Linux to simply not work.  Peter Anvin is working on fixing
this. I suspect that Linux-2.2 has the same problem.

There's a few other minor details that need to be fixed for Pentium 4
features (aka " not very well documented errata"), and I think I have
them all except for waiting for Peter to get the capabilities flag
handling right.

So I suspect that we'll have good support for Pentium IV soon enough.. 

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-07 21:48       ` Alan Cox
@ 2000-11-08 17:31         ` Linus Torvalds
  0 siblings, 0 replies; 20+ messages in thread
From: Linus Torvalds @ 2000-11-08 17:31 UTC (permalink / raw)
  To: linux-kernel

In article <E13tGbg-0007oC-00@the-village.bc.nu>,
Alan Cox  <alan@lxorguk.ukuu.org.uk> wrote:
>
>rep;nop is a magic instruction on the PIV and possibly some PIII series CPUs
>[not sure]. As far as I can make out it naps momentarily or until bus
>activity thus saving power on spinlocks.

>From what I've heard, the reason Intel _really_ wants "rep nop" is that
without it the CPU will heat up quite efficiently (that's what you do
when you want to run at an eventual 2GHz with all cylinders firing all
the time), causing thermal meltdown on non-thermally protected CPU's and
CPU speed throttling on the ones that _are_ thermally protected (which
will obviously have to be all the shipping ones). 

And the thermal throttling will severly cripple performance.

>The problem is 'rep nop' is not defined on other cpus so we can only really use
>it on the PIII/PIV kernel builds

Intel retroactively defined it for all their CPU's. And I very strongly
suspect that every single other x86 CPU vendor does the same. Why not?
They get a new instruction for free, but just documenting it. Maybe they
can sell the same old chip with a new name ("The Xxxxx Wonderchip. Now
with documetned 'rep nop' support! Get one today!").

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-08 17:26     ` Linus Torvalds
@ 2000-11-08 17:50       ` Alan Cox
  2000-11-08 18:10         ` Linus Torvalds
  0 siblings, 1 reply; 20+ messages in thread
From: Alan Cox @ 2000-11-08 17:50 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

> unless that CPU is also SMP-capable).  It's documented by intel these
> days, and it works on all CPU's I've ever heard of, and it even makes
> sense to me (*).

Do the intel docs guarantee it works on i486 and higher, if so SMP athlon
will be the only check needed for the SMP users. You work for an x86 chip
cloning company so if you say it works I trust you 8)

> Also, at least part of the reason Intel removed the TSC check was that
> Linux actually seems to get the extended CPU capability flags wrong,
> overwriting the _real_ capability flags which in turn caused the TSC
> check on Linux to simply not work.  Peter Anvin is working on fixing
> this. I suspect that Linux-2.2 has the same problem.

I've not seen incorrect TSC detection in 2.2, do you know the precise
circumstances this occurs and I'll check over them. I've also got no
bug reports of this failing.

check_config would also panic with the 'Kernel compiled for ..' message 
if it occurred.

> There's a few other minor details that need to be fixed for Pentium 4
> features (aka " not very well documented errata"), and I think I have
> them all except for waiting for Peter to get the capabilities flag
> handling right.
> 
> So I suspect that we'll have good support for Pentium IV soon enough.. 

Excellent

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-08 17:50       ` Alan Cox
@ 2000-11-08 18:10         ` Linus Torvalds
  2000-11-08 18:12           ` Brian Pomerantz
  2000-11-08 18:17           ` Alan Cox
  0 siblings, 2 replies; 20+ messages in thread
From: Linus Torvalds @ 2000-11-08 18:10 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel



On Wed, 8 Nov 2000, Alan Cox wrote:
> > unless that CPU is also SMP-capable).  It's documented by intel these
> > days, and it works on all CPU's I've ever heard of, and it even makes
> > sense to me (*).
> 
> Do the intel docs guarantee it works on i486 and higher, if so SMP athlon
> will be the only check needed for the SMP users. You work for an x86 chip
> cloning company so if you say it works I trust you 8)

Well, we don't make low-power SMP laptops, so as such Transmeta doesn't
much care. It will work, though. And yes, as far as I know Intel made it
an "architecture feature", meaning that they claim it work son all their
ia32 chips.

Now, I could imagine that Intel would select an instruction that didn't
work on Athlon on purpose, but I really don't think they did.  I don't
have an athlon to test.

It's easy enough to generate a test-program. If the following works,
you're pretty much guaranteed that it's ok

	int main()
	{
		printf("Testing 'rep nop' ... ");
		asm volatile("rep ; nop");
		printf("okey-dokey\n"); 
		return 0;
	}

(there's not much a "rep nop" _can_ do, after all - the most likely CPU
extension would be to raise an "Illegal Opcode" fault).

> > Also, at least part of the reason Intel removed the TSC check was that
> > Linux actually seems to get the extended CPU capability flags wrong,
> > overwriting the _real_ capability flags which in turn caused the TSC
> > check on Linux to simply not work.  Peter Anvin is working on fixing
> > this. I suspect that Linux-2.2 has the same problem.
> 
> I've not seen incorrect TSC detection in 2.2, do you know the precise
> circumstances this occurs and I'll check over them. I've also got no
> bug reports of this failing.

It won't fail on other CPU's. The bug is, as far as I can tell, in
get_model_name(),

	cpuid(0x80000001, &dummy, &dummy, &dummy, &(c->x86_capability));

Notice how we overwrite the x86_capability state with whatever we read
from the extended register 0x80000001. So we overwrite the _real_
capabilities that we got the right way in head.S.

This is wrong. It just happens to work on other, non-Pentium IV,
processors. The extended capabilities are an _extention_, not replacement,
for the regular capabilities.

> check_config would also panic with the 'Kernel compiled for ..' message 
> if it occurred.

Which is what it apparently does, if you compile for TSC. Even though very
obviously a Pentium IV _does_ have a TSC.

NOTE! I don't actually have access to a Pentium IV myself yet, although
I'm promised one soon enough. So I've only got second-hand reports on the
cpuid thing so far.

		Linus

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-08 18:10         ` Linus Torvalds
@ 2000-11-08 18:12           ` Brian Pomerantz
  2000-11-08 18:21             ` Alan Cox
  2000-11-08 18:17           ` Alan Cox
  1 sibling, 1 reply; 20+ messages in thread
From: Brian Pomerantz @ 2000-11-08 18:12 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Alan Cox, linux-kernel

On Wed, Nov 08, 2000 at 10:10:45AM -0800, Linus Torvalds wrote:
> 
> Now, I could imagine that Intel would select an instruction that didn't
> work on Athlon on purpose, but I really don't think they did.  I don't
> have an athlon to test.
> 
> It's easy enough to generate a test-program. If the following works,
> you're pretty much guaranteed that it's ok
> 
> 	int main()
> 	{
> 		printf("Testing 'rep nop' ... ");
> 		asm volatile("rep ; nop");
> 		printf("okey-dokey\n"); 
> 		return 0;
> 	}
> 
> (there's not much a "rep nop" _can_ do, after all - the most likely CPU
> extension would be to raise an "Illegal Opcode" fault).
> 

Just for the curious, this works on Athlons. :)


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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-08 18:10         ` Linus Torvalds
  2000-11-08 18:12           ` Brian Pomerantz
@ 2000-11-08 18:17           ` Alan Cox
  1 sibling, 0 replies; 20+ messages in thread
From: Alan Cox @ 2000-11-08 18:17 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Alan Cox, linux-kernel

> It won't fail on other CPU's. The bug is, as far as I can tell, in
> get_model_name(),
> 
> 	cpuid(0x80000001, &dummy, &dummy, &dummy, &(c->x86_capability));

Dave Jones fixed this one - for intel we don't use get_model_name() blindly
now. I can see how some earlier 2.2.18pre's would have blown up, but 2.2.17
would (fortunately) be ok.

Thanks

> Notice how we overwrite the x86_capability state with whatever we read
> from the extended register 0x80000001. So we overwrite the _real_
> capabilities that we got the right way in head.S.

Yep

Alan

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-08 18:12           ` Brian Pomerantz
@ 2000-11-08 18:21             ` Alan Cox
  2000-11-08 18:27               ` kernel
  2000-11-08 18:29               ` Brian Pomerantz
  0 siblings, 2 replies; 20+ messages in thread
From: Alan Cox @ 2000-11-08 18:21 UTC (permalink / raw)
  To: Brian Pomerantz; +Cc: Linus Torvalds, Alan Cox, linux-kernel

> > 		asm volatile("rep ; nop");
> > 
> > (there's not much a "rep nop" _can_ do, after all - the most likely CPU
> > extension would be to raise an "Illegal Opcode" fault).
> 
> Just for the curious, this works on Athlons. :)

What state does it leave the condition codes ?  That matters. 

Take for example

if (!oldval)
                asm volatile(
                        "2:"
                        "cmpl $-1, %0;"
                        "rep; nop;"
                        "je 2b;"
                        	: :"m" (current->need_resched));
}

When running SMP with poll_idle enabled. I can't see it changing condition
codes on an athlon but..

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-08 18:21             ` Alan Cox
@ 2000-11-08 18:27               ` kernel
  2000-11-08 18:47                 ` Alan Cox
  2000-11-08 18:29               ` Brian Pomerantz
  1 sibling, 1 reply; 20+ messages in thread
From: kernel @ 2000-11-08 18:27 UTC (permalink / raw)
  To: Alan Cox; +Cc: Brian Pomerantz, Linus Torvalds, linux-kernel

On Wed, 8 Nov 2000, Alan Cox wrote:

> What state does it leave the condition codes ?  That matters. 

Alan, rep ; nop is one of the suggested 2 byte fillers in the Athon
optimization guide; it's handled during instruction decode and is
completely free.  It also has no effect on K6s.

		-ben

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-08 18:21             ` Alan Cox
  2000-11-08 18:27               ` kernel
@ 2000-11-08 18:29               ` Brian Pomerantz
  1 sibling, 0 replies; 20+ messages in thread
From: Brian Pomerantz @ 2000-11-08 18:29 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linus Torvalds, linux-kernel

On Wed, Nov 08, 2000 at 06:21:54PM +0000, Alan Cox wrote:
> > > 		asm volatile("rep ; nop");
> > > 
> > > (there's not much a "rep nop" _can_ do, after all - the most likely CPU
> > > extension would be to raise an "Illegal Opcode" fault).
> > 
> > Just for the curious, this works on Athlons. :)
> 
> What state does it leave the condition codes ?  That matters. 
> 
> Take for example
> 
> if (!oldval)
>                 asm volatile(
>                         "2:"
>                         "cmpl $-1, %0;"
>                         "rep; nop;"
>                         "je 2b;"
>                         	: :"m" (current->need_resched));
> }
> 
> When running SMP with poll_idle enabled. I can't see it changing condition
> codes on an athlon but..

Yup, that works as well.  This example:

	int	foo = -1;
	asm volatile(
		"2:"
		"cmpl $-1, %0;"
		"rep; nop;"
		"je 2b;"
		: :"m" (foo));

loops forever.  If you set 'foo = 0' it drops out.


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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-08 18:27               ` kernel
@ 2000-11-08 18:47                 ` Alan Cox
  2000-11-09 20:42                   ` Simon Kirby
  0 siblings, 1 reply; 20+ messages in thread
From: Alan Cox @ 2000-11-08 18:47 UTC (permalink / raw)
  To: kernel; +Cc: Alan Cox, Brian Pomerantz, Linus Torvalds, linux-kernel

> On Wed, 8 Nov 2000, Alan Cox wrote:
> 
> > What state does it leave the condition codes ?  That matters. 
> 
> Alan, rep ; nop is one of the suggested 2 byte fillers in the Athon
> optimization guide; it's handled during instruction decode and is
> completely free.  It also has no effect on K6s.

Ok. Issue settled. So 'rep nop' is safe. Ok that can get into the spinlocks
for 2.2.18


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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-08 18:47                 ` Alan Cox
@ 2000-11-09 20:42                   ` Simon Kirby
  0 siblings, 0 replies; 20+ messages in thread
From: Simon Kirby @ 2000-11-09 20:42 UTC (permalink / raw)
  To: linux-kernel

On Wed, Nov 08, 2000 at 06:47:40PM +0000, Alan Cox wrote:

> Ok. Issue settled. So 'rep nop' is safe. Ok that can get into the spinlocks
> for 2.2.18

Just curious... What does "rep nop" actually accomplish, anyway?

Simon-

[  Stormix Technologies Inc.  ][  NetNation Communications Inc. ]
[       sim@stormix.com       ][       sim@netnation.com        ]
[ Opinions expressed are not necessarily those of my employers. ]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
  2000-11-05  0:04 Frank Davis
@ 2000-11-08  0:43 ` Alan Cox
  0 siblings, 0 replies; 20+ messages in thread
From: Alan Cox @ 2000-11-08  0:43 UTC (permalink / raw)
  To: Frank Davis; +Cc: alan, x_coder, andre, linux-kernel

>   As for the 2.2.18 patch for correctly determining 2GHz and above, can
> it be easily  merged into the 2.4.x kernel, and if so, what's the maximum
> clock speed that can be detected?

It should be easy yes. Its good to 100Ghz or so now ;)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Pentium 4 and 2.4/2.5
@ 2000-11-05  0:04 Frank Davis
  2000-11-08  0:43 ` Alan Cox
  0 siblings, 1 reply; 20+ messages in thread
From: Frank Davis @ 2000-11-05  0:04 UTC (permalink / raw)
  To: alan; +Cc: x_coder, andre, linux-kernel

Alan,
  As for 'rep nop', couldn't we add in the code, as an example:  
#ifdef Pentium_4
rep nop
#endif

  As for the 2.2.18 patch for correctly determining 2GHz and above, can
it be easily  merged into the 2.4.x kernel, and if so, what's the maximum
clock speed that can be detected?

Regards,
-Frank

On Tue, 7 Nov 2000 21:48:40 +0000 (GMT) Alan Cox
<alan@lxorguk.ukuu.org.uk> writes:
> > are you saying that rep;nop is not needed in the spinlocks? 
> (because they
> > are for P4)
> 
> rep;nop is a magic instruction on the PIV and possibly some PIII 
> series CPUs
> [not sure]. As far as I can make out it naps momentarily or until 
> bus
> activity thus saving power on spinlocks.
> 
> The problem is 'rep nop' is not defined on other cpus so we can only 
> really use
> it on the PIII/PIV kernel builds
> 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2000-11-09 20:43 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-04 23:36 Pentium 4 and 2.4/2.5 Frank Davis
2000-11-07  3:41 ` Andre Hedrick
2000-11-07 12:13   ` Alan Cox
2000-11-07 21:06     ` Lyle Coder
2000-11-07 21:48       ` Alan Cox
2000-11-08 17:31         ` Linus Torvalds
2000-11-08 17:26     ` Linus Torvalds
2000-11-08 17:50       ` Alan Cox
2000-11-08 18:10         ` Linus Torvalds
2000-11-08 18:12           ` Brian Pomerantz
2000-11-08 18:21             ` Alan Cox
2000-11-08 18:27               ` kernel
2000-11-08 18:47                 ` Alan Cox
2000-11-09 20:42                   ` Simon Kirby
2000-11-08 18:29               ` Brian Pomerantz
2000-11-08 18:17           ` Alan Cox
2000-11-07  4:01 ` Robert M. Love
2000-11-07 12:04 ` Alan Cox
2000-11-05  0:04 Frank Davis
2000-11-08  0:43 ` Alan Cox

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).