From patchwork Tue Oct 22 16:38:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 1181522 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46yKRW59Lpz9sPf for ; Wed, 23 Oct 2019 03:56:55 +1100 (AEDT) Received: from localhost ([::1]:36410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMxS5-0003Le-EH for incoming@patchwork.ozlabs.org; Tue, 22 Oct 2019 12:56:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41125) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMxBQ-0000kp-Lm for qemu-devel@nongnu.org; Tue, 22 Oct 2019 12:38:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMxBO-0006hU-Uh for qemu-devel@nongnu.org; Tue, 22 Oct 2019 12:38:56 -0400 Received: from 5.mo1.mail-out.ovh.net ([178.33.45.107]:46775) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMxBO-0006gh-Nk for qemu-devel@nongnu.org; Tue, 22 Oct 2019 12:38:54 -0400 Received: from player688.ha.ovh.net (unknown [10.108.35.185]) by mo1.mail-out.ovh.net (Postfix) with ESMTP id 6E2DF194F67 for ; Tue, 22 Oct 2019 18:38:52 +0200 (CEST) Received: from kaod.org (lfbn-1-2229-223.w90-76.abo.wanadoo.fr [90.76.50.223]) (Authenticated sender: clg@kaod.org) by player688.ha.ovh.net (Postfix) with ESMTPSA id 70050B32C2DD; Tue, 22 Oct 2019 16:38:46 +0000 (UTC) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: David Gibson Subject: [PATCH v5 0/7] ppc: reset the interrupt presenter from the CPU reset handler Date: Tue, 22 Oct 2019 18:38:05 +0200 Message-Id: <20191022163812.330-1-clg@kaod.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Ovh-Tracer-Id: 3502393138045684710 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrkeejgddutdefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 178.33.45.107 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_Goater?= , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Hello, On the sPAPR machine and PowerNV machine, the interrupt presenters are created by a machine handler at the core level and are reseted independently. This is not consistent and it raises issues when it comes to handle hot-plugged CPUs. In that case, the presenters are not reseted. This is less of an issue in XICS, although a zero MFFR could be a concern, but in XIVE, the OS CAM line is not set and this breaks the presenting algorithm. The current code has workarounds which need a global cleanup. Extend the sPAPR IRQ backend and the PowerNV Chip class with a new cpu_intc_reset() handler called by the CPU reset handler and remove the XiveTCTX reset handler which is now redundant. Set the OS CAM line when the interrupt presenter of the sPAPR core is reseted. This will also cover the case of hot-plugged CPUs. Thanks, C. Changes in v5: - Removed useless PNV_CHIP() cast Changes in v4: - Introduce a PnvCore reset handler - Add PnvChip pointer to PnvCore Changes in v3: - Introduced a DeviceClass::reset for the CPU (Greg) - add support for PowerNV Changes in v2: - removed property - simplified reset handlers Cédric Le Goater (6): spapr: move CPU reset after presenter creation ppc/pnv: Introduce a PnvCore reset handler ppc/pnv: Add a PnvChip pointer to PnvCore ppc: Reset the interrupt presenter from the CPU reset handler ppc/pnv: Fix naming of routines realizing the CPUs spapr/xive: Set the OS CAM line at reset Greg Kurz (1): spapr_cpu_core: Implement DeviceClass::reset include/hw/ppc/pnv.h | 1 + include/hw/ppc/pnv_core.h | 3 +++ include/hw/ppc/spapr_irq.h | 2 ++ include/hw/ppc/spapr_xive.h | 1 - include/hw/ppc/xics.h | 1 + include/hw/ppc/xive.h | 1 + hw/intc/spapr_xive.c | 53 +++++++++++++++++-------------------- hw/intc/xics.c | 8 ++---- hw/intc/xics_spapr.c | 7 +++++ hw/intc/xive.c | 12 +-------- hw/ppc/pnv.c | 18 +++++++++++++ hw/ppc/pnv_core.c | 31 ++++++++++++++++------ hw/ppc/spapr_cpu_core.c | 44 +++++++++++++++++++++++------- hw/ppc/spapr_irq.c | 14 ++++++++++ 14 files changed, 131 insertions(+), 65 deletions(-)