From patchwork Fri Jan 29 06:42:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 8159571 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E00A8BEEE5 for ; Fri, 29 Jan 2016 06:41:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4EC6C20340 for ; Fri, 29 Jan 2016 06:41:59 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 9E0E120328 for ; Fri, 29 Jan 2016 06:41:58 +0000 (UTC) Received: from localhost ([::1]:60233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aP2kn-0006hQ-Vb for patchwork-qemu-devel@patchwork.kernel.org; Fri, 29 Jan 2016 01:41:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aP2kV-0006cR-Cx for qemu-devel@nongnu.org; Fri, 29 Jan 2016 01:41:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aP2kR-0000SS-Iw for qemu-devel@nongnu.org; Fri, 29 Jan 2016 01:41:39 -0500 Received: from ozlabs.org ([103.22.144.67]:35228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aP2kR-0000S1-8Z; Fri, 29 Jan 2016 01:41:35 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 51490140C57; Fri, 29 Jan 2016 17:41:32 +1100 (AEDT) From: David Gibson To: benh@kernel.crashing.org, paulus@samba.org, aik@ozlabs.ru Date: Fri, 29 Jan 2016 17:42:23 +1100 Message-Id: <1454049744-19131-6-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454049744-19131-1-git-send-email-david@gibson.dropbear.id.au> References: <1454049744-19131-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 103.22.144.67 Cc: lvivier@redhat.com, thuth@redhat.com, mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org, agraf@suse.de, qemu-ppc@nongnu.org, David Gibson Subject: [Qemu-devel] [RFCv2 5/6] pseries: Enable HPT resizing for 2.6 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We've now implemented a PAPR extensions which allows PAPR guests (i.e. "pseries" machine type) to resize their hash page table during runtime. However, that extension is only enabled if explicitly chosen on the command line. This patch enables it by default for qemu-2.6, but leaves it disabled (by default) for older machine types. Signed-off-by: David Gibson --- hw/ppc/spapr.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index ddd8b99..0d2759a 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2137,12 +2137,17 @@ static void spapr_machine_initfn(Object *obj) sPAPRMachineState *spapr = SPAPR_MACHINE(obj); spapr->htab_fd = -1; + object_property_add_str(obj, "kvm-type", spapr_get_kvm_type, spapr_set_kvm_type, NULL); object_property_set_description(obj, "kvm-type", "Specifies the KVM virtualization mode (HV, PR)", NULL); + if (!kvm_enabled()) { + /* No KVM implementation of HPT resizing yet */ + spapr->resize_hpt = SPAPR_RESIZE_HPT_ENABLED; + } object_property_add_str(obj, "resize-hpt", spapr_get_resize_hpt, spapr_set_resize_hpt, NULL); object_property_set_description(obj, "resize-hpt", @@ -2412,6 +2417,10 @@ DEFINE_SPAPR_MACHINE(2_6, "2.6", true); static void spapr_machine_2_5_instance_options(MachineState *machine) { + sPAPRMachineState *spapr = SPAPR_MACHINE(machine); + + spapr_machine_2_6_instance_options(machine); + spapr->resize_hpt = SPAPR_RESIZE_HPT_DISABLED; } static void spapr_machine_2_5_class_options(MachineClass *mc)