* [PATCH -mm] IOAT: fix for UP use of cpu_physical_id()
@ 2007-08-20 20:29 Shannon Nelson
2007-08-20 22:26 ` H. Peter Anvin
0 siblings, 1 reply; 3+ messages in thread
From: Shannon Nelson @ 2007-08-20 20:29 UTC (permalink / raw)
To: akpm, linux-kernel; +Cc: chris.leech, ak, tony.luck, shannon.nelson
Make sure we can use cpu_physical_id() even when compiled for
uni-processor.
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Chris Leech <chris.leech@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
---
drivers/dma/ioat_dca.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/dma/ioat_dca.c b/drivers/dma/ioat_dca.c
index c3a500b..b1af49c 100644
--- a/drivers/dma/ioat_dca.c
+++ b/drivers/dma/ioat_dca.c
@@ -25,6 +25,14 @@
#include <linux/smp.h>
#include <linux/interrupt.h>
#include <linux/dca.h>
+
+// either a kernel change is needed, or we need something like this in kernel
+#ifndef CONFIG_SMP
+#include <asm/smp.h>
+#undef cpu_physical_id
+#define cpu_physical_id(cpu) (cpuid_ebx(1) >> 24)
+#endif
+
#include "ioatdma.h"
#include "ioatdma_registers.h"
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -mm] IOAT: fix for UP use of cpu_physical_id()
2007-08-20 20:29 [PATCH -mm] IOAT: fix for UP use of cpu_physical_id() Shannon Nelson
@ 2007-08-20 22:26 ` H. Peter Anvin
2007-08-20 23:21 ` Nelson, Shannon
0 siblings, 1 reply; 3+ messages in thread
From: H. Peter Anvin @ 2007-08-20 22:26 UTC (permalink / raw)
To: Shannon Nelson; +Cc: akpm, linux-kernel, chris.leech, ak, tony.luck
Shannon Nelson wrote:
> Make sure we can use cpu_physical_id() even when compiled for
> uni-processor.
>
> diff --git a/drivers/dma/ioat_dca.c b/drivers/dma/ioat_dca.c
> index c3a500b..b1af49c 100644
> --- a/drivers/dma/ioat_dca.c
> +++ b/drivers/dma/ioat_dca.c
> @@ -25,6 +25,14 @@
> #include <linux/smp.h>
> #include <linux/interrupt.h>
> #include <linux/dca.h>
> +
> +// either a kernel change is needed, or we need something like this in kernel
> +#ifndef CONFIG_SMP
> +#include <asm/smp.h>
> +#undef cpu_physical_id
> +#define cpu_physical_id(cpu) (cpuid_ebx(1) >> 24)
> +#endif
> +
This value should probably be cached. Executing cpuid to get a static
value seems like a bad idea.
-hpa
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH -mm] IOAT: fix for UP use of cpu_physical_id()
2007-08-20 22:26 ` H. Peter Anvin
@ 2007-08-20 23:21 ` Nelson, Shannon
0 siblings, 0 replies; 3+ messages in thread
From: Nelson, Shannon @ 2007-08-20 23:21 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: akpm, linux-kernel, chris.leech, ak, Luck, Tony
>-----Original Message-----
>From: H. Peter Anvin [mailto:hpa@zytor.com]
>Sent: Monday, August 20, 2007 3:27 PM
>To: Nelson, Shannon
>Cc: akpm@linux-foundation.org; linux-kernel@vger.kernel.org;
>chris.leech@gmail.com; ak@suse.de; Luck, Tony
>Subject: Re: [PATCH -mm] IOAT: fix for UP use of cpu_physical_id()
>
>Shannon Nelson wrote:
>> Make sure we can use cpu_physical_id() even when compiled for
>> uni-processor.
>>
>> diff --git a/drivers/dma/ioat_dca.c b/drivers/dma/ioat_dca.c
>> index c3a500b..b1af49c 100644
>> --- a/drivers/dma/ioat_dca.c
>> +++ b/drivers/dma/ioat_dca.c
>> @@ -25,6 +25,14 @@
>> #include <linux/smp.h>
>> #include <linux/interrupt.h>
>> #include <linux/dca.h>
>> +
>> +// either a kernel change is needed, or we need something
>like this in kernel
>> +#ifndef CONFIG_SMP
>> +#include <asm/smp.h>
>> +#undef cpu_physical_id
>> +#define cpu_physical_id(cpu) (cpuid_ebx(1) >> 24)
>> +#endif
>> +
>
>This value should probably be cached. Executing cpuid to get a static
>value seems like a bad idea.
Yeah, this whole cpu_physical_id() gizmo needs to be fixed so it is
actually usable for non-SMP configurations. Unfortunately, I'm not the
guy to do it.
sln
--
======================================================================
Mr. Shannon Nelson LAN Access Division, Intel Corp.
Shannon.Nelson@intel.com I don't speak for Intel
(503) 712-7659 Parents can't afford to be squeamish.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-08-20 23:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-20 20:29 [PATCH -mm] IOAT: fix for UP use of cpu_physical_id() Shannon Nelson
2007-08-20 22:26 ` H. Peter Anvin
2007-08-20 23:21 ` Nelson, Shannon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox