From patchwork Thu Dec 8 05:13:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 9465841 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 4495760459 for ; Thu, 8 Dec 2016 05:13:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F8A82851F for ; Thu, 8 Dec 2016 05:13:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33A1D28548; Thu, 8 Dec 2016 05:13:35 +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_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD7132851F for ; Thu, 8 Dec 2016 05:13:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753121AbcLHFNb (ORCPT ); Thu, 8 Dec 2016 00:13:31 -0500 Received: from ozlabs.org ([103.22.144.67]:43287 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750728AbcLHFN3 (ORCPT ); Thu, 8 Dec 2016 00:13:29 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 3tZ3RW5740z9tB1; Thu, 8 Dec 2016 16:13:27 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1481174007; bh=EgPj7ouOHVRl9aK5m4+7hkzN5WSWYci8ktuAeRl3hrg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LjWlhbrBFxlDkzMQOeXRmaRtxVMdlXDzuRLiM1qH3D1wobDCuggi/lIC7S8cmfFna +fcdYPG3yztllSZiFXqwgJie9Zgsi3wrH7OULy94aDeJudHNaYXUcLv3d688A50Hfc rxwQOrV45h1GxYgn61XoOWTarcQpE+pN2qNT09cM= From: David Gibson To: michael@ellerman.id.au, paulus@samba.org Cc: linuxppc-dev@ozlabs.org, kvm@vger.kernel.org, David Gibson Subject: [PATCH 5/6] pseries: Advertise HPT resizing support via CAS Date: Thu, 8 Dec 2016 16:13:20 +1100 Message-Id: <20161208051321.31446-6-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161208051321.31446-1-david@gibson.dropbear.id.au> References: <20161208051321.31446-1-david@gibson.dropbear.id.au> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The hypervisor needs to know a guest is capable of using the HPT resizing PAPR extension in order to make full advantage of it for memory hotplug. If the hypervisor knows the guest is HPT resize aware, it can size the initial HPT based on the initial guest RAM size, relying on the guest to resize the HPT when more memory is hot-added. Without this, the hypervisor must size the HPT for the maximum possible guest RAM, which can lead to a huge waste of space if the guest never actually expends to that maximum size. This patch advertises the guest's support for HPT resizing via the ibm,client-architecture-support OF interface. We use bit 5 of byte 6 of option vector 5 for this purpose (tentatively assigned in in-progress PAPR change request). Signed-off-by: David Gibson Reviewed-by: Anshuman Khandual Reviewed-by: Paul Mackerras --- arch/powerpc/include/asm/prom.h | 1 + arch/powerpc/kernel/prom_init.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h index 7f436ba..94c92bb 100644 --- a/arch/powerpc/include/asm/prom.h +++ b/arch/powerpc/include/asm/prom.h @@ -151,6 +151,7 @@ struct of_drconf_cell { #define OV5_XCMO 0x0440 /* Page Coalescing */ #define OV5_TYPE1_AFFINITY 0x0580 /* Type 1 NUMA affinity */ #define OV5_PRRN 0x0540 /* Platform Resource Reassignment */ +#define OV5_RESIZE_HPT 0x0601 /* Hash Page Table resizing */ #define OV5_PFO_HW_RNG 0x0E80 /* PFO Random Number Generator */ #define OV5_PFO_HW_842 0x0E40 /* PFO Compression Accelerator */ #define OV5_PFO_HW_ENCR 0x0E20 /* PFO Encryption Accelerator */ diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 88ac964..9942d9f 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c @@ -713,7 +713,7 @@ unsigned char ibm_architecture_vec[] = { 0, #endif OV5_FEAT(OV5_TYPE1_AFFINITY) | OV5_FEAT(OV5_PRRN), - 0, + OV5_FEAT(OV5_RESIZE_HPT), 0, 0, /* WARNING: The offset of the "number of cores" field below