From nobody Sun Apr 28 22:00:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502215483558673.7794909610461; Tue, 8 Aug 2017 11:04:43 -0700 (PDT) Received: from localhost ([::1]:43940 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df8ry-0005kG-Eq for importer@patchew.org; Tue, 08 Aug 2017 14:04:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df8nP-0002Tb-9O for qemu-devel@nongnu.org; Tue, 08 Aug 2017 14:00:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1df8nM-0003Hw-0Q for qemu-devel@nongnu.org; Tue, 08 Aug 2017 13:59:59 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:38487) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1df8nL-0003Hk-Pi; Tue, 08 Aug 2017 13:59:55 -0400 Received: by mail-pf0-x241.google.com with SMTP id h75so3748779pfh.5; Tue, 08 Aug 2017 10:59:55 -0700 (PDT) Received: from roar.au.ibm.com (203-219-56-202.tpgi.com.au. [203.219.56.202]) by smtp.gmail.com with ESMTPSA id k85sm4926954pfj.5.2017.08.08.10.59.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Aug 2017 10:59:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=WMSWYOKQO14WaZpD9e9VFHyUx67sSkigYfYImnpR02Y=; b=ac74bMkdrgm8+ggRQ+HFcX/odCwVSU6QQ/o0R+89pj+6PQdhLA9f2+E0aqLbWezN5O tL+fSgkeXvRmmd81dgM9saSB350Z2UNibGW9hWkCARDmalZerkDeE8lX6cCisQFF5ZXD VjsjBKe3Lpx+4XBC1uZQm8aS6dvL36tLPWNlCZ74gYSy8ZaCcBof7Afv1VSqfqPnEnkQ wNLe4SGEREwIrZu/9qMPKo+iD+kJR8CRrUmq8z3nxZ/YjMNiA0Npu7NfkcWznzK2kojb DqEMCBHMUceSGYjAQQJJgz9+vSOawybHD1XXjyLRN4G+ztKdWDLAcBJtsTp8RW/uhMmq /PYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WMSWYOKQO14WaZpD9e9VFHyUx67sSkigYfYImnpR02Y=; b=knhniG3Us879xqtqra58KPKy6T1+3dQTJuGRNgV25F5Pl64qGksNpmn6M68cYtGyBo VTPZJXjiui3rMvSg82Z125bvvZ9GE4NHKgqSqGTo3bAv0GdCfZT7emRTjajdAC6hKxqw eo3JXaggWVvSn3bcUBhavJeDWU1LxtfMduRGXV8NlWNWlBl+klCCB4piGuSHngeVlWYv HL825KJr2M54bb6Ofr06Sj/dxMkYXOkrBhgx+8v/PY0t3Be5ypYsh2AJ80WESf+VTb8d yXnLVvsRq13K68cG7mfFvDL9nqOfbVUlw/H6LegdVj12230QuwaBVdIpoekZz1W27jDk WvLQ== X-Gm-Message-State: AHYfb5jWqGZKOLP35gqj9pPjWNAFG6xghKgbTIA/3Kcot7YWhdRxF552 YsvRhvjsWEoQCEHf X-Received: by 10.84.215.132 with SMTP id l4mr5576143pli.476.1502215194103; Tue, 08 Aug 2017 10:59:54 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Date: Wed, 9 Aug 2017 03:59:36 +1000 Message-Id: <20170808175936.28793-1-npiggin@gmail.com> X-Mailer: git-send-email 2.13.3 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::241 Subject: [Qemu-devel] [PATCH] ppc/spapr: fix unicast H_SIGNAL_SYS_RESET X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, Nicholas Piggin , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Unicast H_SIGNAL_SYS_RESET does not find the target CPU if it is not the current CPU. Signed-off-by: Nicholas Piggin --- Unfortunately this slipped through without my noticing because the Linux driver for NMI IPIs has a fallback to using regular IPIs, and because Linux did not make much use of unicasts. A new watchdog has started using them. After this patch, this function works properly: Watchdog CPU:0 detected Hard LOCKUP other CPUS:3 *** Unicast NMI IPI is sent here *** Watchdog CPU:3 Hard LOCKUP Modules linked in: CPU: 3 PID: 1 Comm: swapper/0 Not tainted 4.13.0-rc3-00305-ge84cf82ae73a-di= rty #1191 task: c00000001e440000 task.stack: c00000001e480000 NIP: c000000000023800 LR: c00000000000da28 CTR: c000000000626db0 REGS: c00000001ff97d80 TRAP: 0100 Not tainted (4.13.0-rc3-00305-ge84cf82= ae73a-dirty) MSR: 8000000002001033 CR: 48000224 XER: 20000000 CFAR: c00000000002380c SOFTE: 0=20 GPR00: c00000000000d9cc c00000001e483dc0 c000000000ebd900 000000000007d000=20 GPR04: f000000000078680 c00000001e1a0048 c00000001e1a0048 0000000000000001=20 GPR08: 0000000000000000 0000000000075036 00000003d5f633c2 0000000000000020=20 GPR12: 0000000000000000 c00000000fd80f00 c00000000000d988 0000000000000000=20 GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000=20 GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000=20 GPR24: 0000000000000000 0000000000000000 0000000000000000 0000000000000000=20 GPR28: 0000000000000000 0000000000000000 0000000000000000 0000000000000b60=20 NIP [c000000000023800] udelay+0x40/0x60 LR [c00000000000da28] kernel_init+0xa8/0x1b0 Call Trace: [c00000001e483dc0] [c00000000000d9cc] kernel_init+0x4c/0x1b0 (unreliable) [c00000001e483e30] [c00000000000bb1c] ret_from_kernel_thread+0x5c/0xc0 Instruction dump: 7c6349d2 7c210b78 7d4c42a6 7d2c42a6 7d2a4850 7fa34840 409d0028 48000014=20 60000000 60000000 60000000 60420000 <7d2c42a6> 7d2a4850 7fa34840 419dfff4=20 hw/ppc/spapr_hcall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 72ea5a8247..f50e979b43 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -1432,7 +1432,9 @@ static target_ulong h_signal_sys_reset(PowerPCCPU *cp= u, } else { /* Unicast */ CPU_FOREACH(cs) { - if (cpu->cpu_dt_id =3D=3D target) { + PowerPCCPU *c =3D POWERPC_CPU(cs); + + if (c->cpu_dt_id =3D=3D target) { run_on_cpu(cs, spapr_do_system_reset_on_cpu, RUN_ON_CPU_NU= LL); return H_SUCCESS; } --=20 2.13.3