]> xenbits.xensource.com Git - xen.git/commit
x86/mm: Rework get_page_and_type_from_mfn conditional
authorGeorge Dunlap <george.dunlap@citrix.com>
Thu, 31 Oct 2019 16:09:16 +0000 (17:09 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 31 Oct 2019 16:09:16 +0000 (17:09 +0100)
commit273cf03fd8cfe294c02df4aadf6acf1d3c8c1b66
treebf21bdabab7ed3a5fdd19fc382376e635b9ae4ce
parentd78a96731f251ffb2c1a4db40f123603f111396f
x86/mm: Rework get_page_and_type_from_mfn conditional

Make it easier to read by declaring the conditions in which we will
retain the ref, rather than the conditions under which we release it.

The only way (page == current->arch.old_guest_table) can be true is if
preemptible is true; so remove this from the query itself, and add an
ASSERT() to that effect on the opposite path.

No functional change intended.

NB that alloc_lN_table() mishandle the "linear pt failure" situation
described in the comment; this will be addressed in a future patch.

This is part of XSA-299.

Reported-by: George Dunlap <george.dunlap@citrix.com>
Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 2aab06d742e13d7a9d248f1fc7f0ec62b295ada1
master date: 2019-10-31 16:13:23 +0100
xen/arch/x86/mm.c