From patchwork Tue Dec 23 12:30:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 423691 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A5C8E1400D5 for ; Tue, 23 Dec 2014 23:41:13 +1100 (AEDT) Received: from localhost ([::1]:44319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y3Olz-0002MJ-Ss for incoming@patchwork.ozlabs.org; Tue, 23 Dec 2014 07:41:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y3OcY-0002M8-7q for qemu-devel@nongnu.org; Tue, 23 Dec 2014 07:31:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y3OcM-00054O-RB for qemu-devel@nongnu.org; Tue, 23 Dec 2014 07:31:26 -0500 Received: from e7.ny.us.ibm.com ([32.97.182.137]:45020) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y3OcM-00054B-OE for qemu-devel@nongnu.org; Tue, 23 Dec 2014 07:31:14 -0500 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 Dec 2014 07:31:14 -0500 Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e7.ny.us.ibm.com (192.168.1.107) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 23 Dec 2014 07:31:11 -0500 Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 9A2E438C803B; Tue, 23 Dec 2014 07:31:10 -0500 (EST) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sBNCVAEF27525260; Tue, 23 Dec 2014 12:31:10 GMT Received: from d01av04.pok.ibm.com (localhost [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sBNCV913012848; Tue, 23 Dec 2014 07:31:10 -0500 Received: from localhost ([9.80.98.195]) by d01av04.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id sBNCV9h1012801; Tue, 23 Dec 2014 07:31:09 -0500 From: Michael Roth To: qemu-devel@nongnu.org Date: Tue, 23 Dec 2014 06:30:26 -0600 Message-Id: <1419337831-16552-13-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1419337831-16552-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1419337831-16552-1-git-send-email-mdroth@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14122312-0037-0000-0000-000000320CE9 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 32.97.182.137 Cc: aik@ozlabs.ru, agraf@suse.de, ncmike@ncultra.org, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, bharata.rao@gmail.com, nfont@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH v4 12/17] spapr_pci: add dynamic-reconfiguration option for spapr-pci-host-bridge X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This option enables/disables PCI hotplug for a particular PHB. Also add machine compatibility code to disable it by default for machine types prior to pseries-2.3. Signed-off-by: Michael Roth Reviewed-by: David Gibson --- hw/ppc/spapr.c | 21 +++++++++++++++++++++ hw/ppc/spapr_pci.c | 2 ++ include/hw/pci-host/spapr.h | 1 + 3 files changed, 24 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 9eb0a94..4478fa7 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1752,11 +1752,27 @@ static const TypeInfo spapr_machine_info = { }, }; +/* pSeries-specific hardware compatibility properties + * + * As with PC machines and general hardware properties, older + * machine types inherit backward-compability properties needed + * for subsequent machine types. + */ +#define PPC_HW_COMPAT_2_2 \ + {\ + .driver = "spapr-pci-host-bridge",\ + .property = "dynamic-reconfiguration",\ + .value = "off",\ + } + +#define PPC_HW_COMPAT_2_1 PPC_HW_COMPAT_2_2 + static void spapr_machine_2_1_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); static GlobalProperty compat_props[] = { HW_COMPAT_2_1, + PPC_HW_COMPAT_2_1, { /* end of list */ } }; @@ -1774,9 +1790,14 @@ static const TypeInfo spapr_machine_2_1_info = { static void spapr_machine_2_2_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); + static GlobalProperty compat_props[] = { + PPC_HW_COMPAT_2_2, + { /* end of list */ } + }; mc->name = "pseries-2.2"; mc->desc = "pSeries Logical Partition (PAPR compliant) v2.2"; + mc->compat_props = compat_props; } static const TypeInfo spapr_machine_2_2_info = { diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 21b95b3..4850f9a 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -678,6 +678,8 @@ static Property spapr_phb_properties[] = { DEFINE_PROP_UINT64("io_win_addr", sPAPRPHBState, io_win_addr, -1), DEFINE_PROP_UINT64("io_win_size", sPAPRPHBState, io_win_size, SPAPR_PCI_IO_WIN_SIZE), + DEFINE_PROP_BOOL("dynamic-reconfiguration", sPAPRPHBState, dr_enabled, + true), DEFINE_PROP_END_OF_LIST(), }; diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h index 4ea2a0d..ba0f3cc 100644 --- a/include/hw/pci-host/spapr.h +++ b/include/hw/pci-host/spapr.h @@ -67,6 +67,7 @@ struct sPAPRPHBState { int32_t index; uint64_t buid; char *dtbusname; + bool dr_enabled; MemoryRegion memspace, iospace; hwaddr mem_win_addr, mem_win_size, io_win_addr, io_win_size;