lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150116190018.GK18880@pd.tnic>
Date:	Fri, 16 Jan 2015 20:00:18 +0100
From:	Borislav Petkov <bp@...en8.de>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Jiang Liu <jiang.liu@...ux.intel.com>,
	Joerg Roedel <joro@...tes.org>, x86@...nel.org,
	Tony Luck <tony.luck@...el.com>
Subject: Re: [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@...utronix.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.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ