Re: [kvm-devel] [PATCH] Use a table to dispatch IO requests in kvmctl

2007-10-09 Thread Hollis Blanchard
On Tue, 2007-10-09 at 16:40 -0500, Anthony Liguori wrote:
> This patch attempts to clean up kvmctl so that it can be more easily made to
> work for multiple architectures and to support more emulation.
> 
> It introduces a io dispatch mechanism.  This mechanism supports subpage
> granularity but is optimized to efficiently cover regions of pages too.  It's
> a 64-bit address space that's structured as a 5-level table.

> For x86, we'll have two tables, a pio_table and an mmio_table.  For PPC we can
> just have a single table.  The IO functions can support accesses of up to 8
> bytes and can handle input/output in the same function.
> 
> I tried to keep this nice and simple so as to not add too much complexity to
> kvmctl.

I'm having a hard time seeing how this range stuff is useful.

Other than that, a 5-level table sounds like overcomplicating something
where a plain old hash table would do just fine, but it's only one
function so I guess I can't complain much.

-- 
Hollis Blanchard
IBM Linux Technology Center


-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] Windows XP Pro 64 installation issues with kvm-45 onIntel host

2007-10-09 Thread Dong, Eddie
[EMAIL PROTECTED] wrote:
> Hello,
> 
> Trying to install Windows XP Pro 64bits, the first phase goes
> quite well (except
> that it uses 100% of host's cpu), but crashes when trying to
> reboot with the
> following message:
> 
> unhandled vm exit:  0x8021
> rax 0095b9e5 rbx 0095b9c0 rcx 0095b9e5 rdx
> 0600 rsi f883f200 rdi f800011a6960 rsp
>  rbp fadfeb886a10 r8   r9 
> 0100 r10 0095b9e5 r11 0080 r12
>  r13  r14  r15
>  rip  rflags 00023002 
> cs 1000 (0001/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
> ds  (/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
> es  (/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
> ss  (/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
> fs  (/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
> gs  (/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
> tr  (30c0/2088 p 1 dpl 0 db 0 s 0 type b l 0 g 0 avl 0)
> ldt  (/ p 1 dpl 0 db 0 s 0 type 2 l 0 g 0 avl 0)
> gdt 0/ idt 0/
> cr0 6010 cr2 fadfead016a0 cr3 2f941000 cr4 0 cr8 0 efer 0
> ./bin/install_windowsxp64.sh: line 12:  6486 Aborted  sudo nice
> -n -5 qemu-system-x86_64 -smp 2 -m 768 -localtime -net nic
> -net user -hda $DISC
> -cdrom $CDROM -boot d -usb --usbdevice tablet
> 
> It then hangs (no host cpu usage, no mouse movement in guest)
> after a while on
> second installation phase after a manual reboot.
> 
> 
> Trying from zero with -no-kvm-irqchip, it gives a windows blue
> screen (host cpu
> at 100%) when trying to reboot with the following message for if
> anyone understands those windows things:
> 
> STOP: 0x001E
> (0xC096,0xF80001071924,0x,0xFFF
> FFADFEB5BD450) 
> 
> After manual reboot, installation also hangs at some point
> 
> Host: debian lenny, kernel 2.6.21-6
> Processor: Intel(R) Pentium(R) D CPU 3.00GHz
> KVM: 45
> 
> If you want further debug information, I'd be pleased to help.
> 
Can u try with my latest post? I fixed same error when I do reboot.
thx,eddie

-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] SMP reboot issue

2007-10-09 Thread Dong, Eddie
SMP reboot failed with various phenomena such as user level
"unhandled vm exit: 0x8021 ..." when rebooting SMP RHEL5U
or "execption 8 (0)..." when rebooting XP etc. The reason is that 
we are not correctly reset VCPU. create_vcpu does some initialization
work which should be part of reset job. So reset_vcpu can't do full 
VCPU reset and thus cause AP reboot failure.
The best approach is to re-org above 2 functions to make it
clear that everything will be re-initialized in vcpu_reset. create_vcpu
probably only allocate memory and do initialization only for those
communicating with user level data structure. while leave others 
including MMU reset to vcpu_reset. For now, let us
use this small patch to fix current issue: GUEST_CR3 in VMCS is
not correctly reseted due to enter_rmode issue.
With this I get XPSP2 acpi SMP guest reboot successfully
and also SMP Linux RHEL5U.
thanks, eddie





commit 60da97b6de0324a5be1c958b749b33b77cd2b68f
Author: root <[EMAIL PROTECTED](none)>
Date:   Wed Oct 10 14:09:19 2007 +0800

Reset a SMP guest will force AP enter
real mode (RESET) probably from paging enabled
protect mode. While current enter_rmode can
only handle mode switch from nonpaging mode
to real mode which leads to SMP reboot failure.

Signed-off-by: Yaozu (Eddie) Dong <[EMAIL PROTECTED]>
Signed-off-by: Qing He <[EMAIL PROTECTED]>

diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c
index 382bd6a..ece0aa4 100644
--- a/drivers/kvm/mmu.c
+++ b/drivers/kvm/mmu.c
@@ -1142,6 +1142,7 @@ int kvm_mmu_reset_context(struct kvm_vcpu *vcpu)
destroy_kvm_mmu(vcpu);
return init_kvm_mmu(vcpu);
 }
+EXPORT_SYMBOL_GPL(kvm_mmu_reset_context);
 
 int kvm_mmu_load(struct kvm_vcpu *vcpu)
 {
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 0537695..2d75599 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1156,6 +1156,7 @@ static void enter_rmode(struct kvm_vcpu *vcpu)
fix_rmode_seg(VCPU_SREG_GS, &vcpu->rmode.gs);
fix_rmode_seg(VCPU_SREG_FS, &vcpu->rmode.fs);
 
+   kvm_mmu_reset_context(vcpu);
init_rmode_tss(vcpu->kvm);
 }
 

-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kernel device reset support

2007-10-09 Thread Dong, Eddie
Avi Kivity wrote:
> Dong, Eddie wrote:
>> Avi Kivity wrote:
>> 
>>> But, for an ungraceful reset, nothing prevents an AP from
>>> issuing a reset?
>>> 
>> 
>> Mmm, Yes, but I think current architecture can't handle this.
>> The thread where AP issues "RESET" will continue run, which
>> means it becomes BSP now and wake up other APs later on.
>> Or We can block that AP first and then inform BSP to do
>> RESET job. Here we need to block the AP in kernel
>> so that we can wake up.
>> 
> 
> It should call vcpu_halt() immediately after reset.

?? Can user level be able to enter kernel HALT state.

> 
>> It can be a future task which is not that high priority IMO.
>> I will focus on SMP boot 1st. Your opnion?
>> 
> 
> Agree.  But let's make it close to the complete solution.
> 

Yes, halt all APs and let BSP do reset ops in user level. 
Will post patch to Qemu to support SMP reboot some time later.

> 
> The test for vcpu->requests already exists (and is needed for tlb
> flushes) so there is no additional performance hit.

OK, that makes sense. changed. please verify.
User level is split into libkvm and qemu.

thx,eddie

commit a0aed7040befe198491254d3459aeb5897f5f2c1
Author: root <[EMAIL PROTECTED](none)>
Date:   Wed Oct 10 13:45:58 2007 +0800

Add VM reset support in kernel side to
reset the kernel devices and force APs
to enter wait for INIT/SIPI state.

Signed-off-by: Yaozu (Eddie) Dong <[EMAIL PROTECTED]>

diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 4ab487c..81c9af1 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -68,6 +68,7 @@
  * vcpu->requests bit members
  */
 #define KVM_TLB_FLUSH 0
+#define KVM_FROZEN 1
 
 /*
  * Address types:
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 0b2894a..33f16bd 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -2189,9 +2189,17 @@ again:
 
vcpu->guest_mode = 1;
 
-   if (vcpu->requests)
+   if (vcpu->requests) {
if (test_and_clear_bit(KVM_TLB_FLUSH, &vcpu->requests))
kvm_x86_ops->tlb_flush(vcpu);
+   if (test_and_clear_bit(KVM_FROZEN, &vcpu->requests)) {
+   local_irq_enable();
+   preempt_enable();
+   r = -EINTR;
+   kvm_run->exit_reason = KVM_EXIT_FROZEN;
+   goto out;
+   }
+   }
 
kvm_x86_ops->run(vcpu, kvm_run);
 
@@ -2245,6 +2253,8 @@ static int kvm_vcpu_ioctl_run(struct kvm_vcpu
*vcpu, struct kvm_run *kvm_run)
vcpu_load(vcpu);
 
if (unlikely(vcpu->mp_state == VCPU_MP_STATE_UNINITIALIZED)) {
+   if (irqchip_in_kernel(vcpu->kvm) && vcpu->apic)
+   kvm_lapic_reset(vcpu);
kvm_vcpu_block(vcpu);
vcpu_put(vcpu);
return -EAGAIN;
@@ -3143,6 +3153,54 @@ out:
return r;
 }
 
+/*
+ * Reset kernel devices.
+ */
+void kvm_reset_devices(struct kvm *kvm)
+{
+   kvm_pic_reset(&pic_irqchip(kvm)->pics[1]);
+   kvm_pic_reset(&pic_irqchip(kvm)->pics[0]);
+   pic_irqchip(kvm)->output = 0;
+   kvm_ioapic_reset(kvm->vioapic);
+}
+
+/*
+ * Kernel side VM Reset.
+ * NOTE here: User level code must guarantee only the BSP
+ * thread can do this call.
+ *
+ */
+int kvm_vm_reset(struct kvm *kvm)
+{
+   struct kvm_vcpu *vcpu;
+   int i;
+
+   for (i = 0; i < KVM_MAX_VCPUS; i++) {
+   vcpu = kvm->vcpus[i];
+   if (!vcpu)
+   continue;
+   /* active VCPU */
+   if (vcpu->vcpu_id) {
+   vcpu->mp_state = VCPU_MP_STATE_UNINITIALIZED;
+   set_bit(KVM_FROZEN, &vcpu->requests);
+   kvm_vcpu_kick(vcpu);
+   /*
+* Wait till the AP entered waiting for
+* INIT/SIPI state
+*/
+   while (test_bit(KVM_FROZEN, &vcpu->requests))
+   schedule();
+   }
+   else {
+   vcpu->mp_state = VCPU_MP_STATE_RUNNABLE;
+   kvm_lapic_reset(vcpu);
+   }
+   }
+   /* Now only BSP is running... */
+   kvm_reset_devices(kvm);
+   return 0;
+}
+
 static long kvm_vm_ioctl(struct file *filp,
   unsigned int ioctl, unsigned long arg)
 {
@@ -3228,6 +3286,12 @@ static long kvm_vm_ioctl(struct file *filp,
} else
goto out;
break;
+   case KVM_RESET:
+   r = -EINVAL;
+   if (!irqchip_in_kernel(kvm))
+   goto out;
+   r = kvm_vm_reset(kvm);
+   break;
case KVM_IRQ_LINE: {
struct kvm_irq_level irq_event;
 
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index cd4ac12..ea9c004 100644
--- a/include/linux/kvm.h
+++ 

Re: [kvm-devel] split ioapic reset API

2007-10-09 Thread Dong, Eddie
Avi Kivity wrote:
> Dong, Eddie wrote:
>> This one is a preparation for kernel devices reset support.
>> 
>> 
>> 
>>Split ioapic reset API and export PIC reset API
>> 
> 
> Please split into two patches, I need to fold them into the pic patch
> and the ioapic patch. 
> 

Splited, please check in.
It is too small now :-)
thx, eddie


commit f0cd5e0f99b8ac46f23f786de23a905680f0496e
Author: root <[EMAIL PROTECTED](none)>
Date:   Wed Oct 10 13:14:13 2007 +0800

export PIC reset API for kernel RESET.

Signed-off-by: Yaozu (Eddie) Dong <[EMAIL PROTECTED]>

diff --git a/drivers/kvm/i8259.c b/drivers/kvm/i8259.c
index a679157..f0dc2ee 100644
--- a/drivers/kvm/i8259.c
+++ b/drivers/kvm/i8259.c
@@ -181,10 +181,8 @@ int kvm_pic_read_irq(struct kvm_pic *s)
return intno;
 }
 
-static void pic_reset(void *opaque)
+void kvm_pic_reset(struct kvm_kpic_state *s)
 {
-   struct kvm_kpic_state *s = opaque;
-
s->last_irr = 0;
s->irr = 0;
s->imr = 0;
@@ -209,7 +207,7 @@ static void pic_ioport_write(void *opaque, u32 addr,
u32 val)
addr &= 1;
if (addr == 0) {
if (val & 0x10) {
-   pic_reset(s);   /* init */
+   kvm_pic_reset(s);   /* init */
/*
 * deassert a pending interrupt
 */
diff --git a/drivers/kvm/irq.h b/drivers/kvm/irq.h
index 508280e..e08ae10 100644
--- a/drivers/kvm/irq.h
+++ b/drivers/kvm/irq.h
@@ -139,6 +139,7 @@ int kvm_apic_accept_pic_intr(struct kvm_vcpu *vcpu);
 int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu);
 int kvm_create_lapic(struct kvm_vcpu *vcpu);
 void kvm_lapic_reset(struct kvm_vcpu *vcpu);
+void kvm_pic_reset(struct kvm_kpic_state *s);
 void kvm_free_lapic(struct kvm_vcpu *vcpu);
 u64 kvm_lapic_get_cr8(struct kvm_vcpu *vcpu);
 void kvm_lapic_set_tpr(struct kvm_vcpu *vcpu, unsigned long cr8);


commit 6a42a10221ddb4248937d7aacc0a3420dab79598
Author: root <[EMAIL PROTECTED](none)>
Date:   Wed Oct 10 13:15:41 2007 +0800

Split IOAPIC reset function and export for kernel
RESET.

Signed-off-by: Yaozu (Eddie) Dong <[EMAIL PROTECTED]>

diff --git a/drivers/kvm/ioapic.c b/drivers/kvm/ioapic.c
index c7992e6..3b69541 100644
--- a/drivers/kvm/ioapic.c
+++ b/drivers/kvm/ioapic.c
@@ -366,18 +366,27 @@ static void ioapic_mmio_write(struct kvm_io_device
*this, gpa_t addr, int len,
}
 }
 
+void kvm_ioapic_reset(struct kvm_ioapic *ioapic)
+{
+   int i;
+
+   for (i = 0; i < IOAPIC_NUM_PINS; i++)
+   ioapic->redirtbl[i].fields.mask = 1;
+   ioapic->base_address = IOAPIC_DEFAULT_BASE_ADDRESS;
+   ioapic->ioregsel = 0;
+   ioapic->irr = 0;
+   ioapic->id = 0;
+}
+
 int kvm_ioapic_init(struct kvm *kvm)
 {
struct kvm_ioapic *ioapic;
-   int i;
 
ioapic = kzalloc(sizeof(struct kvm_ioapic), GFP_KERNEL);
if (!ioapic)
return -ENOMEM;
kvm->vioapic = ioapic;
-   for (i = 0; i < IOAPIC_NUM_PINS; i++)
-   ioapic->redirtbl[i].fields.mask = 1;
-   ioapic->base_address = IOAPIC_DEFAULT_BASE_ADDRESS;
+   kvm_ioapic_reset(ioapic);
ioapic->dev.read = ioapic_mmio_read;
ioapic->dev.write = ioapic_mmio_write;
ioapic->dev.in_range = ioapic_in_range;
diff --git a/drivers/kvm/irq.h b/drivers/kvm/irq.h
index e08ae10..5ad3cfd 100644
--- a/drivers/kvm/irq.h
+++ b/drivers/kvm/irq.h
@@ -140,6 +140,7 @@ int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu);
 int kvm_create_lapic(struct kvm_vcpu *vcpu);
 void kvm_lapic_reset(struct kvm_vcpu *vcpu);
 void kvm_pic_reset(struct kvm_kpic_state *s);
+void kvm_ioapic_reset(struct kvm_ioapic *ioapic);
 void kvm_free_lapic(struct kvm_vcpu *vcpu);
 u64 kvm_lapic_get_cr8(struct kvm_vcpu *vcpu);
 void kvm_lapic_set_tpr(struct kvm_vcpu *vcpu, unsigned long cr8);



rbt-k1.patch
Description: rbt-k1.patch


rbt-k2.patch
Description: rbt-k2.patch
-
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/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] out of memory page request

2007-10-09 Thread David Brown
> The attached patch should fix, though there's probably another problem
> lurking in there.
>
> --
> Any sufficiently difficult bug is indistinguishable from a feature.
>

Thanks, the patch worked it didn't hoze the host anymore.

- David Brown

-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kvm-45 problems

2007-10-09 Thread Zhao, Yunfeng
This fix cannot resolve this issue.
Against latest kvm commits, SMP linux with 4 vcpus still cannot boot up.
But the issue will not happen , if adding "-smp4 -no-acpi".

Here is the error info in dmesg
BUG: soft lockup detected on CPU#0!
 [] softlockup_tick+0x98/0xa6
 [] update_process_times+0x39/0x5c
 [] smp_apic_timer_interrupt+0x5c/0x64
 [] apic_timer_interrupt+0x1f/0x24
 [] kvm_flush_remote_tlbs+0xcc/0xdb [kvm]
 [] kvm_mmu_pte_write+0x1f2/0x368 [kvm]
 [] emulator_write_emulated_onepage+0x73/0xe6 [kvm]
 [] x86_emulate_insn+0x20c2/0x3122 [kvm]
 [] x86_decode_insn+0x624/0x844 [kvm]
 [] emulate_instruction+0x12b/0x258 [kvm]
 [] handle_exception+0x163/0x23f [kvm_intel]
 [] kvm_handle_exit+0x70/0x8a [kvm_intel]
 [] kvm_vcpu_ioctl_run+0x21a/0x31f [kvm]
 [] kvm_vcpu_ioctl+0x0/0xc58 [kvm]
 [] kvm_vcpu_ioctl+0x103/0xc58 [kvm]
 [] __next_cpu+0x12/0x21
 [] find_busiest_group+0x177/0x462
 [] enqueue_task+0x29/0x39
 [] __activate_task+0x1c/0x29
 [] try_to_wake_up+0x371/0x37b
 [] schedule+0x90d/0x9ba
 [] __wake_up_common+0x2f/0x53
 [] __wake_up+0x2a/0x3d
 [] wake_futex+0x3a/0x44
 [] futex_wake+0xa9/0xb3
 [] do_futex+0x20d/0xb15
 [] __next_cpu+0x12/0x21
 [] __dequeue_signal+0x151/0x15c
 [] dequeue_signal+0x2d/0x9c
 [] smp_call_function_interrupt+0x3e/0x52
 [] kvm_vcpu_ioctl+0x0/0xc58 [kvm]
 [] call_function_interrupt+0x1f/0x24
 [] kvm_vcpu_ioctl+0x0/0xc58 [kvm]
 [] smp_call_function_interrupt+0x3e/0x52
 [] kvm_vcpu_ioctl+0x0/0xc58 [kvm]
 [] do_ioctl+0x1c/0x5d
 [] vfs_ioctl+0x24a/0x25c
 [] sys_ioctl+0x48/0x5f
 [] syscall_call+0x7/0xb

>-Original Message-
>From: Avi Kivity [mailto:[EMAIL PROTECTED]
>Sent: 2007年10月9日 18:19
>To: Zhao, Yunfeng
>Cc: kvm-devel
>Subject: Re: [kvm-devel] kvm-45 problems
>
>Avi Kivity wrote:
>> Zhao, Yunfeng wrote:
>>
>>> We run some booting multiple guest tests in our nightly testing.
>>> Like booting two UP windows guests, booting one UP linux guest and one UP
>windows guest, and booting 4 UP linux guests.
>>> The first two cases have no problem in our testing.
>>> And booting 4 UP linux guests may crash host, but this problem doesn't 
>>> happen
>very time. If the problem didn't happen, linux guest can be log in without any
>problem.
>>>
>>> For smp guest, we meet a problem that booting linux guest with 4 vcpus 
>>> causes
>soft lock error on host. Once this error happened, qemu process also could not
>be killed.
>>>
>>> Our linux guests are using 2.6.9, 2.6.16, and 2.6.23 kernels.
>>>
>>>
>>>
>>
>> This may be due to NMIs or MCEs. Is it possible your machine is
>> receiving them?
>>
>
>
>I pushed a fix for the NMI issue. Can you check if it fixes your hangs?
>
>
>--
>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/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] Firewire Support for KVM Guest?

2007-10-09 Thread Calin Brabandt
I'm a KVM newb and can't find any information or
associated FAQ about KVM guest firewire support.  If
there's no KVM support, I'm seeking alternative
recommendations, if KVM list members are so inclined.

My goal is to boot a dedicated and proprietary Linux
2.4 kernel based AVX1 LiveCD under KVM.  See
http://www.169time.com/ for details, if interested.

Unfortunately, the AVX1 CD source is not available.
(Is this a GPL violation, perhaps?)

Normally the AVX1 CD must run on a standalone PC
equipped with two firewire ports for I/O.  The sole
function of AVX1 is to process firewire HDTV video
data but it can't decode, render, or record the video
data in any manner.

I'd like to run the AVX1 CD under a KVM on my Fedora 7
Mythtv system and loop the AVX1 firewire output back
into a third firewire port that's assigned to the
Mythtv host for capture.  I've booted both the AVX1 CD
disc and an iso image under KVM, but it hangs when it
tries to load the AVX1 guest firewire driver modules.

I have an Intel G965OT mobo with 2GB of DDR-2 and a
6600 Core 2 Duo.  I'll soon upgrade to 4GB of DDR-2
and a Q6600 quad CPU.  I don't believe the AVX1 CD
supports the TI firewire chip on my mobo so I
installed an AVX1 supported VIA chip firewire PCI card
that previously functioned correctly in my standalone
AVX1 system.

Any ideas, encouragement (or discouragement ;)) are
much appreciated.  If I can get this to work, there
are many 169time/AVX1 users at www.avsforum.com who
would be interested.  The 169time developer has
promised "integrated" support for years but, in
reality, I suspect he's completely abandoned the
project.

Thanks for everyone's patience, given that
knowledgeable KVM list readers may immediately
identify my goal as unrealistic folly.

-Cal






   

Looking for a deal? Find great prices on flights and hotels with Yahoo! 
FareChase.
http://farechase.yahoo.com/

-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH 2/2] Allow memory to be specified in kvmctl

2007-10-09 Thread Anthony Liguori
Muli Ben-Yehuda wrote:
> On Tue, Oct 09, 2007 at 05:09:19PM -0500, Anthony Liguori wrote:
>
>   
 +  default:
 +  fprintf(stderr,
 +  "Unrecongized memory suffix: %c\n",
 +  *endptr);
 +  exit(1);
 +  }
 +  break;

 
>>> How about adding a sanity check that memory_size makes sense here
>>> rather than having kvm_create() fail obscurely? For example if the
>>> user got the memory size wrong for some reason we'll end up with
>>> memory_size = 0 here.
>>>   
>> There's an exit(1) and it's using stroull() so the only way that
>> memory_size could equal 0 is if the user specified --memory=0.  I'm
>> 
>
> Or made a mistake and specified memory=G, or memory=100G when he meant
> 100M, etc.
>   

Okay, in that case, I agree.  Have updated my patch.

Regards,

Anthony Liguori

>> not sure I agree it's worth checking for that sort of circumstance,
>> perhaps the user had a reason for doing it?
>> 
>
> I'm a fan of the principle of least surprise.
>
> Cheers,
> Muli
>   


-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH 2/2] Allow memory to be specified in kvmctl

2007-10-09 Thread Muli Ben-Yehuda
On Tue, Oct 09, 2007 at 05:09:19PM -0500, Anthony Liguori wrote:

> >>+   default:
> >>+   fprintf(stderr,
> >>+   "Unrecongized memory suffix: %c\n",
> >>+   *endptr);
> >>+   exit(1);
> >>+   }
> >>+   break;
> >>
> >
> >How about adding a sanity check that memory_size makes sense here
> >rather than having kvm_create() fail obscurely? For example if the
> >user got the memory size wrong for some reason we'll end up with
> >memory_size = 0 here.
> 
> There's an exit(1) and it's using stroull() so the only way that
> memory_size could equal 0 is if the user specified --memory=0.  I'm

Or made a mistake and specified memory=G, or memory=100G when he meant
100M, etc.

> not sure I agree it's worth checking for that sort of circumstance,
> perhaps the user had a reason for doing it?

I'm a fan of the principle of least surprise.

Cheers,
Muli
-- 
SYSTOR 2007 --- 1st Annual Haifa Systems and Storage Conference 2007
http://www.haifa.il.ibm.com/Workshops/systor2007/

Virtualization workshop: Oct 29th, 2007 | Storage workshop: Oct 30th, 2007

-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH] Use a table to dispatch IO requests in kvmctl

2007-10-09 Thread Anthony Liguori
This patch won't apply with the previous two patches applied.  I was 
meant to be independently reviewable.  I have a merged patch that I'll 
send out tomorrow but please still comment on this version :-)

Regards,

Anthony Liguori

Anthony Liguori wrote:
> This patch attempts to clean up kvmctl so that it can be more easily made to
> work for multiple architectures and to support more emulation.
>
> It introduces a io dispatch mechanism.  This mechanism supports subpage
> granularity but is optimized to efficiently cover regions of pages too.  It's
> a 64-bit address space that's structured as a 5-level table.
>
> For x86, we'll have two tables, a pio_table and an mmio_table.  For PPC we can
> just have a single table.  The IO functions can support accesses of up to 8
> bytes and can handle input/output in the same function.
>
> I tried to keep this nice and simple so as to not add too much complexity to
> kvmctl.
>
> Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]>
>
> diff --git a/user/main.c b/user/main.c
> index 70de8e6..2bc2182 100644
> --- a/user/main.c
> +++ b/user/main.c
> @@ -51,6 +51,29 @@ kvm_context_t kvm;
>
>  #define IPI_SIGNAL (SIGRTMIN + 4)
>
> +#define PAGE_SHIFT   12
> +#define PAGE_SIZE(1ULL << PAGE_SHIFT)
> +#define PAGE_MASK(~(PAGE_SIZE - 1))
> +
> +typedef int (io_table_handler_t)(void *, int, int, uint64_t, uint64_t *);
> +
> +struct io_table_entry
> +{
> + io_table_handler_t *handler;
> + void *opaque;
> +};
> +
> +struct io_table_level
> +{
> + struct io_table_entry full_range;
> + struct io_table_level *table;
> +};
> +
> +struct io_table
> +{
> + struct io_table_level table;
> +};
> +
>  static int ncpus = 1;
>  static sem_t init_sem;
>  static __thread int vcpu;
> @@ -58,6 +81,8 @@ static int apic_ipi_vector = 0xff;
>  static sigset_t kernel_sigmask;
>  static sigset_t ipi_sigmask;
>
> +static struct io_table pio_table;
> +
>  struct vcpu_info {
>   pid_t tid;
>   sem_t sipi_sem;
> @@ -67,9 +92,98 @@ struct vcpu_info *vcpus;
>
>  static uint32_t apic_sipi_addr;
>
> -static int apic_range(unsigned addr)
> +static void *mallocz(size_t size)
>  {
> - return (addr >= APIC_BASE) && (addr < APIC_BASE + APIC_SIZE);
> + void *ptr;
> + ptr = malloc(size);
> + if (!ptr)
> + return NULL;
> + memset(ptr, 0, size);
> + return ptr;
> +}
> +
> +struct io_table_entry *io_table_lookup(struct io_table *io_table,
> +uint64_t addr, uint64_t size,
> +int alloc)
> +{
> + struct io_table_level *tbl = &io_table->table;
> + int level = 1;
> +
> + while (level != 5) {
> + int shift = (4 - level) * 9 + PAGE_SHIFT;
> + int bits, mask;
> +
> + if (level == 1)
> + bits = 64 - ((3 * 9) + PAGE_SHIFT);
> + else
> + bits = 9;
> +
> + mask = (1 << bits) - 1;
> +
> + if (alloc) {
> + if ((1ULL << shift) == size && !(addr & (size - 1)))
> + return &tbl->full_range;
> + } else if (tbl->full_range.handler)
> + return &tbl->full_range;
> +
> + if (tbl->table == NULL) {
> + tbl->table = mallocz((1 << bits) *
> +  sizeof(struct io_table_level));
> + if (!tbl->table)
> + return NULL;
> + }
> +
> + tbl = &tbl->table[(addr >> shift) & mask];
> + level++;
> + }
> +
> + if (tbl->table == NULL) {
> + tbl->table = mallocz(PAGE_SIZE * sizeof(struct io_table_level));
> + if (!tbl->table)
> + return NULL;
> + }
> +
> + return &tbl->table[addr & ~PAGE_MASK].full_range;
> +}
> +
> +int io_table_register_address(struct io_table *io_table,
> +   uint64_t addr, uint64_t size,
> +   io_table_handler_t *handler,
> +   void *opaque)
> +{
> + struct io_table_entry *entry;
> +
> + entry = io_table_lookup(io_table, addr, size, 1);
> + if (entry == NULL)
> + return -ENOMEM;
> +
> + entry->handler = handler;
> + entry->opaque = opaque;
> +
> + return 0;
> +}
> +
> +int io_table_register_range(struct io_table *io_table,
> + uint64_t start, uint64_t size,
> + io_table_handler_t *handler,
> + void *opaque)
> +{
> + uint64_t step = 1;
> + uint64_t i;
> + int ret = 0;
> +
> + if (!(size & ~PAGE_MASK) && !(start & ~PAGE_MASK))
> + step = PAGE_SHIFT;
> +
> + for (i = 0; i < size; i += step) {
> + ret = io_table_register_address(io_table,
> + start + i, step,
> + handler, opaque);
> +

Re: [kvm-devel] [PATCH 2/2] Allow memory to be specified in kvmctl

2007-10-09 Thread Anthony Liguori
Muli Ben-Yehuda wrote:
>>  while ((ch = getopt_long(argc, argv, sopts, lopts, &opt_ind)) != -1) {
>>  switch (ch) {
>> @@ -367,6 +372,24 @@ int main(int argc, char **argv)
>>  case 'p':
>>  enter_protected_mode = true;
>>  break;
>> +case 'm':
>> +memory_size = strtoull(optarg, &endptr, 0);
>> +switch (*endptr) {
>> +case 'G': case 'g':
>> +memory_size <<= 10;
>> +case '\0':
>> +case 'M': case 'm':
>> +memory_size <<= 10;
>> +case 'K': case 'k':
>> +memory_size <<= 10;
>> +break;
>> 
>
> Cute trick with the fall-through and shifts... not quite Duff's
> device, but cute. Please consider adding a /* fallthrough */ comment
> to make it obvious.
>   

I'll make it more clear and send out the series again tomorrow when 
others have gotten a chance to review.

>> +default:
>> +fprintf(stderr,
>> +"Unrecongized memory suffix: %c\n",
>> +*endptr);
>> +exit(1);
>> +}
>> +break;
>> 
>
> How about adding a sanity check that memory_size makes sense here
> rather than having kvm_create() fail obscurely? For example if the
> user got the memory size wrong for some reason we'll end up with
> memory_size = 0 here.
>   

There's an exit(1) and it's using stroull() so the only way that 
memory_size could equal 0 is if the user specified --memory=0.  I'm not 
sure I agree it's worth checking for that sort of circumstance, perhaps 
the user had a reason for doing it?

Regards,

Anthony Liguori

> Cheers,
> Muli
>   


-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH 2/2] Allow memory to be specified in kvmctl

2007-10-09 Thread Muli Ben-Yehuda
On Tue, Oct 09, 2007 at 04:31:54PM -0500, Anthony Liguori wrote:

> This patch adds a --memory option to kvmctl to allow the memory size of the
> guest to be specified.
> 
> Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]>
> 
> diff --git a/user/main.c b/user/main.c
> index 9a57a24..7fc0924 100644
> --- a/user/main.c
> +++ b/user/main.c
> @@ -57,6 +57,7 @@ static __thread int vcpu;
>  static int apic_ipi_vector = 0xff;
>  static sigset_t kernel_sigmask;
>  static sigset_t ipi_sigmask;
> +static uint64_t memory_size = 128 * 1024 * 1024;
>  
>  struct vcpu_info {
>   pid_t tid;
> @@ -147,7 +148,7 @@ static int test_inl(void *opaque, uint16_t addr, uint32_t 
> *value)
>  
>   switch (addr) {
>   case 0xd1:
> - *value = 128 * 1024 * 1024;
> + *value = memory_size;
>   break;
>   default:
>   printf("inl 0x%x\n", addr);
> @@ -328,14 +329,16 @@ static void start_vcpu(int n)
>  static void usage(const char *progname)
>  {
>   fprintf(stderr,
> - "Usage: %s [OPTIONS] [bootstrap] flatfile\n"
> - "KVM test harness.\n"
> - "\n"
> - "  -s, --smp=NUM  create a VM with NUM virtual CPUs\n"
> - "  -p, --protected-mode   start VM in protected mode\n"
> - "  -h, --help display this help screen and exit\n"
> - "\n"
> - "Report bugs to .\n"
> +"Usage: %s [OPTIONS] [bootstrap] flatfile\n"
> +"KVM test harness.\n"
> +"\n"
> +"  -s, --smp=NUM  create a VM with NUM virtual CPUs\n"
> +"  -p, --protected-mode   start VM in protected mode\n"
> +"  -m, --memory=NUM[GMKB] allocate NUM memory for virtual machine.  A 
> suffix\n"
> +" can be used to change the unit (default: `M')\n"
> +"  -h, --help display this help screen and exit\n"
> +"\n"
> +"Report bugs to .\n"
>   , progname);
>  }
>  
> @@ -348,16 +351,18 @@ int main(int argc, char **argv)
>  {
>   void *vm_mem;
>   int i;
> - const char *sopts = "s:ph";
> + const char *sopts = "s:phm:";
>   struct option lopts[] = {
>   { "smp", 1, 0, 's' },
>   { "protected-mode", 0, 0, 'p' },
> + { "memory", 1, 0, 'm' },
>   { "help", 0, 0, 'h' },
>   { 0 },
>   };
>   int opt_ind, ch;
>   bool enter_protected_mode = false;
>   int nb_args;
> + char *endptr;
>  
>   while ((ch = getopt_long(argc, argv, sopts, lopts, &opt_ind)) != -1) {
>   switch (ch) {
> @@ -367,6 +372,24 @@ int main(int argc, char **argv)
>   case 'p':
>   enter_protected_mode = true;
>   break;
> + case 'm':
> + memory_size = strtoull(optarg, &endptr, 0);
> + switch (*endptr) {
> + case 'G': case 'g':
> + memory_size <<= 10;
> + case '\0':
> + case 'M': case 'm':
> + memory_size <<= 10;
> + case 'K': case 'k':
> + memory_size <<= 10;
> + break;

Cute trick with the fall-through and shifts... not quite Duff's
device, but cute. Please consider adding a /* fallthrough */ comment
to make it obvious.

> + default:
> + fprintf(stderr,
> + "Unrecongized memory suffix: %c\n",
> + *endptr);
> + exit(1);
> + }
> + break;

How about adding a sanity check that memory_size makes sense here
rather than having kvm_create() fail obscurely? For example if the
user got the memory size wrong for some reason we'll end up with
memory_size = 0 here.

Cheers,
Muli
-- 
SYSTOR 2007 --- 1st Annual Haifa Systems and Storage Conference 2007
http://www.haifa.il.ibm.com/Workshops/systor2007/

Virtualization workshop: Oct 29th, 2007 | Storage workshop: Oct 30th, 2007

-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] [PATCH] Use a table to dispatch IO requests in kvmctl

2007-10-09 Thread Anthony Liguori
This patch attempts to clean up kvmctl so that it can be more easily made to
work for multiple architectures and to support more emulation.

It introduces a io dispatch mechanism.  This mechanism supports subpage
granularity but is optimized to efficiently cover regions of pages too.  It's
a 64-bit address space that's structured as a 5-level table.

For x86, we'll have two tables, a pio_table and an mmio_table.  For PPC we can
just have a single table.  The IO functions can support accesses of up to 8
bytes and can handle input/output in the same function.

I tried to keep this nice and simple so as to not add too much complexity to
kvmctl.

Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]>

diff --git a/user/main.c b/user/main.c
index 70de8e6..2bc2182 100644
--- a/user/main.c
+++ b/user/main.c
@@ -51,6 +51,29 @@ kvm_context_t kvm;
 
 #define IPI_SIGNAL (SIGRTMIN + 4)
 
+#define PAGE_SHIFT 12
+#define PAGE_SIZE  (1ULL << PAGE_SHIFT)
+#define PAGE_MASK  (~(PAGE_SIZE - 1))
+
+typedef int (io_table_handler_t)(void *, int, int, uint64_t, uint64_t *);
+
+struct io_table_entry
+{
+   io_table_handler_t *handler;
+   void *opaque;
+};
+
+struct io_table_level
+{
+   struct io_table_entry full_range;
+   struct io_table_level *table;
+};
+
+struct io_table
+{
+   struct io_table_level table;
+};
+
 static int ncpus = 1;
 static sem_t init_sem;
 static __thread int vcpu;
@@ -58,6 +81,8 @@ static int apic_ipi_vector = 0xff;
 static sigset_t kernel_sigmask;
 static sigset_t ipi_sigmask;
 
+static struct io_table pio_table;
+
 struct vcpu_info {
pid_t tid;
sem_t sipi_sem;
@@ -67,9 +92,98 @@ struct vcpu_info *vcpus;
 
 static uint32_t apic_sipi_addr;
 
-static int apic_range(unsigned addr)
+static void *mallocz(size_t size)
 {
-   return (addr >= APIC_BASE) && (addr < APIC_BASE + APIC_SIZE);
+   void *ptr;
+   ptr = malloc(size);
+   if (!ptr)
+   return NULL;
+   memset(ptr, 0, size);
+   return ptr;
+}
+
+struct io_table_entry *io_table_lookup(struct io_table *io_table,
+  uint64_t addr, uint64_t size,
+  int alloc)
+{
+   struct io_table_level *tbl = &io_table->table;
+   int level = 1;
+
+   while (level != 5) {
+   int shift = (4 - level) * 9 + PAGE_SHIFT;
+   int bits, mask;
+
+   if (level == 1)
+   bits = 64 - ((3 * 9) + PAGE_SHIFT);
+   else
+   bits = 9;
+
+   mask = (1 << bits) - 1;
+
+   if (alloc) {
+   if ((1ULL << shift) == size && !(addr & (size - 1)))
+   return &tbl->full_range;
+   } else if (tbl->full_range.handler)
+   return &tbl->full_range;
+
+   if (tbl->table == NULL) {
+   tbl->table = mallocz((1 << bits) *
+sizeof(struct io_table_level));
+   if (!tbl->table)
+   return NULL;
+   }
+
+   tbl = &tbl->table[(addr >> shift) & mask];
+   level++;
+   }
+
+   if (tbl->table == NULL) {
+   tbl->table = mallocz(PAGE_SIZE * sizeof(struct io_table_level));
+   if (!tbl->table)
+   return NULL;
+   }
+
+   return &tbl->table[addr & ~PAGE_MASK].full_range;
+}
+
+int io_table_register_address(struct io_table *io_table,
+ uint64_t addr, uint64_t size,
+ io_table_handler_t *handler,
+ void *opaque)
+{
+   struct io_table_entry *entry;
+
+   entry = io_table_lookup(io_table, addr, size, 1);
+   if (entry == NULL)
+   return -ENOMEM;
+
+   entry->handler = handler;
+   entry->opaque = opaque;
+
+   return 0;
+}
+
+int io_table_register_range(struct io_table *io_table,
+   uint64_t start, uint64_t size,
+   io_table_handler_t *handler,
+   void *opaque)
+{
+   uint64_t step = 1;
+   uint64_t i;
+   int ret = 0;
+
+   if (!(size & ~PAGE_MASK) && !(start & ~PAGE_MASK))
+   step = PAGE_SHIFT;
+
+   for (i = 0; i < size; i += step) {
+   ret = io_table_register_address(io_table,
+   start + i, step,
+   handler, opaque);
+   if (ret < 0)
+   break;
+   }
+
+   return ret;
 }
 
 static void apic_send_sipi(int vcpu)
@@ -87,11 +201,9 @@ static void apic_send_ipi(int vcpu)
tkill(v->tid, IPI_SIGNAL);
 }
 
-static int apic_io(unsigned addr, int is_write, uint32_t *value)
+static int apic_io(void *opaque, int size, int is_write,
+  uint64_t addr, uint64_t *value)
 {
-

[kvm-devel] [PATCH 1/2] Remove memory size from linker script

2007-10-09 Thread Anthony Liguori
The memory size is currently hardcoded into the linker script (end_of_memory).
This prevents the memory size from being specified dynamically in kvmctl.
This patch adds a PIO port that can be used to query the memory size in the
tests.

Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]>

diff --git a/user/flat.lds b/user/flat.lds
index 7dd922c..61f1057 100644
--- a/user/flat.lds
+++ b/user/flat.lds
@@ -13,6 +13,5 @@ SECTIONS
 .bss : { *(.bss) }
 . = ALIGN(4K);
 edata = .;
-end_of_memory = 128M;
 }
 
diff --git a/user/main.c b/user/main.c
index 3eb8dea..9a57a24 100644
--- a/user/main.c
+++ b/user/main.c
@@ -144,7 +144,15 @@ static int test_inl(void *opaque, uint16_t addr, uint32_t 
*value)
 {
if (apic_io(addr, 0, value))
return 0;
-   printf("inl 0x%x\n", addr);
+
+   switch (addr) {
+   case 0xd1:
+   *value = 128 * 1024 * 1024;
+   break;
+   default:
+   printf("inl 0x%x\n", addr);
+   break;
+   }
return 0;
 }
 
diff --git a/user/test/vm.c b/user/test/vm.c
index 2eb8d96..e0e78d7 100644
--- a/user/test/vm.c
+++ b/user/test/vm.c
@@ -58,7 +58,8 @@ void free_page(void *page)
 free = page;
 }
 
-extern char edata, end_of_memory;
+extern char edata;
+static unsigned long end_of_memory;
 
 #define PTE_PRESENT (1ull << 0)
 #define PTE_PSE (1ull << 7)
@@ -202,10 +203,18 @@ static void setup_mmu(unsigned long len)
 print("paging enabled\n");
 }
 
+static unsigned int inl(unsigned short port)
+{
+unsigned int val;
+asm volatile("inl %w1, %0" : "=a"(val) : "Nd"(port));
+return val;
+}
+
 void setup_vm()
 {
-free_memory(&edata, &end_of_memory - &edata);
-setup_mmu((long)&end_of_memory);
+end_of_memory = inl(0xd1);
+free_memory(&edata, end_of_memory - (unsigned long)&edata);
+setup_mmu(end_of_memory);
 }
 
 void *vmalloc(unsigned long size)

-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] [PATCH 2/2] Allow memory to be specified in kvmctl

2007-10-09 Thread Anthony Liguori
This patch adds a --memory option to kvmctl to allow the memory size of the
guest to be specified.

Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]>

diff --git a/user/main.c b/user/main.c
index 9a57a24..7fc0924 100644
--- a/user/main.c
+++ b/user/main.c
@@ -57,6 +57,7 @@ static __thread int vcpu;
 static int apic_ipi_vector = 0xff;
 static sigset_t kernel_sigmask;
 static sigset_t ipi_sigmask;
+static uint64_t memory_size = 128 * 1024 * 1024;
 
 struct vcpu_info {
pid_t tid;
@@ -147,7 +148,7 @@ static int test_inl(void *opaque, uint16_t addr, uint32_t 
*value)
 
switch (addr) {
case 0xd1:
-   *value = 128 * 1024 * 1024;
+   *value = memory_size;
break;
default:
printf("inl 0x%x\n", addr);
@@ -328,14 +329,16 @@ static void start_vcpu(int n)
 static void usage(const char *progname)
 {
fprintf(stderr,
-   "Usage: %s [OPTIONS] [bootstrap] flatfile\n"
-   "KVM test harness.\n"
-   "\n"
-   "  -s, --smp=NUM  create a VM with NUM virtual CPUs\n"
-   "  -p, --protected-mode   start VM in protected mode\n"
-   "  -h, --help display this help screen and exit\n"
-   "\n"
-   "Report bugs to .\n"
+"Usage: %s [OPTIONS] [bootstrap] flatfile\n"
+"KVM test harness.\n"
+"\n"
+"  -s, --smp=NUM  create a VM with NUM virtual CPUs\n"
+"  -p, --protected-mode   start VM in protected mode\n"
+"  -m, --memory=NUM[GMKB] allocate NUM memory for virtual machine.  A suffix\n"
+" can be used to change the unit (default: `M')\n"
+"  -h, --help display this help screen and exit\n"
+"\n"
+"Report bugs to .\n"
, progname);
 }
 
@@ -348,16 +351,18 @@ int main(int argc, char **argv)
 {
void *vm_mem;
int i;
-   const char *sopts = "s:ph";
+   const char *sopts = "s:phm:";
struct option lopts[] = {
{ "smp", 1, 0, 's' },
{ "protected-mode", 0, 0, 'p' },
+   { "memory", 1, 0, 'm' },
{ "help", 0, 0, 'h' },
{ 0 },
};
int opt_ind, ch;
bool enter_protected_mode = false;
int nb_args;
+   char *endptr;
 
while ((ch = getopt_long(argc, argv, sopts, lopts, &opt_ind)) != -1) {
switch (ch) {
@@ -367,6 +372,24 @@ int main(int argc, char **argv)
case 'p':
enter_protected_mode = true;
break;
+   case 'm':
+   memory_size = strtoull(optarg, &endptr, 0);
+   switch (*endptr) {
+   case 'G': case 'g':
+   memory_size <<= 10;
+   case '\0':
+   case 'M': case 'm':
+   memory_size <<= 10;
+   case 'K': case 'k':
+   memory_size <<= 10;
+   break;
+   default:
+   fprintf(stderr,
+   "Unrecongized memory suffix: %c\n",
+   *endptr);
+   exit(1);
+   }
+   break;
case 'h':
usage(argv[0]);
exit(0);
@@ -401,7 +424,7 @@ int main(int argc, char **argv)
fprintf(stderr, "kvm_init failed\n");
return 1;
}
-   if (kvm_create(kvm, 128 * 1024 * 1024, &vm_mem) < 0) {
+   if (kvm_create(kvm, memory_size, &vm_mem) < 0) {
kvm_finalize(kvm);
fprintf(stderr, "kvm_create failed\n");
return 1;

-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] [PATCH 1/2] enable user configure script for cross compile even more

2007-10-09 Thread Jerone Young
This patch patch applies on the latest git tree. 
This adds more cross compile capability to the user diretory
configure script.

Patch created with git this time :-)

Signed-off-by: Jerone Young <[EMAIL PROTECTED]>


diff --git a/user/configure b/user/configure
index 20b9367..ff10268 100755
--- a/user/configure
+++ b/user/configure
@@ -4,7 +4,8 @@ prefix=/usr/local
 kerneldir=/lib/modules/$(uname -r)/build
 cc=gcc
 ld=ld
-arch=`uname -m | sed -e s/i.86/x86/`
+arch=`uname -m | sed -e s/i.86/i386/`
+cross_prefix=
 
 usage() {
 cat <<-EOF
@@ -12,6 +13,7 @@ usage() {
 
Options include:
--arch=ARCHarchitecture to compile for ($arch)
+   --cross-prefix=PREFIX  cross compiler prefix
--cc=CCc compiler to use ($cc)
--ld=LDld linker to use ($ld)
--prefix=PREFIXwhere to install things ($prefix)
@@ -37,6 +39,9 @@ while [[ "$1" = -* ]]; do
 --arch)
arch="$arg"
;;
+   --cross-prefix)
+   cross_prefix="$arg"
+   ;;
--cc)
cc="$arg"
;;
@@ -56,6 +61,6 @@ cat < config.mak
 PREFIX=$prefix
 KERNELDIR=$(readlink -f $kerneldir)
 ARCH=$arch
-CC=$cc
-LD=$ld
+CC=$cross_prefix$cc
+LD=$cross_prefix$ld
 EOF

-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] [PATCH 2/2] [FIXED] enable user makefile for cross compile

2007-10-09 Thread Jerone Young
This patch enables enable makefile in user for cross compile.
This time is a proper git formatted patch.

Signed-off-by: Joerone Young <[EMAIL PROTECTED]>

diff --git a/user/Makefile b/user/Makefile
index 26eb530..522874b 100644
--- a/user/Makefile
+++ b/user/Makefile
@@ -1,14 +1,22 @@
 
 include config.mak
 
+DESTDIR :=
+
+#make sure env CFLAGS variable is not used
+CFLAGS =
+
+#include architecure specific make rules
+include config-$(ARCH).mak
+
 # cc-option
 # Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
 
 cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
   > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
 
-CFLAGS = -I $(KERNELDIR)/include $(autodepend-flags) -g -fomit-frame-pointer \
-   -Wall -m$(bits)
+CFLAGS += -I $(KERNELDIR)/include $(autodepend-flags) -g -fomit-frame-pointer \
+   -Wall
 CFLAGS += $(call cc-option, -fno-stack-protector, "")
 CFLAGS += $(call cc-option, -fno-stack-protector-all, "")
 
@@ -18,20 +26,6 @@ CXXFLAGS = $(autodepend-flags)
 
 autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d
 
-DESTDIR = 
-
-ifeq ($(shell uname -m), x86_64)
-LIBDIR = /lib64
-cstart.o = test/cstart64.o
-bits = 64
-ldarch = elf64-x86-64
-else
-LIBDIR = /lib
-cstart.o = test/cstart.o
-bits = 32
-ldarch = elf32-i386
-endif
-
 all: kvmctl libkvm.a flatfiles
 
 kvmctl: LDFLAGS += -pthread -lrt
@@ -45,11 +39,7 @@ libkvm.a: kvmctl.o
 
 flatfiles-common = test/bootstrap test/vmexit.flat test/smp.flat
 
-flatfiles-32 =
-
-flatfiles-64 = test/access.flat test/irq.flat test/sieve.flat test/simple.flat 
test/stringio.flat test/memtest1.flat
-
-flatfiles: $(flatfiles-common) $(flatfiles-$(bits))
+flatfiles: $(flatfiles-common) $(flatfiles)
 
 install:
install -D kvmctl.h $(DESTDIR)/$(PREFIX)/include/kvmctl.h
@@ -60,13 +50,13 @@ install:
install -D libkvm.a $(DESTDIR)/$(PREFIX)/$(LIBDIR)/libkvm.a
 
 %.flat: %.o
-   gcc $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds $^
+   $(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds $^
 
 test/bootstrap: test/bootstrap.o
-   gcc -nostdlib -o $@ -Wl,-T,bootstrap.lds $^
+   $(CC) -nostdlib -o $@ -Wl,-T,bootstrap.lds $^
 
 %.o: %.S
-   gcc $(CFLAGS) -c -nostdlib -o $@ $^
+   $(CC) $(CFLAGS) -c -nostdlib -o $@ $^
 
 test/irq.flat: test/print.o
 
diff --git a/user/config-i386.mak b/user/config-i386.mak
new file mode 100644
index 000..d2d181b
--- /dev/null
+++ b/user/config-i386.mak
@@ -0,0 +1,7 @@
+LIBDIR = /lib
+cstart.o = test/cstart.o
+bits = 32
+ldarch = elf32-i386
+CFLAGS += -m32
+
+flatfiles=
diff --git a/user/config-x86_64.mak b/user/config-x86_64.mak
new file mode 100644
index 000..19ebc46
--- /dev/null
+++ b/user/config-x86_64.mak
@@ -0,0 +1,7 @@
+LIBDIR = /lib64
+cstart.o = test/cstart64.o
+bits = 64
+ldarch = elf64-x86-64
+CFLAGS += -m64
+
+flatfiles = test/access.flat test/irq.flat test/sieve.flat test/simple.flat 
test/stringio.flat test/memtest1.flat

-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH 1/2] [RESEND] Enable user directory configure script for cross compile

2007-10-09 Thread Jerone Young
I believe the problem is that I am not generating my patches in git
format. I have been using a mercuial mq tree to generate the patches I
have been sending. While they apply fine with patch command, apparently
git needs the patches fomatted correctly.

I'll get everything together again and use git tools (like guilt) to
make a new patch.

On Tue, 2007-10-09 at 15:26 +0200, Avi Kivity wrote:
> Jerone Young wrote:
> > This patch enables configure script in user directory for cross compile.
> >
> >   
> 
> Still doesn't apply.  What are you generating the patches against?
> 
> 


-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH 1/2] [RESEND] Enable user directory configure script for cross compile

2007-10-09 Thread Jerone Young
The patches are based on an older snapshot. Grabbing todays git tree I
see there have been changes in user/Makefile. This would be why it is
failing.

On Tue, 2007-10-09 at 18:02 +0200, Avi Kivity wrote:
> Jerone Young wrote:
> > I believe the problem is that I am not generating my patches in git
> > format. I have been using a mercuial mq tree to generate the patches I
> > have been sending. While they apply fine with patch command, apparently
> > git needs the patches fomatted correctly.
> >
> >   
> 
> git generally knows how to apply things... perhaps your mq tree is stale 
> and you're generating patches against an older snapshot?
> 
> 


-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] RFC/patch: a very trivial patch towards portability

2007-10-09 Thread Avi Kivity
Carsten Otte wrote:
> A header file named kvm_arch.h is being introduced that contains
> prototypes for funtions in kvm_x86.c.
>
>   

What's the motivation for the new header?  So we have a list of 
arch-dependent functions?  Compiler-wise it could just as well remain in 
kvm.h.


-- 
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] RFC/patch: a very trivial patch towards portability

2007-10-09 Thread Avi Kivity
Carsten Otte wrote:
> We've seen various big patches regarding portability from Christian and
> Xianto, but none was merged to date. Maintaining a large patch set on
> top of a quickly moving code base is painful.
> I thought it might be cool to try to throw trivial patches at Avi that
> obviously don't break things and push towards portability. In case this
> succeeds I'll keep throwing in trivial patches until we've split
> everything proper.
> This patch splits kvm_dev_ioctl into architecture independent and
> architecture dependent ioctls. Those that are arch independent remain in
> kvm_main.c, others are implemented by kvm_arch_dev_ioctl() in kvm_x86.c.
> A header file named kvm_arch.h is being introduced that contains
> prototypes for funtions in kvm_x86.c.
>
> Comments? Is this a preferable approach? What needs to be done
> different?
>
>   

Small, reviewable, posted patches are definitely the best way forward.

> - case KVM_CHECK_EXTENSION: {
> - int ext = (long)argp;
> -
> - switch (ext) {
> - case KVM_CAP_IRQCHIP:
> - case KVM_CAP_HLT:
> - case KVM_CAP_MMU_SHADOW_CACHE_CONTROL:
> - r = 1;
> - break;
> - default:
> - r = 0;
> - break;
> - }
> - break;
> - }
>   

CHECK_EXTENSION is hopefully a generic mechanism (even if the some of 
the actual extensions are not).  So there should be a switch in common 
code for the common extensions, and the default: target should call 
kvm_arch_check_extension() for further processing.

> - case KVM_GET_VCPU_MMAP_SIZE:
> - r = -EINVAL;
> - if (arg)
> - goto out;
> - r = 2 * PAGE_SIZE;
> - break;
>   

I would think this is generic too?  Isn't s390 interested in passing 
information to userspace via a mmap()ed region?

Note that mmio data is passed via that region.


>  
> Index: kvm/drivers/kvm/kvm_x86.c
> ===
> --- /dev/null 1970-01-01 00:00:00.0 +
> +++ kvm/drivers/kvm/kvm_x86.c 2007-10-09 16:47:55.0 +0200
>   

x86.c


-- 
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] RFC/patch: a very trivial patch towards portability

2007-10-09 Thread Carsten Otte
We've seen various big patches regarding portability from Christian and
Xianto, but none was merged to date. Maintaining a large patch set on
top of a quickly moving code base is painful.
I thought it might be cool to try to throw trivial patches at Avi that
obviously don't break things and push towards portability. In case this
succeeds I'll keep throwing in trivial patches until we've split
everything proper.
This patch splits kvm_dev_ioctl into architecture independent and
architecture dependent ioctls. Those that are arch independent remain in
kvm_main.c, others are implemented by kvm_arch_dev_ioctl() in kvm_x86.c.
A header file named kvm_arch.h is being introduced that contains
prototypes for funtions in kvm_x86.c.

Comments? Is this a preferable approach? What needs to be done
different?

signed-off-by: Carsten Otte <[EMAIL PROTECTED]>
---
Index: kvm/drivers/kvm/kvm_arch.h
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ kvm/drivers/kvm/kvm_arch.h  2007-10-09 16:42:09.0 +0200
@@ -0,0 +1,17 @@
+/*
+ * Kernel-based Virtual Machine driver for Linux
+ *
+ * This header defines architecture specific interfaces
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ *
+ */
+
+#ifndef KVM_ARCH_H
+#define KVM_ARCH_H
+long kvm_arch_dev_ioctl(struct file *,
+   unsigned int, unsigned long);
+
+__init void kvm_arch_init(void);
+#endif
Index: kvm/drivers/kvm/kvm_main.c
===
--- kvm.orig/drivers/kvm/kvm_main.c 2007-10-09 15:39:26.0 +0200
+++ kvm/drivers/kvm/kvm_main.c  2007-10-09 16:41:04.0 +0200
@@ -16,6 +16,7 @@
  */
 
 #include "kvm.h"
+#include "kvm_arch.h"
 #include "x86_emulate.h"
 #include "segment_descriptor.h"
 #include "irq.h"
@@ -44,7 +45,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 MODULE_AUTHOR("Qumranet");
@@ -2478,43 +2478,6 @@
 EXPORT_SYMBOL_GPL(kvm_get_cs_db_l_bits);
 
 /*
- * List of msr numbers which we expose to userspace through KVM_GET_MSRS
- * and KVM_SET_MSRS, and KVM_GET_MSR_INDEX_LIST.
- *
- * This list is modified at module load time to reflect the
- * capabilities of the host cpu.
- */
-static u32 msrs_to_save[] = {
-   MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP,
-   MSR_K6_STAR,
-#ifdef CONFIG_X86_64
-   MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR,
-#endif
-   MSR_IA32_TIME_STAMP_COUNTER,
-};
-
-static unsigned num_msrs_to_save;
-
-static u32 emulated_msrs[] = {
-   MSR_IA32_MISC_ENABLE,
-};
-
-static __init void kvm_init_msr_list(void)
-{
-   u32 dummy[2];
-   unsigned i, j;
-
-   for (i = j = 0; i < ARRAY_SIZE(msrs_to_save); i++) {
-   if (rdmsr_safe(msrs_to_save[i], &dummy[0], &dummy[1]) < 0)
-   continue;
-   if (j < i)
-   msrs_to_save[j] = msrs_to_save[i];
-   j++;
-   }
-   num_msrs_to_save = j;
-}
-
-/*
  * Adapt set_msr() to msr_io()'s calling convention
  */
 static int do_set_msr(struct kvm_vcpu *vcpu, unsigned index, u64 *data)
@@ -3292,7 +3255,6 @@
 static long kvm_dev_ioctl(struct file *filp,
  unsigned int ioctl, unsigned long arg)
 {
-   void __user *argp = (void __user *)arg;
long r = -EINVAL;
 
switch (ioctl) {
@@ -3308,56 +3270,8 @@
goto out;
r = kvm_dev_ioctl_create_vm();
break;
-   case KVM_GET_MSR_INDEX_LIST: {
-   struct kvm_msr_list __user *user_msr_list = argp;
-   struct kvm_msr_list msr_list;
-   unsigned n;
-
-   r = -EFAULT;
-   if (copy_from_user(&msr_list, user_msr_list, sizeof msr_list))
-   goto out;
-   n = msr_list.nmsrs;
-   msr_list.nmsrs = num_msrs_to_save + ARRAY_SIZE(emulated_msrs);
-   if (copy_to_user(user_msr_list, &msr_list, sizeof msr_list))
-   goto out;
-   r = -E2BIG;
-   if (n < num_msrs_to_save)
-   goto out;
-   r = -EFAULT;
-   if (copy_to_user(user_msr_list->indices, &msrs_to_save,
-num_msrs_to_save * sizeof(u32)))
-   goto out;
-   if (copy_to_user(user_msr_list->indices
-+ num_msrs_to_save * sizeof(u32),
-&emulated_msrs,
-ARRAY_SIZE(emulated_msrs) * sizeof(u32)))
-   goto out;
-   r = 0;
-   break;
-   }
-   case KVM_CHECK_EXTENSION: {
-   int ext = (long)argp;
-
-   switch (ext) {
-   case KVM_CAP_IRQCHIP:
-   case KVM_CAP_HLT:
-   case 

Re: [kvm-devel] [PATCH 1/2] [RESEND] Enable user directory configure script for cross compile

2007-10-09 Thread Avi Kivity
Jerone Young wrote:
> I believe the problem is that I am not generating my patches in git
> format. I have been using a mercuial mq tree to generate the patches I
> have been sending. While they apply fine with patch command, apparently
> git needs the patches fomatted correctly.
>
>   

git generally knows how to apply things... perhaps your mq tree is stale 
and you're generating patches against an older snapshot?


-- 
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH] Abort if gcc4 was used to compile qemu and kvm is not enabled

2007-10-09 Thread Avi Kivity
Byron Stanoszek wrote:
> Even when I first started using
> KVM, I had no positive feedback that KVM was even working properly (was the
> device node created? am I using a cpu with the correct extensions? etc). I
> eventually figured out that if 'lsmod' showed kvm-intel.ko usage > 0, then I
> knew it was working.
>   

The window title bar says 'QEMU/KVM' instead of 'QEMU' when kvm is active.

-- 
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH 1/2] [RESEND] Enable user directory configure script for cross compile

2007-10-09 Thread Avi Kivity
Jerone Young wrote:
> This patch enables configure script in user directory for cross compile.
>
>   

Still doesn't apply.  What are you generating the patches against?


-- 
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH] Abort if gcc4 was used to compile qemu and kvm is not enabled

2007-10-09 Thread Anthony Liguori
Carlo Marcelo Arenas Belon wrote:
> On Mon, Oct 08, 2007 at 02:29:32PM -0500, Anthony Liguori wrote:
>   
> 3) We do nothing, add a warning to the compilation for the users to read at
> compile time (most of them not aware that they should be using gcc-3.x instead
> as they are used to see all the other compilation warnings anyway) and then
> let kvm segfault when they start it without loading the module first.
>   

Here are some alternatives that I think are more reasonable:

1) implement a KVM target for QEMU that doesn't use dyngen at all.  Some 
of the architecture ports (like ia64 and s390) are going to require this 
anyway since dyngen doesn't support ia64 or s390.  There's no reason 
this can be used for x86 too.

2) work on getting the assembly post-processor merged into upstream 
QEMU.  IMHO, this is the best long term strategy for QEMU GCC4 support.

3) you have to pass an option to ./configure to disable the gcc4 check.  
Issue a big fat warning when the user does this saying that the 
resulting QEMU will not probably work with -no-kvm or if the KVM modules 
are loaded.  The user is smart enough to disable the gcc4 check so I 
have to imagine that they are smart enough to not completely ignore this 
warning.

Regards,

Anthony Liguori

> If nothing, a message saying this won't work because you used the wrong
> compiler, is IMHO better than a plain segfault.
>
> Carlo
>
> PS. if qemu gets upstream officially a solution to compile with gcc4, I'll be
> the first one getting that merged and removing this patch.
>
> PS2. getting gcc4 to generate valid chunks of "copyable" code as required by
> qemu's dyngen is not something that would happen accidentally, for a promising
> alternative look at the GCC 2007 proceedings abstract "Towards GCC as a
> compiler for multiple VMs", pages 117-130,
> http://ols2006.108.redhat.com/2007/GCC-Reprints/GCC2007-Proceedings.pdf
>
>   


-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kvm-45 problems

2007-10-09 Thread Zhao, Yunfeng
>> This may be due to NMIs or MCEs. Is it possible your machine is
>> receiving them?
>>
>
>
>I pushed a fix for the NMI issue. Can you check if it fixes your hangs?
[Yunfeng]  Sure, the result will be available tomorrow.
>
>
>--
>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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kernel device reset support

2007-10-09 Thread Avi Kivity
Dong, Eddie wrote:
> Avi Kivity wrote:
>   
>>> If BSP mp_state becomes VCPU_MP_STATE_UNINITIALIZED, current code
>>> can't wakeup it. We need additional code that I am not aware of now.
>>>
>>> Current VCPU must be BSP, otherwise the code executing in Qemu will
>>> have problem too. 
>>>
>>>   
>> But, for an ungraceful reset, nothing prevents an AP from
>> issuing a reset?
>> 
>
> Mmm, Yes, but I think current architecture can't handle this.
> The thread where AP issues "RESET" will continue run, which
> means it becomes BSP now and wake up other APs later on.
> Or We can block that AP first and then inform BSP to do 
> RESET job. Here we need to block the AP in kernel 
> so that we can wake up.
>   

It should call vcpu_halt() immediately after reset.

> It can be a future task which is not that high priority IMO. 
> I will focus on SMP boot 1st. Your opnion?
>   

Agree.  But let's make it close to the complete solution.

>>>
>>>   
>> What I mean is to use mp_state within the vcpu code (while holding the
>> vcpu mutex) and to use vcpu->requests as a means to tell the vcpu it
>> needs to change state. 
>>
>> 
>
> Then we need to add code to enter waitqueque here. I think force_to_quit
> is much simple and efficient since we don't need to test (atomic test) 
> at each VM Exit even light weight VM Exit.
>   

The test for vcpu->requests already exists (and is needed for tlb 
flushes) so there is no additional performance hit.

> But certainly it can. If you want to save the per VCPU force_to_quit, we
> can share it with vcpu_request, but test in external IRQ is better IMO
> since we take a kick now.
>   

The vcpu may have exited due to some other reason, and the interrupt 
taken in host context?


-- 
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kernel device reset support

2007-10-09 Thread Dong, Eddie
Avi Kivity wrote:
>> 
>> If BSP mp_state becomes VCPU_MP_STATE_UNINITIALIZED, current code
>> can't wakeup it. We need additional code that I am not aware of now.
>> 
>> Current VCPU must be BSP, otherwise the code executing in Qemu will
>> have problem too. 
>> 
> 
> But, for an ungraceful reset, nothing prevents an AP from
> issuing a reset?

Mmm, Yes, but I think current architecture can't handle this.
The thread where AP issues "RESET" will continue run, which
means it becomes BSP now and wake up other APs later on.
Or We can block that AP first and then inform BSP to do 
RESET job. Here we need to block the AP in kernel 
so that we can wake up.

It can be a future task which is not that high priority IMO. 
I will focus on SMP boot 1st. Your opnion?

> 
> 
>> 

>> Mmm, almost Yes, then it is same with force_to_quit.
>> But reset doesn't mean lapic_reset only, it needs to
>> enter wait for INIT/SIPI cycles. So using mp_state is
>> much closer.
>> 
>> 
> 
> What I mean is to use mp_state within the vcpu code (while holding the
> vcpu mutex) and to use vcpu->requests as a means to tell the vcpu it
> needs to change state. 
> 

Then we need to add code to enter waitqueque here. I think force_to_quit
is much simple and efficient since we don't need to test (atomic test) 
at each VM Exit even light weight VM Exit.

But certainly it can. If you want to save the per VCPU force_to_quit, we
can share it with vcpu_request, but test in external IRQ is better IMO
since we take a kick now.
>>> Sounds good.  But the BSP starts executing immediately, no?
>>> 
>> 
>> Yes, BSP will continue. current VCPU=BSP.
>> 
> 
> It's a vm ioctl, there is no current vcpu!
> 
Yes, but it is in the thread BSP use :-)
Thx,eddie

-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kvm-45 problems

2007-10-09 Thread Avi Kivity
Avi Kivity wrote:
> Zhao, Yunfeng wrote:
>   
>> We run some booting multiple guest tests in our nightly testing.
>> Like booting two UP windows guests, booting one UP linux guest and one UP 
>> windows guest, and booting 4 UP linux guests.
>> The first two cases have no problem in our testing.
>> And booting 4 UP linux guests may crash host, but this problem doesn't 
>> happen very time. If the problem didn't happen, linux guest can be log in 
>> without any problem.
>>
>> For smp guest, we meet a problem that booting linux guest with 4 vcpus 
>> causes soft lock error on host. Once this error happened, qemu process also 
>> could not be killed.
>>
>> Our linux guests are using 2.6.9, 2.6.16, and 2.6.23 kernels.
>>
>>   
>> 
>
> This may be due to NMIs or MCEs. Is it possible your machine is
> receiving them?
>   


I pushed a fix for the NMI issue. Can you check if it fixes your hangs?


-- 
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/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kernel device reset support

2007-10-09 Thread Avi Kivity
Dong, Eddie wrote:
> Avi Kivity wrote:
>   
>>> In native, RESET signal force every processor enter "RESET" status,
>>> and then immediately after RESET signal is removed, all CPUs will
>>> compete for BSP role, the winner continue execution, and failor will
>>> be blocked till INIT/SIPI/SIPI. 
>>>
>>>   
>> I meant, you could set both to VCPU_MP_STATE_UNINITIALIZED and let the
>> vcpu code do the reset differently depending on vcpu_id.  This way you
>> don't run into locking issues (kvm_lapic_reset() needs the vcpu lock?)
>> 
>
> If BSP mp_state becomes VCPU_MP_STATE_UNINITIALIZED, current code
> can't wakeup it. We need additional code that I am not aware of now.
>
> Current VCPU must be BSP, otherwise the code executing in Qemu will have
> problem too.
>   

But, for an ungraceful reset, nothing prevents an AP from issuing a reset?


>   
>>> For a graceful reboot, this one is not needed since every APs are
>>> already brought to HALT status before BSP issue RESET signal. But in
>>> case of non-graceful reboot, it is possible the VCPUs are still
>>> executing guest instruction, so we kick the VCPU and then use this
>>> logic to force the exception handler to be a heavy VM Exit and
>>> execute following code at beginning of kvm_vcpu_ioctl_run. (Let
>>> VCPU_MP_STATE_UNINITIALIZED take effective)
>>>
>>> if (unlikely(vcpu->mp_state ==
>>>   
>> VCPU_MP_STATE_UNINITIALIZED)) {
>> 
>>> if (irqchip_in_kernel(vcpu->kvm) && vcpu->apic)
>>> kvm_lapic_reset(vcpu);
>>> kvm_vcpu_block(vcpu);
>>> vcpu_put(vcpu);
>>> return -EAGAIN;
>>> }
>>>
>>> Whether we need to handle those un-graceful reboot case is up to you
>>> :-) If not, then those code can be removed.
>>>
>>>   
>> We do need to support ungraceful resets.  But this could
>> easily be done
>> via vcpu->requests.
>> 
>
> Mmm, almost Yes, then it is same with force_to_quit.
> But reset doesn't mean lapic_reset only, it needs to 
> enter wait for INIT/SIPI cycles. So using mp_state is
> much closer.
>
>   

What I mean is to use mp_state within the vcpu code (while holding the 
vcpu mutex) and to use vcpu->requests as a means to tell the vcpu it 
needs to change state.


>> To reset a vcpu:
>>
>>set_bit(KVM_REQ_RESET, &vcpu->requests)
>>kvm_vcpu_kick(vcpu);
>>
>> And in __vcpu_run():
>>
>>   if (vcpu_requests) {
>> if (test_and_reset_bit(KVM_REQ_RESET, &vcpu->requests))  
>>    }
>>
>> 
>>> Mmm, I will move this to be after VCPU reset.
>>> If a VCPU is still accessing (write)  devices register, we always
>>> have problem. So move after all the processors enetring frozen state
>>> will be simple and safer. 
>>>
>>> Any opnion? Will post after your new comments.
>>>
>>>
>>>   
>> Sounds good.  But the BSP starts executing immediately, no?
>> 
>
> Yes, BSP will continue. current VCPU=BSP.
>   

It's a vm ioctl, there is no current vcpu!

-- 
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kernel device reset support

2007-10-09 Thread Dong, Eddie
Avi Kivity wrote:
>> In native, RESET signal force every processor enter "RESET" status,
>> and then immediately after RESET signal is removed, all CPUs will
>> compete for BSP role, the winner continue execution, and failor will
>> be blocked till INIT/SIPI/SIPI. 
>> 
> 
> I meant, you could set both to VCPU_MP_STATE_UNINITIALIZED and let the
> vcpu code do the reset differently depending on vcpu_id.  This way you
> don't run into locking issues (kvm_lapic_reset() needs the vcpu lock?)

If BSP mp_state becomes VCPU_MP_STATE_UNINITIALIZED, current code
can't wakeup it. We need additional code that I am not aware of now.

Current VCPU must be BSP, otherwise the code executing in Qemu will have
problem too.

>> For a graceful reboot, this one is not needed since every APs are
>> already brought to HALT status before BSP issue RESET signal. But in
>> case of non-graceful reboot, it is possible the VCPUs are still
>> executing guest instruction, so we kick the VCPU and then use this
>> logic to force the exception handler to be a heavy VM Exit and
>> execute following code at beginning of kvm_vcpu_ioctl_run. (Let
>> VCPU_MP_STATE_UNINITIALIZED take effective)
>> 
>> if (unlikely(vcpu->mp_state ==
> VCPU_MP_STATE_UNINITIALIZED)) {
>> if (irqchip_in_kernel(vcpu->kvm) && vcpu->apic)
>> kvm_lapic_reset(vcpu);
>> kvm_vcpu_block(vcpu);
>> vcpu_put(vcpu);
>> return -EAGAIN;
>> }
>> 
>> Whether we need to handle those un-graceful reboot case is up to you
>> :-) If not, then those code can be removed.
>> 
> 
> We do need to support ungraceful resets.  But this could
> easily be done
> via vcpu->requests.

Mmm, almost Yes, then it is same with force_to_quit.
But reset doesn't mean lapic_reset only, it needs to 
enter wait for INIT/SIPI cycles. So using mp_state is
much closer.

> 
> To reset a vcpu:
> 
>set_bit(KVM_REQ_RESET, &vcpu->requests)
>kvm_vcpu_kick(vcpu);
> 
> And in __vcpu_run():
> 
>   if (vcpu_requests) {
> if (test_and_reset_bit(KVM_REQ_RESET, &vcpu->requests))  
>    }
> 
>> 
>> Mmm, I will move this to be after VCPU reset.
>> If a VCPU is still accessing (write)  devices register, we always
>> have problem. So move after all the processors enetring frozen state
>> will be simple and safer. 
>> 
>> Any opnion? Will post after your new comments.
>> 
>> 
> 
> Sounds good.  But the BSP starts executing immediately, no?

Yes, BSP will continue. current VCPU=BSP.

> 
> So maybe two stages for vcpu reset:  first to reset and halt it, then
> start it.  pic and ioapic reset can be performed in between.
> 
thx,eddie

-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kvm-45 problems

2007-10-09 Thread Avi Kivity
Farkas Levente wrote:
> Avi Kivity wrote:
>   
>> Farkas Levente wrote:
>> 
>>> Avi Kivity wrote:
>>>   
>>>   
 Zhao, Yunfeng wrote:
 
 
> We run some booting multiple guest tests in our nightly testing.
> Like booting two UP windows guests, booting one UP linux guest and one UP 
> windows guest, and booting 4 UP linux guests.
> The first two cases have no problem in our testing.
> And booting 4 UP linux guests may crash host, but this problem doesn't 
> happen very time. If the problem didn't happen, linux guest can be log in 
> without any problem.
>
> For smp guest, we meet a problem that booting linux guest with 4 vcpus 
> causes soft lock error on host. Once this error happened, qemu process 
> also could not be killed.
>
> Our linux guests are using 2.6.9, 2.6.16, and 2.6.23 kernels.
>
>   
>   
>   
 This may be due to NMIs or MCEs. Is it possible your machine is
 receiving them?
 
 
>>> what does it mean?
>>>   
>>>   
>> Non-maskable interrupts and machine check exceptions.
>> 
>
> is it something which i can trigger (as as user of kvm)?
>
>   

It's something that happens as part of the ordinary workload of the
machine. I suspect that kvm doesn't handle it correctly.


-- 
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/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kvm-45 problems

2007-10-09 Thread Farkas Levente
Avi Kivity wrote:
> Farkas Levente wrote:
>> Avi Kivity wrote:
>>   
>>> Zhao, Yunfeng wrote:
>>> 
 We run some booting multiple guest tests in our nightly testing.
 Like booting two UP windows guests, booting one UP linux guest and one UP 
 windows guest, and booting 4 UP linux guests.
 The first two cases have no problem in our testing.
 And booting 4 UP linux guests may crash host, but this problem doesn't 
 happen very time. If the problem didn't happen, linux guest can be log in 
 without any problem.

 For smp guest, we meet a problem that booting linux guest with 4 vcpus 
 causes soft lock error on host. Once this error happened, qemu process 
 also could not be killed.

 Our linux guests are using 2.6.9, 2.6.16, and 2.6.23 kernels.

   
   
>>> This may be due to NMIs or MCEs. Is it possible your machine is
>>> receiving them?
>>> 
>> what does it mean?
>>   
> 
> Non-maskable interrupts and machine check exceptions.

is it something which i can trigger (as as user of kvm)?

-- 
  Levente   "Si vis pacem para bellum!"

-
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/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kvm-45 problems

2007-10-09 Thread Avi Kivity
Farkas Levente wrote:
> Avi Kivity wrote:
>   
>> Zhao, Yunfeng wrote:
>> 
>>> We run some booting multiple guest tests in our nightly testing.
>>> Like booting two UP windows guests, booting one UP linux guest and one UP 
>>> windows guest, and booting 4 UP linux guests.
>>> The first two cases have no problem in our testing.
>>> And booting 4 UP linux guests may crash host, but this problem doesn't 
>>> happen very time. If the problem didn't happen, linux guest can be log in 
>>> without any problem.
>>>
>>> For smp guest, we meet a problem that booting linux guest with 4 vcpus 
>>> causes soft lock error on host. Once this error happened, qemu process also 
>>> could not be killed.
>>>
>>> Our linux guests are using 2.6.9, 2.6.16, and 2.6.23 kernels.
>>>
>>>   
>>>   
>> This may be due to NMIs or MCEs. Is it possible your machine is
>> receiving them?
>> 
>
> what does it mean?
>   

Non-maskable interrupts and machine check exceptions.




-- 
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/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kernel device reset support

2007-10-09 Thread Avi Kivity
Avi Kivity wrote:
>>> 
>>>   
>> For a graceful reboot, this one is not needed since every APs are
>> already brought to HALT status before BSP issue RESET signal. But in
>> case of non-graceful reboot, it is possible the VCPUs are still
>> executing guest instruction, so we kick the VCPU and then use this logic
>> to force the exception handler to be a heavy VM Exit and execute
>> following code at beginning of kvm_vcpu_ioctl_run. (Let
>> VCPU_MP_STATE_UNINITIALIZED take effective)
>>
>> if (unlikely(vcpu->mp_state == VCPU_MP_STATE_UNINITIALIZED)) {
>> if (irqchip_in_kernel(vcpu->kvm) && vcpu->apic)
>> kvm_lapic_reset(vcpu);
>> kvm_vcpu_block(vcpu);
>> vcpu_put(vcpu);
>> return -EAGAIN;
>> }
>>
>> Whether we need to handle those un-graceful reboot case is up to you :-)
>> If not, then those code can be removed.
>>   
>> 
>
> We do need to support ungraceful resets.  But this could easily be done 
> via vcpu->requests.
>
> To reset a vcpu:
>
> set_bit(KVM_REQ_RESET, &vcpu->requests)
> kvm_vcpu_kick(vcpu);
>
> And in __vcpu_run():
>
>if (vcpu_requests) {
>  if (test_and_reset_bit(KVM_REQ_RESET, &vcpu->requests))
> 
>}
>
>   


To be clear, you can move the reset call to that location ("...") and 
avoid the need to take a heavyweight exit completely.

-- 
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kvm-45 problems

2007-10-09 Thread Farkas Levente
Avi Kivity wrote:
> Zhao, Yunfeng wrote:
>> We run some booting multiple guest tests in our nightly testing.
>> Like booting two UP windows guests, booting one UP linux guest and one UP 
>> windows guest, and booting 4 UP linux guests.
>> The first two cases have no problem in our testing.
>> And booting 4 UP linux guests may crash host, but this problem doesn't 
>> happen very time. If the problem didn't happen, linux guest can be log in 
>> without any problem.
>>
>> For smp guest, we meet a problem that booting linux guest with 4 vcpus 
>> causes soft lock error on host. Once this error happened, qemu process also 
>> could not be killed.
>>
>> Our linux guests are using 2.6.9, 2.6.16, and 2.6.23 kernels.
>>
>>   
> 
> This may be due to NMIs or MCEs. Is it possible your machine is
> receiving them?

what does it mean?

-- 
  Levente   "Si vis pacem para bellum!"

-
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/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kvm-45 problems

2007-10-09 Thread Avi Kivity
Zhao, Yunfeng wrote:
> We run some booting multiple guest tests in our nightly testing.
> Like booting two UP windows guests, booting one UP linux guest and one UP 
> windows guest, and booting 4 UP linux guests.
> The first two cases have no problem in our testing.
> And booting 4 UP linux guests may crash host, but this problem doesn't happen 
> very time. If the problem didn't happen, linux guest can be log in without 
> any problem.
>
> For smp guest, we meet a problem that booting linux guest with 4 vcpus causes 
> soft lock error on host. Once this error happened, qemu process also could 
> not be killed.
>
> Our linux guests are using 2.6.9, 2.6.16, and 2.6.23 kernels.
>
>   

This may be due to NMIs or MCEs. Is it possible your machine is
receiving them?

-- 
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/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH] kvm: bios: decrease the cpu counts in ACPI table to 15

2007-10-09 Thread Avi Kivity
Yang, Sheng wrote:
> >From dc4cc1a804d9f7705648bdee3d7152054da8dea8 Mon Sep 17 00:00:00 2001
> From: Sheng Yang <[EMAIL PROTECTED]>
> Date: Tue, 9 Oct 2007 16:22:08 +0800
> Subject: [PATCH] kvm: bios: decrease the cpu counts in ACPI table to 15
>
> It seems Windows 2000 only support no more than 15 cpus in ACPI table,
> otherwise it will cause a BSOD of KMODE_EXCEPTION_NOT_HANDLED.
>
> This patch decrease the cpu counts in ACPI table from 16 to 15.
>   

Applied, thanks.


-- 
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] global TSS?

2007-10-09 Thread Avi Kivity
Dong, Eddie wrote:
> Avi:
>   It seems we are using global TSS, and init_rmode_tss will modify
> the table each time when VCPU is reset. Should we move to per CPU TSS
> for correct real mode emulation?
>   

Why is it a problem?

But, the real-mode tss can definitely be improved.  Right now it uses 
guest memory, and it really shouldn't.  The best solution is probably to 
allocate a global tss (for all guests) out of host memory, and modify 
the mmu to map it at some safe location (like 4GB - 512KB - 12KB)

-- 
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] out of memory page request

2007-10-09 Thread Avi Kivity
Dong, Eddie wrote:
> [EMAIL PROTECTED] wrote:
>   
>> David Brown wrote:
>> 
 Can you run 'gdb /path/to/kvm.ko' and post the output of
 'disassemble ioapic_mmio_write' please? 


 
>>> Sorry for not getting back sooner.
>>>
>>> (gdb) disassemble ioapic_mmio_write
>>> Dump of assembler code for function ioapic_mmio_write:
>>>
>>>   
>> The attached patch should fix, though there's probably another
>> problem lurking in there. 
>>
>> 
> Should we printk something to alert something error already?
> Eddie
>   

It needs to be pr_debug() to avoid allowing a guest to spam the host 
logs.  But I don't think it will help in this case.  There's probably a 
bug under low memory conditions that causes the guest to execute 
incorrectly, and it just happened to hit this bug.  I don't think it's 
really related to the ioapic.


-- 
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kernel device reset support

2007-10-09 Thread Avi Kivity
Dong, Eddie wrote:
>>>
>>> +
>>> +/*
>>> + * Reset VM.
>>> + *
>>> + */
>>> +int kvm_vm_reset(struct kvm *kvm)
>>> +{
>>> +   struct kvm_vcpu *vcpu;
>>> +   int i;
>>> +
>>> +   kvm_reset_devices(kvm);
>>> +   for (i = 0; i < KVM_MAX_VCPUS; i++) {
>>> +   vcpu = kvm->vcpus[i];
>>> +   if (!vcpu)
>>> +   continue;
>>> +   /* active VCPU */
>>> +   if (vcpu->vcpu_id)
>>> +   vcpu->mp_state = VCPU_MP_STATE_UNINITIALIZED;
>>> +   else {
>>> +   vcpu->mp_state = VCPU_MP_STATE_RUNNABLE;
>>> +   kvm_lapic_reset(vcpu);
>>>
>>>   
>> Why is the handling here different?
>> 
>
> In native, RESET signal force every processor enter "RESET" status, and
> then immediately after RESET signal is removed, all CPUs will compete
> for BSP role, the winner continue execution, and failor will be blocked
> till INIT/SIPI/SIPI.
>   

I meant, you could set both to VCPU_MP_STATE_UNINITIALIZED and let the 
vcpu code do the reset differently depending on vcpu_id.  This way you 
don't run into locking issues (kvm_lapic_reset() needs the vcpu lock?)

>
>>>  {
>>> ++vcpu->stat.irq_exits;
>>> +   if (vcpu->force_to_quit) {
>>> +   vcpu->force_to_quit = 0;
>>> +   return -EINTR;
>>> +   }
>>> return 1;
>>>  }
>>>
>>> 
>> Why is this needed?
>> 
>
> For a graceful reboot, this one is not needed since every APs are
> already brought to HALT status before BSP issue RESET signal. But in
> case of non-graceful reboot, it is possible the VCPUs are still
> executing guest instruction, so we kick the VCPU and then use this logic
> to force the exception handler to be a heavy VM Exit and execute
> following code at beginning of kvm_vcpu_ioctl_run. (Let
> VCPU_MP_STATE_UNINITIALIZED take effective)
>
> if (unlikely(vcpu->mp_state == VCPU_MP_STATE_UNINITIALIZED)) {
> if (irqchip_in_kernel(vcpu->kvm) && vcpu->apic)
> kvm_lapic_reset(vcpu);
> kvm_vcpu_block(vcpu);
> vcpu_put(vcpu);
> return -EAGAIN;
> }
>
> Whether we need to handle those un-graceful reboot case is up to you :-)
> If not, then those code can be removed.
>   

We do need to support ungraceful resets.  But this could easily be done 
via vcpu->requests.

To reset a vcpu:

set_bit(KVM_REQ_RESET, &vcpu->requests)
kvm_vcpu_kick(vcpu);

And in __vcpu_run():

   if (vcpu_requests) {
 if (test_and_reset_bit(KVM_REQ_RESET, &vcpu->requests))

   }

>   
>> Userspace can always force an exit by sending a signal.
>>
>> 
>>> +/*
>>> + * Reset VM.
>>> + *
>>> + */
>>> +int kvm_vm_reset(struct kvm *kvm)
>>> +{
>>> +   struct kvm_vcpu *vcpu;
>>> +   int i;
>>> +
>>> +   kvm_reset_devices(kvm);
>>>
>>>   
>> Need to take kvm->lock around this.
>> 
>
> Mmm, I will move this to be after VCPU reset.
> If a VCPU is still accessing (write)  devices register, we always have
> problem.
> So move after all the processors enetring frozen state will be simple
> and safer.
>
> Any opnion? Will post after your new comments.
>
>   

Sounds good.  But the BSP starts executing immediately, no?

So maybe two stages for vcpu reset:  first to reset and halt it, then 
start it.  pic and ioapic reset can be performed in between.

-- 
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] Windows XP Pro 64 installation issues with kvm-45 onIntel host

2007-10-09 Thread François Delawarde
Dong, Eddie wrote:
> [EMAIL PROTECTED] wrote:
>   
>> Hello,
>>
>> Trying to install Windows XP Pro 64bits, the first phase goes
>> quite well (except
>> that it uses 100% of host's cpu), but crashes when trying to
>> reboot with the
>> following message:
>>
>> unhandled vm exit:  0x8021
>> rax 0095b9e5 rbx 0095b9c0 rcx 0095b9e5 rdx
>> 0600 rsi f883f200 rdi f800011a6960 rsp
>>  rbp fadfeb886a10 r8   r9 
>> 0100 r10 0095b9e5 r11 0080 r12
>>  r13  r14  r15
>>  rip  rflags 00023002 
>> cs 1000 (0001/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
>> ds  (/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
>> es  (/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
>> ss  (/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
>> fs  (/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
>> gs  (/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
>> tr  (30c0/2088 p 1 dpl 0 db 0 s 0 type b l 0 g 0 avl 0)
>> ldt  (/ p 1 dpl 0 db 0 s 0 type 2 l 0 g 0 avl 0)
>> gdt 0/ idt 0/
>> cr0 6010 cr2 fadfead016a0 cr3 2f941000 cr4 0 cr8 0 efer 0
>> ./bin/install_windowsxp64.sh: line 12:  6486 Aborted  sudo nice
>> -n -5 qemu-system-x86_64 -smp 2 -m 768 -localtime -net nic
>> -net user -hda $DISC
>> -cdrom $CDROM -boot d -usb --usbdevice tablet
>>
>> It then hangs (no host cpu usage, no mouse movement in guest)
>> after a while on
>> second installation phase after a manual reboot.
>>
>>
>> Trying from zero with -no-kvm-irqchip, it gives a windows blue
>> screen (host cpu
>> at 100%) when trying to reboot with the following message for if
>> anyone understands those windows things:
>>
>> STOP: 0x001E
>> (0xC096,0xF80001071924,0x,0xFFF
>> FFADFEB5BD450) 
>>
>> After manual reboot, installation also hangs at some point
>>
>> Host: debian lenny, kernel 2.6.21-6
>> Processor: Intel(R) Pentium(R) D CPU 3.00GHz
>> KVM: 45
>>
>> If you want further debug information, I'd be pleased to help.
>>
>>
>> Thanks,
>> François.
>>
>> 
> Seems to be a known issue for SMP reboot. Are u installing with SMP enabled?
> thx,eddie
>   
Yes, SMP is enabled. I will try tonight without SMP.

Is this only an Intel issue?

Is there an attempt to fix this or does that suppose to many changes for 
the issue to be corrected now?

Thanks for answering,
François.

-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] global TSS?

2007-10-09 Thread Dong, Eddie

Avi:
It seems we are using global TSS, and init_rmode_tss will modify
the table each time when VCPU is reset. Should we move to per CPU TSS
for correct real mode emulation?
thx,eddie

-
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/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] [PATCH] kvm: bios: decrease the cpu counts in ACPI table to 15

2007-10-09 Thread Yang, Sheng
>From dc4cc1a804d9f7705648bdee3d7152054da8dea8 Mon Sep 17 00:00:00 2001
From: Sheng Yang <[EMAIL PROTECTED]>
Date: Tue, 9 Oct 2007 16:22:08 +0800
Subject: [PATCH] kvm: bios: decrease the cpu counts in ACPI table to 15

It seems Windows 2000 only support no more than 15 cpus in ACPI table,
otherwise it will cause a BSOD of KMODE_EXCEPTION_NOT_HANDLED.

This patch decrease the cpu counts in ACPI table from 16 to 15.
---
 bios/acpi-dsdt.dsl |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/bios/acpi-dsdt.dsl b/bios/acpi-dsdt.dsl
index 2ef4118..df255ce 100755
--- a/bios/acpi-dsdt.dsl
+++ b/bios/acpi-dsdt.dsl
@@ -42,7 +42,6 @@ DefinitionBlock (
 Processor (CPUC, 0x0c, 0xb010, 0x06) {}
 Processor (CPUD, 0x0d, 0xb010, 0x06) {}
 Processor (CPUE, 0x0e, 0xb010, 0x06) {}
-Processor (CPUF, 0x0f, 0xb010, 0x06) {}
 }
 
 Scope (\)
-- 
1.5.2


0001-kvm-bios-decrease-the-cpu-counts-in-ACPI-table-to.patch
Description: 0001-kvm-bios-decrease-the-cpu-counts-in-ACPI-table-to.patch
-
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/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kvm-45 problems

2007-10-09 Thread Zhao, Yunfeng
We run some booting multiple guest tests in our nightly testing.
Like booting two UP windows guests, booting one UP linux guest and one UP 
windows guest, and booting 4 UP linux guests.
The first two cases have no problem in our testing.
And booting 4 UP linux guests may crash host, but this problem doesn't happen 
very time. If the problem didn't happen, linux guest can be log in without any 
problem.

For smp guest, we meet a problem that booting linux guest with 4 vcpus causes 
soft lock error on host. Once this error happened, qemu process also could not 
be killed.

Our linux guests are using 2.6.9, 2.6.16, and 2.6.23 kernels.

Thanks
Yunfeng


>-Original Message-
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of Farkas Levente
>Sent: 2007年10月9日 14:45
>To: Dong, Eddie
>Cc: kvm-devel
>Subject: Re: [kvm-devel] kvm-45 problems
>
>Dong, Eddie wrote:
>> [EMAIL PROTECTED] wrote:
>>> hi,
>>> i'm just try kvm-45. for me it still unusable, so switch back
>>> to kvm-36:-(
>>> setup:
>>> - host: centos-5 x86-64 (4 core, 8gb ram)
>>> - guest:
>>>  - centos-5 i386   4 cpu, 2gb
>>>  - centos-5 x86-64 4 cpu, 1gb
>>>  - mandrake-9 i586 2 cpu, 1gb
>>>  - winxp 32bit1gb
>>> the problems:
>>> after start the above setup none of the guest be able to boot until
>>> login screen (except winxp?:-( i attached the guest's virt-manager
>>> screenshots. the worse thing comes when i try to stop the guests.
>>> virt-manager crash. after that i try to kill qemu-kvm's but it was
>>> simple not possible!:-( -
>>> Ignoring de-assert INIT to vcpu 0
>>> Ignoring de-assert INIT to vcpu 1
>>> vcpu 1 received sipi with vector # 10
>>> vcpu 2 received sipi with vector # 10
>>> vcpu 3 received sipi with vector # 10
>>> kvm: emulating exchange as write
>>> vcpu 1 received sipi with vector # 3
>>> vcpu 2 received sipi with vector # 3
>>> vcpu 3 received sipi with vector # 3
>>> vcpu 1 received sipi with vector # 10
>>> vcpu 2 received sipi with vector # 10
>>> vcpu 3 received sipi with vector # 10
>>> vcpu 1 received sipi with vector # 10
>>> vcpu 1 received sipi with vector # 6
>>> vcpu 2 received sipi with vector # 6
>>> vcpu 3 received sipi with vector # 6
>>> -
>>> in the host dmesg:
>>> -
>>> Ignoring de-assert INIT to vcpu 1
>>> SIPI to vcpu 1 vector 0x06
>>> vcpu 1 received sipi with vector # 6
>>> SIPI to vcpu 1 vector 0x06
>>> Ignoring de-assert INIT to vcpu 2
>>> SIPI to vcpu 2 vector 0x06
>>> vcpu 2 received sipi with vector # 6
>>> SIPI to vcpu 2 vector 0x06
>>> Ignoring de-assert INIT to vcpu 3
>>> SIPI to vcpu 3 vector 0x06
>>> vcpu 3 received sipi with vector # 6
>>> SIPI to vcpu 3 vector 0x06
>>> -
>>> so try to reboot, but the host crash during the shutdown (i've no
>>> screenshot of this and the important part are scrolled up), so
>>> reset:-( on the host console: the strange thing that after i reboot
>>> and replace all guest to 1 cpu all of the guests boot except the
>>> centos-i386 which also hang (may be because this is the only guest
>>> which has 2gb ram assigned?) but i still not able to login to them
>>> (except winxp), ie. after boot neither from console nor from remote i
>>> can't connect it's looks like guests are frozen, but there is nothing
>>> on the host console or log files.
>>> so i revert to kvm-36 which working with 1cpu/guest.
>>> my real question i do something wrong or just no one use more cpu and
>>> more guest on such and old kernel as centos's
>>> 2.6.18-8.1.14.el5:-( or my
>>> hardware are so strange?
>>>
>> Did u try above configuration in KVM-36 (i.e. multiple guest + SMP)?
>
>smp is not working in kmv-36, but multiple guest with single cpu is stable.
>
>--
>  Levente   "Si vis pacem para bellum!"
>
>-
>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/
>___
>kvm-devel mailing list
>kvm-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/kvm-devel

-
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/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel