Re: [kvm-devel] kvm+virtmanager can't save machine state?

2007-07-02 Thread Uri Lublin
Actually, although not intended (and was not tested), KVM's migration 
capability enables save/restore of non-qcow images.
I used it to debug the migration code.
Please look at the bottom of http://kvm.qumranet.com/kvmwiki/Migration 
("savevm/loadvm to an external state file").
BTW, my little trick also works for "live" savevm/loadvm (kids don't try 
this at home).
Hope that helps,
Uri.

Daniel P. Berrange wrote:
> On Fri, Jun 29, 2007 at 04:05:22PM +0800, youhongyu wrote:
>   
>> hi all,
>>
>> i use: fc7, built in xen, kvm.
>> i boot my machine into normal kernal and install a guest os by vir-manager, 
>> and i encounter a strange situation  the "save" command from virtual-
>> manager menu failed! it pop out a small windows seem want to tell me 
>> something, but it quickly disappeared. what's thing happens?
>> 
>
> The window shouldn't have disappeared like that - it should have told
> you that this isn't supported
>
> We can't support save/restore of  KVM guests in virt-manager at this
> time. QEMU 0.9.0 was really very unhelpful and removed the ability specify
> a filename for saving VM state, assuming that everyone happens to be using
> a qcow file :-( Not much use if you are using raw files, or physical volumes,
> or LVM which are the primary storage types used in virt-manager currently.
>
> Dan.
>   

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


[kvm-devel] opening windows from linux (using kvm) in full screen by default

2007-07-02 Thread Mark Ryden
Hello,
I have FC7 with windows 2003 installed under it using kvm.

I know that by alt/ctrl/f you can toggle the windows 2003 screen so
that it will be full screen or not.

My question is:
I am launching windows 2003 from linux by
"/usr/local/kvm/bin/qemu-system-x86_64 . -hda vdisk.img -cdrom
/dev/hdb -no-acpi -boot d -m 384".

It does not launch in full screem.

Is there some way to cause it to open by default in full screen ?

Regards,
Mark

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


Re: [kvm-devel] opening windows from linux (using kvm) in full screen by default

2007-07-02 Thread Luca
On 7/2/07, Mark Ryden <[EMAIL PROTECTED]> wrote:
> My question is:
> I am launching windows 2003 from linux by
> "/usr/local/kvm/bin/qemu-system-x86_64 . -hda vdisk.img -cdrom
> /dev/hdb -no-acpi -boot d -m 384".

-full-screen and, please, man pages exist for a reason ;)

Luca

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


Re: [kvm-devel] breaking kvm :-)

2007-07-02 Thread Arnd Bergmann
On Saturday 30 June 2007, ron minnich wrote:
> Somebody here at OLS was asking me about linuxbios on kvm. Well, that
> was too much to resist.
> 
> Short form: it works, uses a grub-like interface that does not use
> BIOS callbacks. It's noticeably faster to boot than Bochs. I realize
> that it's all pretty fast but linuxbios is 32-bit code, so there is
> pretty much no emulation to worry about.

Very nice. I'm curious though since I've never used Linuxbios before:
what operating systems can it load? Only Linux, anything that comes
as an ELF image, or even proprietary operating systems?

Arnd <><


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


Re: [kvm-devel] breaking kvm :-)

2007-07-02 Thread ron minnich
On 7/2/07, Arnd Bergmann <[EMAIL PROTECTED]> wrote:

> Very nice. I'm curious though since I've never used Linuxbios before:
> what operating systems can it load? Only Linux, anything that comes
> as an ELF image, or even proprietary operating systems?


pretty soon, anything grub can load. For now, ELF arbitrary elf images.

ron

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


[kvm-devel] kvm-27 host oopses

2007-07-02 Thread Dave Hansen
I had a host running kvm-27 oops on me last week.  The system had been
up for about 2 weeks, and had probably run and stopped at least a couple
hundred kvm guests.  I don't think it is very reproducible, but here it
is anyway.  The host is running 2.6.20.4.  

Here's the actual BUG_ON() that was hit:

static void *mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc,
size_t size)
{
void *p;

BUG_ON(!mc->nobjs);
p = mc->objects[--mc->nobjs];
memset(p, 0, size);
return p;
}

There were several oopses in there, but I think probably on the first
one is of any real interest.

Jun 29 06:40:45 elm3b173 kernel: [982460.818197] [ cut here 
]
Jun 29 06:40:45 elm3b173 kernel: [982460.827716] kernel BUG at 
/home/dave/kvm-27/kernel/mmu.c:276!
Jun 29 06:40:45 elm3b173 kernel: [982460.841230] invalid opcode:  [1] SMP 
Jun 29 06:40:45 elm3b173 kernel: [982460.849587] CPU 0 
Jun 29 06:40:45 elm3b173 kernel: [982460.853928] Modules linked in: kvm_intel 
kvm aic94xx
Jun 29 06:40:45 elm3b173 kernel: [982460.864257] Pid: 11430, comm: 
qemu-system-x86 Not tainted 2.6.20.4 #6
Jun 29 06:40:45 elm3b173 kernel: [982460.877419] RIP: 
0010:[_end+124740199/2127394328]  [_end+124740199/2127394328] 
:kvm:mmu_memory_cache_alloc+0xf/0x40
Jun 29 06:40:45 elm3b173 kernel: [982460.896268] RSP: 0018:810129485548  
EFLAGS: 00010246
Jun 29 06:40:45 elm3b173 kernel: [982460.907199] RAX:  RBX: 
8101d49cf820 RCX: 0002
Jun 29 06:40:45 elm3b173 kernel: [982460.921831] RDX:  RSI: 
0050 RDI: 8101f9ad24e8
Jun 29 06:40:45 elm3b173 kernel: [982460.936469] RBP: 810129485558 R08: 
 R09: 
Jun 29 06:40:45 elm3b173 kernel: [982460.951101] R10: 8100504f4000 R11: 
1000 R12: 8101f9ad2128
Jun 29 06:40:45 elm3b173 kernel: [982460.965739] R13:  R14: 
8101f9ad1990 R15: 8101f9ad2128
Jun 29 06:40:45 elm3b173 kernel: [982460.980375] FS:  2ba55b51fa00() 
GS:807d4000() knlGS:
Jun 29 06:40:45 elm3b173 kernel: [982460.996918] CS:  0010 DS: 002b ES: 002b 
CR0: 80050033
Jun 29 06:40:45 elm3b173 kernel: [982461.008690] CR2: b7f3e884 CR3: 
0001d37b CR4: 26e0
Jun 29 06:40:45 elm3b173 kernel: [982461.023339] Process qemu-system-x86 (pid: 
11430, threadinfo 810129484000, task 8102172900c0)
Jun 29 06:40:45 elm3b173 kernel: [982461.041972] Stack:  810088fd31e0 
8101d49cf820 810129485588 8801f1d8
Jun 29 06:40:45 elm3b173 kernel: [982461.058500]  81019896fefc 
8101d49cf820 0322 270d
Jun 29 06:40:45 elm3b173 kernel: [982461.073776]  8101294855c8 
8801f5ea  8101f9ad2128
Jun 29 06:40:45 elm3b173 kernel: [982461.088592] Call Trace:
Jun 29 06:40:45 elm3b173 kernel: [982461.094248]  [_end+124741616/2127394328] 
:kvm:kvm_mmu_alloc_page+0x38/0x110
Jun 29 06:40:45 elm3b173 kernel: [982461.107243]  [_end+124742658/2127394328] 
:kvm:kvm_mmu_get_page+0xda/0x150
Jun 29 06:40:45 elm3b173 kernel: [982461.119888]  [_end+124744897/2127394328] 
:kvm:mmu_alloc_roots+0xf9/0x190
Jun 29 06:40:45 elm3b173 kernel: [982461.132360]  [_end+124745400/2127394328] 
:kvm:paging_new_cr3+0x30/0x60
Jun 29 06:40:45 elm3b173 kernel: [982461.144467]  [_end+124724233/2127394328] 
:kvm:set_cr3+0xb1/0xd0
Jun 29 06:40:45 elm3b173 kernel: [982461.155369]  [_end+124818018/2127394328] 
:kvm_intel:handle_cr+0xba/0x1d0
Jun 29 06:40:45 elm3b173 kernel: [982461.167839]  [_end+124819078/2127394328] 
:kvm_intel:kvm_handle_exit+0x7e/0xb0
Jun 29 06:40:45 elm3b173 kernel: [982461.181163]  [_end+124819740/2127394328] 
:kvm_intel:vmx_vcpu_run+0x224/0x2d0
Jun 29 06:40:45 elm3b173 kernel: [982461.194314]  [_end+124732211/2127394328] 
:kvm:kvm_vcpu_ioctl_run+0xfb/0x140
Jun 29 06:40:45 elm3b173 kernel: [982461.207305]  [_end+124736555/2127394328] 
:kvm:kvm_vcpu_ioctl+0x113/0x420
Jun 29 06:40:45 elm3b173 kernel: [982461.219779]  [__alloc_pages+100/768] 
__alloc_pages+0x64/0x300
Jun 29 06:40:45 elm3b173 kernel: [982461.231031]  [find_busiest_group+673/1856] 
find_busiest_group+0x2a1/0x740
Jun 29 06:40:45 elm3b173 kernel: [982461.243319]  
[find_next_zero_string+39/128] find_next_zero_string+0x27/0x80
Jun 29 06:40:45 elm3b173 kernel: [982461.255772]  [iommu_range_alloc+40/208] 
iommu_range_alloc+0x28/0xd0
Jun 29 06:40:45 elm3b173 kernel: [982461.267531]  [iommu_alloc+134/208] 
iommu_alloc+0x86/0xd0
Jun 29 06:40:45 elm3b173 kernel: [982461.278256]  [calgary_map_single+75/128] 
calgary_map_single+0x4b/0x80
Jun 29 06:40:45 elm3b173 kernel: [982461.290199]  
[tg3_start_xmit_dma_bug+1215/1344] tg3_start_xmit_dma_bug+0x4bf/0x540
Jun 29 06:40:45 elm3b173 kernel: [982461.303175]  [dev_hard_start_xmit+131/256] 
dev_hard_start_xmit+0x83/0x100
Jun 29 06:40:45 elm3b173 kernel: [982461.315457]  [__qdisc_run+83/480] 
__qdisc_run+0x53/0x1e0
Jun 29 

Re: [kvm-devel] kvm-27 host oopses

2007-07-02 Thread Luca
On 7/2/07, Dave Hansen <[EMAIL PROTECTED]> wrote:
> I had a host running kvm-27 oops on me last week.  The system had been
> up for about 2 weeks, and had probably run and stopped at least a couple
> hundred kvm guests.  I don't think it is very reproducible, but here it
> is anyway.  The host is running 2.6.20.4.
>
> Here's the actual BUG_ON() that was hit:
>
> static void *mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc,
> size_t size)
> {
> void *p;
>
> BUG_ON(!mc->nobjs);
> p = mc->objects[--mc->nobjs];
> memset(p, 0, size);
> return p;
> }

MMU working memory was exhausted during a guest context switch. It has
been fixed by:

KVM: Lazy guest cr3 switching
4b82b37a35a085a07d9ed84efee06c69655fd3d1

which is included in KVM-28.

Luca

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


Re: [kvm-devel] kvm-27 host oopses

2007-07-02 Thread Avi Kivity
Dave Hansen wrote:
> I had a host running kvm-27 oops on me last week.  The system had been
> up for about 2 weeks, and had probably run and stopped at least a couple
> hundred kvm guests.  I don't think it is very reproducible, but here it
> is anyway.  The host is running 2.6.20.4.  
> :kvm:kvm_mmu_alloc_page+0x38/0x110
> Jun 29 06:40:45 elm3b173 kernel: [982461.107243]  [_end+124742658/2127394328] 
> :kvm:kvm_mmu_get_page+0xda/0x150
> Jun 29 06:40:45 elm3b173 kernel: [982461.119888]  [_end+124744897/2127394328] 
> :kvm:mmu_alloc_roots+0xf9/0x190
> Jun 29 06:40:45 elm3b173 kernel: [982461.132360]  [_end+124745400/2127394328] 
> :kvm:paging_new_cr3+0x30/0x60
> Jun 29 06:40:45 elm3b173 kernel: [982461.144467]  [_end+124724233/2127394328] 
> :kvm:set_cr3+0xb1/0xd0
> Jun 29 06:40:45 elm3b173 kernel: [982461.155369]  [_end+124818018/2127394328] 
> :kvm_intel:handle_cr+0xba/0x1d0
>   

That's fixed in kvm-28 (4b82b37a35a085a07d9ed84efee06c69655fd3d1).


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


Re: [kvm-devel] kvm-27 host oopses

2007-07-02 Thread Dave Hansen
On Mon, 2007-07-02 at 20:58 +0200, Luca wrote:
> 
> MMU working memory was exhausted during a guest context switch. It has
> been fixed by:
> 
> KVM: Lazy guest cr3 switching
> 4b82b37a35a085a07d9ed84efee06c69655fd3d1
> 
> which is included in KVM-28. 

OK, I'll give kvm-28 a shot.  Thanks for the help!

-- Dave


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


[kvm-devel] [PATCH] fix gcc 3.x issue

2007-07-02 Thread Dave Hansen
I've been getting compile errors lately with gcc 3.x compiling kvm 27
and 28:


gcc -I /home/dave/kvm/kvm-28/kernel/include -MMD -MF test/.access.d -g 
-fomit-frame-pointer -Wall -m64 -nostdlib -o test/access.flat 
-Wl,-T,flat.lds test/access.o test/cstart64.o test/printf.o test/print.o 
test/smp.o
test/print.o: In function `print':
/home/dave/kvm/kvm-28/user/test/print.S:19: undefined reference to 
`PSEUDO_SERIAL_PORT'
collect2: ld returned 1 exit status

Looking at 'gcc -E' output, you can see the problem:

...
.globl print
print:
push %rax
push %rsi
push %rdx

mov %rdi, %rsi
mov $PSEUDO_SERIAL_PORT, %edx

The PSEUDO_SERIAL_PORT macro isn't getting expanded for some reason.
However, it works in gcc 4.1.  The following patch fixes it for me. 

--- kvm-28/user/test/print.S.orig   2007-07-02 12:57:02.0 -0700
+++ kvm-28/user/test/print.S2007-07-02 12:57:14.0 -0700
@@ -16,7 +16,7 @@
push %rdx
 
mov %rdi, %rsi
-   mov $PSEUDO_SERIAL_PORT, %edx
+   mov $(PSEUDO_SERIAL_PORT), %edx
 
 putchar:
cmpb $0, (%rsi)

-- Dave


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


[kvm-devel] maybe pxeboot doesnt work in kvm-28

2007-07-02 Thread Peter Skogström
Hi

I cant get pxeboot to work in kvm-28. I built kvm-28 on ubuntu 7.04
(feisty) and everything has worked great. But when testing pxeboot with:

/usr/local/kvm/bin/qemu -net nic,vlan=0 -net
tap,vlan=0,script=/etc/qemu-ifup2,ifname=foo kvm-stuff/etch.qcow2.img
-boot n


It doesnt work. It boots c instead. But with -no-kvm it works and also a
separate qemu works without trouble. I can file a bug, but it would be
great if some more can test pxe first to confirm the behaviour.

I use pxelinux 3.51 against a debian server (sarge).

qemu-ifup2:

#!/bin/sh
sudo /sbin/ifconfig $1 0.0.0.0 promisc up
sudo /usr/sbin/brctl addif br0 $1

Standard qemu networking with bridge.

regards

//Peter
-- 

bitrunner

0708-460260
Andra Långgatan 28
41327 Göteborg
Sweden

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


Re: [kvm-devel] In kernel PIC support: kernel patch

2007-07-02 Thread Avi Kivity
Dong, Eddie wrote:
> Here is the updated patch with all comments fixed.
>
>
> Meanwhile I enabled SVM support by copying code from Xen and  managed to
> find an AMD box to have a shoot, it works!
> Please also find the svm patch.
>
>
>
>
>  drivers/kvm/kvm_irq.c  |   59 ++
>  drivers/kvm/kvm_irq.h  |   64 ++
>   

These can be named as irq.c and irq.h.  No need for the kvm prefix.

> +void kvm_pic_set_irq_new(void *opaque, int irq, int level)
>   

Remove _new from the name.  It's just an artifact of qemu's development 
history; we don't need it.

> +
> +int kvm_pic_read_irq(struct kvm_pic *s)
> +{
> + int irq, irq2, intno;
> +
> + irq = pic_get_irq(&s->pics[0]);
> + if (irq >= 0) {
> + pic_intack(&s->pics[0], irq);
> + if (irq == 2) {
> + irq2 = pic_get_irq(&s->pics[1]);
> + if (irq2 >= 0) {
> + pic_intack(&s->pics[1], irq2);
> + } else {
> + /*
> +  * spurious IRQ on slave controller
> +  */
> + irq2 = 7;
> + }
>   

A few braces can be removed here.


> +
> +static uint32_t pic_poll_read(struct kvm_pic_state *s, uint32_t addr1)
>   

u32

> +static uint32_t pic_ioport_read(void *opaque, uint32_t addr1)
>   

here too, and a few other places.

> +
> +static void picdev_write(struct kvm_io_device *this,
> +  gpa_t addr, int len, const void *val)
> +{
> + struct kvm_pic *s = this->private;
> + unsigned char data = *(unsigned char *)val;
> +
> + if (len != 1) {
> + printk(KERN_ERR "PIC: non byte write\n");
> + return;
> + }
>   

This can be used to spam the host kernel log, if the guest issues lots 
of nonbyte accesses.  You can use printk_ratelimit() or something 
similar.  This goes for the read function too.

>  
> +struct kvm_pic;
>  struct kvm {
>   spinlock_t lock; /* protects everything except vcpus */
>   int naliases;
> @@ -456,8 +457,19 @@ struct kvm {
>   struct file *filp;
>   struct kvm_io_bus mmio_bus;
>   struct kvm_io_bus pio_bus;
> + struct kvm_pic *vpic;
>  };
>   

Why not include it inline and avoid the pointer dereference?

>  
> +static inline struct kvm_pic *pic_irqchip(struct kvm *kvm)
> +{
> + return kvm->vpic;
> +}
> +
> +static inline int irqchip_in_kernel(struct kvm *kvm)
> +{
> + return pic_irqchip(kvm) != 0;
> +}
>   

That's why...

>   }
> + case KVM_CREATE_PIC:
> + r = -ENOMEM;
> + kvm->vpic = kvm_create_pic(kvm);
> + if (kvm->vpic) {
> + r = 0;
> + }
>   

braces.  also, the usual logic is to 'goto out' if an error occured.

>  };
>  
> +/* for KVM_SET_IRQ_LEVEL */
> +struct kvm_irq_level {
> + __u32 irq;
> + __u32 level;
> +};
>   

Please add an irqchip index, so this can be used for configurations with 
multiple irqchips (likely ioapics).  You'll also need to add padding so 
the structure is 64-bit aligned.

Other than these minor issues, the patch looks fine.


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


Re: [kvm-devel] kvm+virtmanager can't save machine state?

2007-07-02 Thread Anthony Liguori
Uri Lublin wrote:
> Actually, although not intended (and was not tested), KVM's migration 
> capability enables save/restore of non-qcow images.
> I used it to debug the migration code.
> Please look at the bottom of http://kvm.qumranet.com/kvmwiki/Migration 
> ("savevm/loadvm to an external state file").
> BTW, my little trick also works for "live" savevm/loadvm (kids don't try 
> this at home).
>   

One of these days, I plan on implementing a checkpoint:// protocol that 
always "fails" and does a live savevm to disk without shutting down the VM.

Regards,

Anthony Liguori

> Hope that helps,
> Uri.
>
> Daniel P. Berrange wrote:
>   
>> On Fri, Jun 29, 2007 at 04:05:22PM +0800, youhongyu wrote:
>>   
>> 
>>> hi all,
>>>
>>> i use: fc7, built in xen, kvm.
>>> i boot my machine into normal kernal and install a guest os by vir-manager, 
>>> and i encounter a strange situation  the "save" command from virtual-
>>> manager menu failed! it pop out a small windows seem want to tell me 
>>> something, but it quickly disappeared. what's thing happens?
>>> 
>>>   
>> The window shouldn't have disappeared like that - it should have told
>> you that this isn't supported
>>
>> We can't support save/restore of  KVM guests in virt-manager at this
>> time. QEMU 0.9.0 was really very unhelpful and removed the ability specify
>> a filename for saving VM state, assuming that everyone happens to be using
>> a qcow file :-( Not much use if you are using raw files, or physical volumes,
>> or LVM which are the primary storage types used in virt-manager currently.
>>
>> Dan.
>>   
>> 
>
> -
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> ___
> kvm-devel mailing list
> kvm-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>
>   


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


[kvm-devel] [PATCH] Fix network boot while KVM is enabled

2007-07-02 Thread Anthony Liguori
While QEMU can remap portions of physical ram to a higher address in
phys_ram_base, KVM requires that the memory be present where it would be in
physical memory.  Make sure to copy the option ROMs to the right space in
physical memory when KVM is enabled.

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

diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c
index eda49cf..a6e4ea1 100644
--- a/qemu/hw/pc.c
+++ b/qemu/hw/pc.c
@@ -558,14 +558,20 @@ static void pc_init1(int ram_size, int vga_ram_size, int 
boot_device,
 
 option_rom_offset = 0;
 for (i = 0; i < nb_option_roms; i++) {
-   int offset = bios_offset + bios_size + option_rom_offset;
+   int offset = bios_size + option_rom_offset;
int size;
 
-   size = load_image(option_rom[i], phys_ram_base + offset);
+   size = load_image(option_rom[i], phys_ram_base + bios_offset + offset);
if ((size + option_rom_offset) > 0x1) {
fprintf(stderr, "Too many option ROMS\n");
exit(1);
}
+
+   if (kvm_allowed)
+   memcpy(phys_ram_base + 0xc + offset,
+  phys_ram_base + bios_offset + offset,
+  size);
+
cpu_register_physical_memory(0xd + option_rom_offset,
 size, offset | IO_MEM_ROM);
option_rom_offset += size + 2047;

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


Re: [kvm-devel] maybe pxeboot doesnt work in kvm-28

2007-07-02 Thread Anthony Liguori
Peter Skogström wrote:
> Hi
>
> I cant get pxeboot to work in kvm-28. I built kvm-28 on ubuntu 7.04
> (feisty) and everything has worked great. But when testing pxeboot with:
>   

I was able to reproduce and fix your problem.  Let me know if you have 
any problems with the patch I posted.

Regards,

Anthony Liguori

> /usr/local/kvm/bin/qemu -net nic,vlan=0 -net
> tap,vlan=0,script=/etc/qemu-ifup2,ifname=foo kvm-stuff/etch.qcow2.img
> -boot n
>
>
> It doesnt work. It boots c instead. But with -no-kvm it works and also a
> separate qemu works without trouble. I can file a bug, but it would be
> great if some more can test pxe first to confirm the behaviour.
>
> I use pxelinux 3.51 against a debian server (sarge).
>
> qemu-ifup2:
>
> #!/bin/sh
> sudo /sbin/ifconfig $1 0.0.0.0 promisc up
> sudo /usr/sbin/brctl addif br0 $1
>
> Standard qemu networking with bridge.
>
> regards
>
> //Peter
>   


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


[kvm-devel] [PATCH] Make sure to sync registers in monitor/gdbstub (v2)

2007-07-02 Thread Anthony Liguori
This patch adds support to gdbstub and the monitor to sync CPU state before
and after the user views/changes it.  I also added kvm_allowed guards to
kvm_{load,save}_registers.  I chose to do it here so that callers didn't need
to use the guards.  We should probably provide nop implementations so that
#ifdef USE_KVM guards aren't required either.

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

diff --git a/qemu/gdbstub.c b/qemu/gdbstub.c
index c33a66e..a3b82af 100644
--- a/qemu/gdbstub.c
+++ b/qemu/gdbstub.c
@@ -30,6 +30,7 @@
 #include "qemu.h"
 #else
 #include "vl.h"
+#include "qemu-kvm.h"
 #endif
 
 #include "qemu_socket.h"
@@ -871,6 +872,9 @@ static int gdb_handle_packet(GDBState *s, CPUState *env, 
const char *line_buf)
 addr = strtoull(p, (char **)&p, 16);
 #if defined(TARGET_I386)
 env->eip = addr;
+#ifdef USE_KVM
+   kvm_load_registers(env);
+#endif
 #elif defined (TARGET_PPC)
 env->nip = addr;
 #elif defined (TARGET_SPARC)
@@ -893,6 +897,9 @@ static int gdb_handle_packet(GDBState *s, CPUState *env, 
const char *line_buf)
 addr = strtoul(p, (char **)&p, 16);
 #if defined(TARGET_I386)
 env->eip = addr;
+#ifdef USE_KVM
+   kvm_load_registers(env);
+#endif
 #elif defined (TARGET_PPC)
 env->nip = addr;
 #elif defined (TARGET_SPARC)
@@ -940,6 +947,9 @@ static int gdb_handle_packet(GDBState *s, CPUState *env, 
const char *line_buf)
 }
 break;
 case 'g':
+#ifdef USE_KVM
+   kvm_save_registers(env);
+#endif
 reg_size = cpu_gdb_read_registers(env, mem_buf);
 memtohex(buf, mem_buf, reg_size);
 put_packet(s, buf);
@@ -949,6 +959,9 @@ static int gdb_handle_packet(GDBState *s, CPUState *env, 
const char *line_buf)
 len = strlen(p) / 2;
 hextomem((uint8_t *)registers, p, len);
 cpu_gdb_write_registers(env, mem_buf, len);
+#ifdef USE_KVM
+   kvm_load_registers(env);
+#endif
 put_packet(s, "OK");
 break;
 case 'm':
diff --git a/qemu/monitor.c b/qemu/monitor.c
index ed8473c..de8d1ea 100644
--- a/qemu/monitor.c
+++ b/qemu/monitor.c
@@ -25,9 +25,8 @@
 #include "disas.h"
 #include 
 
-#if USE_KVM
 #include "qemu-kvm.h"
-#endif
+
 //#define DEBUG
 //#define DEBUG_COMPLETION
 
@@ -258,6 +257,11 @@ CPUState *mon_get_cpu(void)
 if (!mon_cpu) {
 mon_set_cpu(0);
 }
+
+#ifdef USE_KVM
+kvm_save_registers(mon_cpu);
+#endif
+
 return mon_cpu;
 }
 
@@ -2253,15 +2257,6 @@ static void monitor_handle_command(const char *cmdline)
 goto fail;
 }
 
-#ifdef USE_KVM
-if(1)
-{
-CPUState *env=mon_get_cpu();
-if (kvm_allowed)
-kvm_save_registers(env);
-}
-#endif
-
 switch(nb_args) {
 case 0:
 cmd->handler();
diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index 1849997..68a6ea5 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -441,12 +441,14 @@ static void pre_kvm_run(void *opaque, int vcpu)
 
 void kvm_load_registers(CPUState *env)
 {
-load_regs(env);
+if (kvm_allowed)
+   load_regs(env);
 }
 
 void kvm_save_registers(CPUState *env)
 {
-save_regs(env);
+if (kvm_allowed)
+   save_regs(env);
 }
 
 int kvm_cpu_exec(CPUState *env)

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


Re: [kvm-devel] [PATCH] Make sure to sync registers in monitor/gdbstub

2007-07-02 Thread Anthony Liguori
Avi Kivity wrote:
> Anthony Liguori wrote:
>   
>> This patch adds support to gdbstub and the monitor to sync CPU state before
>> and after the user views/changes it.
>>
>> Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]>
>>
>> diff --git a/qemu/gdbstub.c b/qemu/gdbstub.c
>> index c33a66e..a3b82af 100644
>> --- a/qemu/gdbstub.c
>> +++ b/qemu/gdbstub.c
>> @@ -30,6 +30,7 @@
>>  #include "qemu.h"
>>  #else
>>  #include "vl.h"
>> +#include "qemu-kvm.h"
>>  #endif
>>  
>>  #include "qemu_socket.h"
>> @@ -871,6 +872,9 @@ static int gdb_handle_packet(GDBState *s, CPUState *env, 
>> const char *line_buf)
>>  addr = strtoull(p, (char **)&p, 16);
>>  #if defined(TARGET_I386)
>>  env->eip = addr;
>> +#ifdef USE_KVM
>> +kvm_load_registers(env);
>> +#endif
>>   
>> 
>
> You need some if (kvm_allowed) checks in there, no?
>   

Yup, new patch sent.

Regards,

Anthony Liguori

>
> -
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> ___
> kvm-devel mailing list
> kvm-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>
>   


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


Re: [kvm-devel] [PATCH] fix gcc 3.x issue

2007-07-02 Thread Avi Kivity
Dave Hansen wrote:
> I've been getting compile errors lately with gcc 3.x compiling kvm 27
> and 28:
>
>
> gcc -I /home/dave/kvm/kvm-28/kernel/include -MMD -MF test/.access.d -g 
> -fomit-frame-pointer -Wall -m64 -nostdlib -o test/access.flat 
> -Wl,-T,flat.lds test/access.o test/cstart64.o test/printf.o test/print.o 
> test/smp.o
> test/print.o: In function `print':
> /home/dave/kvm/kvm-28/user/test/print.S:19: undefined reference to 
> `PSEUDO_SERIAL_PORT'
> collect2: ld returned 1 exit status
>
>   

Applied, thanks.


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


Re: [kvm-devel] [PATCH] Fix network boot while KVM is enabled

2007-07-02 Thread Avi Kivity
Anthony Liguori wrote:
> While QEMU can remap portions of physical ram to a higher address in
> phys_ram_base, KVM requires that the memory be present where it would be in
> physical memory.  Make sure to copy the option ROMs to the right space in
> physical memory when KVM is enabled.
>
> Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]>
>
> diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c
> index eda49cf..a6e4ea1 100644
> --- a/qemu/hw/pc.c
> +++ b/qemu/hw/pc.c
> @@ -558,14 +558,20 @@ static void pc_init1(int ram_size, int vga_ram_size, 
> int boot_device,
>  
>  option_rom_offset = 0;
>  for (i = 0; i < nb_option_roms; i++) {
> - int offset = bios_offset + bios_size + option_rom_offset;
> + int offset = bios_size + option_rom_offset;
>   int size;
>  
> - size = load_image(option_rom[i], phys_ram_base + offset);
> + size = load_image(option_rom[i], phys_ram_base + bios_offset + offset);
>   if ((size + option_rom_offset) > 0x1) {
>   fprintf(stderr, "Too many option ROMS\n");
>   exit(1);
>   }
> +
> + if (kvm_allowed)
> + memcpy(phys_ram_base + 0xc + offset,
> +phys_ram_base + bios_offset + offset,
> +size);
> +
>   cpu_register_physical_memory(0xd + option_rom_offset,
>size, offset | IO_MEM_ROM);
>   

#ifdef USE_KVM is needed here.


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


Re: [kvm-devel] [PATCH] Make sure to sync registers in monitor/gdbstub (v2)

2007-07-02 Thread Avi Kivity
Anthony Liguori wrote:
> This patch adds support to gdbstub and the monitor to sync CPU state before
> and after the user views/changes it.  I also added kvm_allowed guards to
> kvm_{load,save}_registers.  I chose to do it here so that callers didn't need
> to use the guards.  We should probably provide nop implementations so that
> #ifdef USE_KVM guards aren't required either.
>
>   

Applied, thanks.

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


Re: [kvm-devel] [PATCH] Fix network boot while KVM is enabled

2007-07-02 Thread Anthony Liguori
Avi Kivity wrote:
> Anthony Liguori wrote:
>> While QEMU can remap portions of physical ram to a higher address in
>> phys_ram_base, KVM requires that the memory be present where it would 
>> be in
>> physical memory.  Make sure to copy the option ROMs to the right 
>> space in
>> physical memory when KVM is enabled.
>>
>> Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]>
>>
>> diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c
>> index eda49cf..a6e4ea1 100644
>> --- a/qemu/hw/pc.c
>> +++ b/qemu/hw/pc.c
>> @@ -558,14 +558,20 @@ static void pc_init1(int ram_size, int 
>> vga_ram_size, int boot_device,
>>   option_rom_offset = 0;
>>  for (i = 0; i < nb_option_roms; i++) {
>> -int offset = bios_offset + bios_size + option_rom_offset;
>> +int offset = bios_size + option_rom_offset;
>>  int size;
>>  
>> -size = load_image(option_rom[i], phys_ram_base + offset);
>> +size = load_image(option_rom[i], phys_ram_base + bios_offset + 
>> offset);
>>  if ((size + option_rom_offset) > 0x1) {
>>  fprintf(stderr, "Too many option ROMS\n");
>>  exit(1);
>>  }
>> +
>> +if (kvm_allowed)
>> +memcpy(phys_ram_base + 0xc + offset,
>> +   phys_ram_base + bios_offset + offset,
>> +   size);
>> +
>>  cpu_register_physical_memory(0xd + option_rom_offset,
>>   size, offset | IO_MEM_ROM);
>>   
>
> #ifdef USE_KVM is needed here.

I thought a patch was recently submitted that made kvm_allowed not 
depend on USE_KVM?  If not, do you have a problem with one?

Regards,

Anthony Liguori



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


Re: [kvm-devel] [PATCH] Fix network boot while KVM is enabled

2007-07-02 Thread Avi Kivity
Anthony Liguori wrote:
>>>   
>>
>> #ifdef USE_KVM is needed here.
>
> I thought a patch was recently submitted that made kvm_allowed not 
> depend on USE_KVM?  

I must have missed it, or forgotten.

> If not, do you have a problem with one?
>


It serves as a delimiter of what code we introduced, but then, I guess a 
diff against pristine qemu does the same job better.  I guess we can do 
this to non performance critical sections (which could well be all of them).


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


Re: [kvm-devel] In kernel PIC support: kernel patch

2007-07-02 Thread Dong, Eddie

>> +/* for KVM_SET_IRQ_LEVEL */
>> +struct kvm_irq_level {
>> +__u32 irq;
>> +__u32 level;
>> +};
>> 
> 
> Please add an irqchip index, so this can be used for
> configurations with
> multiple irqchips (likely ioapics).  You'll also need to add
> padding so
> the structure is 64-bit aligned.
> 
Adding irqchip index is one way, another way is to just use gsi index
(probably rename irq to gsi). I.e. In X86, gsi 0-15 is for both PIC and
IOAPIC
 and gsi 16-23 is for IOAPIC0 only, gsi 24---xxx can be for ioapic 1,2,
.. n.

In IA64, gsi 0-xxx is just for IOAPIC 0,1, .. n.

Since ACPI already defined gsi, so do we really want to use irqchip
index? 
They are functionally equvalent but gsi is cross architecture neutral,
while
irqchip index is very X86 specific.

Eddie

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