x86/pv: Inject #GP for implicit grant unmaps
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 19 Jul 2022 20:37:43 +0000 (21:37 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 26 Jul 2022 14:09:48 +0000 (15:09 +0100)
commitf61c54967f4a5ea7e0c9fc3a4e966efa26481cb9
tree7d6fb697cc18b00253d00316cb528012711714b7
parenta9949efb288fd6e21bbaf9d5826207c7c41cda27
x86/pv: Inject #GP for implicit grant unmaps

This is a debug behaviour to identify buggy kernels.  Crashing the domain is
the most unhelpful thing to do, because it discards the relevant context.

Instead, inject #GP[0] like other permission errors in x86.  In particular,
this lets the kernel provide a backtrace which is more likely to be helpful to
a developer.

As a bugfix, this always injects #GP[0] to current, not l1e_owner.  It is not
l1e_owner's fault if dom0 using superpowers triggers an implicit unmap.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm.c