[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1AE640813FDE7649BE1B193DEA596E886CE286ED@SHSMSX101.ccr.corp.intel.com>
Date: Tue, 10 Jan 2017 05:46:56 +0000
From: "Zheng, Lv" <lv.zheng@...el.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>
CC: "Wysocki, Rafael J" <rafael.j.wysocki@...el.com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
"Brown, Len" <len.brown@...el.com>, Lv Zheng <zetalog@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
"Huang, Ying" <ying.huang@...el.com>,
"Borislav Petkov" <bp@...en8.de>
Subject: RE: [PATCH] ACPI / OSL: Fix rcu synchronization logic
Hi, Rafael
> From: rjwysocki@...il.com [mailto:rjwysocki@...il.com] On Behalf Of Rafael J. Wysocki
> Sent: Tuesday, January 10, 2017 7:35 AM
> Subject: Re: [PATCH] ACPI / OSL: Fix rcu synchronization logic
>
> On Mon, Jan 9, 2017 at 10:56 AM, Lv Zheng <lv.zheng@...el.com> wrote:
> > The rcu synchronization logic is originally provided to protect
> > apei_read()/apei_write() as in the APEI drivers, there is NMI event source
> > requiring non spinlock based synchronization mechanism.
> >
> > After that, ACPI developers think FADT registers may also require same
> > facility, so they moved the RCU stuffs to generic ACPI layer.
> >
> > So now non-task-context ACPI map lookup is only protected by RCU.
> >
> > This triggers problem as acpi_os_map_memory()/acpi_os_unmap_memory() can be
> > used to map/unmap tables as long as to map/unmap ACPI registers. When it is
> > used for the ACPI tables, the caller could invoke this very early. When it
> > is invoked earlier than workqueue_init() and later than
> > check_early_ioremp_leak(), invoking synchronize_rcu_expedited() can cause a
> > kernel hang.
> >
> > Actually this facility is only used to protect non-task-context ACPI map
> > lookup,
>
> That doesn't sound quite right.
>
> acpi_os_read/write_memory() use RCU-protected list lookups, so it's
> not just non-task-context AFAICS.
Yes, you are right.
>
> > and such mappings are only introduced by
> > acpi_os_map_generic_address(). So before it is invoked, there is no need to
> > invoke synchronize_rcu_expedited().
>
> That said it may be fine to start actually synchronize RCU after
> acpi_os_map_generic_address() has been called for the first time. I
> need a better (or more detailed) explanation why it is fine, though.
>
The reason is wrong.
As list lookups are only protected by RCU.
Thanks
Lv
Powered by blists - more mailing lists