Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760259AbcLPJYg (ORCPT ); Fri, 16 Dec 2016 04:24:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46330 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760138AbcLPJYW (ORCPT ); Fri, 16 Dec 2016 04:24:22 -0500 Subject: Re: [PATCH 03/11] powerpc/kvm: Gather HPT related variables into sub-structure To: David Gibson , paulus@samba.org References: <20161215055404.29351-1-david@gibson.dropbear.id.au> <20161215055404.29351-4-david@gibson.dropbear.id.au> Cc: michael@ellerman.id.au, benh@kernel.crashing.org, sjitindarsingh@gmail.com, lvivier@redhat.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org From: Thomas Huth Message-ID: Date: Fri, 16 Dec 2016 10:24:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20161215055404.29351-4-david@gibson.dropbear.id.au> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 16 Dec 2016 09:24:22 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1493 Lines: 38 On 15.12.2016 06:53, David Gibson wrote: > Currently, the powerpc kvm_arch structure contains a number of variables > tracking the state of the guest's hashed page table (HPT) in KVM HV. This > patch gathers them all together into a single kvm_hpt_info substructure. > This makes life more convenient for the upcoming HPT resizing > implementation. > > Signed-off-by: David Gibson > --- > arch/powerpc/include/asm/kvm_host.h | 16 ++++--- > arch/powerpc/kvm/book3s_64_mmu_hv.c | 90 ++++++++++++++++++------------------- > arch/powerpc/kvm/book3s_hv.c | 2 +- > arch/powerpc/kvm/book3s_hv_rm_mmu.c | 62 ++++++++++++------------- > 4 files changed, 87 insertions(+), 83 deletions(-) > > diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h > index e59b172..2673271 100644 > --- a/arch/powerpc/include/asm/kvm_host.h > +++ b/arch/powerpc/include/asm/kvm_host.h > @@ -241,12 +241,20 @@ struct kvm_arch_memory_slot { > #endif /* CONFIG_KVM_BOOK3S_HV_POSSIBLE */ > }; > > +struct kvm_hpt_info { > + unsigned long virt; > + struct revmap_entry *rev; > + unsigned long npte; > + unsigned long mask; > + u32 order; > + int cma; > +}; While you're at it, it would be really great if you could add a comment at the end of each line with a short description of what the variables are about. E.g. if I just read "virt" and do not have much clue of the code yet, I have a hard time to figure out what this means... Thomas