]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV: Align gfn to L1 page size when inserting nest-rmap entry
authorSuraj Jitindar Singh <sjitindarsingh@gmail.com>
Fri, 21 Dec 2018 03:28:40 +0000 (14:28 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Fri, 21 Dec 2018 03:37:43 +0000 (14:37 +1100)
commit6e76ace26892ef149e06fdff6266cf3c6a3144c6
treebf4e649876cc15b7cbd5a052cc24a53b426ebc50
parentd9d87e0fce5dd43dac83f293d1da7b2a9bca9b9a
KVM: PPC: Book3S HV: Align gfn to L1 page size when inserting nest-rmap entry

Nested rmap entries are used to store the translation from L1 gpa to L2
gpa when entries are inserted into the shadow (nested) page tables. This
rmap list is located by indexing the rmap array in the memslot by L1
gfn. When we come to search for these entries we only know the L1 page size
(which could be PAGE_SIZE, 2M or a 1G page) and so can only select a gfn
aligned to that size. This means that when we insert the entry, so we can
find it later, we need to align the gfn we use to select the rmap list
in which to insert the entry to L1 page size as well.

By not doing this we were missing nested rmap entries when modifying L1
ptes which were for a page also passed through to an L2 guest.

Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/book3s_hv_nested.c