x86emul: avoid triggering assertions with VME/PVI early #GP check
authorJan Beulich <jbeulich@suse.com>
Tue, 18 Dec 2018 14:21:17 +0000 (15:21 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 18 Dec 2018 14:21:17 +0000 (15:21 +0100)
commit57f78a734bcabeab75ca21d4e871be78a3463fbe
treeb26c27a09edc179ec914ea6359779d5060c1ae54
parent1f2a4cb17b4b925dc279ab263907844ed5800f20
x86emul: avoid triggering assertions with VME/PVI early #GP check

In commit efe9cba66c ("x86emul: VME and PVI modes require a #GP(0) check
first thing") I neglected the fact that the retire flags get zapped only
in x86_decode(), which hasn't been invoked yet at the point of the #GP(0)
check added. Move output state initialization into a helper function,
and invoke it from the callers of x86_decode() instead of doing it
(possibly too late) in that function.

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