]> www.infradead.org Git - users/dwmw2/linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Jan 2019 08:20:50 +0000 (09:20 +0100)
commitaeced082bc2cd7058d0a41f6ed6fb088c09c7c5d
treef5fdeb835482f8063fdfae2de4af052b236538fc
parent0cdee8d71f1988b9adf00720925640b25b5bfe5a
KVM: PPC: Book3S HV: Align gfn to L1 page size when inserting nest-rmap entry

[ Upstream commit 8400f8740651c1a3081c30b46004451c448f4d5f ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/kvm/book3s_hv_nested.c