From: Avi Kivity <avi@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 2/3] Consolidate userspace and kernel interrupt injection for VMX.
Date: Sat, 11 Apr 2009 14:29:28 +0300 [thread overview]
Message-ID: <49E07F18.4070609@redhat.com> (raw)
In-Reply-To: <20090407090817.2074.76611.stgit@trex.usersys.redhat.com>
Gleb Natapov wrote:
> Use the same callback to inject irq/nmi events no matter what irqchip is
> in use. Only from VMX for now.
>
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> ---
>
> arch/x86/include/asm/kvm_host.h | 2 +
> arch/x86/kvm/svm.c | 2 +
> arch/x86/kvm/vmx.c | 71 +++++++++------------------------------
> arch/x86/kvm/x86.c | 2 +
> 4 files changed, 19 insertions(+), 58 deletions(-)
>
> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> index e672ca5..4e39c40 100644
> --- a/arch/x86/include/asm/kvm_host.h
> +++ b/arch/x86/include/asm/kvm_host.h
> @@ -520,7 +520,7 @@ struct kvm_x86_ops {
> void (*queue_exception)(struct kvm_vcpu *vcpu, unsigned nr,
> bool has_error_code, u32 error_code);
> bool (*exception_injected)(struct kvm_vcpu *vcpu);
> - void (*inject_pending_irq)(struct kvm_vcpu *vcpu);
> + void (*inject_pending_irq)(struct kvm_vcpu *vcpu, struct kvm_run *run);
>
kvm_run is available as vcpu->run, so this isn't needed. But better to
keep it for now and drop it in a later patch.
> static int vmx_set_tss_addr(struct kvm *kvm, unsigned int addr)
> {
> int ret;
> @@ -3351,8 +3309,11 @@ static void vmx_complete_interrupts(struct vcpu_vmx *vmx)
> }
> }
>
> -static void vmx_intr_assist(struct kvm_vcpu *vcpu)
> +static void vmx_intr_assist(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
> {
> + bool req_int_win = !irqchip_in_kernel(vcpu->kvm) &&
> + kvm_run->request_interrupt_window;
> +
> update_tpr_threshold(vcpu);
>
> vmx_update_window_states(vcpu);
> @@ -3373,25 +3334,25 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu)
> return;
> }
> }
>
Why not convert the 'enable_nmi_window(); return;' above to a 'goto out'
like you do elsewhere?
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
next prev parent reply other threads:[~2009-04-11 11:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-07 9:08 [PATCH 1/3] Make kvm_cpu_(has|get)_interrupt() work for userspace irqchip too Gleb Natapov
2009-04-07 9:08 ` [PATCH 2/3] Consolidate userspace and kernel interrupt injection for VMX Gleb Natapov
2009-04-11 11:29 ` Avi Kivity [this message]
2009-04-11 19:53 ` Gleb Natapov
2009-04-07 9:08 ` [PATCH 3/3] Cleanup vmx_intr_assist() Gleb Natapov
2009-04-11 11:30 ` Avi Kivity
2009-04-11 19:52 ` Gleb Natapov
2009-04-07 9:56 ` [PATCH 1/3] Make kvm_cpu_(has|get)_interrupt() work for userspace irqchip too Sheng Yang
2009-04-07 10:07 ` Gleb Natapov
2009-04-11 11:24 ` 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=49E07F18.4070609@redhat.com \
--to=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
/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.