mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shaohua Li <shaohua.li@intel.com>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm-devel@lists.sourceforge.net, Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH][RFC] kvm-scheduler integration
Date: Mon, 09 Jul 2007 16:50:01 +0800	[thread overview]
Message-ID: <1183971001.4254.3.camel@sli10-conroe.sh.intel.com> (raw)
In-Reply-To: <11838994974161-git-send-email-avi@qumranet.com>

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

On Sun, 2007-07-08 at 20:58 +0800, Avi Kivity wrote:
> The only fly in the ointment is that it crashes quite soon.  Haven't
> figured
> out why yet, but comments on the general direction would be welcome.
Attached patch seems help in my test. prepare_task_switch is called with
irq disabled.


> -static void vmx_vcpu_load(struct kvm_vcpu *vcpu)
> +static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
>  {
>         u64 phys_addr = __pa(vcpu->vmcs);
> -       int cpu;
>         u64 tsc_this, delta;
> 
> -       cpu = get_cpu();
> -
> +       WARN_ON(!preempt_count());
This and below change will break preempt disabled case. better remove
them.

>         if (vcpu->cpu != cpu)
>                 vcpu_clear(vcpu);
> 
> @@ -426,9 +432,9 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu)
> 
>  static void vmx_vcpu_put(struct kvm_vcpu *vcpu)
>  {
> +       WARN_ON(!preempt_count());
>         vmx_load_host_state(vcpu);
>         kvm_put_guest_fpu(vcpu);
> -       put_cpu();
>  }


[-- Attachment #2: dbg.patch --]
[-- Type: text/x-patch, Size: 779 bytes --]

Index: linux-2.6/drivers/kvm/vmx.c
===================================================================
--- linux-2.6.orig/drivers/kvm/vmx.c
+++ linux-2.6/drivers/kvm/vmx.c
@@ -347,6 +347,7 @@ static void vmx_save_host_state(struct k
 static void vmx_load_host_state(struct kvm_vcpu *vcpu)
 {
 	struct vmx_host_state *hs = &vcpu->vmx_host_state;
+	unsigned long flags;
 
 	if (!hs->loaded)
 		return;
@@ -359,12 +360,12 @@ static void vmx_load_host_state(struct k
 		 * If we have to reload gs, we must take care to
 		 * preserve our gs base.
 		 */
-		local_irq_disable();
+		local_irq_save(flags);
 		load_gs(hs->gs_sel);
 #ifdef CONFIG_X86_64
 		wrmsrl(MSR_GS_BASE, vmcs_readl(HOST_GS_BASE));
 #endif
-		local_irq_enable();
+		local_irq_restore(flags);
 
 		reload_tss();
 	}

  parent reply	other threads:[~2007-07-09  8:54 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-08 12:58 Avi Kivity
2007-07-08 13:09 ` Ingo Molnar
2007-07-08 13:16   ` Avi Kivity
2007-07-08 13:36     ` Ingo Molnar
2007-07-08 13:35 ` Ingo Molnar
2007-07-08 13:41   ` Avi Kivity
2007-07-08 13:48     ` Ingo Molnar
2007-07-08 13:53       ` Avi Kivity
2007-07-08 13:59         ` Ingo Molnar
2007-07-08 15:13           ` Avi Kivity
2007-07-10 11:18           ` Avi Kivity
2007-07-10 11:30             ` Ingo Molnar
2007-07-08 23:32       ` [kvm-devel] " Rusty Russell
2007-07-09  6:39         ` Avi Kivity
2007-07-10  1:09           ` Rusty Russell
2007-07-10  5:53             ` Avi Kivity
2007-07-10  6:47               ` Rusty Russell
2007-07-10  7:19                 ` Avi Kivity
2007-07-10  8:01                   ` Rusty Russell
2007-07-10  8:24                     ` Avi Kivity
2007-07-11  5:50                   ` Avi Kivity
2007-07-08 19:07 ` Andi Kleen
2007-07-09  6:41   ` Avi Kivity
2007-07-09  8:50 ` Shaohua Li [this message]
2007-07-09  9:46   ` Avi Kivity
2007-07-09 10:21     ` 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=1183971001.4254.3.camel@sli10-conroe.sh.intel.com \
    --to=shaohua.li@intel.com \
    --cc=avi@qumranet.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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

Powered by JetHome