[PATCH v2] KVM: emulator: Use linearize() when fetching instructions.

2011-04-18 Thread Nelson Elhage
Since segments need to be handled slightly differently when fetching instructions, we add a __linearize helper that accepts a new 'fetch' boolean. Signed-off-by: Nelson Elhage nelh...@ksplice.com --- arch/x86/include/asm/kvm_emulate.h |1 - arch/x86/kvm/emulate.c | 26

[PATCH] KVM: emulator: Use linearize() when fetching instructions.

2011-04-14 Thread Nelson Elhage
This means that the truncation behavior in linearize needs to grow an additional slight piece of complexity: when fetching, truncation is dependent on the execution mode, instead of the current address size. Signed-off-by: Nelson Elhage nelh...@ksplice.com --- arch/x86/include/asm/kvm_emulate.h

[PATCH] KVM: emulator: Handle wraparound in (cs_base + offset) when fetching.

2011-04-13 Thread Nelson Elhage
Currently, setting a large (i.e. negative) base address for %cs does not work on a 64-bit host. The JOS teaching operating system, used by MIT and other universities, relies on such segments while bootstrapping its way to full virtual memory management. Signed-off-by: Nelson Elhage nelh