x86/PV: assert page state in mark_pv_pt_pages_rdonly()
authorJan Beulich <jbeulich@suse.com>
Wed, 18 Aug 2021 07:40:08 +0000 (09:40 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 18 Aug 2021 07:40:08 +0000 (09:40 +0200)
commit6b1ca51b1a91d002636518afe4a8a50ba7212495
tree426a3234b48a1e7818af34f5b0743d36f10c6536
parent4c0a19991465fc19c5afa9bc3f304bae6044314e
x86/PV: assert page state in mark_pv_pt_pages_rdonly()

About every time I look at dom0_construct_pv()'s "calculation" of
nr_pt_pages I question (myself) whether the result is precise or merely
an upper bound. I think it is meant to be precise, but I think we would
be better off having some checking in place. Hence add ASSERT()s to
verify that
- all pages have a valid L1...Ln (currently L4) page table type and
- no other bits are set, in particular the type refcount is still zero.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citirx.com>
xen/arch/x86/pv/dom0_build.c