Null SS is valid in long mode; allow loading it.
Signed-off-by: Avi Kivity <[email protected]>
---
arch/x86/kvm/emulate.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index db95a55..9a95132 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -1325,7 +1325,9 @@ static int load_segment_descriptor(struct
x86_emulate_ctxt *ctxt,
}
/* NULL selector is not valid for TR, CS and SS */
- if ((seg == VCPU_SREG_CS || seg == VCPU_SREG_SS || seg == VCPU_SREG_TR)
+ if ((seg == VCPU_SREG_CS
+ || (seg == VCPU_SREG_SS && ctxt->mode != X86EMUL_MODE_PROT64)
+ || seg == VCPU_SREG_TR)
&& null_selector)
goto exception;
--
1.7.10.1
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html