[PATCH 05/21] KVM: x86 emulator: allow loading null SS in long mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Null SS is valid in long mode; allow loading it.

Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>
---
 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux