mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
x86/emul: Fix the decoding of segment overrides in 64bit mode
Explicit segment overides other than %fs and %gs are documented as ignored by
both Intel and AMD.
In practice, this means that:
* Explicit uses of %ss don't actually yield #SS[0] for non-canonical
memory references.
* Explicit uses of %{e,c,d}s don't override %rbp/%rsp-based memory references
to yield #GP[0] for non-canonical memory references.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
eb1d3a3f04
commit
b7dce29d9f
1 file changed
+4
@@ -2505,6 +2505,10 @@ x86_decode(
|
||||
}
|
||||
done_prefixes:
|
||||
|
||||
/* %{e,c,s,d}s overrides are ignored in 64bit mode. */
|
||||
if ( mode_64bit() && override_seg < x86_seg_fs )
|
||||
override_seg = x86_seg_none;
|
||||
|
||||
if ( rex_prefix & REX_W )
|
||||
op_bytes = 8;
|
||||
|
||||
|
||||