Re: [kvm-devel] hugetlbfs

2008-04-10 Thread Yunfeng Zhao
Dor Laor wrote:
 On Wed, 2008-04-09 at 17:26 +0800, Yunfeng Zhao wrote:
   
 Hi,
 I meet problem to get hugetlbfs work on my test box.
 If i added --mem-path to qemu, the guest will always fail to boot with 
 the error messages below printed on qemu console:
 ###
 ata0 master: ATA-0 Hard-Disk (  0 MBytes)
 ata1 master: ATAPI-0 Device

 Booting from Hard Disk .
 Booting from Hard Disk failed: could not read the boot disk
 ##

 And I checked my system, hugepages has been enabled.
 [EMAIL PROTECTED] ~]# grep -i huge /proc/meminfo
 HugePages_Total:   100
 HugePages_Free: 96
 HugePages_Rsvd:  0
 Hugepagesize: 2048 kB

 [EMAIL PROTECTED] ~]# mount
 /dev/sda1 on / type ext3 (rw)
 none on /dev/shm type tmpfs (rw,size=4G)
 nodev on /hugepages type hugetlbfs (rw)
 /dev/sda3 on /share type ext2 (rw)
 /dev/sda2 on /mnt/sda2 type ext3 (rw)

 The command i am using:
 qemu -m 256 -monitor pty -net 
 nic,macaddr=00:16:3e:48:d4:aa,model=rtl8139 -net 
 tap,script=/etc/kvm/qemu-ifup -hda /dev/sda --mem-path /hugepages/

 If I remove --mem-path, the guest can be booted up.

 

 You have only 96 free 2MB pages, it is less then 256M you asked for the
 VM.
 you can do 'echo 200  /proc/sys/vm/nr_hugepages'
 HTH,
 Dor
   
I tried to enable 512MB pages, and then to boot 256M guest. It still 
fails with the same error.

thanks
Yunfeng
   
 Anybody knows what the problem is?

 thanks
 Yunfeng

 -
 This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
 Don't miss this year's exciting event. There's still time to save $100. 
 Use priority code J8TL2D2. 
 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 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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] PCI Passthrough support for KVM

2008-04-10 Thread Amit Shah

This patchset introduces PCI passthrough support for KVM.

This has been tested with an Ethernet device. The device is
seen in the guest and interrupts are generated. However, no
data transfer can take place unless pvdma or reserved-ram
is used. The patches for pvdma will be available shortly.

Sharing of interrupt line for the PCI device on the host side
will cause slowness (and / or some glitches). Also, proper
locking isn't in place yet. Single VMs exploiting this feature
run well though.

There also is a git repository for you to explore:

git-pull git://git.kernel.org/pub/scm/linux/kernel/git/amit/kvm.git
git-pull git://git.kernel.org/pub/scm/linux/kernel/git/amit/kvm-userspace.git

Comments, feedback welcome.

Amit.

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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/1] QEMU/KVM: Support for PCI Passthrough

2008-04-10 Thread Amit Shah
We can assign a device from the host machine to a guest.

A new command-line option, -pcidevice is added.
For example, to invoke it for an Ethernet device sitting at
PCI bus:dev.fn 04:08.0 with host IRQ 18, use this:

-pcidevice Ethernet/04:08.0-18

The host ethernet driver is to be removed before doing the passthrough.

If kvm uses the in-kernel irqchip, interrupts are routed to
the guest via the kvm module (accompanied kernel changes are necessar).
If -no-kvm-irqchip is used, the 'irqhook' module, also included here,
is to be used.

Signed-off-by: Amit Shah [EMAIL PROTECTED]
---
 Makefile  |   10 +-
 irqhook/Kbuild|3 +
 irqhook/Makefile  |   25 ++
 irqhook/irqhook_main.c|  215 ++
 kernel/Makefile   |4 +
 libkvm/libkvm-x86.c   |   14 +-
 libkvm/libkvm.h   |   24 ++
 qemu/Makefile.target  |1 +
 qemu/hw/apic.c|2 +
 qemu/hw/isa.h |2 +
 qemu/hw/pc.c  |4 +
 qemu/hw/pci-passthrough.c |  677 +
 qemu/hw/pci-passthrough.h |  102 +++
 qemu/hw/pci.c |   11 +
 qemu/hw/pci.h |1 +
 qemu/hw/piix_pci.c|   19 ++
 qemu/vl.c |   16 +
 tools/pci_barsize.c   |   53 
 tools/pci_mmio.c  |   82 ++
 19 files changed, 1260 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 76c149a..1a98c0b 100644
--- a/Makefile
+++ b/Makefile
@@ -5,16 +5,16 @@ DESTDIR=
 
 rpmrelease = devel
 
-.PHONY: kernel user libkvm qemu bios vgabios extboot clean libfdt
+.PHONY: kernel irqhook user libkvm qemu bios vgabios extboot clean libfdt
 
 all: libkvm qemu
 ifneq '$(filter $(ARCH), x86_64 i386 ia64)' ''
-all: $(if $(WANT_MODULE), kernel) user
+all: $(if $(WANT_MODULE), kernel irqhook) user
 endif
 
 kcmd = $(if $(WANT_MODULE),,@\#)
 
-qemu kernel user libkvm:
+qemu kernel user irqhook libkvm:
$(MAKE) -C $@
 
 qemu: libkvm
@@ -66,6 +66,7 @@ install-rpm:
 
 install:
$(kcmd)make -C kernel DESTDIR=$(DESTDIR) install
+   $(kcmd)make -C irqhook DESTDIR=$(DESTDIR) install
make -C libkvm DESTDIR=$(DESTDIR) install
make -C qemu DESTDIR=$(DESTDIR) install
 
@@ -86,6 +87,7 @@ srpm:
tar czf $(RPMTOPDIR)/SOURCES/user.tar.gz user
tar czf $(RPMTOPDIR)/SOURCES/libkvm.tar.gz libkvm
tar czf $(RPMTOPDIR)/SOURCES/kernel.tar.gz kernel
+   tar czf $(RPMTOPDIR)/SOURCES/irqhook.tar.gz irqhook
tar czf $(RPMTOPDIR)/SOURCES/scripts.tar.gz scripts
tar czf $(RPMTOPDIR)/SOURCES/extboot.tar.gz extboot
cp Makefile configure kvm_stat $(RPMTOPDIR)/SOURCES
@@ -93,7 +95,7 @@ srpm:
$(RM) $(tmpspec)
 
 clean:
-   for i in $(if $(WANT_MODULE), kernel) user libkvm qemu libfdt; do \
+   for i in $(if $(WANT_MODULE), kernel irqhook) user libkvm qemu libfdt; 
do \
make -C $$i clean; \
done
 
diff --git a/irqhook/Kbuild b/irqhook/Kbuild
new file mode 100644
index 000..9af75a4
--- /dev/null
+++ b/irqhook/Kbuild
@@ -0,0 +1,3 @@
+EXTRA_CFLAGS := -I$(src)/include
+obj-m := irqhook.o
+irqhook-objs := irqhook_main.o
diff --git a/irqhook/Makefile b/irqhook/Makefile
new file mode 100644
index 000..3b1d851
--- /dev/null
+++ b/irqhook/Makefile
@@ -0,0 +1,25 @@
+include ../config.mak
+
+KVERREL = $(patsubst /lib/modules/%/build,%,$(KERNELDIR))
+
+DESTDIR=
+
+INSTALLDIR = $(patsubst %/build,%/extra,$(KERNELDIR))
+
+rpmrelease = devel
+
+LINUX = ../linux-2.6
+
+all::
+   $(MAKE) -C $(KERNELDIR) M=`pwd` $$@
+
+#sync:
+#  rsync --exclude='*.mod.c' $(LINUX)/drivers/irqhook/*.[ch] .
+
+install:
+   mkdir -p $(DESTDIR)/$(INSTALLDIR)
+   cp *.ko $(DESTDIR)/$(INSTALLDIR)
+   /sbin/depmod -a
+
+clean:
+   $(MAKE) -C $(KERNELDIR) M=`pwd` $@
diff --git a/irqhook/irqhook_main.c b/irqhook/irqhook_main.c
new file mode 100644
index 000..0f93d17
--- /dev/null
+++ b/irqhook/irqhook_main.c
@@ -0,0 +1,215 @@
+#include linux/module.h
+#include linux/kernel.h
+#include linux/fs.h
+#include linux/bitmap.h
+#include linux/interrupt.h
+#include linux/spinlock.h
+#include linux/miscdevice.h
+#include linux/pci.h
+
+#include asm/uaccess.h
+
+#define irqh_VERSION 0.0.1
+#define irqh_MODULE_NAME irqhook
+#define irqh_DRIVER_NAME   irqh_MODULE_NAME  HW IRQ hook  irqh_VERSION
+
+// based on earlier proprietary Tutis code; this modified version goes under 
GPL
+MODULE_AUTHOR(Nir Peleg - Tutis);
+MODULE_DESCRIPTION(IRQ hook driver);
+MODULE_LICENSE(GPL);
+
+//#define irqh_DEBUG /* define to enable copious debugging info */
+
+#ifdef irqh_DEBUG
+#define DPRINTK(fmt, args...) printk(1 %s:  fmt, __FUNCTION__ , ## args)
+#else
+#define DPRINTK(fmt, args...)
+#endif
+
+#define ERROR(fmt, args...) printk(1 %s:  fmt, __FUNCTION__ , ## args)
+
+static spinlock_t irqh_lock;
+static wait_queue_head_t irqh_proc_list;
+
+static DECLARE_BITMAP(pending, NR_IRQS);
+static DECLARE_BITMAP(handled, NR_IRQS);
+

[kvm-devel] [PATCH 2/2] KVM: Handle interrupts for PCI passthrough devices

2008-04-10 Thread Amit Shah
Passthrough devices are host machine PCI devices which have
been handed off to the guest. Handle interrupts from these
devices and route them to the appropriate guest irq lines.
The userspace provides us with the necessary information
via the ioctls.

The guest IRQ numbers can change dynamically, so we have an
additional ioctl that keeps track of those changes in userspace
and notifies us whenever that happens.

It is expected the kernel driver for the passthrough device
is removed before passing it on to the guest.

Signed-off-by: Amit Shah [EMAIL PROTECTED]
---
 arch/x86/kvm/lapic.c   |2 +
 arch/x86/kvm/x86.c |  191 
 include/asm-x86/kvm_host.h |   15 
 include/asm-x86/kvm_para.h |   15 +++-
 include/linux/kvm.h|4 +
 5 files changed, 226 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 31280df..d8df755 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -450,6 +450,8 @@ static void apic_set_eoi(struct kvm_lapic *apic)
 
if (apic_test_and_clear_vector(vector, apic-regs + APIC_TMR))
kvm_ioapic_update_eoi(apic-vcpu-kvm, vector);
+
+   kvm_pci_pt_ack_irq(apic-vcpu-kvm, vector);
 }
 
 static void apic_send_ipi(struct kvm_lapic *apic)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index c7ad235..908dd1e 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -21,6 +21,7 @@
 #include tss.h
 
 #include linux/clocksource.h
+#include linux/interrupt.h
 #include linux/kvm.h
 #include linux/fs.h
 #include linux/vmalloc.h
@@ -94,6 +95,170 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
{ NULL }
 };
 
+/*
+ * Used to find a registered host PCI device (a passthrough device)
+ * during interrupts or EOI
+ */
+static struct kvm_pci_pt_dev_list *
+find_pci_pt_dev(struct list_head *head,
+   struct kvm_pci_pt_info *pv_pci_info, int irq, int source)
+{
+   struct list_head *ptr;
+   struct kvm_pci_pt_dev_list *match;
+
+   list_for_each(ptr, head) {
+   match = list_entry(ptr, struct kvm_pci_pt_dev_list, list);
+
+   switch (source) {
+   case KVM_PT_SOURCE_IRQ:
+   /*
+* Used to find a registered host device
+* during interrupt context on host
+*/
+   if (match-pt_dev.host.irq == irq)
+   return match;
+   break;
+   case KVM_PT_SOURCE_IRQ_ACK:
+   /*
+* Used to find a registered host device when
+* the guest acks an interrupt
+*/
+   if (match-pt_dev.guest.irq == irq)
+   return match;
+   break;
+   }
+   }
+   return NULL;
+}
+
+static DECLARE_BITMAP(pt_irq_pending, NR_IRQS);
+static DECLARE_BITMAP(pt_irq_handled, NR_IRQS);
+
+/* FIXME: Implement the OR logic needed to make shared interrupts on
+ * this line behave properly
+ */
+static irqreturn_t
+kvm_pci_pt_dev_intr(int irq, void *dev_id)
+{
+   struct kvm_pci_pt_dev_list *match;
+   struct kvm *kvm = (struct kvm *) dev_id;
+
+   if (!test_bit(irq, pt_irq_handled))
+   return IRQ_NONE;
+
+   if (test_bit(irq, pt_irq_pending))
+   return IRQ_HANDLED;
+
+   match = find_pci_pt_dev(kvm-arch.pci_pt_dev_head, NULL,
+   irq, KVM_PT_SOURCE_IRQ);
+   if (!match)
+   return IRQ_NONE;
+
+   /* Not possible to detect if the guest uses the PIC or the
+* IOAPIC.  So set the bit in both. The guest will ignore
+* writes to the unused one.
+*/
+   kvm_ioapic_set_irq(kvm-arch.vioapic, match-pt_dev.guest.irq, 1);
+   kvm_pic_set_irq(pic_irqchip(kvm), match-pt_dev.guest.irq, 1);
+   set_bit(irq, pt_irq_pending);
+   return IRQ_HANDLED;
+}
+
+/* Ack the irq line for a passthrough device */
+void
+kvm_pci_pt_ack_irq(struct kvm *kvm, int vector)
+{
+   int irq;
+   struct kvm_pci_pt_dev_list *match;
+
+   irq = get_eoi_gsi(kvm-arch.vioapic, vector);
+   match = find_pci_pt_dev(kvm-arch.pci_pt_dev_head, NULL,
+   irq, KVM_PT_SOURCE_IRQ_ACK);
+   if (!match)
+   return;
+   if (test_bit(match-pt_dev.host.irq, pt_irq_pending)) {
+   kvm_ioapic_set_irq(kvm-arch.vioapic, irq, 0);
+   kvm_pic_set_irq(pic_irqchip(kvm), irq, 0);
+   clear_bit(match-pt_dev.host.irq, pt_irq_pending);
+   }
+}
+
+static int
+kvm_vm_ioctl_pci_pt_dev(struct kvm *kvm,
+   struct kvm_pci_passthrough_dev *pci_pt_dev)
+{
+   int r = 0;
+   struct kvm_pci_pt_dev_list *match;
+
+   if (irqchip_in_kernel(kvm)) {
+   /* Has this been added already? */
+

[kvm-devel] [PATCH 1/2] KVM: Expose get_eoi_gsi() for IRQ acking by PCI passthrough devices

2008-04-10 Thread Amit Shah
Signed-off-by: Amit Shah [EMAIL PROTECTED]
---
 virt/kvm/ioapic.c |2 +-
 virt/kvm/ioapic.h |1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c
index 4232fd7..c5e776a 100644
--- a/virt/kvm/ioapic.c
+++ b/virt/kvm/ioapic.c
@@ -268,7 +268,7 @@ void kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, 
int level)
}
 }
 
-static int get_eoi_gsi(struct kvm_ioapic *ioapic, int vector)
+int get_eoi_gsi(struct kvm_ioapic *ioapic, int vector)
 {
int i;
 
diff --git a/virt/kvm/ioapic.h b/virt/kvm/ioapic.h
index 7f16675..d112a88 100644
--- a/virt/kvm/ioapic.h
+++ b/virt/kvm/ioapic.h
@@ -91,5 +91,6 @@ void kvm_ioapic_update_eoi(struct kvm *kvm, int vector);
 int kvm_ioapic_init(struct kvm *kvm);
 void kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level);
 void kvm_ioapic_reset(struct kvm_ioapic *ioapic);
+int get_eoi_gsi(struct kvm_ioapic *ioapic, int vector);
 
 #endif
-- 
1.4.4.2


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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] PCI Passthrough support for KVM

2008-04-10 Thread Amit Shah
This patchset introduces PCI passthrough support for KVM.

This has been tested with an Ethernet device. The device is
seen in the guest and interrupts are generated. However, no
data transfer can take place unless pvdma or reserved-ram
is used. The patches for pvdma will be available shortly.

Sharing of interrupt line for the PCI device on the host side
will cause slowness (and / or some glitches). Also, proper
locking isn't in place yet. Single VMs exploiting this feature
run well though.

There also is a git repository for you to explore:

git-pull git://git.kernel.org/pub/scm/linux/kernel/git/amit/kvm.git
git-pull git://git.kernel.org/pub/scm/linux/kernel/git/amit/kvm-userspace.git

Comments, feedback welcome.

Amit.

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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] use NR_IRQS for irq count

2008-04-10 Thread Amit Shah
* On Wednesday 09 Apr 2008 17:41:10 Glauber Costa wrote:
 Amit Shah wrote:
  * On Tuesday 08 April 2008 22:34:36 Glauber Costa wrote:
  Instead of artificially limiting irq numbers, use arch provided NR_IRQS
 
  Signed-off-by: Glauber Costa [EMAIL PROTECTED]
 
  Thanks, applied.
 
  Going forward, we're going to use the in-kernel approach for interrupt
  injection (which already has this change). The irqhook module will stay
  around for testing / debugging purposes (will be used with
  -no-kvm-irqchip).
 
  Amit.

 Is it already in your tree?

Yes, it's in the new tree I just sent the link to.

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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] Using Swiftshader for 3d in kvm

2008-04-10 Thread Pelle
Hi all,

I've recently read about swiftshader, a software 3d renderer for windows.
I tested this on my virtual windows install and the demo's are looking good.
This may not be perfect, but is should allow to play a simple 3d game 
inside kvm.

http://www.transgaming.com/products/swiftshader/

Regards, Pelle

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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] virtio with 2.6.25-rc8: problem with /dev/vda

2008-04-10 Thread Dor Laor

On Thu, 2008-04-10 at 14:14 +0900, Jun Koi wrote:
 On 4/10/08, Jorge Lucángeli Obes [EMAIL PROTECTED] wrote:
  On Thu, Apr 10, 2008 at 12:59 AM, Jun Koi [EMAIL PROTECTED] wrote:
 Now I succesfully installed 2.6.25-rc8, and virtio block device works
 well. But from inside my VM, how can I say it is using virtio for
 block?
   
 And is there any number about the performance gain using virtio block?
   
 Another question: currently I have some problem with network: I use 
  option
   
 -net nic,model=virtio
   
 and try to configure VM from inside after booting, network doesnt
 work, even after I manually configure eth0.
   
 How to fix that network problem?
 
 
  '-net nic,...' only specifies the hardware part of QEMU/KVM's
   networking. You also need to specify whether you are going to use
   usermode networking or bridged networking. QEMU documentation covers
   both modes pretty well.
 
   To test the card quickly, use usermode networking, where QEMU provides
   a usermode network stack (complete with DHCP server) that let's you
   use the VM as if it were behind a completely restrictive firewall that
   only allows outbound connections.
 
   '-net nic,model=virtio -net user'
 
   It's a great way to test the network card. If your host has an
   Internet connection, firing up a browser in the guest (after getting
   the guest interface up using DHCP) and accessing a web page should
   just work.
 
 -net user works, thanks!
 

For general knowledge -net tap drastically improves performance.
There is also work in progress mainly by Rusty to do copy-less tap
networking.

 I didnt use the option because I think that is default. But it seems
 if you use -net (for model=virtio in this case), you must specify
 the networking mode.
 
 Regards,
 Jun
 
 -
 This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
 Don't miss this year's exciting event. There's still time to save $100. 
 Use priority code J8TL2D2. 
 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 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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 0 of 3] KVM for PowerPC 440

2008-04-10 Thread Josh Boyer
On Mon, 07 Apr 2008 15:53:31 -0500
Hollis Blanchard [EMAIL PROTECTED] wrote:

 Implement initial support for KVM for PowerPC 440. There are just two small
 prerequisite patches, and then the bulk of the code can't be split easily.
 
 Please review; I would like to submit these for 2.6.26. There is plenty of 
 work
 to do, both functional and optimization, but this code is sufficient to run
 unmodified 440 Linux guests on a 440 Linux host. What's your favorite bike 
 shed
 color?

Who's tree are you looking to get this patch set into?

josh

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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] kvm-userspace: fix compilation breakage when in-kernel pit is not detected

2008-04-10 Thread Joerg Roedel
The compilation of kvm-userspace part fails if the in-kernel pit is not
detected in linux/kvm.h with the following error message:

pc.o: In function `pc_init1':
/home/jroedel/src/kvm/kvm-userspace/qemu/hw/pc.c:987: undefined reference to 
`kvm_pit_init'
collect2: ld returned 1 exit status

This patch fixes this little issue.

Signed-off-by: Joerg Roedel [EMAIL PROTECTED]
---
 qemu/configure |1 +
 qemu/hw/pc.c   |2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/qemu/configure b/qemu/configure
index ca9bce2..bfbd93c 100755
--- a/qemu/configure
+++ b/qemu/configure
@@ -1187,6 +1187,7 @@ configure_kvm() {
 echo CONFIG_KVM_KERNEL_INC=$kernel_path/include  $config_mak
 if test $kvm_cap_pit = yes ; then
echo USE_KVM_PIT=1  $config_mak
+   echo #define USE_KVM_PIT 1  $config_h
 fi
 disable_cpu_emulation
   fi
diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c
index 859d7db..aa9afea 100644
--- a/qemu/hw/pc.c
+++ b/qemu/hw/pc.c
@@ -983,9 +983,11 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
 if (pci_enabled) {
 ioapic = ioapic_init();
 }
+#ifdef USE_KVM_PIT
 if (kvm_enabled()  qemu_kvm_pit_in_kernel())
pit = kvm_pit_init(0x40, i8259[0]);
 else
+#endif
pit = pit_init(0x40, i8259[0]);
 pcspk_init(pit);
 if (pci_enabled) {
-- 
1.5.2.5



-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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] problems with Ubuntu server amd64 (kernel 2.6.24) and Windows 2003 32bit as guest

2008-04-10 Thread Davide D'Amico

Il giorno 09/apr/08, alle ore 15:27, Felix Leimbach ha scritto:

 On 09.04.2008 Davide D'Amico wrote:
  I have a Windows 2003 32 bit guest that hangs up (i.e. not  
 responding anymore)

 Hi Davide,

 I had very similar problems (details in [1]) which were solved by  
 upgrading to host's kernel to 2.6.25.
 Since then all guests including the Win 2003 Servers are rock-solid,  
 even under heavy load.

 regards,
 Felix


Everything is fine, now.
But I am experimenting a strange behaviour: if I have to virtualize  
32bit guest I have to use vcpu1/vcpu feature,
otherwise I see kernel panic (FreeBSD 6.3 i386) or black screen of  
death (Windows 2003 32bit).

Any ideas?


dave

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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 1 of 3] [POWERPC 44x] Export tlb_44x_hwater for KVM

2008-04-10 Thread Josh Boyer
On Mon, 07 Apr 2008 15:53:32 -0500
Hollis Blanchard [EMAIL PROTECTED] wrote:

 1 file changed, 2 insertions(+)
 include/asm-powerpc/mmu-44x.h |2 ++
 
 
 PowerPC 440 KVM needs to know how many TLB entries are used for the host 
 kernel
 linear mapping (it does not modify these mappings when switching between guest
 and host execution).
 
 Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]

Acked-by: Josh Boyer [EMAIL PROTECTED]

 
 diff --git a/include/asm-powerpc/mmu-44x.h b/include/asm-powerpc/mmu-44x.h
 --- a/include/asm-powerpc/mmu-44x.h
 +++ b/include/asm-powerpc/mmu-44x.h
 @@ -53,6 +53,8 @@
 
  #ifndef __ASSEMBLY__
 
 +extern unsigned int tlb_44x_hwater;
 +
  typedef unsigned long long phys_addr_t;
 
  typedef struct {
 ___
 Linuxppc-dev mailing list
 [EMAIL PROTECTED]
 https://ozlabs.org/mailman/listinfo/linuxppc-dev

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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/2] KVM: hlt emulation should take in-kernel APIC/PIT timers into account

2008-04-10 Thread Marcelo Tosatti
Timers that fire between guest hlt and vcpu_block's add_wait_queue() are 
ignored, possibly resulting in hangs.

Also make sure that atomic_inc and waitqueue_active tests happen in the
specified order, otherwise the following race is open:

CPU0CPU1
if (waitqueue_active(wq))
add_wait_queue()
if (!atomic_read(pit_timer-pending))
schedule()
atomic_inc(pit_timer-pending)

Which is not an issue for the APIC timer due to migration logic.

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

Index: kvm/arch/x86/kvm/i8254.c
===
--- kvm.orig/arch/x86/kvm/i8254.c
+++ kvm/arch/x86/kvm/i8254.c
@@ -199,6 +199,7 @@ int __pit_timer_fn(struct kvm_kpit_state
struct kvm_kpit_timer *pt = ps-pit_timer;
 
atomic_inc(pt-pending);
+   smp_mb__after_atomic_inc();
if (vcpu0  waitqueue_active(vcpu0-wq)) {
vcpu0-arch.mp_state = VCPU_MP_STATE_RUNNABLE;
wake_up_interruptible(vcpu0-wq);
@@ -210,6 +211,16 @@ int __pit_timer_fn(struct kvm_kpit_state
return (pt-period == 0 ? 0 : 1);
 }
 
+int pit_has_pending_timer(struct kvm_vcpu *vcpu)
+{
+   struct kvm_pit *pit = vcpu-kvm-arch.vpit;
+
+   if (pit  vcpu-vcpu_id == 0)
+   return atomic_read(pit-pit_state.pit_timer.pending);
+
+   return 0;
+}
+
 static enum hrtimer_restart pit_timer_fn(struct hrtimer *data)
 {
struct kvm_kpit_state *ps;
Index: kvm/arch/x86/kvm/irq.c
===
--- kvm.orig/arch/x86/kvm/irq.c
+++ kvm/arch/x86/kvm/irq.c
@@ -26,6 +26,21 @@
 #include i8254.h
 
 /*
+ * check if there are pending timer events
+ * to be processed.
+ */
+int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu)
+{
+   int ret;
+
+   ret = pit_has_pending_timer(vcpu);
+   ret |= apic_has_pending_timer(vcpu);
+
+   return ret;
+}
+EXPORT_SYMBOL(kvm_cpu_has_pending_timer);
+
+/*
  * check if there is pending interrupt without
  * intack.
  */
Index: kvm/arch/x86/kvm/irq.h
===
--- kvm.orig/arch/x86/kvm/irq.h
+++ kvm/arch/x86/kvm/irq.h
@@ -85,4 +85,7 @@ void kvm_inject_pending_timer_irqs(struc
 void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu);
 void __kvm_migrate_apic_timer(struct kvm_vcpu *vcpu);
 
+int pit_has_pending_timer(struct kvm_vcpu *vcpu);
+int apic_has_pending_timer(struct kvm_vcpu *vcpu);
+
 #endif
Index: kvm/arch/x86/kvm/lapic.c
===
--- kvm.orig/arch/x86/kvm/lapic.c
+++ kvm/arch/x86/kvm/lapic.c
@@ -952,6 +952,16 @@ static int __apic_timer_fn(struct kvm_la
return result;
 }
 
+int apic_has_pending_timer(struct kvm_vcpu *vcpu)
+{
+   struct kvm_lapic *lapic = vcpu-arch.apic;
+
+   if (lapic)
+   return atomic_read(lapic-timer.pending);
+
+   return 0;
+}
+
 static int __inject_apic_timer_irq(struct kvm_lapic *apic)
 {
int vector;
Index: kvm/include/linux/kvm_host.h
===
--- kvm.orig/include/linux/kvm_host.h
+++ kvm/include/linux/kvm_host.h
@@ -272,6 +272,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm
 
 int kvm_cpu_get_interrupt(struct kvm_vcpu *v);
 int kvm_cpu_has_interrupt(struct kvm_vcpu *v);
+int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu);
 void kvm_vcpu_kick(struct kvm_vcpu *vcpu);
 
 static inline void kvm_guest_enter(void)
Index: kvm/virt/kvm/kvm_main.c
===
--- kvm.orig/virt/kvm/kvm_main.c
+++ kvm/virt/kvm/kvm_main.c
@@ -752,6 +752,7 @@ void mark_page_dirty(struct kvm *kvm, gf
}
 }
 
+#ifdef CONFIG_X86
 /*
  * The vCPU has executed a HLT instruction with in-kernel mode enabled.
  */
@@ -765,6 +766,7 @@ void kvm_vcpu_block(struct kvm_vcpu *vcp
 * We will block until either an interrupt or a signal wakes us up
 */
while (!kvm_cpu_has_interrupt(vcpu)
+   !kvm_cpu_has_pending_timer(vcpu)
!signal_pending(current)
!kvm_arch_vcpu_runnable(vcpu)) {
set_current_state(TASK_INTERRUPTIBLE);
@@ -776,6 +778,7 @@ void kvm_vcpu_block(struct kvm_vcpu *vcp
__set_current_state(TASK_RUNNING);
remove_wait_queue(vcpu-wq, wait);
 }
+#endif
 
 void kvm_resched(struct kvm_vcpu *vcpu)
 {

-- 


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net

[kvm-devel] [patch 0/2] fix in-kernel timer / IRQ injection races

2008-04-10 Thread Marcelo Tosatti

-- 


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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/2] KVM: fix kvm_vcpu_kick vs __vcpu_run race

2008-04-10 Thread Marcelo Tosatti
There is a window open between testing of pending IRQ's 
and assignment of guest_mode in __vcpu_run.

Injection of IRQ's can race with __vcpu_run as follows:

CPU0CPU1
kvm_x86_ops-run()
vcpu-guest_mode = 0SET_IRQ_LINE ioctl
..
kvm_x86_ops-inject_pending_irq 
kvm_cpu_has_interrupt()

apic_test_and_set_irr()
kvm_vcpu_kick
if (vcpu-guest_mode)
send_ipi()

vcpu-guest_mode = 1

So move guest_mode=1 assignment before -inject_pending_irq, and make
sure that it won't reorder after it.

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

Index: kvm/arch/x86/kvm/x86.c
===
--- kvm.orig/arch/x86/kvm/x86.c
+++ kvm/arch/x86/kvm/x86.c
@@ -2777,6 +2777,13 @@ again:
goto out;
}
 
+   vcpu-guest_mode = 1;
+   /*
+* Make sure that guest_mode assignment won't happen after
+* testing the pending IRQ vector bitmap.
+*/
+   smp_wmb();
+
if (vcpu-arch.exception.pending)
__queue_exception(vcpu);
else if (irqchip_in_kernel(vcpu-kvm))
@@ -2788,7 +2795,6 @@ again:
 
up_read(vcpu-kvm-slots_lock);
 
-   vcpu-guest_mode = 1;
kvm_guest_enter();
 
if (vcpu-requests)
@@ -3944,11 +3950,12 @@ static void vcpu_kick_intr(void *info)
 void kvm_vcpu_kick(struct kvm_vcpu *vcpu)
 {
int ipi_pcpu = vcpu-cpu;
+   int cpu = smp_processor_id();
 
if (waitqueue_active(vcpu-wq)) {
wake_up_interruptible(vcpu-wq);
++vcpu-stat.halt_wakeup;
}
-   if (vcpu-guest_mode)
+   if (vcpu-guest_mode  vcpu-cpu != cpu)
smp_call_function_single(ipi_pcpu, vcpu_kick_intr, vcpu, 0, 0);
 }

-- 


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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 of 2] Remove kvm_load_registers from ppc440_bamboo board model

2008-04-10 Thread Jerone Young
1 file changed, 3 deletions(-)
qemu/hw/ppc440_bamboo.c |3 ---


This patch removes the call to kvm_load_registers while in board platform setup 
code. This must now be done later in vcpu initialization.

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

diff --git a/qemu/hw/ppc440_bamboo.c b/qemu/hw/ppc440_bamboo.c
--- a/qemu/hw/ppc440_bamboo.c
+++ b/qemu/hw/ppc440_bamboo.c
@@ -174,9 +174,6 @@ void bamboo_init(ram_addr_t ram_size, in
env-gpr[3] = dt_base;
 #endif
env-nip = ep;
-
-   printf(%s: loading kvm registers\n, __func__);
-   kvm_load_registers(env);
}
 
for (i = 0; i  nb_nics; i++) {

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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 of 2] Add kvm_load_registers after first vcpu creation

2008-04-10 Thread Jerone Young
1 file changed, 5 insertions(+)
qemu/qemu-kvm.c |5 +


This patch adds a call to load_kvm_registers after creation of vcpu. This is 
required for ppc since we are required to set certain registers before boot. 
This should not have any effect on the curren x86 code (though I need to test 
this to make sure).

What I would like though are some comments on the fix. Is this the right place 
for this? We had this in our platform setup code, but with recent code changes 
it will not work there anymore).

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

diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -353,6 +353,11 @@ static void *ap_main_loop(void *_env)
 sigdelset(signals, SIG_IPI);
 sigprocmask(SIG_BLOCK, signals, NULL);
 kvm_create_vcpu(kvm_context, env-cpu_index);
+if (env-cpu_index == 0) {
+ /* load any registers set in env into 
+kvm  for the first guest vcpu */ 
+kvm_load_registers(env);
+}
 kvm_qemu_init_env(env);
 if (kvm_irqchip_in_kernel(kvm_context))
env-hflags = ~HF_HALTED_MASK;

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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 of 2] Fix loading of registers preboot for PowerPC

2008-04-10 Thread Jerone Young
These patches fix issue with brining up bamboo board model for PowerPC. We need 
to load certain registers in the first vcp preboot. 

I have not tested this on x86, but it should work without issue. Does anyone 
not like this being where it is?

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

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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 1 of 2] Add kvm_load_registers after first vcpu creation

2008-04-10 Thread Jerone Young
On Thu, 2008-04-10 at 18:35 -0300, Marcelo Tosatti wrote:
 On Thu, Apr 10, 2008 at 04:04:47PM -0500, Jerone Young wrote:
  1 file changed, 5 insertions(+)
  qemu/qemu-kvm.c |5 +
  
 
  This patch adds a call to load_kvm_registers after creation of
  vcpu. This is required for ppc since we are required to set certain
  registers before boot. This should not have any effect on the curren
  x86 code (though I need to test this to make sure).
 
  What I would like though are some comments on the fix. Is this the
  right place for this? We had this in our platform setup code, but with
  recent code changes it will not work there anymore).
 
  Signed-off-by: Jerone Young [EMAIL PROTECTED]
  
  diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
  --- a/qemu/qemu-kvm.c
  +++ b/qemu/qemu-kvm.c
  @@ -353,6 +353,11 @@ static void *ap_main_loop(void *_env)
   sigdelset(signals, SIG_IPI);
   sigprocmask(SIG_BLOCK, signals, NULL);
   kvm_create_vcpu(kvm_context, env-cpu_index);
  +if (env-cpu_index == 0) {
  + /* load any registers set in env into 
  +kvm  for the first guest vcpu */ 
  +kvm_load_registers(env);
  +}
   kvm_qemu_init_env(env);
   if (kvm_irqchip_in_kernel(kvm_context))
  env-hflags = ~HF_HALTED_MASK;
 
 Hi Jerone,
 
 You can hook into PPC's kvm_arch_qemu_init_env().

That would be a much better place. 

I also noticed that kvm_qemu_init_env() is called in ap_main_loop and
the kvm_main_loop_cpu. ap_main_loop calls kvm_main_loop_cpu, so  one
them should be removed. I'll submit another patch for that.

 


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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 of 3] Remove duplicate kvm_qemu_init() calls

2008-04-10 Thread Jerone Young
1 file changed, 1 deletion(-)
qemu/qemu-kvm.c |1 -


kvm_qemu_init is called in ap_main_loop() , when ap_main_loop() calls 
kvm_main_loop_cpu(), kvm_qemu_init() is run for a second time. It should only 
be called in kvm_main_loop_cpu().

Signed-off-by: Jerone Young [EMAIL PROTECTED]
~

diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -353,7 +353,6 @@ static void *ap_main_loop(void *_env)
 sigdelset(signals, SIG_IPI);
 sigprocmask(SIG_BLOCK, signals, NULL);
 kvm_create_vcpu(kvm_context, env-cpu_index);
-kvm_qemu_init_env(env);
 if (kvm_irqchip_in_kernel(kvm_context))
env-hflags = ~HF_HALTED_MASK;
 kvm_main_loop_cpu(env);

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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 of 3] Add kvm_load_registers into qemu_arch_init for PowerPC

2008-04-10 Thread Jerone Young
1 file changed, 6 insertions(+)
qemu/qemu-kvm-powerpc.c |6 ++


This patch adds a call to load_kvm_registers after creation of vcpu. This is 
required for ppc since we are required to set certain registers before boot.

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

diff --git a/qemu/qemu-kvm-powerpc.c b/qemu/qemu-kvm-powerpc.c
--- a/qemu/qemu-kvm-powerpc.c
+++ b/qemu/qemu-kvm-powerpc.c
@@ -121,6 +121,12 @@ void kvm_arch_save_regs(CPUState *env)
 
 int kvm_arch_qemu_init_env(CPUState *cenv)
 {
+if (cenv-cpu_index == 0) {
+/* load any registers set in env into
+   kvm  for the first guest vcpu */
+kvm_load_registers(cenv);
+}
+
 return 0;
 }
 

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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 of 3] [V2] Fix loading of registers preboot for PowerPC

2008-04-10 Thread Jerone Young
So this now moves code away from common code to arch specific 
kvm_qemu_arch_init(). Also added is a removal of duplicate calls to 
kvm_qemu_init_env() in common code.

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

3 files changed, 6 insertions(+), 4 deletions(-)
qemu/hw/ppc440_bamboo.c |3 ---
qemu/qemu-kvm-powerpc.c |6 ++
qemu/qemu-kvm.c |1 -

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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] kvm-userspace: fix compilation breakage when in-kernel pit is not detected

2008-04-10 Thread Avi Kivity
Joerg Roedel wrote:
 The compilation of kvm-userspace part fails if the in-kernel pit is not
 detected in linux/kvm.h with the following error message:

 pc.o: In function `pc_init1':
 /home/jroedel/src/kvm/kvm-userspace/qemu/hw/pc.c:987: undefined reference to 
 `kvm_pit_init'
 collect2: ld returned 1 exit status

 This patch fixes this little issue.

   

Applied, thanks.

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


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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 0/3] SVM: handle MCEs properly

2008-04-10 Thread Avi Kivity
Joerg Roedel wrote:
 This patchset implements proper MCE handling for SVM in the KVM hypervisor.
 Currently KVM does not set CR4.MCE when it runs the guest. When a MCE 
 condition
 occurs while the guest is running the exception gets lost. This may result in
 data corruption or other undefined behaviour. This patchset sets CR4.MCE to 
 the
 value in the host and adds the intercept for machine check exceptions to the
 SVM implementation. When this intercept occurs, it calls the host MCE 
 exception
 handler manually.

   

Applied all, thanks.

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


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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 0/5]Add kvm trace support v3

2008-04-10 Thread Avi Kivity
Liu, Eric E wrote:
 Hi, Avi and all
   According to your comments from V2, I work out the new patchsets
 of kvm trace. Please help to review, Thanks.
 In this version, fix the issues you pointed out and add a new ioctl
 PAUSE to make user space  app better to control trace stream.
 Hope it is useful for performance accounting and cause less headaches
 when people use it :).

   

Applied all, thanks.  I added a comment to the effect that the binary 
interface is not fixed, so we can change it at will.  I also stubbed out 
ia64 and s390 support.

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


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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 0/4] fix SMP migration and loadvm/savevm (V2)

2008-04-10 Thread Avi Kivity
Marcelo Tosatti wrote:
 On Wed, Apr 09, 2008 at 12:59:50AM +0300, Avi Kivity wrote:
   
 Marcelo Tosatti wrote:
 
 Avi, I prefer not to fold mpstate into kvm_save_registers() as a hidden
 register because the MPSTATE is only used during migration, whereas 
 save_registers() is not (seems safer)
   
 But that's the point... what about savevm/loadvm, etc?  They deserve to 
 work too.
 

 savevm/loadvm will work through cpu_save/cpu_load just as live migration
 does, so they are covered.

   
Right.

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


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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] add ioctl's to save/restore mpstate

2008-04-10 Thread Avi Kivity
Marcelo Tosatti wrote:
  /*
   * ioctls for VM fds
 @@ -340,5 +341,7 @@ struct kvm_s390_interrupt {
  #define KVM_S390_SET_INITIAL_PSW  _IOW(KVMIO,  0x96, struct kvm_s390_psw)
  /* initial reset for s390 */
  #define KVM_S390_INITIAL_RESET_IO(KVMIO,  0x97)
 +#define KVM_GET_MP_STATE   _IO(KVMIO,  0x98)
 +#define KVM_SET_MP_STATE   _IO(KVMIO,  0x99)
   

This needs _IOW or _IORW to document transfer direction and structure 
size.  Please put the data in a structure, and document the values by 
moving the #defines into linux/kvm.h

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


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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] vmwarevga error

2008-04-10 Thread Mark Bidewell
When I use the vmwarevga option I get the following error:

kvm: get_dirty_pages returned -2

This is the same error that used to occur with -std-vga.  Is this a known
issue?

Mark Bidewell
-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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] kvm-userspace: fix compilation breakage when in-kernel pit is not detected

2008-04-10 Thread Anthony Liguori
Joerg Roedel wrote:
 The compilation of kvm-userspace part fails if the in-kernel pit is not
 detected in linux/kvm.h with the following error message:

 pc.o: In function `pc_init1':
 /home/jroedel/src/kvm/kvm-userspace/qemu/hw/pc.c:987: undefined reference to 
 `kvm_pit_init'
 collect2: ld returned 1 exit status

 This patch fixes this little issue.
   

A better solution is to wrap qemu_kvm_put_in_kernel in an #ifdef 
KVM_CAP_PIT so that if it isn't defined, it always returns 0.  gcc will 
then do the right thing.

Regards,

Anthony Liguori

 Signed-off-by: Joerg Roedel [EMAIL PROTECTED]
 ---
  qemu/configure |1 +
  qemu/hw/pc.c   |2 ++
  2 files changed, 3 insertions(+), 0 deletions(-)

 diff --git a/qemu/configure b/qemu/configure
 index ca9bce2..bfbd93c 100755
 --- a/qemu/configure
 +++ b/qemu/configure
 @@ -1187,6 +1187,7 @@ configure_kvm() {
  echo CONFIG_KVM_KERNEL_INC=$kernel_path/include  $config_mak
  if test $kvm_cap_pit = yes ; then
   echo USE_KVM_PIT=1  $config_mak
 + echo #define USE_KVM_PIT 1  $config_h
  fi
  disable_cpu_emulation
fi
 diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c
 index 859d7db..aa9afea 100644
 --- a/qemu/hw/pc.c
 +++ b/qemu/hw/pc.c
 @@ -983,9 +983,11 @@ static void pc_init1(ram_addr_t ram_size, int 
 vga_ram_size,
  if (pci_enabled) {
  ioapic = ioapic_init();
  }
 +#ifdef USE_KVM_PIT
  if (kvm_enabled()  qemu_kvm_pit_in_kernel())
   pit = kvm_pit_init(0x40, i8259[0]);
  else
 +#endif
   pit = pit_init(0x40, i8259[0]);
  pcspk_init(pit);
  if (pci_enabled) {
   


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
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