Real mode interrupt injection
v2 cover Real mode interrupt injection
This patch introduces real mode interrupt injection for VMX. It currently invokes the x86 emulator to emulate interrupts instead of manually setting VMX controls.
Needless to say, this is not meant for merging in its current state. The emulator still needs some more work to get this completely operational.
Mohammed Gamal (3):
x86 emulator: Expose emulate_int_real()
x86: Add inject_realmode_interrupt() wrapper
VMX: Emulated real mode interrupt injection
arch/x86/include/asm/kvm_emulate.h | 3 ++- arch/x86/kvm/vmx.c | 11 +---------- arch/x86/kvm/x86.c | 14 ++++++++++++++ arch/x86/kvm/x86.h | 1 + 4 files changed, 18 insertions(+), 11 deletions(-)
---
Changes since v1:
- Save emulation context eip value early in emulate_int_real()
- Properly initialize emulation context in inject_realmode_interrupt()
- Implement error checks on using inject_realmode_interrupt()
RFC PATCH v2 1/4 x86 emulator: Expose emulate_int_real()
--- arch/x86/include/asm/kvm_emulate.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
arch/x86/include/asm/kvm_emulate.h +2 -1
@@ -255,5 +255,6 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt);int emulator_task_switch (struct x86_emulate_ctxt *ctxt,u16 tss_selector,int reason,bool has_error_code,u32 error_code); - +int emulate_int_real (struct x86_emulate_ctxt *ctxt, +struct x86_emulate_ops *ops,int irq);#endif /* _ASM_X86_KVM_X86_EMULATE_H */
Signature · 1 line
1.7.0.4
Quoted 18 lines · Mohammed Gamal
This patch introduces real mode interrupt injection for VMX. It currently invokes the x86 emulator to emulate interrupts instead of manually setting VMX controls.
Needless to say, this is not meant for merging in its current state. The emulator still needs some more work to get this completely operational.
Mohammed Gamal (3):
x86 emulator: Exposeemulate_int_real()
x86: Addinject_realmode_interrupt()wrapper
VMX: Emulated real mode interrupt injectionarch/x86/include/asm/kvm_emulate.h | 3 ++- arch/x86/kvm/vmx.c | 11 +---------- arch/x86/kvm/x86.c | 14 ++++++++++++++ arch/x86/kvm/x86.h | 1 + 4 files changed, 18 insertions(+), 11 deletions(-)
Quoted 5 lines
---
Changes since v1:
- Save emulation context eip value early inemulate_int_real()
- Properly initialize emulation context ininject_realmode_interrupt()
- Implement error checks on usinginject_realmode_interrupt()
Do those changes help your tests?
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 21 lines · Avi Kivity
Quoted 20 lines · Mohammed Gamal
This patch introduces real mode interrupt injection for VMX. It currently invokes the x86 emulator to emulate interrupts instead of manually setting VMX controls.
Needless to say, this is not meant for merging in its current state. The emulator still needs some more work to get this completely operational.
Mohammed Gamal (3):
x86 emulator: Exposeemulate_int_real()
x86: Addinject_realmode_interrupt()wrapper
VMX: Emulated real mode interrupt injectionarch/x86/include/asm/kvm_emulate.h | 3 ++-
arch/x86/kvm/vmx.c | 11 +---------- arch/x86/kvm/x86.c | 14 ++++++++++++++ arch/x86/kvm/x86.h | 1 + 4 files changed, 18 insertions(+), 11 deletions(-)
Quoted 8 lines
Quoted 5 lines
---
Changes since v1:
- Save emulation context eip value early inemulate_int_real()
- Properly initialize emulation context ininject_realmode_interrupt()
- Implement error checks on usinginject_realmode_interrupt()Do those changes help your tests?
To an extent. At least now the BIOS mostly runs smoothly since eip values are updated correctly. However, it looks like guests go into nowhere once things are handed over to the boot loader. So there is still many things we need to fix. I'll post a trace shortly.
Quoted 4 lines
--
error compilingcommittee.c: too many arguments to function