From patchwork Tue Aug 8 17:59:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 9888879 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B446360384 for ; Tue, 8 Aug 2017 18:04:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4E12289A9 for ; Tue, 8 Aug 2017 18:04:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99607289C0; Tue, 8 Aug 2017 18:04:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3AC63289A9 for ; Tue, 8 Aug 2017 18:04:29 +0000 (UTC) Received: from localhost ([::1]:43937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df8rk-0005Av-IG for patchwork-qemu-devel@patchwork.kernel.org; Tue, 08 Aug 2017 14:04:28 -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) 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) 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) 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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-dirty #1191 task: c00000001e440000 task.stack: c00000001e480000 NIP: c000000000023800 LR: c00000000000da28 CTR: c000000000626db0 REGS: c00000001ff97d80 TRAP: 0100 Not tainted (4.13.0-rc3-00305-ge84cf82ae73a-dirty) MSR: 8000000002001033 CR: 48000224 XER: 20000000 CFAR: c00000000002380c SOFTE: 0 GPR00: c00000000000d9cc c00000001e483dc0 c000000000ebd900 000000000007d000 GPR04: f000000000078680 c00000001e1a0048 c00000001e1a0048 0000000000000001 GPR08: 0000000000000000 0000000000075036 00000003d5f633c2 0000000000000020 GPR12: 0000000000000000 c00000000fd80f00 c00000000000d988 0000000000000000 GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR24: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR28: 0000000000000000 0000000000000000 0000000000000000 0000000000000b60 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 60000000 60000000 60000000 60420000 <7d2c42a6> 7d2a4850 7fa34840 419dfff4 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 *cpu, } else { /* Unicast */ CPU_FOREACH(cs) { - if (cpu->cpu_dt_id == target) { + PowerPCCPU *c = POWERPC_CPU(cs); + + if (c->cpu_dt_id == target) { run_on_cpu(cs, spapr_do_system_reset_on_cpu, RUN_ON_CPU_NULL); return H_SUCCESS; }