]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: emulator: fix error code for __linearize
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 27 Oct 2014 13:40:49 +0000 (14:40 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 29 Oct 2014 11:40:28 +0000 (12:40 +0100)
commit22e6be9c70e22de022b92097fec1c2fe26659b1e
treedb65b7ea305f2412439720b7c6715c44dca46eb2
parent762e338c222828819464e5c2404c73e974ed3257
KVM: emulator: fix error code for __linearize

The error code for #GP and #SS is zero when the segment is used to
access an operand or an instruction.  It is only non-zero when
a segment register is being loaded; for limit checks this means
cases such as:

* for #GP, when RIP is beyond the limit on a far call (before the first
instruction is executed).  We do not implement this check, but it
would be in em_jmp_far/em_call_far.

* for #SS, if the new stack overflows during an inter-privilege-level
call to a non-conforming code segment.  We do not implement stack
switching at all.

So use an error code of zero.

Reviewed-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/emulate.c