x86/p2m: avoid unnecessary calls of write_p2m_entry_pre() hook
authorJan Beulich <jbeulich@suse.com>
Fri, 8 Jan 2021 15:49:23 +0000 (16:49 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 8 Jan 2021 15:49:23 +0000 (16:49 +0100)
commit570065b9d5a8a00c5c1aab9e13e9e1ad3e35ce7d
treec284f19c0bd9ae76e750703529b6d2bbfe444fb2
parent3e6c560ea1931ff579fc2c9504a6e46e5c4572c9
x86/p2m: avoid unnecessary calls of write_p2m_entry_pre() hook

When shattering a large page, we first construct the new page table page
and only then hook it up. The "pre" hook in this case does nothing, for
the page starting out all blank. Avoid 512 calls into shadow code in
this case by passing in INVALID_GFN, indicating the page being updated
is (not yet) associated with any GFN. (The alternative to this change
would be to actually pass in a correct GFN, which can't be all the same
on every loop iteration.)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/mm/p2m-pt.c