public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 0/7] guest SMP with in-kernel APIC
@ 2007-08-30  9:02 He, Qing
       [not found] ` <37E52D09333DE2469A03574C88DBF40FA9C1E8-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: He, Qing @ 2007-08-30  9:02 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

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

Hi,

This patch set enables guest SMP when using in-kernel APIC. It is
independent from the partial kernel apic SMP patch from Avi. We are
posting it here for comments and possible merging with that patch. The
patch set is based on:
	KVM: lapic5 branch: e9ddfaf472 (Remove dead code) with a patch
that undoes 34735648ce (apic: implement init/sipi, work in progress),
see the attachment in [PATCH 0/7].
	kvm-userspace: lapic5 branch: 206d1aa22f (qemu: prevent set
wrong cr8 when using irqchip).

btw, I can't find the cr8 patch in kvm-userspace from kvm-userspace.git,
but it is in kvm-commits mailing list. Is there anything happened when
kvm-userspace relocates on kernel.org or am I missing anything?

The patch set is:
	[PATCH 0/7] :this post, and a temporary sipi/init undo patch
	[PATCH 1/7] is a preparation patch for userspace
	[PATCH 2/7] and [PATCH 3/7] are bug fixes for kernel
	[PATCH 4/7] modifies the PIC interrupt routing for SMP
	[PATCH 5/7] enables round robin for the apic lowest priority
delivery
	[PATCH 6/7] is the main patch for SMP support. It handles
SIPI/INIT in the kernel
	[PATCH 7/7] is the usermode part for SMP support, which disables
userleve SIPI/INIT handling


I have tested some situation, 32bit SMP Windows xp/srv2k3 and Linux
2.6.9/2.6.18 all works fine using in-kernel apics. User mode APICs also
works fine. Test for other environments is ongoing.

[PATCH 6/7] and [PATCH 7/7] have additional comments, please see the
corresponding post.

Any comments are welcomed.

Thanks,
Qing

[-- Attachment #2: 0000-sipi-undo.patch --]
[-- Type: application/octet-stream, Size: 10225 bytes --]

sipi-undo

---
 drivers/kvm/irq.c      |   10 +------
 drivers/kvm/kvm.h      |    6 ----
 drivers/kvm/kvm_main.c |   76 ++----------------------------------------------
 drivers/kvm/lapic.c    |   15 ++-------
 drivers/kvm/svm.c      |    7 +----
 drivers/kvm/vmx.c      |   39 +-----------------------
 6 files changed, 11 insertions(+), 142 deletions(-)

diff --git a/drivers/kvm/irq.c b/drivers/kvm/irq.c
index ab2bc72..eb72b56 100644
--- a/drivers/kvm/irq.c
+++ b/drivers/kvm/irq.c
@@ -32,17 +32,9 @@ int kvm_cpu_has_interrupt(struct kvm_vcpu *v)
 {
 	struct kvm_pic *s;
 
-	if (!(kvm_arch_ops->get_rflags(v) & X86_EFLAGS_IF))
-		return v->sipi_vector != -1;
-
-	if (v->vcpu_id == 1 && v->sipi_vector != -1)
-		printk("%s: %d sipi_vector %x\n", __FUNCTION__, v->vcpu_id, v->sipi_vector);
 	if (kvm_apic_has_interrupt(v) == -1) {	/* LAPIC */
 		s = pic_irqchip(v->kvm);	/* PIC */
-		if (v->vcpu_id && s->output) printk("%s: pic\n", __FUNCTION__);
-		if (s->output && v->vcpu_id == 0)
-			return 1;
-		return v->sipi_vector != -1;
+		return s->output;
 	}
 	return 1;
 }
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 8ead745..f8fe87d 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -65,9 +65,6 @@
  * vcpu->requests bit members
  */
 #define KVM_TLB_FLUSH 0
-#define KVM_REQ_SIPI  1
-#define KVM_REQ_INIT  2
-#define KVM_REQ_HALT  3
 
 /*
  * Address types:
@@ -311,7 +308,6 @@ struct kvm_vcpu {
 	struct kvm_run *run;
 	int interrupt_window_open;
 	int guest_mode;
-	int sipi_vector;
 	unsigned long requests;
 	unsigned long irq_summary; /* bit vector: 1 per word in irq_pending */
 	DECLARE_BITMAP(irq_pending, KVM_NR_INTERRUPTS);
@@ -572,8 +568,6 @@ int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
 			    gva_t address, int rep, unsigned port);
 void kvm_emulate_cpuid(struct kvm_vcpu *vcpu);
 int kvm_emulate_halt(struct kvm_vcpu *vcpu);
-void kvm_handle_init(struct kvm_vcpu *vcpu);
-void kvm_handle_sipi(struct kvm_vcpu *vcpu);
 int emulate_invlpg(struct kvm_vcpu *vcpu, gva_t address);
 int emulate_clts(struct kvm_vcpu *vcpu);
 int emulator_get_dr(struct x86_emulate_ctxt* ctxt, int dr,
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 9667cfc..f4cbd4f 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -249,7 +249,6 @@ int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id)
 	vcpu->mmu.root_hpa = INVALID_PAGE;
 	vcpu->kvm = kvm;
 	vcpu->vcpu_id = id;
-	vcpu->sipi_vector = -1;
 	init_waitqueue_head(&vcpu->wq);
 
 	page = alloc_page(GFP_KERNEL | __GFP_ZERO);
@@ -1369,40 +1368,30 @@ int emulate_instruction(struct kvm_vcpu *vcpu,
 }
 EXPORT_SYMBOL_GPL(emulate_instruction);
 
-static int vcpu_unhalted(struct kvm_vcpu *vcpu)
-{
-	return (irqchip_in_kernel(vcpu->kvm) && kvm_cpu_has_interrupt(vcpu))
-		|| vcpu->irq_summary;
-}
-
 /*
  * The vCPU has executed a HLT instruction with in-kernel mode enabled.
  */
 static void kvm_vcpu_kernel_halt(struct kvm_vcpu *vcpu)
 {
 	DECLARE_WAITQUEUE(wait, current);
-	int unhalt;
 
 	add_wait_queue(&vcpu->wq, &wait);
 
 	/*
 	 * We will block until either an interrupt or a signal wakes us up
 	 */
-	if (vcpu->vcpu_id) printk("halt start\n");
-	while(!(unhalt = vcpu_unhalted(vcpu)) && !signal_pending(current)) {
+	while(!(irqchip_in_kernel(vcpu->kvm) && kvm_cpu_has_interrupt(vcpu))
+	      && !vcpu->irq_summary
+	      && !signal_pending(current)) {
 		set_current_state(TASK_INTERRUPTIBLE);
 		vcpu_put(vcpu);
 		schedule();
 		vcpu_load(vcpu);
 	}
-	if (vcpu->vcpu_id) printk("halt end\n");
 
 	remove_wait_queue(&vcpu->wq, &wait);
 	set_current_state(TASK_RUNNING);
-	if (unhalt)
-		clear_bit(KVM_REQ_HALT, &vcpu->requests);
 }
-EXPORT_SYMBOL_GPL(kvm_vcpu_kernel_halt);
 
 int kvm_emulate_halt(struct kvm_vcpu *vcpu)
 {
@@ -2005,65 +1994,6 @@ int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
 }
 EXPORT_SYMBOL_GPL(kvm_emulate_pio_string);
 
-static void setup_segment(struct kvm_segment *seg, unsigned selector)
-{
-	seg->base = selector << 4;
-	seg->limit = 0xffff;
-	seg->selector = selector;
-	seg->type = 3;
-	seg->present = 1;
-	seg->dpl = 0;
-	seg->db = 0;
-	seg->s = 1;
-	seg->l = 0;
-	seg->g = 0;
-	seg->avl = 0;
-}
-
-void kvm_handle_init(struct kvm_vcpu *vcpu)
-{
-	struct kvm_segment seg;
-
-	printk("%s: %d init\n", __FUNCTION__, vcpu->vcpu_id);
-	memset(vcpu->regs, 0, sizeof vcpu->regs);
-	vcpu->rip = 0xfff0;
-	setup_segment(&seg, 0);
-	kvm_arch_ops->set_segment(vcpu, &seg, VCPU_SREG_DS);
-	kvm_arch_ops->set_segment(vcpu, &seg, VCPU_SREG_ES);
-	kvm_arch_ops->set_segment(vcpu, &seg, VCPU_SREG_FS);
-	kvm_arch_ops->set_segment(vcpu, &seg, VCPU_SREG_GS);
-	kvm_arch_ops->set_segment(vcpu, &seg, VCPU_SREG_SS);
-	setup_segment(&seg, 0xf000);
-	kvm_arch_ops->set_segment(vcpu, &seg, VCPU_SREG_CS);
-	kvm_arch_ops->decache_regs(vcpu);
-#ifdef CONFIG_X86_64
-	set_efer(vcpu, 0);
-#endif
-	set_cr0(vcpu, 0x60000010);
-	vcpu->cr2 = 0;
-	set_cr3(vcpu, 0);
-	set_cr4(vcpu, 0);
-	if (vcpu->vcpu_id != 0)
-		set_bit(KVM_REQ_HALT, &vcpu->requests);
-}
-EXPORT_SYMBOL_GPL(kvm_handle_init);
-
-void kvm_handle_sipi(struct kvm_vcpu *vcpu)
-{
-	struct kvm_segment seg;
-
-	printk("%s: %d sipi %x\n", __FUNCTION__, vcpu->vcpu_id,
-	       vcpu->sipi_vector);
-	kvm_arch_ops->cache_regs(vcpu);
-	setup_segment(&seg, vcpu->sipi_vector << 8);
-	kvm_arch_ops->set_segment(vcpu, &seg, VCPU_SREG_CS);
-	vcpu->rip = 0;
-	kvm_arch_ops->decache_regs(vcpu);
-	vcpu->sipi_vector = -1;
-	clear_bit(KVM_REQ_HALT, &vcpu->requests);
-}
-EXPORT_SYMBOL_GPL(kvm_handle_sipi);
-
 static int kvm_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 {
 	int r;
diff --git a/drivers/kvm/lapic.c b/drivers/kvm/lapic.c
index 751ec03..0d3c16b 100644
--- a/drivers/kvm/lapic.c
+++ b/drivers/kvm/lapic.c
@@ -40,7 +40,7 @@
 
 #define APIC_BUS_CYCLE_NS 1
 
-// #define apic_debug(fmt,arg...) printk(KERN_WARNING fmt,##arg)
+/* #define apic_debug(fmt,arg...) printk(KERN_WARNING fmt,##arg) */
 #define apic_debug(fmt, arg...)
 
 #define APIC_LVT_NUM			6
@@ -353,16 +353,11 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
 		break;
 
 	case APIC_DM_INIT:
-		printk("%s: init\n", __FUNCTION__);
-		set_bit(KVM_REQ_INIT, &apic->vcpu->requests);
-		kvm_vcpu_kick(apic->vcpu);
+		printk(KERN_DEBUG "Ignoring guest INIT\n");
 		break;
 
 	case APIC_DM_STARTUP:
-		printk("%s: sipi %x\n", __FUNCTION__, vector);
-		apic->vcpu->sipi_vector = vector;
-		set_bit(KVM_REQ_SIPI, &apic->vcpu->requests);
-		kvm_vcpu_kick(apic->vcpu);
+		printk(KERN_DEBUG "Ignoring guest STARTUP\n");
 		break;
 
 	default:
@@ -776,7 +771,7 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
 
 	/* with FSB delivery interrupt, we can restart APIC functionality */
 	apic_debug("apic base msr is 0x%016" PRIx64 ", and base address is "
-		   "0x%lx.\n", vcpu->apic_base, apic->base_address);
+		   "0x%lx.\n", apic->apic_base, apic->base_address);
 
 	spin_unlock_bh(&apic->lock);
 }
@@ -972,8 +967,6 @@ int kvm_apic_has_interrupt(struct kvm_vcpu *vcpu)
 	if ((highest_irr == -1) ||
 	    ((highest_irr & 0xF0) <= apic_get_reg(apic, APIC_PROCPRI)))
 		return -1;
-	if (vcpu->vcpu_id)
-		printk("apic vector: %x\n", highest_irr);
 	return highest_irr;
 }
 
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index c64fe6d..3093fb9 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1475,14 +1475,9 @@ again:
 		do_interrupt_requests(svm, kvm_run);
 
 	vcpu->guest_mode = 1;
-	if (vcpu->requests) {
+	if (vcpu->requests)
 		if (test_and_clear_bit(KVM_TLB_FLUSH, &vcpu->requests))
 		    svm_flush_tlb(vcpu);
-		if (test_and_clear_bit(KVM_REQ_SIPI, &vcpu->requests))
-		    kvm_handle_sipi(vcpu);
-		if (test_and_clear_bit(KVM_REQ_INIT, &vcpu->requests))
-		    kvm_handle_init(vcpu);
-	}
 
 	pre_svm_run(svm);
 
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index dafa55e..34a7fad 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1409,8 +1409,6 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
 	msr = 0xfee00000 | MSR_IA32_APICBASE_ENABLE;
 	if (vmx->vcpu.vcpu_id == 0)
 		msr |= MSR_IA32_APICBASE_BSP;
-	else
-		set_bit(KVM_REQ_HALT, &vmx->vcpu.requests);
 	kvm_set_apic_base(&vmx->vcpu, msr);
 
 	fx_init(&vmx->vcpu);
@@ -2041,8 +2039,7 @@ static int handle_interrupt_window(struct kvm_vcpu *vcpu,
 static int handle_halt(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 {
 	skip_emulated_instruction(vcpu);
-	set_bit(KVM_REQ_HALT, &vcpu->requests);
-	return 1;
+	return kvm_emulate_halt(vcpu);
 }
 
 static int handle_vmcall(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
@@ -2095,7 +2092,6 @@ static int kvm_handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
 	else {
 		kvm_run->exit_reason = KVM_EXIT_UNKNOWN;
 		kvm_run->hw.hardware_exit_reason = exit_reason;
-		printk("exit %d\n", exit_reason);
 	}
 	return 0;
 }
@@ -2197,23 +2193,11 @@ static int vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 	u8 fail;
 	int r;
 
-	if (vcpu->vcpu_id)
-		printk("vcpu requests %lx rip %x:%lx\n", vcpu->requests,
-		       vmcs_read16(GUEST_CS_SELECTOR), vmcs_readl(GUEST_RIP));
 preempted:
 	if (vcpu->guest_debug.enabled)
 		kvm_guest_debug_pre(vcpu);
 
 again:
-	if (signal_pending(current)) {
-		if (vcpu->vcpu_id)
-			printk("signal exit\n");
-		r = -EINTR;
-		kvm_run->exit_reason = KVM_EXIT_INTR;
-		++vcpu->stat.signal_exits;
-		goto out;
-	}
-
 	r = kvm_mmu_reload(vcpu);
 	if (unlikely(r))
 		goto out;
@@ -2245,28 +2229,9 @@ again:
 		do_interrupt_requests(vcpu, kvm_run);
 
 	vcpu->guest_mode = 1;
-	if (vcpu->requests) {
+	if (vcpu->requests)
 		if (test_and_clear_bit(KVM_TLB_FLUSH, &vcpu->requests))
 		    vmx_flush_tlb(vcpu);
-		if (test_and_clear_bit(KVM_REQ_INIT, &vcpu->requests)) {
-			vcpu->guest_mode = 0;
-			local_irq_enable();
-			preempt_enable();
-			kvm_handle_init(vcpu);
-			goto again;
-		}
-		if (test_and_clear_bit(KVM_REQ_SIPI, &vcpu->requests))
-			kvm_handle_sipi(vcpu);
-		if (test_bit(KVM_REQ_HALT, &vcpu->requests)) {
-			if (vcpu->vcpu_id)
-				printk("vcpu %d halting\n", vcpu->vcpu_id);
-			vcpu->guest_mode = 0;
-			local_irq_enable();
-			preempt_enable();
-			kvm_emulate_halt(vcpu);
-			goto again;
-		}
-	}
 
 	asm (
 		/* Store host registers */


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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

[-- 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC][PATCH 0/7] guest SMP with in-kernel APIC
       [not found] ` <37E52D09333DE2469A03574C88DBF40FA9C1E8-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2007-09-03 14:22   ` Avi Kivity
       [not found]     ` <46DC1894.7050100-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2007-09-03 14:22 UTC (permalink / raw)
  To: He, Qing; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

He, Qing wrote:
> Hi,
>
> This patch set enables guest SMP when using in-kernel APIC. It is
> independent from the partial kernel apic SMP patch from Avi. We are
> posting it here for comments and possible merging with that patch. The
> patch set is based on:
> 	KVM: lapic5 branch: e9ddfaf472 (Remove dead code) with a patch
> that undoes 34735648ce (apic: implement init/sipi, work in progress),
> see the attachment in [PATCH 0/7].
> 	kvm-userspace: lapic5 branch: 206d1aa22f (qemu: prevent set
> wrong cr8 when using irqchip).
>
> btw, I can't find the cr8 patch in kvm-userspace from kvm-userspace.git,
> but it is in kvm-commits mailing list. Is there anything happened when
> kvm-userspace relocates on kernel.org or am I missing anything?
>
> The patch set is:
> 	[PATCH 0/7] :this post, and a temporary sipi/init undo patch
> 	[PATCH 1/7] is a preparation patch for userspace
> 	[PATCH 2/7] and [PATCH 3/7] are bug fixes for kernel
> 	[PATCH 4/7] modifies the PIC interrupt routing for SMP
> 	[PATCH 5/7] enables round robin for the apic lowest priority
> delivery
> 	[PATCH 6/7] is the main patch for SMP support. It handles
> SIPI/INIT in the kernel
> 	[PATCH 7/7] is the usermode part for SMP support, which disables
> userleve SIPI/INIT handling
>
>
> I have tested some situation, 32bit SMP Windows xp/srv2k3 and Linux
> 2.6.9/2.6.18 all works fine using in-kernel apics. User mode APICs also
> works fine. Test for other environments is ongoing.
>
> [PATCH 6/7] and [PATCH 7/7] have additional comments, please see the
> corresponding post.
>   

Applied all to lapic6 (with minor style modification).  Did not apply 
the bios change; will do it later through cmos nvram.

I will do some folding later on (will try out git rebase --interactive) 
and merge to master.

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


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC][PATCH 0/7] guest SMP with in-kernel APIC
       [not found]     ` <46DC1894.7050100-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-09-06  7:33       ` He, Qing
       [not found]         ` <37E52D09333DE2469A03574C88DBF40FA9C206-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: He, Qing @ 2007-09-06  7:33 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

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



>-----Original Message-----
>From: Avi Kivity [mailto:avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org]
>Sent: 2007年9月3日 22:22
>To: He, Qing
>Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>Subject: Re: [kvm-devel] [RFC][PATCH 0/7] guest SMP with in-kernel APIC
>
>He, Qing wrote:
>> Hi,
>>
>> This patch set enables guest SMP when using in-kernel APIC. It is
>> independent from the partial kernel apic SMP patch from Avi. We are
>> posting it here for comments and possible merging with that patch. The
>> patch set is based on:
>> 	KVM: lapic5 branch: e9ddfaf472 (Remove dead code) with a patch
>> that undoes 34735648ce (apic: implement init/sipi, work in progress),
>> see the attachment in [PATCH 0/7].
>> 	kvm-userspace: lapic5 branch: 206d1aa22f (qemu: prevent set
>> wrong cr8 when using irqchip).
>>
>> btw, I can't find the cr8 patch in kvm-userspace from kvm-userspace.git,
>> but it is in kvm-commits mailing list. Is there anything happened when
>> kvm-userspace relocates on kernel.org or am I missing anything?
>>
>> The patch set is:
>> 	[PATCH 0/7] :this post, and a temporary sipi/init undo patch
>> 	[PATCH 1/7] is a preparation patch for userspace
>> 	[PATCH 2/7] and [PATCH 3/7] are bug fixes for kernel
>> 	[PATCH 4/7] modifies the PIC interrupt routing for SMP
>> 	[PATCH 5/7] enables round robin for the apic lowest priority
>> delivery
>> 	[PATCH 6/7] is the main patch for SMP support. It handles
>> SIPI/INIT in the kernel
>> 	[PATCH 7/7] is the usermode part for SMP support, which disables
>> userleve SIPI/INIT handling
>>
>>
>> I have tested some situation, 32bit SMP Windows xp/srv2k3 and Linux
>> 2.6.9/2.6.18 all works fine using in-kernel apics. User mode APICs also
>> works fine. Test for other environments is ongoing.
>>
>> [PATCH 6/7] and [PATCH 7/7] have additional comments, please see the
>> corresponding post.
>>
>
>Applied all to lapic6 (with minor style modification).  Did not apply
>the bios change; will do it later through cmos nvram.
>
>I will do some folding later on (will try out git rebase --interactive)
>and merge to master.

Avi,
	During the rebase to lapic6, I saw two patches missing in this branch. Please see the attachments.

	For the p1 patch, it was Sheng's patch to fix x86_64 windows booting. I believe the commit 948a4b9e4b in kernel side (disable tpr/cr8 sync when in-kernel APIC is used) also addresses this issue, but from code point of view, this user mode patch is just OK, I see no reason to remove it. (btw., my original update on the patch is unnecessary, you can just drop that update).

	For the p2 patch, it was applied by you, and it's necessary for kernel apic SMP. Please reapply it to lapic6, and it can be folded and merged with kvm-userspace commit 314694c464 (conditionally bypass user level init/sipi handling).

	There is also a regression on SMP introduced by hrtimer migration. We are currently working on it and will send it out later as separate patch set.

Thanks,
Qing

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

[-- Attachment #2: p2-qemu-no-halted-mask-in-user.patch --]
[-- Type: application/octet-stream, Size: 811 bytes --]

    kvm: qemu: clear HALT mask for AP when using kernel irqchip
    
    AP HALT mask is used for userspace irqchip, when kernel irqchip is used,
    this flag will cause AP to block forever.
    
    Signed-off-by: Avi Kivity <avi@qumranet.com>
    Signed-off-by: Qing He <qing.he@intel.com>


---
 qemu/qemu-kvm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index b64c5ef..395a9e6 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -770,6 +770,8 @@ static void *ap_main_loop(void *_env)
     sigprocmask(SIG_BLOCK, &signals, NULL);
     kvm_create_vcpu(kvm_context, env->cpu_index);
     kvm_qemu_init_env(env);
+    if (kvm_irqchip_in_kernel(kvm_context))
+	env->hflags &= ~HF_HALTED_MASK;
     kvm_main_loop_cpu(env);
     return NULL;
 }


[-- Attachment #3: p1-qemu-no-cr8-sync-kernapic.patch --]
[-- Type: application/octet-stream, Size: 745 bytes --]

    kvm: qemu: prevent set wrong cr8 when using irqchip
    
    this allows running 64-bit Windows
    
    Signed-off-by: Sheng Yang <sheng.yang@intel.com>


---
 qemu/qemu-kvm.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index 02e3252..b64c5ef 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -518,7 +518,8 @@ static int pre_kvm_run(void *opaque, int vcpu)
 	pthread_mutex_lock(&qemu_mutex);
     }
 
-    kvm_set_cr8(kvm_context, vcpu, cpu_get_apic_tpr(env));
+    if (!kvm_irqchip_in_kernel(kvm_context))
+	kvm_set_cr8(kvm_context, vcpu, cpu_get_apic_tpr(env));
     if (env->interrupt_request & CPU_INTERRUPT_EXIT)
 	return 1;
     pthread_mutex_unlock(&qemu_mutex);


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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

[-- Attachment #5: 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC][PATCH 0/7] guest SMP with in-kernel APIC
       [not found]         ` <37E52D09333DE2469A03574C88DBF40FA9C206-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2007-09-09  7:58           ` Avi Kivity
  0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2007-09-09  7:58 UTC (permalink / raw)
  To: He, Qing; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

He, Qing wrote:
> Avi,
> 	During the rebase to lapic6, I saw two patches missing in this branch. Please see the attachments.
>
> 	For the p1 patch, it was Sheng's patch to fix x86_64 windows booting. I believe the commit 948a4b9e4b in kernel side (disable tpr/cr8 sync when in-kernel APIC is used) also addresses this issue, but from code point of view, this user mode patch is just OK, I see no reason to remove it. (btw., my original update on the patch is unnecessary, you can just drop that update).
>
> 	For the p2 patch, it was applied by you, and it's necessary for kernel apic SMP. Please reapply it to lapic6, and it can be folded and merged with kvm-userspace commit 314694c464 (conditionally bypass user level init/sipi handling).
>
> 	There is also a regression on SMP introduced by hrtimer migration. We are currently working on it and will send it out later as separate patch set.
>
>   

Applied both, thanks.


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


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-09-09  7:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-30  9:02 [RFC][PATCH 0/7] guest SMP with in-kernel APIC He, Qing
     [not found] ` <37E52D09333DE2469A03574C88DBF40FA9C1E8-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-09-03 14:22   ` Avi Kivity
     [not found]     ` <46DC1894.7050100-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-09-06  7:33       ` He, Qing
     [not found]         ` <37E52D09333DE2469A03574C88DBF40FA9C206-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-09-09  7:58           ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox