x86: XENMAPSPACE_gmfn{,_batch,_range} want to special case idx == gpfn
authorJan Beulich <jbeulich@suse.com>
Fri, 23 Oct 2020 08:05:29 +0000 (10:05 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 23 Oct 2020 08:05:29 +0000 (10:05 +0200)
commitba45ae4d7f3a93ee7297d24bb03a564146d321c6
tree319cc6b9cf8eb33b5da2888b6d270a1c50a0c3de
parent861f0c110976fa8879b7bf63d9478b6be83d4ab6
x86: XENMAPSPACE_gmfn{,_batch,_range} want to special case idx == gpfn

In this case up to now we've been freeing the page (through
guest_remove_page(), with the actual free typically happening at the
put_page() later in the function), but then failing the call on the
subsequent GFN consistency check. However, in my opinion such a request
should complete as an "expensive" no-op (leaving aside the potential
unsharing of the page).

This points out that f33d653f46f5 ("x86: replace bad ASSERT() in
xenmem_add_to_physmap_one()" would really have needed an XSA, despite
its description claiming otherwise, as in release builds we then put in
place a P2M entry referencing the about to be freed page.

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