From patchwork Thu Sep 20 16:45:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Bringmann X-Patchwork-Id: 972562 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42GN880Wz4z9s89 for ; Fri, 21 Sep 2018 02:52:56 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42GN875YNJzF3NL for ; Fri, 21 Sep 2018 02:52:55 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=mwb@linux.vnet.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42GMzS1JVxzF3NQ for ; Fri, 21 Sep 2018 02:45:20 +1000 (AEST) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8KGdOFQ103173 for ; Thu, 20 Sep 2018 12:45:19 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0a-001b2d01.pphosted.com with ESMTP id 2mmd7u6c1u-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Sep 2018 12:45:19 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 20 Sep 2018 10:45:18 -0600 Received: from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 20 Sep 2018 10:45:15 -0600 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w8KGjFOv26935436 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 20 Sep 2018 09:45:15 -0700 Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E9D20BE054; Thu, 20 Sep 2018 10:45:14 -0600 (MDT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 24A69BE04F; Thu, 20 Sep 2018 10:45:14 -0600 (MDT) Received: from oc5000245537.ibm.com (unknown [9.53.92.191]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 20 Sep 2018 10:45:13 -0600 (MDT) To: linuxppc-dev@lists.ozlabs.org From: Michael Bringmann Subject: [PATCH v02] REPOST powerpc/migration: Handle unitialized timer reset Openpgp: preference=signencrypt Autocrypt: addr=mwb@linux.vnet.ibm.com; prefer-encrypt=mutual; keydata= xsBNBFcY7GcBCADzw3en+yzo9ASFGCfldVk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ZgZFsqmuxBxVGiav2HB+dNvs3PFB087Pvc9OHe qhajPWOP/gNLMmvBvknn1NToM9a8/E8rzcIZXoYs4RggRRYh6wARAQABwsBfBBgBAgAJBQJX GOxnAhsMAAoJEEhHWoN3abky+RUH/jE08/r5QzaNKYeVhu0uVbgXu5fsxqr2cAxhf+KuwT3T efhEP2alarxzUZdEh4MsG6c+X2NYLbD3cryiXxVx/7kSAJEFQJfA5P06g8NLR25Qpq9BLsN7 ++dxQ+CLKzSEb1X24hYAJZpOhS8ev3ii+M/XIo+olDBKuTaTgB6elrg3CaxUsVgLBJ+jbRkW yQe2S5f/Ja1ThDpSSLLWLiLK/z7+gaqwhnwjQ8Z8Y9D2itJQcj4itHilwImsqwLG7SxzC0NX IQ5KaAFYdRcOgwR8VhhkOIVd70ObSZU+E4pTET1WDz4o65xZ89yfose1No0+r5ht/xWOOrh8 53/hcWvxHVs= Organization: IBM Linux Technology Center Date: Thu, 20 Sep 2018 11:45:13 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 18092016-0020-0000-0000-00000E693BA3 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009740; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01091129; UDB=6.00563751; IPR=6.00871153; MB=3.00023415; MTD=3.00000008; XFM=3.00000015; UTC=2018-09-20 16:45:16 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18092016-0021-0000-0000-00006318E8BC Message-Id: <6a7769a5-c8bc-f857-61cc-a76cdd98b28c@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-09-20_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809200161 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nathan Fontenot , Michael Bringmann , minkim@us.ibm.com, Thomas Falcon , Tyrel Datwyler Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 powerpc 'migration_store' 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. Note: This crash was observed on every LPM in the 4.17-rc7 kernel (and in the 4.18 kernel) of a system with dedicated CPUs enabled. An example crash log without the patch is as follows. [ 2571.437467] ibmvscsi 30000081: Re-enabling adapter! [ 2571.673850] ------------[ cut here ]------------ [ 2571.673863] kernel BUG at kernel/time/timer.c:958! [ 2571.673875] Oops: Exception in kernel mode, sig: 5 [#1] [ 2571.673877] LE SMP NR_CPUS=2048 NUMA pSeries [ 2571.673886] 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 [ 2571.673969] CPU: 11 PID: 3067 Comm: drmgr Not tainted 4.17.0+ #179 [ 2571.673972] NIP: c000000000198a2c LR: c000000000075990 CTR: 0000000000000000 [ 2571.673975] REGS: c0000003f9407560 TRAP: 0700 Not tainted (4.17.0+) [ 2571.673977] MSR: 800000010282b033 CR: 44482824 XER: 00000000 [ 2571.673990] CFAR: c00000000007598c SOFTE: 0 [ 2571.673990] GPR00: c000000000075990 c0000003f94077e0 c00000000113a900 c0000000012e5968 [ 2571.673990] GPR04: 000000010003776b c0000003ffa05180 0000000000000020 c0000003f9407850 [ 2571.673990] GPR08: 0000000000000000 0000000000000001 ffffffffffffffff 0000000000000220 [ 2571.673990] GPR12: c000000000076560 c00000001ec90200 0000000040000000 0000000000000018 [ 2571.673990] GPR16: 0000000000000000 000000000000000d c0000003e9ea5015 0000000000000010 [ 2571.673990] GPR20: 000000000000000b 0000000000000050 c0000003e9ea4068 0000000000000001 [ 2571.673990] GPR24: 000000000000001c c0000003ffff3ab0 0000000000000000 c0000003f9407990 [ 2571.673990] GPR28: 0000000000000005 c0000003ffff3ab0 000000010003776b c0000000012e5968 [ 2571.674042] NIP [c000000000198a2c] mod_timer+0x4c/0x400 [ 2571.674051] LR [c000000000075990] reset_topology_timer+0x40/0x60 [ 2571.674053] Call Trace: [ 2571.674056] [c0000003f94077e0] [c0000003f9407830] 0xc0000003f9407830 (unreliable) [ 2571.674060] [c0000003f9407860] [c000000000075990] reset_topology_timer+0x40/0x60 [ 2571.674063] [c0000003f9407880] [c000000000076660] dt_update_callback+0x100/0x120 [ 2571.674072] [c0000003f94078d0] [c00000000012ada0] notifier_call_chain+0x90/0x100 [ 2571.674077] [c0000003f9407920] [c00000000012b270] __blocking_notifier_call_chain+0x60/0x90 [ 2571.674092] [c0000003f9407970] [c0000000007b9a60] of_property_notify+0x90/0xd0 [ 2571.674096] [c0000003f94079d0] [c0000000007b4644] of_update_property+0x104/0x150 [ 2571.674103] [c0000003f9407a30] [c0000000000c0ddc] update_dt_property+0xdc/0x1f0 [ 2571.674106] [c0000003f9407a90] [c0000000000c11c0] pseries_devicetree_update+0x2d0/0x510 [ 2571.674110] [c0000003f9407bc0] [c0000000000c147c] post_mobility_fixup+0x7c/0xf0 [ 2571.674113] [c0000003f9407c30] [c0000000000c1594] migration_store+0xa4/0xc0 [ 2571.674123] [c0000003f9407c70] [c000000000989940] kobj_attr_store+0x30/0x60 [ 2571.674133] [c0000003f9407c90] [c00000000040b294] sysfs_kf_write+0x64/0xa0 [ 2571.674136] [c0000003f9407cb0] [c00000000040a02c] kernfs_fop_write+0x16c/0x240 [ 2571.674146] [c0000003f9407d00] [c00000000034eeb0] __vfs_write+0x40/0x200 [ 2571.674149] [c0000003f9407d90] [c00000000034f288] vfs_write+0xc8/0x240 [ 2571.674152] [c0000003f9407de0] [c00000000034f5bc] ksys_write+0x5c/0x100 [ 2571.674158] [c0000003f9407e30] [c00000000000b284] system_call+0x58/0x6c [ 2571.674161] Instruction dump: [ 2571.674163] fb01ffc0 7c7f1b78 fb21ffc8 fb41ffd0 fb61ffd8 fb81ffe0 fba1ffe8 f8010010 [ 2571.674168] f821ff81 e9230018 7d290074 7929d182 <0b090000> e9230008 2fa90000 419e0278 [ 2571.674176] ---[ end trace 0c7939657d5522df ]--- Signed-off-by: Michael Bringmann --- Changes in patch: -- Revised patch description. --- 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 index 0c7e05d..a789d57 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -1457,7 +1457,8 @@ static void topology_timer_fn(struct timer_list *unused) 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