]> xenbits.xensource.com Git - xen.git/commit
x86/pv: Rework guest_io_okay() to return X86EMUL_*
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 29 Oct 2024 15:27:29 +0000 (16:27 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 29 Oct 2024 15:27:29 +0000 (16:27 +0100)
commitf879df5eb40fb32057e09a78cfa52f9ff08f8030
tree4886657edd87a55e9d46cfe1b5fbf324fd7a5b8e
parent8f9dad658ad7b1a9c2a7f1a0a5e7e7cbe7f87bc3
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>
master commit: 7429e1cc071b0e20ea9581da4893fb9b2f6d21d4
master date: 2024-10-01 14:58:18 +0100
xen/arch/x86/pv/emul-priv-op.c