]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commit
x86/pv: Rework guest_io_okay() to return X86EMUL_*
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 30 Sep 2024 15:09:51 +0000 (16:09 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 1 Oct 2024 13:58:18 +0000 (14:58 +0100)
commit7429e1cc071b0e20ea9581da4893fb9b2f6d21d4
tree089a06bbc1d1e9a47410b304df3f257d0e42d0e3
parent66878a8b7566e9a98d20b69ab95ddaffe1130683
x86/pv: Rework guest_io_okay() to return X86EMUL_*

In order to fix a bug with guest_io_okay() (subsequent patch), rework
guest_io_okay() to take in an emulation context, and return X86EMUL_* rather
than a boolean.

For the failing case, take the opportunity to inject #GP explicitly, rather
than returning X86EMUL_UNHANDLEABLE.  There is a logical difference between
"we know what this is, and it's #GP", vs "we don't know what this is".

There is no change in practice as emulation is the final step on general #GP
resolution, but returning X86EMUL_UNHANDLEABLE would be a latent bug if a
subsequent action were to appear.

No practical change.

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