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] [day] [month] [year] [list]
Message-ID: <20120910201313.GA31746@lizard>
Date:	Mon, 10 Sep 2012 13:13:13 -0700
From:	Anton Vorontsov <anton.vorontsov@...aro.org>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Russell King <linux@....linux.org.uk>,
	Jason Wessel <jason.wessel@...driver.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Alan Cox <alan@...ux.intel.com>,
	Arve Hjønnevåg <arve@...roid.com>,
	Colin Cross <ccross@...roid.com>,
	Brian Swetland <swetland@...gle.com>,
	John Stultz <john.stultz@...aro.org>,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linaro-kernel@...ts.linaro.org, patches@...aro.org,
	kernel-team@...roid.com, kgdb-bugreport@...ts.sourceforge.net,
	linux-serial@...r.kernel.org
Subject: Re: [PATCH 08/14] tty/serial/kgdboc: Add and wire up clear_irqs
 callback

On Mon, Sep 10, 2012 at 08:19:18PM +0100, Alan Cox wrote:
> On Mon, 10 Sep 2012 10:57:04 -0700
> Anton Vorontsov <anton.vorontsov@...aro.org> wrote:
> 
> > On Mon, Sep 10, 2012 at 12:16:24PM +0100, Alan Cox wrote:
> > > > serial port, the CPU receives NMI exception, and we fall into KDB
> > > > shell.  So, it is our "debug console", and it is able to interrupt
> > > > (and thus debug) even IRQ handlers themselves.
> > > 
> > > You seem to have an assumption of single core here. What happens if
> > > the NMI hits CPU #0 and the serial IRQ hits CPU #1 simultaneously ?
> > 
> > If you can't redirect all serial IRQs to NMI context, e.g. sometimes you get
> > NMIs, sometimes IRQs, then your NMI handling is not deterministic, and surely
> > this is not supported.
> 
> This seems like arch specific magic leaking into the tty code. Surely
> this should be buried in the depths of the platform IRQ code ?

I'd not call this arch-specific. It's task-specific, and the task is quite
peculiar, true, but still nothing to do with arch.

If the arch is not able to turn serial IRQs into NMIs, then surely that arch is
not able to implement serial-triggered NMI/KDB-shell, so we don't support that
arch.

And we don't have any other way to accoplish the same: we need to clear the
serial interrupts, not some arch-specific interrupts. It is the serial device
that causes NMI, not some arch's magic. So we just provide the knob to manage
the device's functionality.

We do have a separate arch-specific NMI-masking knob that works at CPU level,
but if we mask NMI source at CPU level, we have to keep it always masked,
otherwise we'll keep reentering NMI. So, we really have to clear serial's
interrupt line.

That's why I came with clear_irqs callback, it has defined semantics for the
serial driver, and zero knowledge about any underlaying architecture or task.

Thanks,

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