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:	Fri, 1 Apr 2016 13:48:52 +0100
From:	Paul Burton <paul.burton@...tec.com>
To:	Qais Yousef <qsyousef@...il.com>, <ralf@...ux-mips.org>
CC:	Guenter Roeck <linux@...ck-us.net>,
	Thomas Gleixner <tglx@...utronix.de>,
	<linux-mips@...ux-mips.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] MIPS: Fix broken malta qemu

On Thu, Mar 17, 2016 at 09:08:09PM +0000, Qais Yousef wrote:
> Malta defconfig compiles with GIC on. Hence when compiling for SMP it causes the
> new IPI code to be activated. But on qemu malta there's no GIC causing a
> BUG_ON(!ipidomain) to be hit in mips_smp_ipi_init().
> 
> Since in that configuration one can only run a single core SMP (!), skip IPI
> initialisation if we detect that this is the case. It is a sensible behaviour
> to introduce and should keep such possible configuration to run rather than die
> hard unnecessarily.

Hi Qais/Ralf,

This patch is insufficient I'm afraid. It's entirely possible to use SMP
with multiple VPEs in a single core on Malta boards that don't have a
GIC - we have code handling IPIs in that case guarded by #ifdef
CONFIG_MIPS_MT_SMP in arch/mips/mti-malta/malta-int.c. I think the
BUG_ON needs to be removed entirely, unless that single-core multi-VPE
IPI code is also converted to use an IPI irqdomain.

Thanks,
    Paul

> 
> Signed-off-by: Qais Yousef <qsyousef@...il.com>
> Reported-by: Guenter Roeck <linux@...ck-us.net>
> Cc: Guenter Roeck <linux@...ck-us.net>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: linux-mips@...ux-mips.org
> Cc: linux-kernel@...r.kernel.org
> ---
>  arch/mips/kernel/smp.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
> index 37708d9..27cb638 100644
> --- a/arch/mips/kernel/smp.c
> +++ b/arch/mips/kernel/smp.c
> @@ -243,6 +243,18 @@ static int __init mips_smp_ipi_init(void)
>  	struct irq_domain *ipidomain;
>  	struct device_node *node;
>  
> +	/*
> +	 * In some cases like qemu-malta, it is desired to try SMP with
> +	 * a single core. Qemu-malta has no GIC, so an attempt to set any IPIs
> +	 * would cause a BUG_ON() to be triggered since there's no ipidomain.
> +	 *
> +	 * Since for a single core system IPIs aren't required really, skip the
> +	 * initialisation which should generally keep any such configurations
> +	 * happy and only fail hard when trying to truely run SMP.
> +	 */
> +	if (cpumask_weight(cpu_possible_mask) == 1)
> +		return 0;
> +
>  	node = of_irq_find_parent(of_root);
>  	ipidomain = irq_find_matching_host(node, DOMAIN_BUS_IPI);
>  
> -- 
> 2.7.3
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ