public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Gregory Haskins <ghaskins-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH 0/9] in-kernel APIC v9 (kernel side)
Date: Sun, 03 Jun 2007 18:39:19 +0300	[thread overview]
Message-ID: <4662E0A7.7040208@qumranet.com> (raw)
In-Reply-To: <466289A4.9000201-atKUWr5tajBWk0Htik3J/w@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1481 bytes --]

Avi Kivity wrote:
> Gregory Haskins wrote:
>> Incorporates v8 plus the following changes:
>>
>> 1) Fix for hang on AMD
>> 2) Fixes issue where irq-windows are inaccurately reported to userspace
>> 3) Fixed issue where irq-window-exiting requests can be ignored in 
>> some cases
>>
>>   
>
> FC6 x86_64 hangs on this (AMD) after 'Detected 62.502 MHz APIC 
> Timer.'.  At least it doesn't kill the machine -- just the guest.  
> I'll try to see what's wrong.
>
> Note that this is with just the kernel patches applied.
>
> The patchset is available as the lapic branch in kvm.git (with some 
> whitespace damage fixed).
>

Things are a little better with the attached patch.

On AMD, to detect the interrupt window opening, we queue an interrupt 
and then ask for an intercept immediately before interrupt disaptching.  
Effectively that means an intercept after sti, as on vmx.

The problem occurs when we want to inject an interrupt _and_ request an 
interrupt window.  Using the current code, we loop immediately because 
we queue the requested interrupt, then ask for an intercept when it is 
dispatched.  A complex way to spin.

The fix is to inject the interrupt instead of queueing it.  Injected 
events are not intercepted, so we can ask for an interrupt window 
concurrently with injecting an interrupt.

However, there are still problems (like Windows spontaneously 
rebooting).  Will investigate further.

-- 
error compiling committee.c: too many arguments to function


[-- Attachment #2: lapic-amd-fix.patch --]
[-- Type: text/x-patch, Size: 634 bytes --]

diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index bdc5d98..651c860 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1425,13 +1425,18 @@ static void do_intr_requests(struct kvm_vcpu *vcpu,
 
 		if (ack.flags & KVM_IRQACKDATA_VECTOR_VALID) {
 			control = &vcpu->svm->vmcb->control;
+#if 0
 			control->int_vector = ack.vector;
 			control->int_ctl &= ~V_INTR_PRIO_MASK;
 			control->int_ctl |= V_IRQ_MASK |
 				((/*control->int_vector >> 4*/ 0xf) <<
 				 V_INTR_PRIO_SHIFT);
+#endif
+			control->event_inj = ack.vector
+				| SVM_EVTINJ_VALID
+				| SVM_EVTINJ_TYPE_INTR;
 
 			++vcpu->stat.irq_accepted;
 		}
 	}
 

[-- Attachment #3: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #4: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

  parent reply	other threads:[~2007-06-03 15:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-31 18:08 [PATCH 0/9] in-kernel APIC v9 (kernel side) Gregory Haskins
     [not found] ` <20070531180005.1810.23884.stgit-5CR4LY5GPkvLDviKLk5550HKjMygAv58XqFh9Ls21Oc@public.gmane.org>
2007-05-31 18:08   ` [PATCH 1/9] KVM: Adds support for in-kernel mmio handlers Gregory Haskins
2007-05-31 18:08   ` [PATCH 2/9] KVM: VMX - fix interrupt checking on light-exit Gregory Haskins
2007-05-31 18:09   ` [PATCH 3/9] KVM: Add irqdevice object Gregory Haskins
     [not found]     ` <20070531180903.1810.87474.stgit-5CR4LY5GPkvLDviKLk5550HKjMygAv58XqFh9Ls21Oc@public.gmane.org>
2007-06-04  7:13       ` Dong, Eddie
2007-05-31 18:09   ` [PATCH 4/9] KVM: Adds ability to preempt an executing VCPU Gregory Haskins
2007-05-31 18:09   ` [PATCH 5/9] KVM: Add support for in-kernel LAPIC model Gregory Haskins
2007-05-31 18:09   ` [PATCH 6/9] KVM: Adds support for real NMI injection on VMX processors Gregory Haskins
     [not found]     ` <20070531180919.1810.30009.stgit-5CR4LY5GPkvLDviKLk5550HKjMygAv58XqFh9Ls21Oc@public.gmane.org>
2007-06-01  2:43       ` [PATCH 6/9] KVM: Adds support for real NMI injection onVMX processors Li, Xin B
2007-05-31 18:09   ` [PATCH 7/9] KVM: Adds basic plumbing to support TPR shadow features Gregory Haskins
2007-05-31 18:09   ` [PATCH 8/9] KVM: Add statistics from interrupt subsystem Gregory Haskins
2007-05-31 18:09   ` [PATCH 9/9] KVM: Adds support for halting in the kernel Gregory Haskins
     [not found]     ` <20070531180934.1810.45024.stgit-5CR4LY5GPkvLDviKLk5550HKjMygAv58XqFh9Ls21Oc@public.gmane.org>
2007-06-19 14:48       ` Avi Kivity
2007-06-02 22:04   ` [PATCH 0/9] in-kernel APIC v9 (kernel side) Dor Laor
2007-06-03  9:28   ` Avi Kivity
     [not found]     ` <466289A4.9000201-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-06-03 15:39       ` Avi Kivity [this message]
2007-06-07  8:20   ` Dong, Eddie
  -- strict thread matches above, loose matches on Subject: below --
2007-06-11 11:56 Gregory Haskins
     [not found] ` <1181562984.4515.20.camel-5CR4LY5GPkvLDviKLk5550HKjMygAv58XqFh9Ls21Oc@public.gmane.org>
2007-06-11 14:41   ` Dong, Eddie
2007-06-13 22:26   ` Dor Laor
2007-06-11 15:40 Gregory Haskins

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=4662E0A7.7040208@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=ghaskins-Et1tbQHTxzrQT0dZR+AlfA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox