From patchwork Thu Dec 15 05:54:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 9475535 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 16A5E6047D for ; Thu, 15 Dec 2016 05:59:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 046C6286AA for ; Thu, 15 Dec 2016 05:59:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECF43286D0; Thu, 15 Dec 2016 05:59:29 +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 67066286AA for ; Thu, 15 Dec 2016 05:59:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757357AbcLOF65 (ORCPT ); Thu, 15 Dec 2016 00:58:57 -0500 Received: from ozlabs.org ([103.22.144.67]:60455 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756770AbcLOF6z (ORCPT ); Thu, 15 Dec 2016 00:58:55 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 3tfN6Z4fm6z9vDZ; Thu, 15 Dec 2016 16:58:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1481781526; bh=2kGLQ9DhKhDm3geL7rlIRw7ykJ+gJlUWY08mAcqe8Rs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A7oPs6j5ufew44o79+22sysb2U1m7S1I+Y4JUPquwvtMNqyOgpNPB/d4qC7T4Pi9S 54niFUe4P/znI15vUJxp5QHgxzsdNzY4/00M8DfPKpdu1ahNxkGMoO3Hrzx5kj0PR3 UIIjyjfTZDbILoLit88TDG4XkNpsPN/NXkmaVHGc= From: David Gibson To: paulus@samba.org Cc: michael@ellerman.id.au, benh@kernel.crashing.org, sjitindarsingh@gmail.com, thuth@redhat.com, lvivier@redhat.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, David Gibson Subject: [PATCH 11/11] powerpc/kvm: Advertise availablity of HPT resizing on KVM HV Date: Thu, 15 Dec 2016 16:54:04 +1100 Message-Id: <20161215055404.29351-12-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161215055404.29351-1-david@gibson.dropbear.id.au> References: <20161215055404.29351-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 This updates the KVM_CAP_SPAPR_RESIZE_HPT capability to advertise the presence of in-kernel HPT resizing on KVM HV. In fact the HPT resizing isn't fully implemented, but this allows us to experiment with what's there. Signed-off-by: David Gibson --- arch/powerpc/kvm/powerpc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index bb23923..965d26b 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -606,7 +606,10 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) r = 1; break; case KVM_CAP_SPAPR_RESIZE_HPT: - r = 1; /* resize allowed only if HPT is outside kernel */ + if (hv_enabled) + r = 2; /* In-kernel resize implementation */ + else + r = 1; /* outside kernel resize allowed */ break; #endif case KVM_CAP_PPC_HTM: