Re: [kvm-devel] [Qemu-devel] [PATCH 2/6] PCI DMA API (v2)

2008-04-05 Thread Blue Swirl
On 4/5/08, Anthony Liguori <[EMAIL PROTECTED]> wrote:
> This patch introduces a PCI DMA API and some generic code to support other DMA
>  APIs.  It introduces a IOVector type that contains physical address/length
>  pairs.  These vectors can be translated by the PCI layer and passed either to
>  generic copying functions or directly to the block or network subsystems.

But cpu_map_physical_page can't be the correct function for
translation for every case. To support Sparc IOMMU and DMA controller
I need a way to call a series of different translation functions
depending on the bus where we are. For the byte swapping case the
memcpy functions must be dynamic as well.

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] problem using kvm-guest-drivers

2008-04-05 Thread Dennis Jacobfeuerborn
Nikola Ciprich wrote:
> Hello,
> I'm trying to get virtio_blk working, but I can't figure what am I doing
> wrong...

You'll probably have to build a new initrd image in the guest adding the 
following options to the mkinitrd call:
"--with=virtio_pci --with=virtio_blk"

This makes sure that the guest will find the virtual devices when booting.

If you use LVM volume groups in the guest then you also need to make sure 
that you use a *very* recent version of the lvm2 package (not older than a 
month) because older versions don't scan the virtual block devices for 
volume groups due to a name change.

Regards,
   Dennis

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] problem using kvm-guest-drivers

2008-04-05 Thread Anthony Liguori
Nikola Ciprich wrote:
> Hello,
> I'm trying to get virtio_blk working, but I can't figure what am I doing 
> wrong...
> First thing I do not really understand is what kernels are supported, as 
> in README file it is written:
>
> Where /path/to/kernel is the path to a recent kernel tree containing 
> virtio drivers.  At the moment, this must be Rusty Russell's virtio patch 
> queue[1] applied on top of Linus' git tree[2].
>   

This is meant for when you're building the guest drivers from source.  
If you just download a tarball, this step is unnecessary.

> and few lines later:
>
> Supported Kernels
> -
> 2.6.24, 2.6.23, 2.6.22, 2.6.21, 2.6.20, 2.6.19, 2.6.18
>
> anyways, I'm not able to get it working either on 2.6.24, or latest GIT 
> with rusty's patches.
>
> If I run kvm with
> ... -drive file=/some/file,if=virtio and then load virtio_blk inside it, I 
> simply don't see any new block device appear.
>
> What am I doing wrong?
>
> Oh and I'm using kvm-64 with 2.6.24 for host.
>   

Make sure you have virtio_pci loaded in the guest.

Regards,

Anthony Liguori

> Thanks a lot in advance for any hints.
>
> BR
> nik
>
>
> -
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
> Register now and save $200. Hurry, offer ends at 11:59 p.m., 
> Monday, April 7! Use priority code J8TLD2. 
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> ___
> kvm-devel mailing list
> kvm-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>   


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] problem using kvm-guest-drivers

2008-04-05 Thread Nikola Ciprich
Hello,
I'm trying to get virtio_blk working, but I can't figure what am I doing 
wrong...
First thing I do not really understand is what kernels are supported, as 
in README file it is written:

Where /path/to/kernel is the path to a recent kernel tree containing 
virtio drivers.  At the moment, this must be Rusty Russell's virtio patch 
queue[1] applied on top of Linus' git tree[2].

and few lines later:

Supported Kernels
-
2.6.24, 2.6.23, 2.6.22, 2.6.21, 2.6.20, 2.6.19, 2.6.18

anyways, I'm not able to get it working either on 2.6.24, or latest GIT 
with rusty's patches.

If I run kvm with
... -drive file=/some/file,if=virtio and then load virtio_blk inside it, I 
simply don't see any new block device appear.

What am I doing wrong?

Oh and I'm using kvm-64 with 2.6.24 for host.

Thanks a lot in advance for any hints.

BR
nik


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] [patch 2/4] QEMU/KVM: save and load mp state

2008-04-05 Thread Marcelo Tosatti
Use the new ioctl's to save and restore the MP_STATE for all vcpu's.

Fixes SMP migration.

Signed-off-by: Marcelo Tosatti <[EMAIL PROTECTED]>

Index: kvm-userspace.io/libkvm/libkvm.c
===
--- kvm-userspace.io.orig/libkvm/libkvm.c
+++ kvm-userspace.io/libkvm/libkvm.c
@@ -776,6 +776,17 @@ int kvm_set_sregs(kvm_context_t kvm, int
 return ioctl(kvm->vcpu_fd[vcpu], KVM_SET_SREGS, sregs);
 }
 
+int kvm_get_mpstate(kvm_context_t kvm, int vcpu, int *mpstate)
+{
+return ioctl(kvm->vcpu_fd[vcpu], KVM_GET_MP_STATE, mpstate);
+}
+
+int kvm_set_mpstate(kvm_context_t kvm, int vcpu, int *mpstate)
+{
+return ioctl(kvm->vcpu_fd[vcpu], KVM_SET_MP_STATE, mpstate);
+}
+
+
 static int handle_mmio(kvm_context_t kvm, struct kvm_run *kvm_run)
 {
unsigned long addr = kvm_run->mmio.phys_addr;
Index: kvm-userspace.io/libkvm/libkvm.h
===
--- kvm-userspace.io.orig/libkvm/libkvm.h
+++ kvm-userspace.io/libkvm/libkvm.h
@@ -301,6 +301,18 @@ int kvm_get_sregs(kvm_context_t kvm, int
 int kvm_set_sregs(kvm_context_t kvm, int vcpu, struct kvm_sregs *regs);
 
 /*!
+ *  * \brief Read VCPU MP state
+ *
+ */
+int kvm_get_mpstate(kvm_context_t kvm, int vcpu, int *mpstate);
+
+/*!
+ *  * \brief Write VCPU MP state
+ *
+ */
+int kvm_set_mpstate(kvm_context_t kvm, int vcpu, int *mpstate);
+
+/*!
  * \brief Simulate an external vectored interrupt
  *
  * This allows you to simulate an external vectored interrupt.
Index: kvm-userspace.io/qemu/qemu-kvm-x86.c
===
--- kvm-userspace.io.orig/qemu/qemu-kvm-x86.c
+++ kvm-userspace.io/qemu/qemu-kvm-x86.c
@@ -282,6 +282,15 @@ void kvm_arch_load_regs(CPUState *env)
 perror("kvm_set_msrs FAILED");
 }
 
+void kvm_save_mpstate(CPUState *env)
+{
+kvm_get_mpstate(kvm_context, env->cpu_index, &env->mp_state);
+}
+
+void kvm_load_mpstate(CPUState *env)
+{
+kvm_set_mpstate(kvm_context, env->cpu_index, &env->mp_state);
+}
 
 void kvm_arch_save_regs(CPUState *env)
 {
Index: kvm-userspace.io/qemu/qemu-kvm.h
===
--- kvm-userspace.io.orig/qemu/qemu-kvm.h
+++ kvm-userspace.io/qemu/qemu-kvm.h
@@ -18,6 +18,8 @@ int kvm_init_ap(void);
 void kvm_qemu_destroy(void);
 void kvm_load_registers(CPUState *env);
 void kvm_save_registers(CPUState *env);
+void kvm_load_mpstate(CPUState *env);
+void kvm_save_mpstate(CPUState *env);
 int kvm_cpu_exec(CPUState *env);
 int kvm_update_debugger(CPUState *env);
 int kvm_qemu_init_env(CPUState *env);
Index: kvm-userspace.io/qemu/target-i386/cpu.h
===
--- kvm-userspace.io.orig/qemu/target-i386/cpu.h
+++ kvm-userspace.io/qemu/target-i386/cpu.h
@@ -599,6 +599,7 @@ typedef struct CPUX86State {
 /* in order to simplify APIC support, we leave this pointer to the
user */
 struct APICState *apic_state;
+int mp_state;
 } CPUX86State;
 
 CPUX86State *cpu_x86_init(const char *cpu_model);
Index: kvm-userspace.io/qemu/vl.c
===
--- kvm-userspace.io.orig/qemu/vl.c
+++ kvm-userspace.io/qemu/vl.c
@@ -6655,8 +6655,10 @@ void cpu_save(QEMUFile *f, void *opaque)
 uint32_t hflags;
 int i;
 
-if (kvm_enabled())
+if (kvm_enabled()) {
 kvm_save_registers(env);
+kvm_save_mpstate(env);
+}
 
 for(i = 0; i < CPU_NB_REGS; i++)
 qemu_put_betls(f, &env->regs[i]);
@@ -6748,6 +6750,7 @@ void cpu_save(QEMUFile *f, void *opaque)
 qemu_put_be32s(f, &env->kvm_interrupt_bitmap[i]);
 }
 qemu_put_be64s(f, &env->tsc);
+qemu_put_be32s(f, &env->mp_state);
 }
 }
 
@@ -6899,7 +6902,9 @@ int cpu_load(QEMUFile *f, void *opaque, 
 qemu_get_be32s(f, &env->kvm_interrupt_bitmap[i]);
 }
 qemu_get_be64s(f, &env->tsc);
+qemu_get_be32s(f, &env->mp_state);
 kvm_load_registers(env);
+kvm_load_mpstate(env);
 }
 return 0;
 }

-- 


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] [patch 0/4] fix SMP migration and savevm/loadvm

2008-04-05 Thread Marcelo Tosatti

-- 


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] [patch 1/4] QEMU/KVM: only use KVM apic registers if vm is running

2008-04-05 Thread Marcelo Tosatti
In the -incoming case the apic regs are not initialized and therefore
bogus.

Signed-off-by: Marcelo Tosatti <[EMAIL PROTECTED]>

Index: kvm-userspace.io/qemu/qemu-kvm-x86.c
===
--- kvm-userspace.io.orig/qemu/qemu-kvm-x86.c
+++ kvm-userspace.io/qemu/qemu-kvm-x86.c
@@ -27,6 +27,8 @@ static int kvm_has_msr_star;
 
 static int lm_capable_kernel;
 
+extern int vm_running;
+
 int kvm_arch_qemu_create_context(void)
 {
 int i;
@@ -248,7 +250,7 @@ void kvm_arch_load_regs(CPUState *env)
 sregs.cr3 = env->cr[3];
 sregs.cr4 = env->cr[4];
 
-if (kvm_irqchip_in_kernel(kvm_context)) {
+if (kvm_irqchip_in_kernel(kvm_context) && vm_running) {
 sregs.cr8 = kvm_get_cr8(kvm_context, env->cpu_index);
 sregs.apic_base = kvm_get_apic_base(kvm_context, env->cpu_index);
 } else {

-- 


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] [patch 4/4] QEMU/KVM: dont read any bits from userspace APIC emulation if its done in-kernel

2008-04-05 Thread Marcelo Tosatti
Fixes loadvm/savem on SMP.

Signed-off-by: Marcelo Tosatti <[EMAIL PROTECTED]>

Index: kvm-userspace.io/qemu/hw/apic.c
===
--- kvm-userspace.io.orig/qemu/hw/apic.c
+++ kvm-userspace.io/qemu/hw/apic.c
@@ -248,8 +248,11 @@ void cpu_set_apic_base(CPUState *env, ui
 #ifdef DEBUG_APIC
 printf("cpu_set_apic_base: %016" PRIx64 "\n", val);
 #endif
-s->apicbase = (val & 0xf000) |
-(s->apicbase & (MSR_IA32_APICBASE_BSP | MSR_IA32_APICBASE_ENABLE));
+if (kvm_enabled() && qemu_kvm_irqchip_in_kernel())
+s->apicbase = val;
+else
+s->apicbase = (val & 0xf000) |
+(s->apicbase & (MSR_IA32_APICBASE_BSP | MSR_IA32_APICBASE_ENABLE));
 /* if disabled, cannot be enabled again */
 if (!(val & MSR_IA32_APICBASE_ENABLE)) {
 s->apicbase &= ~MSR_IA32_APICBASE_ENABLE;

-- 


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] [patch 3/4] QEMU/KVM: ignore SIG_IPI signals in userspace

2008-04-05 Thread Marcelo Tosatti
Otherwise a signal can be received in userspace and a vcpu goes back
to the kernel while it should stay still.

Signed-off-by: Marcelo Tosatti <[EMAIL PROTECTED]>

Index: kvm-userspace.io/qemu/qemu-kvm.c
===
--- kvm-userspace.io.orig/qemu/qemu-kvm.c
+++ kvm-userspace.io/qemu/qemu-kvm.c
@@ -350,7 +350,6 @@ static void *ap_main_loop(void *_env)
 vcpu->env = env;
 vcpu->env->thread_id = kvm_get_thread_id();
 sigfillset(&signals);
-sigdelset(&signals, SIG_IPI);
 sigprocmask(SIG_BLOCK, &signals, NULL);
 kvm_create_vcpu(kvm_context, env->cpu_index);
 kvm_qemu_init_env(env);

-- 


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] extboot usage?

2008-04-05 Thread Anthony Liguori
Jun Koi wrote:
> On 4/4/08, Anthony Liguori <[EMAIL PROTECTED]> wrote:
>   
>> Jun Koi wrote:
>>
>> 
>>> On 4/4/08, Laurent Vivier <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>>   
  Le vendredi 04 avril 2008 à 18:29 +0900, Jun Koi a écrit :



 
> On 4/3/08, Anthony Liguori <[EMAIL PROTECTED]> wrote:
>
>
>   
  > > Jun Koi wrote:
  > >
  > > > Hi,
  > > >
  > > > Could someone please post some concret examples on how to use
 
>> extboot?
>> 
  > > > I looked around, but saw nothing.
  > > >
  > > >
  > >
  > >  Just append boot=on to your -drive parameter.
  > >
  >
  > OK, but the question is that when I need to have "boot=on"? Because
  > without it (or "boot=off"), -drive still works in some cases, right?


 You need extboot when you want to boot from a disk which is not managed
  by IDE controller.


 
>>> I see, thanks.
>>>
>>> in extboot.S, I see some dead code, like the macro "callout". Perhaps
>>> it is there for testing. It is better to get rid of it.
>>>
>>>
>>>   
>>  It's debug code and it's not compiled in unless it's used so there's no
>> point in eliminating it.  I personally do not enjoy rewriting 16-bit
>> assembly code :-)
>> 
>
> I understand your feeling :-)
>
> BTW, in the send_command code we have something like this:
>
> push %ax
> mov 2(%bx), %ax
> pop %ax
>
> Just doesnt look right to me.
>   

Yeah, that looks like remnants of debug code to me.  Feel free to submit 
a patch to remove it if you'd like.

Regards,

Anthony Liguori

> Thanks,
> Jun
>
>   
>>  Regards,
>>
>>  Anthony Liguori
>>
>>
>> 
>>> Thanks,
>>> Jun
>>>
>>>
>>>   
>> 


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] extboot usage?

2008-04-05 Thread Jun Koi
On 4/4/08, Anthony Liguori <[EMAIL PROTECTED]> wrote:
> Jun Koi wrote:
>
> > On 4/4/08, Laurent Vivier <[EMAIL PROTECTED]> wrote:
> >
> >
> > >  Le vendredi 04 avril 2008 à 18:29 +0900, Jun Koi a écrit :
> > >
> > >
> > >
> > > > On 4/3/08, Anthony Liguori <[EMAIL PROTECTED]> wrote:
> > > >
> > > >
> > >  > > Jun Koi wrote:
> > >  > >
> > >  > > > Hi,
> > >  > > >
> > >  > > > Could someone please post some concret examples on how to use
> extboot?
> > >  > > > I looked around, but saw nothing.
> > >  > > >
> > >  > > >
> > >  > >
> > >  > >  Just append boot=on to your -drive parameter.
> > >  > >
> > >  >
> > >  > OK, but the question is that when I need to have "boot=on"? Because
> > >  > without it (or "boot=off"), -drive still works in some cases, right?
> > >
> > >
> > > You need extboot when you want to boot from a disk which is not managed
> > >  by IDE controller.
> > >
> > >
> >
> > I see, thanks.
> >
> > in extboot.S, I see some dead code, like the macro "callout". Perhaps
> > it is there for testing. It is better to get rid of it.
> >
> >
>
>  It's debug code and it's not compiled in unless it's used so there's no
> point in eliminating it.  I personally do not enjoy rewriting 16-bit
> assembly code :-)

I understand your feeling :-)

BTW, in the send_command code we have something like this:

push %ax
mov 2(%bx), %ax
pop %ax

Just doesnt look right to me.

Thanks,
Jun

>
>
>  Regards,
>
>  Anthony Liguori
>
>
> > Thanks,
> > Jun
> >
> >
>
>

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] [ kvm-Bugs-1935481 ] unhandled vm exit: 0x80000021 vcpu_id 0

2008-04-05 Thread SourceForge.net
Bugs item #1935481, was opened at 2008-04-05 22:07
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=893831&aid=1935481&group_id=180599

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: intel
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Balaji Rao R (balajirrao)
Assigned to: Nobody/Anonymous (nobody)
Summary: unhandled vm exit: 0x8021 vcpu_id 0

Initial Comment:
Win Vista Ultimate 32 bit does not work. It works fine with -no-kvm. No 
problems during installation. Problem surfaces only on first boot.

bash-3.2# qemu-system-x86_64 -m 1536 -hda vista.img 
unhandled vm exit: 0x8021 vcpu_id 0
rax 0010 rbx 0080 rcx  rdx 
0080
rsi 0026b238 rdi 0008b238 rsp 0200 rbp 
1f20
r8   r9   r10  r11 

r12  r13  r14  r15 

rip 009b rflags 00023002
cs b000 (002b/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
ds 0020 (0200/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
es 0020 (0200/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
ss 0020 (0200/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
fs 0020 (0200/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
gs 0020 (0200/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
tr  (fffbd000/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 2b/27
idt 0/3ff
cr0 10 cr2 0 cr3 0 cr4 0 cr8 0 efer 0
Aborted


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=893831&aid=1935481&group_id=180599

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kernel BUG at drivers/virtio/virtio_ring.c:218!

2008-04-05 Thread Balaji Rao
On Friday 04 April 2008 01:46:21 pm Balaji Rao wrote:
> Hi Rusty,
> 
> I hit a bug in virtio_ring.c:218 when I was stressing virtio_net using kvm 
> with -smp 4.
> 
> static void vring_disable_cb(struct virtqueue *_vq)
> {
> struct vring_virtqueue *vq = to_vvq(_vq);
> 
> START_USE(vq);
> -->BUG_ON(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT);
> vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT;
> END_USE(vq);
> }
> 
> Going through the source code, I felt that this BUG_ON is not required as any 
> CPU could race and call disable_cb when one 
> cpu still believes that its enabled. To validate my understanding, I 
> commented out the BUG_ON and everything worked 
> perfectly well.
> 
> I also get a lot of "Unlikely: restart svq race" on my console. Under high 
> load conditions, a race could occur very often 
> and I'm not sure if that signals a buggy situation. We could printk_ratelimit 
> if at all we need to retain it.
> 
> If you agree, I'll send a patch to this.
> 
Christian Borntraeger CCed.

BTW, this is with respect to kvm.git, not a version prior to 

commit 4265f161b6bb7b31163671329b1142b9023bf4e3
Author: Christian Borntraeger <[EMAIL PROTECTED]>
Date:   Fri Mar 14 14:17:05 2008 +0100

virtio: fix race in enable_cb


The above commit does not fix the problem.I see this oops even today. There is 
a race happening between calls to enable_cb 
and disable_cb.
-- 
regards,
Balaji Rao
Dept. of Mechanical Engineering,
National Institute of Technology Karnataka, India

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] [ kvm-Bugs-1935336 ] guest Windows 2008 Server 64-bit Install crashes

2008-04-05 Thread SourceForge.net
Bugs item #1935336, was opened at 2008-04-05 13:10
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=893831&aid=1935336&group_id=180599

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Danyel Ceccaldi (danyelceccaldi)
Assigned to: Nobody/Anonymous (nobody)
Summary: guest Windows 2008 Server 64-bit Install crashes

Initial Comment:
CPU: Intel(R) Core(TM)2 Duo CPU T7700  @ 2.40GHz
kvm version: build 64
host kernel: 2.6.22-14-generic, x86_64
guest: Windows Server 2008, 64 Bit
guest image: 6001.18000.080118-1840_amd64fre_Server_en-us-KRMSXFRE_EN_DVD.iso
kvm commandline: kvm -m 1000 -smp 2 -net nic,model=rtl8139 -net user -cdrom 
/dev/cdrom -boot d windows.img
(the windows install iso image has been burnt onto dvd, and dvd is in dvd drive)

the vm is starting up, a windows installer progress bar appears "windows 
loading files". It completes to 100% and between there and before the next 
screen can be seen, the vm crashes with the output below:

unhandled vm exit: 0xb
rax 0002 rbx f8000a576f00 rcx 4742444b rdx 
f8000a576f00
rsi f80009e50158 rdi  rsp f8000bfaae20 rbp 

r8  0330 r9  f8000bfaaf08 r10 f8000a578680 r11 
0002
r12 f80009e50100 r13 f8000a631300 r14  r15 
f8000bfaafc0
rip f8000a846cda rflags 0082
cs 0010 (/ p 1 dpl 0 db 0 s 1 type b l 1 g 0 avl 0)
ds 002b (/ p 1 dpl 3 db 1 s 1 type 3 l 0 g 1 avl 0)
es 002b (/ p 1 dpl 3 db 1 s 1 type 3 l 0 g 1 avl 0)
ss  (/ p 0 dpl 0 db 0 s 0 type 0 l 0 g 0 avl 0)
fs 0053 (/3c00 p 1 dpl 3 db 1 s 1 type 3 l 0 g 0 avl 0)
gs 0060 (f8000a578500/ p 1 dpl 0 db 0 s 1 type 3 l 0 g 0 avl 0)
tr 0040 (f8000bfa4070/0067 p 1 dpl 0 db 0 s 0 type b l 0 g 0 avl 0)
ldt  (/ p 0 dpl 0 db 0 s 0 type 0 l 0 g 0 avl 0)
gdt f8000bfa3000/6f
idt f8000bfa3070/fff
cr0 e0050031 cr2 0 cr3 2dc000 cr4 6a0 cr8 2 efer d01
Aborted (core dumped)

serial.log is empty.

The problem does not occur using the -no-kvm switch.
with no-kvm the progress bar progresses much more smooth/continuous compared to 
using kvm.


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=893831&aid=1935336&group_id=180599

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] Luxury leather products and watches at a steal

2008-04-05 Thread sharette
Go deep sea diving with this immaculate masterpiece and wow your fellow divers. 
http://www.terniaglo.com/

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] idle load

2008-04-05 Thread Antoine Martin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Dor Laor wrote:
| On Fri, 2008-03-28 at 23:41 +, Antoine Martin wrote:
| Hi,
|
| Guests seem to be doing a lot of timer related polling, is there any way
| to reduce that (which would reduce load on the host):
|
|
|> It's weird we don't see any ioctl in the middle, are you sure kvm
|> modules are loaded?
Ooops, the guest I traced was started before loading them...
Here is one that got started after (sorry for the line noise):

select(5, [0 4], [], [], {0, 0})= 0 (Timeout)
select(0, [], NULL, NULL, {0, 0})   = 0 (Timeout)
clock_gettime(CLOCK_MONOTONIC, {1685112, 356558791}) = 0
ioctl(5, 0x4008ae61, 0x7fff4f1caff0)= 0
ioctl(5, 0x4008ae61, 0x7fff4f1caff0)= 0
ioctl(5, 0x4008ae61, 0x7fff4f1caff0)= 0
ioctl(5, 0x4008ae61, 0x7fff4f1caff0)= 0
clock_gettime(CLOCK_MONOTONIC, {1685112, 356664879}) = 0
clock_gettime(CLOCK_MONOTONIC, {1685112, 356683016}) = 0
clock_gettime(CLOCK_MONOTONIC, {1685112, 356703393}) = 0
timer_gettime(0x1, {it_interval={0, 0}, it_value={0, 0}}) = 0
timer_settime(0x1, 0, {it_interval={0, 0}, it_value={0, 1900}},
NULL) = 0
ioctl(6, 0xae80, 0) = 0
ioctl(6, 0xae80, 0) = 0
clock_gettime(CLOCK_MONOTONIC, {1685112, 356829961}) = 0
ioctl(5, 0x4008ae61, 0x7fff4f1cb160)= 0
clock_gettime(CLOCK_MONOTONIC, {1685112, 356866505}) = 0
clock_gettime(CLOCK_MONOTONIC, {1685112, 356886845}) = 0
timer_gettime(0x1, {it_interval={0, 0}, it_value={0, 18844990}}) = 0
ioctl(6, 0xae80, 0) = 0
clock_gettime(CLOCK_MONOTONIC, {1685112, 356959171}) = 0
ioctl(6, 0xae80, 0) = 0
ioctl(6, 0xae80, 0) = 0
clock_gettime(CLOCK_MONOTONIC, {1685112, 357036644}) = 0
ioctl(5, 0x4008ae61, 0x7fff4f1cb160)= 0
clock_gettime(CLOCK_MONOTONIC, {1685112, 357072651}) = 0
clock_gettime(CLOCK_MONOTONIC, {1685112, 357092946}) = 0
timer_gettime(0x1, {it_interval={0, 0}, it_value={0, 18639127}}) = 0
timer_settime(0x1, 0, {it_interval={0, 0}, it_value={0, 9158000}}, NULL) = 0
ioctl(6, 0xae80, 0) = 0
ioctl(6, 0xae80, 0) = 0
clock_gettime(CLOCK_MONOTONIC, {1685112, 357235274}) = 0
ioctl(5, 0x4008ae61, 0x7fff4f1cb160)= 0
clock_gettime(CLOCK_MONOTONIC, {1685112, 357271483}) = 0
clock_gettime(CLOCK_MONOTONIC, {1685112, 357293651}) = 0
timer_gettime(0x1, {it_interval={0, 0}, it_value={0, 8985696}}) = 0
ioctl(6, 0xae80, 0) = 0
ioctl(6, 0xae80, 0) = 0
clock_gettime(CLOCK_MONOTONIC, {1685112, 357386790}) = 0
ioctl(5, 0x4008ae61, 0x7fff4f1cb160)= 0
clock_gettime(CLOCK_MONOTONIC, {1685112, 357422880}) = 0
clock_gettime(CLOCK_MONOTONIC, {1685112, 357442799}) = 0

|
|> Another thing to do is run with -clock=[unix|rtc]

What about -clock dynticks?
Isn't that going to reduce unnecessary calls?

Cheers
Antoine
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREKAAYFAkf3PvIACgkQGK2zHPGK1rtVfgCcDqdt8zWS//HEUPHdVf9I+2t9
650AnjLM9HOOqyk/Rqsev4vQmXII37jr
=1f+t
-END PGP SIGNATURE-

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] Ubuntu Gutsy host / XP guest / -smp 2

2008-04-05 Thread Avi Kivity
David Abrahams wrote:
> on Wed Apr 02 2008, Avi Kivity  wrote:
>
>   
>> David Abrahams wrote:
>> 
>>> With the title combination, the guest takes nearly 100% of my real CPU
>>> time and still only sees one CPU.  Is this a known problem, and does it
>>> have a known solution?
>>>
>>>   
>>>   
>> Can you send the output of 'kvm_stat -1'?  
>> 
>
> $ ./kvm_stat -1
> exits5919444 74219
> halt_exits   1746937 59420
> invlpg 0 0
> io_exits 2181506  6569
> irq_exits  23055   335
> irq_window  283977
> mmio_exits200851 0
> pf_fixed 1160592  6251
> pf_guest   43473   396
> request_irq0 0
> signal_exits   24838   281
> tlb_flush  37381  1132
>
>   

Versions of kvm producing this sort of output are common in 
archaeological digs.  Please try a more recent release.

>> What HAL do you see in device manager?
>> 
> "Standard PC"
>
>   

This HAL does not support SMP.  You need the "ACPI Multiprocessor PC" 
HAL or some such.

Unless you have a recent Intel processor, the combination of SMP and 
Windows XP will give noticeably lower performance.  I recommend sticking 
with uniprocessor in such cases.

-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH] Fix external module install for new host kernels

2008-04-05 Thread Avi Kivity
Anthony Liguori wrote:
> KVM kernel modules are now located in arch/x86/kvm so make sure to rename 
> those
> too.
>
>   

Applied, thanks.  Though the kvm provided with 2.6.25 should be good 
enough for most uses.

-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel