* [PATCH 1/2] x86: apic/apic.c declare default_init_apic_ldr() before it get used
@ 2009-05-13 21:57 Jaswinder Singh Rajput
2009-05-13 21:59 ` [PATCH 2/2] x86: apic/apic.c native_apic_write_dummy() should be static Jaswinder Singh Rajput
2009-05-14 7:53 ` [PATCH 1/2] x86: apic/apic.c declare default_init_apic_ldr() before it get used Thomas Gleixner
0 siblings, 2 replies; 6+ messages in thread
From: Jaswinder Singh Rajput @ 2009-05-13 21:57 UTC (permalink / raw)
To: Ingo Molnar, x86 maintainers, LKML
default_init_apic_ldr() is also required for 64 bit so moving it out
from CONFIG_X86_32.
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
arch/x86/include/asm/apic.h | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 229d0be..d1acc60 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -469,10 +469,6 @@ static inline unsigned int read_apic_id(void)
extern void default_setup_apic_routing(void);
-#ifdef CONFIG_X86_32
-
-extern struct apic apic_default;
-
/*
* Set up the logical destination ID.
*
@@ -482,6 +478,10 @@ extern struct apic apic_default;
*/
extern void default_init_apic_ldr(void);
+#ifdef CONFIG_X86_32
+
+extern struct apic apic_default;
+
static inline int default_apic_id_registered(void)
{
return physid_isset(read_apic_id(), phys_cpu_present_map);
--
1.6.0.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] x86: apic/apic.c native_apic_write_dummy() should be static
2009-05-13 21:57 [PATCH 1/2] x86: apic/apic.c declare default_init_apic_ldr() before it get used Jaswinder Singh Rajput
@ 2009-05-13 21:59 ` Jaswinder Singh Rajput
2009-05-14 3:04 ` Cyrill Gorcunov
2009-05-14 7:53 ` [PATCH 1/2] x86: apic/apic.c declare default_init_apic_ldr() before it get used Thomas Gleixner
1 sibling, 1 reply; 6+ messages in thread
From: Jaswinder Singh Rajput @ 2009-05-13 21:59 UTC (permalink / raw)
To: Ingo Molnar; +Cc: x86 maintainers, LKML, Cyrill Gorcunov
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
arch/x86/kernel/apic/apic.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index d6d4ffd..966783b 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -243,7 +243,7 @@ static int modern_apic(void)
* bare function to substitute write operation
* and it's _that_ fast :)
*/
-void native_apic_write_dummy(u32 reg, u32 v)
+static void native_apic_write_dummy(u32 reg, u32 v)
{
WARN_ON_ONCE((cpu_has_apic || !disable_apic));
}
--
1.6.0.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] x86: apic/apic.c native_apic_write_dummy() should be static
2009-05-13 21:59 ` [PATCH 2/2] x86: apic/apic.c native_apic_write_dummy() should be static Jaswinder Singh Rajput
@ 2009-05-14 3:04 ` Cyrill Gorcunov
0 siblings, 0 replies; 6+ messages in thread
From: Cyrill Gorcunov @ 2009-05-14 3:04 UTC (permalink / raw)
To: Jaswinder Singh Rajput; +Cc: Ingo Molnar, x86 maintainers, LKML, Yinghai Lu
On 5/14/09, Jaswinder Singh Rajput <jaswinder@kernel.org> wrote:
>
> Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
> ---
> arch/x86/kernel/apic/apic.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
> index d6d4ffd..966783b 100644
> --- a/arch/x86/kernel/apic/apic.c
> +++ b/arch/x86/kernel/apic/apic.c
> @@ -243,7 +243,7 @@ static int modern_apic(void)
> * bare function to substitute write operation
> * and it's _that_ fast :)
> */
> -void native_apic_write_dummy(u32 reg, u32 v)
> +static void native_apic_write_dummy(u32 reg, u32 v)
> {
> WARN_ON_ONCE((cpu_has_apic || !disable_apic));
> }
> --
> 1.6.0.6
Hi Jaswinder,
Check please latest tip numa branch. I thought Yinghai already fixed this nit.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] x86: apic/apic.c declare default_init_apic_ldr() before it get used
2009-05-13 21:57 [PATCH 1/2] x86: apic/apic.c declare default_init_apic_ldr() before it get used Jaswinder Singh Rajput
2009-05-13 21:59 ` [PATCH 2/2] x86: apic/apic.c native_apic_write_dummy() should be static Jaswinder Singh Rajput
@ 2009-05-14 7:53 ` Thomas Gleixner
2009-05-14 8:49 ` [PATCH -tip] x86: apic/apic.c default_init_apic_ldr() is required only for X86_32 Jaswinder Singh Rajput
1 sibling, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2009-05-14 7:53 UTC (permalink / raw)
To: Jaswinder Singh Rajput; +Cc: Ingo Molnar, x86 maintainers, LKML
On Thu, 14 May 2009, Jaswinder Singh Rajput wrote:
>
> default_init_apic_ldr() is also required for 64 bit so moving it out
> from CONFIG_X86_32.
[linux-2.6-tip]$ git grep default_init_apic_ldr arch/x86/
arch/x86/include/asm/apic.h:extern void default_init_apic_ldr(void);
arch/x86/kernel/apic/apic.c:void default_init_apic_ldr(void)
arch/x86/kernel/apic/probe_32.c: .init_apic_ldr = default_init_apic_ldr,
I have a hard time to see how 64bit requires that function.
Thanks,
tglx
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH -tip] x86: apic/apic.c default_init_apic_ldr() is required only for X86_32
2009-05-14 7:53 ` [PATCH 1/2] x86: apic/apic.c declare default_init_apic_ldr() before it get used Thomas Gleixner
@ 2009-05-14 8:49 ` Jaswinder Singh Rajput
2009-05-14 9:24 ` Jaswinder Singh Rajput
0 siblings, 1 reply; 6+ messages in thread
From: Jaswinder Singh Rajput @ 2009-05-14 8:49 UTC (permalink / raw)
To: Thomas Gleixner, Yinghai Lu; +Cc: Ingo Molnar, x86 maintainers, LKML
On Thu, 2009-05-14 at 09:53 +0200, Thomas Gleixner wrote:
> On Thu, 14 May 2009, Jaswinder Singh Rajput wrote:
> >
> > default_init_apic_ldr() is also required for 64 bit so moving it out
> > from CONFIG_X86_32.
>
> [linux-2.6-tip]$ git grep default_init_apic_ldr arch/x86/
> arch/x86/include/asm/apic.h:extern void default_init_apic_ldr(void);
> arch/x86/kernel/apic/apic.c:void default_init_apic_ldr(void)
> arch/x86/kernel/apic/probe_32.c: .init_apic_ldr = default_init_apic_ldr,
>
> I have a hard time to see how 64bit requires that function.
>
Here is new patch to make you easy :-)
[PATCH] x86: apic/apic.c default_init_apic_ldr() is required only for X86_32
default_init_apic_ldr() is used only by X86_32.
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
arch/x86/kernel/apic/apic.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index d6d4ffd..6ae5303 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1941,6 +1941,7 @@ int hard_smp_processor_id(void)
return read_apic_id();
}
+#ifdef CONFIG_X86_32
void default_init_apic_ldr(void)
{
unsigned long val;
@@ -1951,7 +1952,6 @@ void default_init_apic_ldr(void)
apic_write(APIC_LDR, val);
}
-#ifdef CONFIG_X86_32
int default_apicid_to_node(int logical_apicid)
{
#ifdef CONFIG_SMP
--
1.6.0.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH -tip] x86: apic/apic.c default_init_apic_ldr() is required only for X86_32
2009-05-14 8:49 ` [PATCH -tip] x86: apic/apic.c default_init_apic_ldr() is required only for X86_32 Jaswinder Singh Rajput
@ 2009-05-14 9:24 ` Jaswinder Singh Rajput
0 siblings, 0 replies; 6+ messages in thread
From: Jaswinder Singh Rajput @ 2009-05-14 9:24 UTC (permalink / raw)
To: Thomas Gleixner; +Cc: Yinghai Lu, Ingo Molnar, x86 maintainers, LKML
On Thu, 2009-05-14 at 14:19 +0530, Jaswinder Singh Rajput wrote:
> On Thu, 2009-05-14 at 09:53 +0200, Thomas Gleixner wrote:
> > On Thu, 14 May 2009, Jaswinder Singh Rajput wrote:
> > >
> > > default_init_apic_ldr() is also required for 64 bit so moving it out
> > > from CONFIG_X86_32.
> >
> > [linux-2.6-tip]$ git grep default_init_apic_ldr arch/x86/
> > arch/x86/include/asm/apic.h:extern void default_init_apic_ldr(void);
> > arch/x86/kernel/apic/apic.c:void default_init_apic_ldr(void)
> > arch/x86/kernel/apic/probe_32.c: .init_apic_ldr = default_init_apic_ldr,
> >
> > I have a hard time to see how 64bit requires that function.
> >
>
> Here is new patch to make you easy :-)
>
> [PATCH] x86: apic/apic.c default_init_apic_ldr() is required only for X86_32
>
> default_init_apic_ldr() is used only by X86_32.
>
I think it will be better to use this:
[PATCH-tip] x86: apic/apic.c move default_init_apic_ldr() and default_apicid_to_node() to probe_32.c
default_init_apic_ldr() and default_apicid_to_node() is used only by probe_32.c
so move them to probe_32.c and make them static.
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
arch/x86/include/asm/apic.h | 11 -----------
arch/x86/kernel/apic/apic.c | 21 ---------------------
arch/x86/kernel/apic/probe_32.c | 27 +++++++++++++++++++++++++++
3 files changed, 27 insertions(+), 32 deletions(-)
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 229d0be..bc9eca8 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -473,15 +473,6 @@ extern void default_setup_apic_routing(void);
extern struct apic apic_default;
-/*
- * Set up the logical destination ID.
- *
- * Intel recommends to set DFR, LDR and TPR before enabling
- * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
- * document number 292116). So here it goes...
- */
-extern void default_init_apic_ldr(void);
-
static inline int default_apic_id_registered(void)
{
return physid_isset(read_apic_id(), phys_cpu_present_map);
@@ -492,8 +483,6 @@ static inline int default_phys_pkg_id(int cpuid_apic, int index_msb)
return cpuid_apic >> index_msb;
}
-extern int default_apicid_to_node(int logical_apicid);
-
#endif
static inline unsigned int
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index d6d4ffd..b97fd65 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1941,27 +1941,6 @@ int hard_smp_processor_id(void)
return read_apic_id();
}
-void default_init_apic_ldr(void)
-{
- unsigned long val;
-
- apic_write(APIC_DFR, APIC_DFR_VALUE);
- val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
- val |= SET_APIC_LOGICAL_ID(1UL << smp_processor_id());
- apic_write(APIC_LDR, val);
-}
-
-#ifdef CONFIG_X86_32
-int default_apicid_to_node(int logical_apicid)
-{
-#ifdef CONFIG_SMP
- return apicid_2_node[hard_smp_processor_id()];
-#else
- return 0;
-#endif
-}
-#endif
-
/*
* Power management
*/
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c
index 440a8bc..47c8a49 100644
--- a/arch/x86/kernel/apic/probe_32.c
+++ b/arch/x86/kernel/apic/probe_32.c
@@ -93,6 +93,33 @@ static int probe_default(void)
return 1;
}
+/*
+ * Set up the logical destination ID.
+ *
+ * Intel recommends to set DFR, LDR and TPR before enabling
+ * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
+ * document number 292116). So here it goes...
+ */
+
+static void default_init_apic_ldr(void)
+{
+ unsigned long val;
+
+ apic_write(APIC_DFR, APIC_DFR_VALUE);
+ val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
+ val |= SET_APIC_LOGICAL_ID(1UL << smp_processor_id());
+ apic_write(APIC_LDR, val);
+}
+
+static int default_apicid_to_node(int logical_apicid)
+{
+#ifdef CONFIG_SMP
+ return apicid_2_node[hard_smp_processor_id()];
+#else
+ return 0;
+#endif
+}
+
struct apic apic_default = {
.name = "default",
--
1.6.0.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-05-14 9:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-13 21:57 [PATCH 1/2] x86: apic/apic.c declare default_init_apic_ldr() before it get used Jaswinder Singh Rajput
2009-05-13 21:59 ` [PATCH 2/2] x86: apic/apic.c native_apic_write_dummy() should be static Jaswinder Singh Rajput
2009-05-14 3:04 ` Cyrill Gorcunov
2009-05-14 7:53 ` [PATCH 1/2] x86: apic/apic.c declare default_init_apic_ldr() before it get used Thomas Gleixner
2009-05-14 8:49 ` [PATCH -tip] x86: apic/apic.c default_init_apic_ldr() is required only for X86_32 Jaswinder Singh Rajput
2009-05-14 9:24 ` Jaswinder Singh Rajput
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox