KVM: PPC: Book3S HV: Define usage types for rmap array in guest memslot
authorSuraj Jitindar Singh <sjitindarsingh@gmail.com>
Tue, 20 Aug 2019 06:13:49 +0000 (16:13 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Fri, 23 Aug 2019 05:57:24 +0000 (15:57 +1000)
commitd22deab6960a6cb015a36e74a2dcbab6ca9f5544
treea98815792b2d3d44b045ae68e7fa55478bc0e41a
parentff7240ccf0cdab86762635840c6d62eec7147d18
KVM: PPC: Book3S HV: Define usage types for rmap array in guest memslot

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 <sjitindarsingh@gmail.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/kvm/book3s_hv_rm_mmu.c