From: Paul Mackerras Date: Fri, 23 Aug 2019 10:04:54 +0000 Subject: Re: [PATCH] KVM: PPC: Book3S HV: Define usage types for rmap array in guest memslot Message-Id: <20190823100454.GA11357@blackberry> List-Id: References: <20190820061349.28995-1-sjitindarsingh@gmail.com> In-Reply-To: <20190820061349.28995-1-sjitindarsingh@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Suraj Jitindar Singh Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org On Tue, Aug 20, 2019 at 04:13:49PM +1000, Suraj Jitindar Singh wrote: > The rmap array in the guest memslot is an array of size number of guest > pages, allocated at memslot creation time. Each rmap entry in this array > is used to store information about the guest page to which it > corresponds. For example for a hpt guest it is used to store a lock bit, > rc bits, a present bit and the index of a hpt entry in the guest hpt > which maps this page. For a radix guest which is running nested guests > it is used to store a pointer to a linked list of nested rmap entries > which store the nested guest physical address which maps this guest > address and for which there is a pte in the shadow page table. > > As there are currently two uses for the rmap array, and the potential > for this to expand to more in the future, define a type field (being the > top 8 bits of the rmap entry) to be used to define the type of the rmap > entry which is currently present and define two values for this field > for the two current uses of the rmap array. > > Since the nested case uses the rmap entry to store a pointer, define > this type as having the two high bits set as is expected for a pointer. > Define the hpt entry type as having bit 56 set (bit 7 IBM bit ordering). > > Signed-off-by: Suraj Jitindar Singh Thanks, applied to my kvm-ppc-next branch. Paul.