From patchwork Tue Jul 25 18:01:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kurz X-Patchwork-Id: 793571 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 3xH5r45fT9z9s3T for ; Wed, 26 Jul 2017 04:10:12 +1000 (AEST) Received: from localhost ([::1]:33929 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da4Ha-0001Uc-F4 for incoming@patchwork.ozlabs.org; Tue, 25 Jul 2017 14:10:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da49J-00039e-Q3 for qemu-devel@nongnu.org; Tue, 25 Jul 2017 14:01:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1da49G-0002lJ-NF for qemu-devel@nongnu.org; Tue, 25 Jul 2017 14:01:37 -0400 Received: from 11.mo5.mail-out.ovh.net ([46.105.47.167]:54552) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1da49G-0002jz-GE for qemu-devel@nongnu.org; Tue, 25 Jul 2017 14:01:34 -0400 Received: from player760.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo5.mail-out.ovh.net (Postfix) with ESMTP id 2727A1165D3 for ; Tue, 25 Jul 2017 20:01:33 +0200 (CEST) Received: from [192.168.0.243] (gar31-1-82-66-74-139.fbx.proxad.net [82.66.74.139]) (Authenticated sender: groug@kaod.org) by player760.ha.ovh.net (Postfix) with ESMTPA id B6CDE20078; Tue, 25 Jul 2017 20:01:25 +0200 (CEST) From: Greg Kurz To: qemu-devel@nongnu.org Date: Tue, 25 Jul 2017 20:01:25 +0200 Message-ID: <150100568549.27487.11903027800624299907.stgit@bahia> In-Reply-To: <150100547373.27487.3154210751350595400.stgit@bahia> References: <150100547373.27487.3154210751350595400.stgit@bahia> User-Agent: StGit/0.17.1-20-gc0b1b-dirty MIME-Version: 1.0 X-Ovh-Tracer-Id: 9762959567368198617 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelkedrheehgdduvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.47.167 Subject: [Qemu-devel] [for-2.11 PATCH 16/26] spapr: enable PHB hotplug for pseries-2.11 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: "Michael S. Tsirkin" , Michael Roth , qemu-ppc@nongnu.org, Bharata B Rao , Paolo Bonzini , Daniel Henrique Barboza , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Michael Roth The 'dr_phb_enabled' field of that class can be set as part of machine-specific init code, and is then propagated to sPAPREnvironment to conditionally enable creation of DRC objects and device-tree description to facilitate hotplug of PHBs. Since we can't migrate this state to older machine types, default the option to true and disable it for older machine types. Signed-off-by: Michael Roth Signed-off-by: Greg Kurz --- Changes since RFC: - rebased against ppc-for-2.10 - updated changelog and title - set default to true and disable for 2.10 and older --- hw/ppc/spapr.c | 6 ++++++ include/hw/ppc/spapr.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 277daa4f9645..8dc505343c0f 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2382,6 +2382,8 @@ static void ppc_spapr_init(MachineState *machine) /* We always have at least the nvram device on VIO */ spapr_create_nvram(spapr); + spapr->dr_phb_enabled = smc->dr_phb_enabled; + /* Set up PCI */ spapr_pci_rtas_init(); @@ -3482,6 +3484,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) * in which LMBs are represented and hot-added */ mc->numa_mem_align_shift = 28; + smc->dr_phb_enabled = true; } static const TypeInfo spapr_machine_info = { @@ -3558,8 +3561,11 @@ static void spapr_machine_2_10_instance_options(MachineState *machine) static void spapr_machine_2_10_class_options(MachineClass *mc) { + sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); + spapr_machine_2_11_class_options(mc); SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_10); + smc->dr_phb_enabled = false; } DEFINE_SPAPR_MACHINE(2_10, "2.10", false); diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 2a303a705c17..8004d9c2ab2c 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -59,6 +59,7 @@ struct sPAPRMachineClass { /*< public >*/ bool dr_lmb_enabled; /* enable dynamic-reconfig/hotplug of LMBs */ + bool dr_phb_enabled; /* enable dynamic-reconfig/hotplug of PHBs */ bool use_ohci_by_default; /* use USB-OHCI instead of XHCI */ const char *tcg_default_cpu; /* which (TCG) CPU to simulate by default */ bool pre_2_10_has_unused_icps; @@ -122,6 +123,8 @@ struct sPAPRMachineState { * occurs during the unplug process. */ QTAILQ_HEAD(, sPAPRDIMMState) pending_dimm_unplugs; + bool dr_phb_enabled; /* hotplug / dynamic-reconfiguration of PHBs */ + /*< public >*/ char *kvm_type; MemoryHotplugState hotplug_memory;