From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Balaji Rao <balajirrao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [RFC] nmi watchdog in kvm
Date: Wed, 30 Jan 2008 16:39:32 +0200 [thread overview]
Message-ID: <47A08C24.8040505@qumranet.com> (raw)
In-Reply-To: <200801301952.57604.balajirrao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Balaji Rao wrote:
> On Wednesday 30 January 2008 04:13:58 pm Avi Kivity wrote:
>
>>> @@ -790,6 +795,18 @@ static int apic_mmio_range(struct kvm_io_device
>>> *this, gpa_t addr) return ret;
>>> }
>>>
>>> +static int nmi_notify(struct notifier_block *self,unsigned long val,
>>> void *data) { +
>>> + struct kvm *kvm;
>>> + kvm = list_entry(vm_list.next, struct kvm, vm_list);
>>> + kvm_x86_ops->inject_nmi(kvm->vcpus[0]);
>>> + return NOTIFY_STOP;
>>> +}
>>>
>> You're not guaranteed to be in vcpu context here, that's what's causing
>> the vmwrite errors.
>>
>>
> I intended to do this here. Looks like its not the right way to check for
> presence in vcpu context. How do i do it ? please explain.
>
> +static void vmx_inject_nmi(struct kvm_vcpu *vcpu) {
> +
> + struct vcpu_vmx * vmx = to_vmx(vcpu);
> + if (vmx->launched)
> + vmcs_write32(VM_ENTRY_INTR_INFO_FIELD,
> + 2 | INTR_TYPE_NMI | INTR_INFO_VALID_MASK);
> +}
>
>
No, this is the wrong place. If you have a vcpu, you'd better be in
vcpu context.
The way to do it is to set a bit in vcpu->requests and force an IPI to
vcpu->cpu. You can look at kvm_flush_remote_tlbs() for an example
(another example is in the lapic IPI code, actually a better one since
it also wakes the cpu up if it is in hlt state).
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
next prev parent reply other threads:[~2008-01-30 14:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-28 8:18 [RFC] nmi watchdog in kvm Balaji Rao
[not found] ` <200801281348.41010.balajirrao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-01-28 10:57 ` Ingo Molnar
2008-01-28 12:29 ` Joerg Roedel
[not found] ` <20080128122925.GA11803-5C7GfCeVMHo@public.gmane.org>
2008-01-28 14:42 ` Balaji Rao
[not found] ` <200801282012.26225.balajirrao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-01-28 15:00 ` Joerg Roedel
[not found] ` <20080128150032.GF6960-5C7GfCeVMHo@public.gmane.org>
2008-01-28 16:30 ` Balaji Rao
2008-01-30 10:43 ` Avi Kivity
[not found] ` <47A054EE.6010408-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-30 14:22 ` Balaji Rao
[not found] ` <200801301952.57604.balajirrao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-01-30 14:39 ` Avi Kivity [this message]
[not found] ` <47A08C24.8040505-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-30 15:02 ` Balaji Rao
[not found] ` <200801302032.01603.balajirrao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-01-30 15:13 ` 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=47A08C24.8040505@qumranet.com \
--to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
--cc=balajirrao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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.