|
@@ -1504,6 +1504,15 @@ static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
|
|
if (rpl > cpl || dpl != cpl)
|
|
if (rpl > cpl || dpl != cpl)
|
|
goto exception;
|
|
goto exception;
|
|
}
|
|
}
|
|
|
|
+ /* in long-mode d/b must be clear if l is set */
|
|
|
|
+ if (seg_desc.d && seg_desc.l) {
|
|
|
|
+ u64 efer = 0;
|
|
|
|
+
|
|
|
|
+ ctxt->ops->get_msr(ctxt, MSR_EFER, &efer);
|
|
|
|
+ if (efer & EFER_LMA)
|
|
|
|
+ goto exception;
|
|
|
|
+ }
|
|
|
|
+
|
|
/* CS(RPL) <- CPL */
|
|
/* CS(RPL) <- CPL */
|
|
selector = (selector & 0xfffc) | cpl;
|
|
selector = (selector & 0xfffc) | cpl;
|
|
break;
|
|
break;
|