x86/ioemul: Account for ioemul_handle_quirk() in stub length check
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 9 Jan 2018 16:28:28 +0000 (16:28 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 10 Jan 2018 10:33:26 +0000 (10:33 +0000)
commitb6c2c7f48ab8bd5566759cb404afd80fd0df2dfe
treea0a0723eea3816693cfb6c7b4ee6741f326f3903
parentd51baf310e530659f73e714acf575555bdc46303
x86/ioemul: Account for ioemul_handle_quirk() in stub length check

The opcode potentially written into ctxt->io_emul_stub[] in the case
that ioemul_handle_quirk() is overriding the default logic isnt
accounted for in the build-time check that the stubs are large enough.

Introduce IOEMUL_QUIRK_STUB_BYTES and use for both the main and quirk
stub cases.  As a slim optimisation, avoid writing out the default stub
when we know we are going to overwrite it.

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