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>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.11.1509302043070.4500@nanos>
Date:	Wed, 30 Sep 2015 20:52:44 +0200 (CEST)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	"Zhang, Tianfei" <tianfei.zhang@...el.com>
cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"mingo@...nel.org" <mingo@...nel.org>
Subject: Re: poweroff block on i8259A_shutdown

On Fri, 25 Sep 2015, Zhang, Tianfei wrote:
> I have a board it block on i8259A_shutdown when I want to
> poweroff. It is not always re-produce.

> [   27.832384] PM: Calling mce_syscore_shutdown+0x0/0x50 start
> [   27.838651] PM: Calling mce_syscore_shutdown+0x0/0x50 stop
> [   27.844813] PM: Calling i8259A_shutdown+0x0/0x20 start
> 
> It seems has a potential race on i8259A_shutdown(), should it add
> lock and disable IRQ on i8259A_shutdown?

Indeed, but that won't cure the problem completely. We shut down i8259
before we made sure, that all interrupts which end up there are
shutdown. So even with the patch applied you can run into the
following problem:

CPU0			CPU1
			interrupt
			   i8259_mask();
i8259A_shutdown();
			   i8259_unmask();

That needs some more thought. Can you provide a bit more information
about your system please? Output of /proc/interrupts would be a good
starting point.
 
> --- a/arch/x86/kernel/i8259.c
> +++ b/arch/x86/kernel/i8259.c
> @@ -262,8 +262,11 @@ static void i8259A_shutdown(void)
>       * the kernel initialization code can get it
>       * out of.
>       */
> +     unsigned long flags;
> +     raw_spin_lock_irqsave(&i8259A_lock, flags);
>      outb(0xff, PIC_MASTER_IMR);       /* mask all of 8259A-1 */
>      outb(0xff, PIC_SLAVE_IMR);    /* mask all of 8259A-2 */
> +     raw_spin_unlock_irqrestore(&i8259A_lock, flags);
> }

FYI, that patch is white space damaged. Please configure your mail
client correctly or use one which does not mangle stuff.

Aside of that, a patch wants a proper changelog. You also did not tell
us whether that patch solves your problem. See Documentation for
instructions on how to submit patches please.

Thanks,

	tglx


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