Re: [RFC PATCH 2/3] x86: Add inject_realmode_interrupt() wrapper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 On 08/08/2010 03:24 PM, Mohammed Gamal wrote:
This adds a wrapper function inject_realmode_interrupt() around the
emulator function emulate_int_real() to allow real mode interrupt injection.

Signed-off-by: Mohammed Gamal<m.gamal005@xxxxxxxxx>
---
  arch/x86/kvm/x86.c |   14 ++++++++++++++
  arch/x86/kvm/x86.h |    1 +
  2 files changed, 15 insertions(+), 0 deletions(-)


Really has no business in x86.c, as it's there to work around a vmx specific problem.


+int inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq)
+{
+	struct x86_emulate_ctxt *ctxt =&vcpu->arch.emulate_ctxt;
+	int rc;
+
+	rc = emulate_int_real(ctxt,&emulate_ops, irq);
+
+	if (rc != X86EMUL_CONTINUE)
+		return EMULATE_FAIL;
+
+	return EMULATE_DONE;
+}
+EXPORT_SYMBOL_GPL(inject_realmode_interrupt);

Doesn't seem to add much value. I'd say just export emulate_int_real() and call it from vmx.c.

Hmm, you aren't initializing the context. So I guess you do need this function (and I guess it's better to keep it in x86.c near the rest of the emulation stuff, just make sure the emulation context is initialized).

--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux