lkml.org 
[lkml]   [2015]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [patch 11/23] x86/x2apic: Split enable and setup function
    On Thu, Jan 15, 2015 at 09:22:26PM -0000, Thomas Gleixner wrote:
    > enable_x2apic() is a convoluted unreadable mess because it is used for
    > both enablement in early boot and for setup in cpu_init().
    >
    > Split the code into x2apic_enable() for enablement and x2apic_setup()
    > for setup of (secondary cpus). Make use of the new state tracking to
    > simplify the logic.
    >
    > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    > ---

    ...

    > @@ -1517,6 +1528,21 @@ static int __init setup_nox2apic(char *s
    > }
    > early_param("nox2apic", setup_nox2apic);
    >
    > +/* Called from cpu_init() to enable x2apic on (secondary) cpus */
    > +void x2apic_setup(void)
    > +{
    > + /*
    > + * If x2apic is not in ON state, disable it if already enabled
    > + * from BIOS.
    > + */
    > + if (x2apic_state != X2APIC_ON) {
    > + if (cpu_has_apic)

    Let's move this test into disable_x2apic() so that callers don't have to
    pay attention.

    > + disable_x2apic();
    > + return;
    > + }
    > + enable_x2apic();
    > +}
    > +
    > static __init void x2apic_disable(void)
    > {
    > u64 msr;

    ...

    > Index: tip/arch/x86/kernel/cpu/common.c
    > ===================================================================
    > --- tip.orig/arch/x86/kernel/cpu/common.c
    > +++ tip/arch/x86/kernel/cpu/common.c
    > @@ -1332,7 +1332,7 @@ void cpu_init(void)
    > barrier();
    >
    > x86_configure_nx();
    > - enable_x2apic();
    > + x2apic_setup();

    64-bit only?

    I'd guess so since the original call enable_x2apic() is 64-bit only too
    but why?

    --
    Regards/Gruss,
    Boris.

    ECO tip #101: Trim your mails when you reply.
    --

    \
     
     \ /
      Last update: 2015-01-16 20:21    [W:3.024 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site