diff options
author | Nadav Amit <namit@cs.technion.ac.il> | 2014-11-19 10:43:12 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-11-19 12:19:57 -0500 |
commit | abc7d8a4c935dbe0be5db2eb338b2ec9b27ae157 (patch) | |
tree | a66b88a71c4fb6b4674300be3b5bbc217d81ffa9 | |
parent | d50eaa18039b8b848c2285478d0775335ad5e930 (diff) |
KVM: x86: Non-canonical access using SS should cause #SS
When SS is used using a non-canonical address, an #SS exception is generated on
real hardware. KVM emulator causes a #GP instead. Fix it to behave as real x86
CPU.
Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | arch/x86/kvm/emulate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 4d083fb9dd8e..57dc0d79c10e 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -635,7 +635,7 @@ static __always_inline int __linearize(struct x86_emulate_ctxt *ctxt, | |||
635 | switch (mode) { | 635 | switch (mode) { |
636 | case X86EMUL_MODE_PROT64: | 636 | case X86EMUL_MODE_PROT64: |
637 | if (is_noncanonical_address(la)) | 637 | if (is_noncanonical_address(la)) |
638 | return emulate_gp(ctxt, 0); | 638 | goto bad; |
639 | 639 | ||
640 | *max_size = min_t(u64, ~0u, (1ull << 48) - la); | 640 | *max_size = min_t(u64, ~0u, (1ull << 48) - la); |
641 | if (size > *max_size) | 641 | if (size > *max_size) |