x86emul: correct loading of %ss
authorJan Beulich <jbeulich@suse.com>
Mon, 26 Sep 2016 15:21:36 +0000 (17:21 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 26 Sep 2016 15:26:21 +0000 (17:26 +0200)
commit5602e74c60c1ec2feef4cdd75376e4b1a1d7e681
treefa6e6a7673e85a2759ba76e1b4d453f2af4c0714
parent7c8004ef0cb699320161e2bb3bb10bafadd3f8d4
x86emul: correct loading of %ss

- Instead of #NP, #SS needs to be raised for non-present descriptors.
- Loading a null selector is fine in 64-bit mode at CPL != 3, as long
  as RPL == CPL.
- Don't lose the low two selector bits on null selector loads (also
  applies to %ds, %es, %fs, %gs, and LDTR).

Since we need CPL earlier now, also switch to using get_cpl() (instead
of open coding it).

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