|
|
@@ -8251,10 +8251,16 @@ static int get_vmx_mem_address(struct kvm_vcpu *vcpu,
|
|
|
/* Protected mode: #GP(0)/#SS(0) if the segment is unusable.
|
|
|
*/
|
|
|
exn = (s.unusable != 0);
|
|
|
- /* Protected mode: #GP(0)/#SS(0) if the memory
|
|
|
- * operand is outside the segment limit.
|
|
|
+
|
|
|
+ /*
|
|
|
+ * Protected mode: #GP(0)/#SS(0) if the memory operand is
|
|
|
+ * outside the segment limit. All CPUs that support VMX ignore
|
|
|
+ * limit checks for flat segments, i.e. segments with base==0,
|
|
|
+ * limit==0xffffffff and of type expand-up data or code.
|
|
|
*/
|
|
|
- exn = exn || (off + sizeof(u64) > s.limit);
|
|
|
+ if (!(s.base == 0 && s.limit == 0xffffffff &&
|
|
|
+ ((s.type & 8) || !(s.type & 4))))
|
|
|
+ exn = exn || (off + sizeof(u64) > s.limit);
|
|
|
}
|
|
|
if (exn) {
|
|
|
kvm_queue_exception_e(vcpu,
|