Instead of #NP, #SS needs to be raised for a non-present %ss
descriptor.
Don't lose the low two selector bits on null selector loads.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
if ( (seg == x86_seg_cs) || (seg == x86_seg_ss) )
goto fail;
memset(&segr, 0, sizeof(segr));
+ segr.sel = sel;
hvm_set_segment_register(v, seg, &segr);
return 0;
}
/* Segment present in memory? */
if ( !(desc.b & _SEGMENT_P) )
{
- fault_type = TRAP_no_segment;
+ fault_type = (seg != x86_seg_ss) ? TRAP_no_segment
+ : TRAP_stack_error;
goto unmap_and_fail;
}