All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Mohammed Gamal <m.gamal005@gmail.com>
Cc: mtosatti@redhat.com, kvm@vger.kernel.org
Subject: Re: [RFC PATCH 2/3] x86: Add inject_realmode_interrupt() wrapper
Date: Mon, 09 Aug 2010 22:57:35 -0400	[thread overview]
Message-ID: <4C60C01F.8020700@redhat.com> (raw)
In-Reply-To: <1281295456-11114-3-git-send-email-m.gamal005@gmail.com>

  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@gmail.com>
> ---
>   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.


  reply	other threads:[~2010-08-10  2:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-08 19:24 [RFC PATCH 0/3] Real mode interrupt injection Mohammed Gamal
2010-08-08 19:24 ` [RFC PATCH 1/3] x86 emulator: Expose emulate_int_real() Mohammed Gamal
2010-08-08 19:24 ` [RFC PATCH 2/3] x86: Add inject_realmode_interrupt() wrapper Mohammed Gamal
2010-08-10  2:57   ` Avi Kivity [this message]
2010-08-08 19:24 ` [RFC PATCH 3/3] VMX: Emulated real mode interrupt injection Mohammed Gamal
2010-08-10  3:03   ` Avi Kivity
2010-08-10 17:13     ` Mohammed Gamal
2010-08-10 22:52       ` Avi Kivity
2010-08-10  2:52 ` [RFC PATCH 0/3] Real " Avi Kivity
2010-08-10 17:06   ` Mohammed Gamal
2010-08-10 23:02     ` Avi Kivity
2010-08-11  1:19       ` Mohammed Gamal
     [not found]         ` <AANLkTimmhvH2q7cCJZ+AV0OYhbvz=AZ_LLA3jU-nLdF1@mail.gmail.com>
2010-08-11 11:04           ` Avi Kivity
2010-08-11 11:20             ` Avi Kivity
2010-08-11 12:08               ` Avi Kivity
2010-08-11 23:22                 ` Mohammed Gamal
2010-08-12  0:48                   ` Avi Kivity
2010-08-12  1:07                     ` Mohammed Gamal
2010-08-15 12:23                       ` Avi Kivity
2010-08-15 12:30                         ` Mohammed Gamal
2010-08-11 11:15     ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C60C01F.8020700@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=m.gamal005@gmail.com \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.