lkml.org 
[lkml]   [2006]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [patch, -rc6] x86_64: UP build fixes

    * Andrew Morton <akpm@osdl.org> wrote:

    > On Thu, 16 Nov 2006 09:48:55 +0100
    > Ingo Molnar <mingo@elte.hu> wrote:
    >
    > > +static inline int
    > > +smp_call_function_single(int cpuid, void (*func) (void *info), void *info,
    > > + int retry, int wait)
    > > +{
    > > + func(info);
    > > +
    > > + return 0;
    > > +}
    > > +
    >
    > Given that on SMP the function is called with local interrupts
    > disabled, I'd suggest that it should be called with local interrupts
    > disabled on UP as well.
    >
    > on_each_cpu() does this and one caller (at least) relies upon it
    > (invalidate_bh_lrus(), iirc).

    ok, fair enough. Then this is a (minor) bugfix as well.

    Ingo

    --------------->
    Subject: x86_64: build fixes
    From: Ingo Molnar <mingo@elte.hu>

    x86_64 does not build cleanly on UP:

    arch/x86_64/kernel/vsyscall.c: In function 'cpu_vsyscall_notifier':
    arch/x86_64/kernel/vsyscall.c:282: warning: implicit declaration of function 'smp_call_function_single'
    arch/x86_64/kernel/vsyscall.c: At top level:
    arch/x86_64/kernel/vsyscall.c:279: warning: 'cpu_vsyscall_notifier' defined but not used

    this patch fixes it.

    Signed-off-by: Ingo Molnar <mingo@elte.hu>
    ---
    include/asm-x86_64/smp.h | 11 ++---------
    include/linux/smp.h | 13 +++++++++++++
    2 files changed, 15 insertions(+), 9 deletions(-)

    Index: linux/include/asm-x86_64/smp.h
    ===================================================================
    --- linux.orig/include/asm-x86_64/smp.h
    +++ linux/include/asm-x86_64/smp.h
    @@ -115,16 +115,9 @@ static __inline int logical_smp_processo
    }

    #ifdef CONFIG_SMP
    -#define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu]
    +# define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu]
    #else
    -#define cpu_physical_id(cpu) boot_cpu_id
    -static inline int smp_call_function_single(int cpuid, void (*func) (void *info),
    - void *info, int retry, int wait)
    -{
    - /* Disable interrupts here? */
    - func(info);
    - return 0;
    -}
    +# define cpu_physical_id(cpu) boot_cpu_id
    #endif /* !CONFIG_SMP */
    #endif

    Index: linux/include/linux/smp.h
    ===================================================================
    --- linux.orig/include/linux/smp.h
    +++ linux/include/linux/smp.h
    @@ -100,6 +100,19 @@ static inline void smp_send_reschedule(i
    #define num_booting_cpus() 1
    #define smp_prepare_boot_cpu() do {} while (0)

    +static inline int
    +smp_call_function_single(int cpuid, void (*func) (void *info), void *info,
    + int retry, int wait)
    +{
    + unsigned long flags;
    +
    + local_irq_save(flags);
    + func(info);
    + local_irq_restore(flags);
    +
    + return 0;
    +}
    +
    #endif /* !SMP */

    /*
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2006-11-16 10:31    [W:0.026 / U:31.440 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site