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]
Date:	Mon, 17 Aug 2009 11:33:39 -0700
From:	Suresh Siddha <suresh.b.siddha@...el.com>
To:	Yinghai Lu <yinghai@...nel.org>
Cc:	Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Gleb Natapov <gleb@...hat.com>,
	"Pallipadi, Venkatesh" <venkatesh.pallipadi@...el.com>
Subject: Re: [PATCH] x86: move dmar_table_init out of enable_IR

On Mon, 2009-08-17 at 11:19 -0700, Yinghai Lu wrote:
> ---
>  arch/x86/kernel/apic/apic.c |   22 +++++++++++++---------
>  1 file changed, 13 insertions(+), 9 deletions(-)
> 
> Index: linux-2.6/arch/x86/kernel/apic/apic.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/kernel/apic/apic.c
> +++ linux-2.6/arch/x86/kernel/apic/apic.c
> @@ -1365,14 +1365,6 @@ void enable_x2apic(void)
>  int __init enable_IR(void)
>  {
>  #ifdef CONFIG_INTR_REMAP
> -	int ret;
> -
> -	ret = dmar_table_init();
> -	if (ret) {
> -		pr_debug("dmar_table_init() failed with %d:\n", ret);
> -		return 0;
> -	}
> -
>  	if (!intr_remapping_supported()) {
>  		pr_debug("intr-remapping not supported\n");
>  		return 0;
> @@ -1400,6 +1392,14 @@ void __init enable_IR_x2apic(void)
>  	unsigned long flags;
>  	struct IO_APIC_route_entry **ioapic_entries = NULL;
>  	int ret, x2apic_enabled = 0;
> +	int dmar_table_init_ret = 0;
> +
> +#ifdef CONFIG_INTR_REMAP
> +	dmar_table_init_ret = dmar_table_init();
> +	if (dmar_table_init_ret)
> +		pr_debug("dmar_table_init() failed with %d:\n",
> +				dmar_table_init_ret);
> +#endif

We can remove this ifdef check, as dmar_table_init() already handles
the !config_intr_remap

Also, at this error condition, we should simply return if the cpu has no
x2apic support. There is no x2apic support and we failed to enable
interrupt-remapping. No need to go further down.

thanks,
suresh

>  
>  	ioapic_entries = alloc_ioapic_entries();
>  	if (!ioapic_entries) {
> @@ -1417,7 +1417,11 @@ void __init enable_IR_x2apic(void)
>  	mask_8259A();
>  	mask_IO_APIC_setup(ioapic_entries);
>  
> -	ret = enable_IR();
> +	if (dmar_table_init_ret)
> +		ret = 0;
> +	else
> +		ret = enable_IR();
> +
>  	if (!ret) {
>  		/* IR is required if there is APIC ID > 255 even when running
>  		 * under KVM
> 

--
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