* FAILED: patch "[PATCH] powerpc/pseries: Fix unitialized timer reset on migration" failed to apply to 4.4-stable tree @ 2018-10-02 12:18 gregkh 2018-10-02 14:18 ` Michael Bringmann 0 siblings, 1 reply; 7+ messages in thread From: gregkh @ 2018-10-02 12:18 UTC (permalink / raw) To: mwb, mpe; +Cc: stable The patch below does not apply to the 4.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <stable@vger.kernel.org>. thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 8604895a34d92f5e186ceb931b0d1b384030ea3d Mon Sep 17 00:00:00 2001 From: Michael Bringmann <mwb@linux.vnet.ibm.com> Date: Thu, 20 Sep 2018 11:45:13 -0500 Subject: [PATCH] powerpc/pseries: Fix unitialized timer reset on migration After migration of a powerpc LPAR, the kernel executes code to update the system state to reflect new platform characteristics. Such changes include modifications to device tree properties provided to the system by PHYP. Property notifications received by the post_mobility_fixup() code are passed along to the kernel in general through a call to of_update_property() which in turn passes such events back to all modules through entries like the '.notifier_call' function within the NUMA module. When the NUMA module updates its state, it resets its event timer. If this occurs after a previous call to stop_topology_update() or on a system without VPHN enabled, the code runs into an unitialized timer structure and crashes. This patch adds a safety check along this path toward the problem code. An example crash log is as follows. ibmvscsi 30000081: Re-enabling adapter! ------------[ cut here ]------------ kernel BUG at kernel/time/timer.c:958! Oops: Exception in kernel mode, sig: 5 [#1] LE SMP NR_CPUS=2048 NUMA pSeries Modules linked in: nfsv3 nfs_acl nfs tcp_diag udp_diag inet_diag lockd unix_diag af_packet_diag netlink_diag grace fscache sunrpc xts vmx_crypto pseries_rng sg binfmt_misc ip_tables xfs libcrc32c sd_mod ibmvscsi ibmveth scsi_transport_srp dm_mirror dm_region_hash dm_log dm_mod CPU: 11 PID: 3067 Comm: drmgr Not tainted 4.17.0+ #179 ... NIP mod_timer+0x4c/0x400 LR reset_topology_timer+0x40/0x60 Call Trace: 0xc0000003f9407830 (unreliable) reset_topology_timer+0x40/0x60 dt_update_callback+0x100/0x120 notifier_call_chain+0x90/0x100 __blocking_notifier_call_chain+0x60/0x90 of_property_notify+0x90/0xd0 of_update_property+0x104/0x150 update_dt_property+0xdc/0x1f0 pseries_devicetree_update+0x2d0/0x510 post_mobility_fixup+0x7c/0xf0 migration_store+0xa4/0xc0 kobj_attr_store+0x30/0x60 sysfs_kf_write+0x64/0xa0 kernfs_fop_write+0x16c/0x240 __vfs_write+0x40/0x200 vfs_write+0xc8/0x240 ksys_write+0x5c/0x100 system_call+0x58/0x6c Fixes: 5d88aa85c00b ("powerpc/pseries: Update CPU maps when device tree is updated") Cc: stable@vger.kernel.org # v3.10+ Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 35ac5422903a..b5a71baedbc2 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -1452,7 +1452,8 @@ static struct timer_list topology_timer; static void reset_topology_timer(void) { - mod_timer(&topology_timer, jiffies + topology_timer_secs * HZ); + if (vphn_enabled) + mod_timer(&topology_timer, jiffies + topology_timer_secs * HZ); } #ifdef CONFIG_SMP ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: FAILED: patch "[PATCH] powerpc/pseries: Fix unitialized timer reset on migration" failed to apply to 4.4-stable tree 2018-10-02 12:18 FAILED: patch "[PATCH] powerpc/pseries: Fix unitialized timer reset on migration" failed to apply to 4.4-stable tree gregkh @ 2018-10-02 14:18 ` Michael Bringmann 2018-10-02 16:27 ` Greg KH 0 siblings, 1 reply; 7+ messages in thread From: Michael Bringmann @ 2018-10-02 14:18 UTC (permalink / raw) To: gregkh, mpe; +Cc: stable To backport the patc commit 8604895a34d92f5e186ceb931b0d1b384030ea3d to the 4.4-stable tree, please try the following backport: diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c --- a/arch/powerpc/mm/numa.c 2018-10-02 09:03:06.232491410 -0500 +++ b/arch/powerpc/mm/numa.c 2018-10-02 09:04:17.152494472 -0500 @@ -1606,7 +1606,8 @@ { topology_timer.data = 0; topology_timer.expires = jiffies + topology_timer_secs * HZ; - mod_timer(&topology_timer, topology_timer.expires); + if (vphn_enabled) + mod_timer(&topology_timer, topology_timer.expires); } #ifdef CONFIG_SMP On 10/02/2018 07:18 AM, gregkh@linuxfoundation.org wrote: > > The patch below does not apply to the 4.4-stable tree. > If someone wants it applied there, or to any other stable or longterm > tree, then please email the backport, including the original git commit > id to <stable@vger.kernel.org>. > > thanks, > > greg k-h > > ------------------ original commit in Linus's tree ------------------ > >>>From 8604895a34d92f5e186ceb931b0d1b384030ea3d Mon Sep 17 00:00:00 2001 > From: Michael Bringmann <mwb@linux.vnet.ibm.com> > Date: Thu, 20 Sep 2018 11:45:13 -0500 > Subject: [PATCH] powerpc/pseries: Fix unitialized timer reset on migration > > After migration of a powerpc LPAR, the kernel executes code to > update the system state to reflect new platform characteristics. > > Such changes include modifications to device tree properties provided > to the system by PHYP. Property notifications received by the > post_mobility_fixup() code are passed along to the kernel in general > through a call to of_update_property() which in turn passes such > events back to all modules through entries like the '.notifier_call' > function within the NUMA module. > > When the NUMA module updates its state, it resets its event timer. If > this occurs after a previous call to stop_topology_update() or on a > system without VPHN enabled, the code runs into an unitialized timer > structure and crashes. This patch adds a safety check along this path > toward the problem code. > > An example crash log is as follows. > > ibmvscsi 30000081: Re-enabling adapter! > ------------[ cut here ]------------ > kernel BUG at kernel/time/timer.c:958! > Oops: Exception in kernel mode, sig: 5 [#1] > LE SMP NR_CPUS=2048 NUMA pSeries > Modules linked in: nfsv3 nfs_acl nfs tcp_diag udp_diag inet_diag lockd unix_diag af_packet_diag netlink_diag grace fscache sunrpc xts vmx_crypto pseries_rng sg binfmt_misc ip_tables xfs libcrc32c sd_mod ibmvscsi ibmveth scsi_transport_srp dm_mirror dm_region_hash dm_log dm_mod > CPU: 11 PID: 3067 Comm: drmgr Not tainted 4.17.0+ #179 > ... > NIP mod_timer+0x4c/0x400 > LR reset_topology_timer+0x40/0x60 > Call Trace: > 0xc0000003f9407830 (unreliable) > reset_topology_timer+0x40/0x60 > dt_update_callback+0x100/0x120 > notifier_call_chain+0x90/0x100 > __blocking_notifier_call_chain+0x60/0x90 > of_property_notify+0x90/0xd0 > of_update_property+0x104/0x150 > update_dt_property+0xdc/0x1f0 > pseries_devicetree_update+0x2d0/0x510 > post_mobility_fixup+0x7c/0xf0 > migration_store+0xa4/0xc0 > kobj_attr_store+0x30/0x60 > sysfs_kf_write+0x64/0xa0 > kernfs_fop_write+0x16c/0x240 > __vfs_write+0x40/0x200 > vfs_write+0xc8/0x240 > ksys_write+0x5c/0x100 > system_call+0x58/0x6c > > Fixes: 5d88aa85c00b ("powerpc/pseries: Update CPU maps when device tree is updated") > Cc: stable@vger.kernel.org # v3.10+ > Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com> > Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> > > diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c > index 35ac5422903a..b5a71baedbc2 100644 > --- a/arch/powerpc/mm/numa.c > +++ b/arch/powerpc/mm/numa.c > @@ -1452,7 +1452,8 @@ static struct timer_list topology_timer; > > static void reset_topology_timer(void) > { > - mod_timer(&topology_timer, jiffies + topology_timer_secs * HZ); > + if (vphn_enabled) > + mod_timer(&topology_timer, jiffies + topology_timer_secs * HZ); > } > > #ifdef CONFIG_SMP > > -- Michael W. Bringmann Linux Technology Center IBM Corporation Tie-Line 363-5196 External: (512) 286-5196 Cell: (512) 466-0650 mwb@linux.vnet.ibm.com ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: FAILED: patch "[PATCH] powerpc/pseries: Fix unitialized timer reset on migration" failed to apply to 4.4-stable tree 2018-10-02 14:18 ` Michael Bringmann @ 2018-10-02 16:27 ` Greg KH 2018-10-02 18:30 ` Michael Bringmann 0 siblings, 1 reply; 7+ messages in thread From: Greg KH @ 2018-10-02 16:27 UTC (permalink / raw) To: Michael Bringmann; +Cc: mpe, stable On Tue, Oct 02, 2018 at 09:18:26AM -0500, Michael Bringmann wrote: > To backport the patc > > commit 8604895a34d92f5e186ceb931b0d1b384030ea3d > > to the 4.4-stable tree, please try the following backport: What about 4.14-stable and 4.9-stable? thanks, greg k-h ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: FAILED: patch "[PATCH] powerpc/pseries: Fix unitialized timer reset on migration" failed to apply to 4.4-stable tree 2018-10-02 16:27 ` Greg KH @ 2018-10-02 18:30 ` Michael Bringmann 2018-10-02 18:37 ` Greg KH 0 siblings, 1 reply; 7+ messages in thread From: Michael Bringmann @ 2018-10-02 18:30 UTC (permalink / raw) To: Greg KH; +Cc: mpe, stable For 4.9-stable & 4.14-stable, we would adapt commit 8604895a34d92f5e186ceb931b0d1b384030ea3d to the following: diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c --- a/arch/powerpc/mm/numa.c 2018-10-02 13:18:42.615084257 -0500 +++ b/arch/powerpc/mm/numa.c 2018-10-02 13:19:51.488209551 -0500 @@ -1469,7 +1469,8 @@ { topology_timer.data = 0; topology_timer.expires = jiffies + 60 * HZ; - mod_timer(&topology_timer, topology_timer.expires); + if (vphn_enabled) + mod_timer(&topology_timer, topology_timer.expires); } #ifdef CONFIG_SMP On 10/02/2018 11:27 AM, Greg KH wrote: > On Tue, Oct 02, 2018 at 09:18:26AM -0500, Michael Bringmann wrote: >> To backport the patc >> >> commit 8604895a34d92f5e186ceb931b0d1b384030ea3d >> >> to the 4.4-stable tree, please try the following backport: > > What about 4.14-stable and 4.9-stable? > > thanks, > > greg k-h > > -- Michael W. Bringmann Linux Technology Center IBM Corporation Tie-Line 363-5196 External: (512) 286-5196 Cell: (512) 466-0650 mwb@linux.vnet.ibm.com ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: FAILED: patch "[PATCH] powerpc/pseries: Fix unitialized timer reset on migration" failed to apply to 4.4-stable tree 2018-10-02 18:30 ` Michael Bringmann @ 2018-10-02 18:37 ` Greg KH 2018-10-02 19:36 ` Michael Bringmann 0 siblings, 1 reply; 7+ messages in thread From: Greg KH @ 2018-10-02 18:37 UTC (permalink / raw) To: Michael Bringmann; +Cc: mpe, stable On Tue, Oct 02, 2018 at 01:30:28PM -0500, Michael Bringmann wrote: > For 4.9-stable & 4.14-stable, we would adapt commit 8604895a34d92f5e186ceb931b0d1b384030ea3d > to the following: > > diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c > --- a/arch/powerpc/mm/numa.c 2018-10-02 13:18:42.615084257 -0500 > +++ b/arch/powerpc/mm/numa.c 2018-10-02 13:19:51.488209551 -0500 > @@ -1469,7 +1469,8 @@ > { > topology_timer.data = 0; > topology_timer.expires = jiffies + 60 * HZ; > - mod_timer(&topology_timer, topology_timer.expires); > + if (vphn_enabled) > + mod_timer(&topology_timer, topology_timer.expires); > } > > #ifdef CONFIG_SMP > > Can you send these all in a format that I can actually apply them in? This way does not work, sorry. greg k-h ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: FAILED: patch "[PATCH] powerpc/pseries: Fix unitialized timer reset on migration" failed to apply to 4.4-stable tree 2018-10-02 18:37 ` Greg KH @ 2018-10-02 19:36 ` Michael Bringmann 2018-10-02 19:42 ` Greg KH 0 siblings, 1 reply; 7+ messages in thread From: Michael Bringmann @ 2018-10-02 19:36 UTC (permalink / raw) To: Greg KH; +Cc: mpe, stable [-- Attachment #1: Type: text/plain, Size: 1086 bytes --] Providing backports as attachments. On 10/02/2018 01:37 PM, Greg KH wrote: > On Tue, Oct 02, 2018 at 01:30:28PM -0500, Michael Bringmann wrote: >> For 4.9-stable & 4.14-stable, we would adapt commit 8604895a34d92f5e186ceb931b0d1b384030ea3d >> to the following: >> >> diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c >> --- a/arch/powerpc/mm/numa.c 2018-10-02 13:18:42.615084257 -0500 >> +++ b/arch/powerpc/mm/numa.c 2018-10-02 13:19:51.488209551 -0500 >> @@ -1469,7 +1469,8 @@ >> { >> topology_timer.data = 0; >> topology_timer.expires = jiffies + 60 * HZ; >> - mod_timer(&topology_timer, topology_timer.expires); >> + if (vphn_enabled) >> + mod_timer(&topology_timer, topology_timer.expires); >> } >> >> #ifdef CONFIG_SMP >> >> > > Can you send these all in a format that I can actually apply them in? > > This way does not work, sorry. > > greg k-h > > -- Michael W. Bringmann Linux Technology Center IBM Corporation Tie-Line 363-5196 External: (512) 286-5196 Cell: (512) 466-0650 mwb@linux.vnet.ibm.com [-- Attachment #2: 0001-powerpc-pseries-Fix-unitialized-timer-reset-on-migra.v4.4.patch --] [-- Type: text/x-patch, Size: 373 bytes --] --- numa.c.orig 2018-10-02 09:03:06.232491410 -0500 +++ numa.c 2018-10-02 09:04:17.152494472 -0500 @@ -1606,7 +1606,8 @@ { topology_timer.data = 0; topology_timer.expires = jiffies + topology_timer_secs * HZ; - mod_timer(&topology_timer, topology_timer.expires); + if (vphn_enabled) + mod_timer(&topology_timer, topology_timer.expires); } #ifdef CONFIG_SMP [-- Attachment #3: 0001-powerpc-pseries-Fix-unitialized-timer-reset-on-migra.v4.9.patch --] [-- Type: text/x-patch, Size: 3047 bytes --] >From 8604895a34d92f5e186ceb931b0d1b384030ea3d Mon Sep 17 00:00:00 2001 From: Michael Bringmann <mwb@linux.vnet.ibm.com> Date: Thu, 20 Sep 2018 11:45:13 -0500 Subject: [PATCH] powerpc/pseries: Fix unitialized timer reset on migration After migration of a powerpc LPAR, the kernel executes code to update the system state to reflect new platform characteristics. Such changes include modifications to device tree properties provided to the system by PHYP. Property notifications received by the post_mobility_fixup() code are passed along to the kernel in general through a call to of_update_property() which in turn passes such events back to all modules through entries like the '.notifier_call' function within the NUMA module. When the NUMA module updates its state, it resets its event timer. If this occurs after a previous call to stop_topology_update() or on a system without VPHN enabled, the code runs into an unitialized timer structure and crashes. This patch adds a safety check along this path toward the problem code. An example crash log is as follows. ibmvscsi 30000081: Re-enabling adapter! ------------[ cut here ]------------ kernel BUG at kernel/time/timer.c:958! Oops: Exception in kernel mode, sig: 5 [#1] LE SMP NR_CPUS=2048 NUMA pSeries Modules linked in: nfsv3 nfs_acl nfs tcp_diag udp_diag inet_diag lockd unix_diag af_packet_diag netlink_diag grace fscache sunrpc xts vmx_crypto pseries_rng sg binfmt_misc ip_tables xfs libcrc32c sd_mod ibmvscsi ibmveth scsi_transport_srp dm_mirror dm_region_hash dm_log dm_mod CPU: 11 PID: 3067 Comm: drmgr Not tainted 4.17.0+ #179 ... NIP mod_timer+0x4c/0x400 LR reset_topology_timer+0x40/0x60 Call Trace: 0xc0000003f9407830 (unreliable) reset_topology_timer+0x40/0x60 dt_update_callback+0x100/0x120 notifier_call_chain+0x90/0x100 __blocking_notifier_call_chain+0x60/0x90 of_property_notify+0x90/0xd0 of_update_property+0x104/0x150 update_dt_property+0xdc/0x1f0 pseries_devicetree_update+0x2d0/0x510 post_mobility_fixup+0x7c/0xf0 migration_store+0xa4/0xc0 kobj_attr_store+0x30/0x60 sysfs_kf_write+0x64/0xa0 kernfs_fop_write+0x16c/0x240 __vfs_write+0x40/0x200 vfs_write+0xc8/0x240 ksys_write+0x5c/0x100 system_call+0x58/0x6c Fixes: 5d88aa85c00b ("powerpc/pseries: Update CPU maps when device tree is updated") Cc: stable@vger.kernel.org # v3.10+ Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> --- arch/powerpc/mm/numa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c --- a/arch/powerpc/mm/numa.c 2018-10-02 13:18:42.615084257 -0500 +++ b/arch/powerpc/mm/numa.c 2018-10-02 13:19:51.488209551 -0500 @@ -1469,7 +1469,8 @@ { topology_timer.data = 0; topology_timer.expires = jiffies + 60 * HZ; - mod_timer(&topology_timer, topology_timer.expires); + if (vphn_enabled) + mod_timer(&topology_timer, topology_timer.expires); } #ifdef CONFIG_SMP ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: FAILED: patch "[PATCH] powerpc/pseries: Fix unitialized timer reset on migration" failed to apply to 4.4-stable tree 2018-10-02 19:36 ` Michael Bringmann @ 2018-10-02 19:42 ` Greg KH 0 siblings, 0 replies; 7+ messages in thread From: Greg KH @ 2018-10-02 19:42 UTC (permalink / raw) To: Michael Bringmann; +Cc: mpe, stable On Tue, Oct 02, 2018 at 02:36:01PM -0500, Michael Bringmann wrote: > --- numa.c.orig 2018-10-02 09:03:06.232491410 -0500 > +++ numa.c 2018-10-02 09:04:17.152494472 -0500 > @@ -1606,7 +1606,8 @@ > { > topology_timer.data = 0; > topology_timer.expires = jiffies + topology_timer_secs * HZ; > - mod_timer(&topology_timer, topology_timer.expires); > + if (vphn_enabled) > + mod_timer(&topology_timer, topology_timer.expires); > } > > #ifdef CONFIG_SMP That's not a patch I can apply :( Please send one-email-per-patch, in the correct format. And not as an attachment. Come on, you know better than this... greg k-h ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-10-03 2:27 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-10-02 12:18 FAILED: patch "[PATCH] powerpc/pseries: Fix unitialized timer reset on migration" failed to apply to 4.4-stable tree gregkh 2018-10-02 14:18 ` Michael Bringmann 2018-10-02 16:27 ` Greg KH 2018-10-02 18:30 ` Michael Bringmann 2018-10-02 18:37 ` Greg KH 2018-10-02 19:36 ` Michael Bringmann 2018-10-02 19:42 ` Greg KH
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.