Re: [PATCH v3 07/12] ACPI / APEI: Make the nmi_fixmap_idx per-ghes to allow multiple in_nmi() users

2018-05-17 Thread James Morse
Hi Borislav, On 17/05/18 14:36, Borislav Petkov wrote: > On Wed, May 16, 2018 at 03:51:14PM +0100, James Morse wrote: >> I thought this was safe because its just ghes_copy_tofrom_phys()s access to >> the >> fixmap slots that needs mutual exclusion. and here is where I was wrong: I was only looki

Re: [PATCH v3 07/12] ACPI / APEI: Make the nmi_fixmap_idx per-ghes to allow multiple in_nmi() users

2018-05-17 Thread Borislav Petkov
On Wed, May 16, 2018 at 11:38:16AM -0400, Tyler Baicar wrote: > I haven't seen a deadlock from that, but it looks possible. What if > the ghes_proc() call in ghes_probe() is moved before the second switch > statement? That way it is before the NMI/IRQ/poll is setup. At quick > glance I think that s

Re: [PATCH v3 07/12] ACPI / APEI: Make the nmi_fixmap_idx per-ghes to allow multiple in_nmi() users

2018-05-17 Thread Borislav Petkov
On Wed, May 16, 2018 at 03:51:14PM +0100, James Morse wrote: > The first two overload existing architectural behavior, the third improves all > this with a third standard option. Its the standard story! :-) > I thought this was safe because its just ghes_copy_tofrom_phys()s access to > the > fix

Re: [PATCH v3 07/12] ACPI / APEI: Make the nmi_fixmap_idx per-ghes to allow multiple in_nmi() users

2018-05-16 Thread Tyler Baicar
On 5/16/2018 7:05 AM, Borislav Petkov wrote: On Tue, May 08, 2018 at 09:45:01AM +0100, James Morse wrote: Alternatively, I can put the fixmap-page and spinlock in some 'struct ghes_notification' that only the NMI-like struct-ghes need. This is just moving the indirection up a level, but it does

Re: [PATCH v3 07/12] ACPI / APEI: Make the nmi_fixmap_idx per-ghes to allow multiple in_nmi() users

2018-05-16 Thread James Morse
Hi Borislav, On 16/05/18 12:05, Borislav Petkov wrote: > On Tue, May 08, 2018 at 09:45:01AM +0100, James Morse wrote: >> NOTIFY_NMI is x86's NMI, arm doesn't have anything that behaves in the same >> way, >> so doesn't use it. The equivalent notifications with NMI-like behaviour are: >> * SEA (sy

Re: [PATCH v3 07/12] ACPI / APEI: Make the nmi_fixmap_idx per-ghes to allow multiple in_nmi() users

2018-05-16 Thread Borislav Petkov
On Tue, May 08, 2018 at 09:45:01AM +0100, James Morse wrote: > NOTIFY_NMI is x86's NMI, arm doesn't have anything that behaves in the same > way, > so doesn't use it. The equivalent notifications with NMI-like behaviour are: > * SEA (synchronous external abort) > * SEI (SError Interrupt) > * SDEI

Re: [PATCH v3 07/12] ACPI / APEI: Make the nmi_fixmap_idx per-ghes to allow multiple in_nmi() users

2018-05-08 Thread James Morse
Hi Borislav, On 05/05/18 13:27, Borislav Petkov wrote: > On Fri, Apr 27, 2018 at 04:35:05PM +0100, James Morse wrote: >> Arm64 has multiple NMI-like notifications, but ghes.c only has one >> in_nmi() path, risking deadlock if one NMI-like notification can >> interrupt another. >> >> To support thi

Re: [PATCH v3 07/12] ACPI / APEI: Make the nmi_fixmap_idx per-ghes to allow multiple in_nmi() users

2018-05-05 Thread Borislav Petkov
On Fri, Apr 27, 2018 at 04:35:05PM +0100, James Morse wrote: > Arm64 has multiple NMI-like notifications, but ghes.c only has one > in_nmi() path, risking deadlock if one NMI-like notification can > interrupt another. > > To support this we need a fixmap entry and lock for each notification > type