Re: [PATCH v2 02/12] KVM: x86: tag the instructions which are used to write page table

2011-08-03 Thread Xiao Guangrong
On 08/02/2011 08:20 PM, Avi Kivity wrote: On 08/02/2011 02:07 PM, Xiao Guangrong wrote: The idea is from Avi: | tag instructions that are typically used to modify the page tables, and drop | shadow if any other instruction is used | The list would include, I'd guess, and, or, bts, btc, mov,

Re: [PATCH v2 08/12] KVM: MMU: fast prefetch spte on invlpg path

2011-08-03 Thread Xiao Guangrong
On 08/03/2011 02:36 AM, Marcelo Tosatti wrote: mask.cr0_wp = mask.cr4_pae = mask.nxe = 1; diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index 0f915b5..3466229 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h @@ -666,20 +666,22 @@ static

Re: [PATCH 1/3] L1 TSC handling

2011-08-03 Thread Zachary Amsden
ACK from me, but please check with Joerg on the SVM change. I believe the scaling is done properly, however it won't hurt to have a second opinion. Zach On Tue, Aug 2, 2011 at 5:54 AM, Nadav Har'El n...@il.ibm.com wrote: KVM assumed in several places that reading the TSC MSR returns the value

Re: [PATCH v2 05/12] KVM: x86: fast emulate repeat string write instructions

2011-08-03 Thread Avi Kivity
On 08/02/2011 02:09 PM, Xiao Guangrong wrote: We usually use repeat string instructions to clear the page, for example, we call memset to clear a page table, stosb is used in this function, and repeated for 1024 times, that means we should occupy mmu lock for 1024 times and walking shadow page

Re: [PATCH 2/3] Fix nested VMX TSC emulation

2011-08-03 Thread Zachary Amsden
Comments inline. Sorry for top-posting. Gmail is not my normal mode of LKML processing, but hey. On Tue, Aug 2, 2011 at 5:54 AM, Nadav Har'El n...@il.ibm.com wrote: This patch fixes two corner cases in nested (L2) handling of TSC-related issues: 1. Somewhat suprisingly, according to the

Re: [Qemu-devel] [PATCH] memory: use signed arithmetic

2011-08-03 Thread Avi Kivity
On 08/03/2011 01:15 AM, Richard Henderson wrote: On 08/02/2011 03:06 PM, Avi Kivity wrote: I don't think there's any cpu which has a real 64-bit physical address space? Don't they all truncate it? I don't know. You're right that x86_64 does, at 48 bits. The alpha system I'm trying to

Re: [PATCH 3/3] Fix TSC MSR read in nested SVM

2011-08-03 Thread Zachary Amsden
Caution: this requires more care. Pretty sure this breaks userspace suspend at the cost of supporting a not-so-reasonable hardware feature. On Tue, Aug 2, 2011 at 5:55 AM, Nadav Har'El n...@il.ibm.com wrote: When the TSC MSR is read by an L2 guest (when L1 allowed this MSR to be read without

Re: [PATCH 2/3] Fix nested VMX TSC emulation

2011-08-03 Thread Nadav Har'El
Hi, On Wed, Aug 03, 2011, Zachary Amsden wrote about Re: [PATCH 2/3] Fix nested VMX TSC emulation: ... @@ -6529,8 +6537,11 @@ static void prepare_vmcs02(struct kvm_vc -       vmcs_write64(TSC_OFFSET, -               vmx-nested.vmcs01_tsc_offset + vmcs12-tsc_offset); +       if

[PATCH v2] memory: use signed arithmetic

2011-08-03 Thread Avi Kivity
When trying to map an alias of a ram region, where the alias starts at address A and we map it into address B, and A B, we had an arithmetic underflow. Because we use unsigned arithmetic, the underflow converted into a large number which failed addrrange_intersects() tests. The concrete example

Re: qemu-kvm aborts - vhost_dev_unassign_memory: Assertion `to = 0' failed.

2011-08-03 Thread Avi Kivity
On 08/01/2011 08:44 PM, David Ahern wrote: qemu-kvm.git as of: commit dacdc4b10bafbb21120e1c24a9665444768ef999 Merge: 7b69d4f 0af4922 Author: Avi Kivitya...@redhat.com Date: Sun Jul 31 11:42:26 2011 +0300 Merge branch 'upstream-merge' into next is aborting with the error: qemu-kvm:

Re: [PATCH v2 02/12] KVM: x86: tag the instructions which are used to write page table

2011-08-03 Thread Xiao Guangrong
Hi Avi, On 08/03/2011 04:09 PM, Avi Kivity wrote: On 08/03/2011 09:02 AM, Xiao Guangrong wrote: Note we don't need to actually emulate, just decode, since page_fault can tell us whether a write failed due to page tables or mmio. This is a interesting feature. If it happens, i will just

Re: [PATCH v2 02/12] KVM: x86: tag the instructions which are used to write page table

2011-08-03 Thread Avi Kivity
On 08/03/2011 12:24 PM, Xiao Guangrong wrote: Maybe it's better to emulate if we can't find a fix for that. One way would be to emulate every 20 instructions; this breaks us out of the loop but reduces costly emulations to 5%. After much thought about this, may be this optimization is

Re: [PATCH v2 05/12] KVM: x86: fast emulate repeat string write instructions

2011-08-03 Thread Xiao Guangrong
On 08/03/2011 04:10 PM, Avi Kivity wrote: On 08/02/2011 02:09 PM, Xiao Guangrong wrote: We usually use repeat string instructions to clear the page, for example, we call memset to clear a page table, stosb is used in this function, and repeated for 1024 times, that means we should occupy mmu

Re: [PATCH v2 02/12] KVM: x86: tag the instructions which are used to write page table

2011-08-03 Thread Xiao Guangrong
On 08/03/2011 05:25 PM, Avi Kivity wrote: On 08/03/2011 12:24 PM, Xiao Guangrong wrote: Maybe it's better to emulate if we can't find a fix for that. One way would be to emulate every 20 instructions; this breaks us out of the loop but reduces costly emulations to 5%. After much

Re: [PATCH v2 02/12] KVM: x86: tag the instructions which are used to write page table

2011-08-03 Thread Avi Kivity
On 08/03/2011 12:41 PM, Xiao Guangrong wrote: OK. :-) Um, how about cache the last eip when we do this optimization, if we meet the same eip, we can break out the potential infinite loop? Yes, that can work. -- error compiling committee.c: too many arguments to function -- To unsubscribe

unconditional CPUID propagation?

2011-08-03 Thread Andre Przywara
Hi, while looking through the code I found commit f79116867ec80ed5d1d10043a3fd9ac8afd182c1 (upstream QEMU: enable SMEP) which unconditionally propagates the bits from CPUID leaf 0x7 to the guest. Though there is the KVM module in the line, this currently whitelists three feature bits. Doesn't

Re: [PATCH] cpu hotplug issue

2011-08-03 Thread Vasilis Liaskovitis
When rebooting after a CPU hotplug in qemu-kvm, Seabios can get stuck in smp_probe(). Normally cmos_smp_count is read from cmos and the smp_ap_boot_code is run on all cpus except bootstrap. The expected result is CountCPUs == cmos_smp_count + 1. After a cpu hotplug, more than cmos_smp_count

Re: [PATCH] cpu hotplug issue

2011-08-03 Thread Jan Kiszka
On 2011-08-03 12:07, Vasilis Liaskovitis wrote: When rebooting after a CPU hotplug in qemu-kvm, Seabios can get stuck in smp_probe(). Normally cmos_smp_count is read from cmos and the smp_ap_boot_code is run on all cpus except bootstrap. The expected result is CountCPUs == cmos_smp_count +

Re: [PATCH] cpu hotplug issue

2011-08-03 Thread Gleb Natapov
On Wed, Aug 03, 2011 at 12:37:13PM +0200, Jan Kiszka wrote: On 2011-08-03 12:07, Vasilis Liaskovitis wrote: When rebooting after a CPU hotplug in qemu-kvm, Seabios can get stuck in smp_probe(). Normally cmos_smp_count is read from cmos and the smp_ap_boot_code is run on all cpus

Re: [PATCH] cpu hotplug issue

2011-08-03 Thread Jan Kiszka
On 2011-08-03 12:38, Gleb Natapov wrote: On Wed, Aug 03, 2011 at 12:37:13PM +0200, Jan Kiszka wrote: On 2011-08-03 12:07, Vasilis Liaskovitis wrote: When rebooting after a CPU hotplug in qemu-kvm, Seabios can get stuck in smp_probe(). Normally cmos_smp_count is read from cmos and the

Re: [PATCH 3/3] Fix TSC MSR read in nested SVM

2011-08-03 Thread Nadav Har'El
Hi, On Wed, Aug 03, 2011, Zachary Amsden wrote about Re: [PATCH 3/3] Fix TSC MSR read in nested SVM: Pretty sure this breaks userspace suspend at the cost of supporting a not-so-reasonable hardware feature. ... This is correct. Now you properly return the correct MSR value for the TSC to

Re: qemu-kvm aborts - vhost_dev_unassign_memory: Assertion `to = 0' failed.

2011-08-03 Thread Avi Kivity
On 08/01/2011 08:44 PM, David Ahern wrote: qemu-kvm.git as of: commit dacdc4b10bafbb21120e1c24a9665444768ef999 Merge: 7b69d4f 0af4922 Author: Avi Kivitya...@redhat.com Date: Sun Jul 31 11:42:26 2011 +0300 Merge branch 'upstream-merge' into next is aborting with the error: qemu-kvm:

Re: [Qemu-devel] [PATCH] memory: use signed arithmetic

2011-08-03 Thread Benjamin Herrenschmidt
On Wed, 2011-08-03 at 11:26 +0300, Avi Kivity wrote: On 08/03/2011 01:15 AM, Richard Henderson wrote: On 08/02/2011 03:06 PM, Avi Kivity wrote: I don't think there's any cpu which has a real 64-bit physical address space? Don't they all truncate it? I don't know. You're right that

[PATCH v2 01/38] pci: add API to get a BAR's mapped address

2011-08-03 Thread Avi Kivity
This is a hack, for devices that have a back-channel to read this address back outside the normal configuration mechanisms, such as VMware svga. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/pci.c |5 + hw/pci.h |1 + 2 files

[PATCH v2 00/38] Memory API, batch 2: PCI devices

2011-08-03 Thread Avi Kivity
This is a mostly mindless conversion of all QEMU PCI devices to the memory API. After this patchset is applied, it is no longer possible to create a PCI device using the old API. An immediate benefit is that PCI BARs that overlap each other are now handled correctly: currently, the sequence

[PATCH v2 04/38] cirrus: simplify mmio BAR access functions

2011-08-03 Thread Avi Kivity
Make use of the memory API's ability to satisfy multi-byte accesses via multiple single-byte accesses. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/cirrus_vga.c | 78 +- 1 files changed, 8

[PATCH v2 06/38] cirrus: simplify vga window mmio access functions

2011-08-03 Thread Avi Kivity
Make use of the memory API's ability to satisfy multi-byte accesses via multiple single-byte accesses. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/cirrus_vga.c | 79 +++--- 1 files changed, 11

[PATCH v2 09/38] Integrate I/O memory regions into qemu

2011-08-03 Thread Avi Kivity
get_system_io() returns the root I/O memory region. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- exec-memory.h |2 ++ exec.c| 10 ++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/exec-memory.h

[PATCH v2 05/38] cirrus: simplify bitblt BAR access functions

2011-08-03 Thread Avi Kivity
Make use of the memory API's ability to satisfy multi-byte accesses via multiple single-byte accesses. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/cirrus_vga.c | 81 +-- 1 files changed, 13

[PATCH v2 08/38] cirrus: simplify linear framebuffer access functions

2011-08-03 Thread Avi Kivity
Make use of the memory API's ability to satisfy multi-byte accesses via multiple single-byte accesses. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/cirrus_vga.c | 74 ++- 1 files changed, 8

[PATCH v2 07/38] vga: simplify vga window mmio access functions

2011-08-03 Thread Avi Kivity
Make use of the memory API's ability to satisfy multi-byte accesses via multiple single-byte accesses. We have to keep vga_mem_{read,write}b() since they're used by cirrus. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/cirrus_vga.c |4 +-

[PATCH v2 02/38] vmsvga: don't remember pci BAR address in callback any more

2011-08-03 Thread Avi Kivity
We're going to remove the callback, so we can't use it to save the address. Use the pci API instead. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/vmware_vga.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git

[PATCH v2 03/38] vga: convert vga and its derivatives to the memory API

2011-08-03 Thread Avi Kivity
Convert all vga memory to the memory API. Note we need to fall back to get_system_memory(), since the various buses don't pass the vga window as a memory region. We no longer need to sync the dirty bitmap of the cirrus mapped memory banks, since the memory API takes care of that for us. [jan:

[PATCH v2 11/38] pci: allow I/O BARs to be registered with pci_register_bar_region()

2011-08-03 Thread Avi Kivity
Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/pci.c | 43 +++ hw/pci.h |1 + hw/pci_internals.h |3 ++- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git

[PATCH v2 12/38] rtl8139: convert to memory API

2011-08-03 Thread Avi Kivity
Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/rtl8139.c | 72 ++--- 1 files changed, 38 insertions(+), 34 deletions(-) diff --git a/hw/rtl8139.c b/hw/rtl8139.c index 5214b8c..dfbab90 100644

[PATCH v2 10/38] pci: pass I/O address space to new PCI bus

2011-08-03 Thread Avi Kivity
This lets us register BARs in the I/O address space. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/apb_pci.c |1 + hw/bonito.c|1 + hw/grackle_pci.c |8 ++-- hw/gt64xxx.c |4 +++- hw/pc.h|

[PATCH v2 13/38] ac97: convert to memory API

2011-08-03 Thread Avi Kivity
fixes BAR sizing as well. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/ac97.c | 88 +++- 1 files changed, 51 insertions(+), 37 deletions(-) diff --git a/hw/ac97.c b/hw/ac97.c index

[PATCH v2 14/38] e1000: convert to memory API

2011-08-03 Thread Avi Kivity
Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/e1000.c | 114 +-- 1 files changed, 48 insertions(+), 66 deletions(-) diff --git a/hw/e1000.c b/hw/e1000.c index 96d84f9..dfc082b 100644 ---

[PATCH v2 20/38] ahci: convert to memory API

2011-08-03 Thread Avi Kivity
Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/ide/ahci.c | 31 +-- hw/ide/ahci.h |2 +- hw/ide/ich.c |3 +-- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c

[PATCH v2 15/38] eepro100: convert to memory API

2011-08-03 Thread Avi Kivity
Note: the existing code aliases the flash BAR into the MMIO bar. This is probably a bug. This patch does not correct the problem. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/eepro100.c | 182

[PATCH v2 21/38] intel-hda: convert to memory API

2011-08-03 Thread Avi Kivity
Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/intel-hda.c | 35 +++ 1 files changed, 19 insertions(+), 16 deletions(-) diff --git a/hw/intel-hda.c b/hw/intel-hda.c index 5a2bc3a..1e4c71e 100644 ---

[PATCH v2 19/38] virtio-pci: convert to memory API

2011-08-03 Thread Avi Kivity
except msix. [jan: fix build] Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/virtio-pci.c | 74 ++ hw/virtio-pci.h |2 +- 2 files changed, 31 insertions(+), 45 deletions(-) diff --git

[PATCH v2 27/38] isa-mmio: concert to memory API

2011-08-03 Thread Avi Kivity
Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/isa.h |2 ++ hw/isa_mmio.c | 30 +++--- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/hw/isa.h b/hw/isa.h index d2b6126..f1f2181 100644 ---

[PATCH v2 16/38] es1370: convert to memory API

2011-08-03 Thread Avi Kivity
Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/es1370.c | 43 +-- 1 files changed, 25 insertions(+), 18 deletions(-) diff --git a/hw/es1370.c b/hw/es1370.c index 1ed62b7..6a01797 100644 --- a/hw/es1370.c

[PATCH v2 29/38] ehci: convert to memory API

2011-08-03 Thread Avi Kivity
Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/usb-ehci.c | 36 +--- 1 files changed, 9 insertions(+), 27 deletions(-) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index 8b0dcc3..025ed1f 100644 --- a/hw/usb-ehci.c

[PATCH v2 18/38] ivshmem: convert to memory API

2011-08-03 Thread Avi Kivity
excluding msix. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/ivshmem.c | 148 -- 1 files changed, 50 insertions(+), 98 deletions(-) diff --git a/hw/ivshmem.c b/hw/ivshmem.c index

[PATCH v2 33/38] pci: remove pci_register_bar_simple()

2011-08-03 Thread Avi Kivity
Reviewed-by: Richard Henderson r...@twiddle.net Superceded by pci_register_bar_region(). --- hw/pci.c | 17 - hw/pci.h |3 --- 2 files changed, 0 insertions(+), 20 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 980840f..6aca1af 100644 --- a/hw/pci.c +++ b/hw/pci.c @@

[PATCH v2 22/38] lsi53c895a: convert to memory API

2011-08-03 Thread Avi Kivity
An optimization that fast-pathed DMA reads from the SCRIPTS memory was removed int the process. Likely it breaks with iommus anyway. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/lsi53c895a.c | 258

[PATCH v2 28/38] sun4u: convert to memory API

2011-08-03 Thread Avi Kivity
fixes memory leak on repeated BAR map/unmap Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/sun4u.c | 55 +-- 1 files changed, 25 insertions(+), 30 deletions(-) diff --git a/hw/sun4u.c

[PATCH v2 31/38] xen-platform: convert to memory API

2011-08-03 Thread Avi Kivity
Since this device bypasses PCI and registers I/O ports directly with the system bus, it needs further attention. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/xen_platform.c | 84 - 1 files

[PATCH v2 24/38] ne2000: convert to memory API

2011-08-03 Thread Avi Kivity
Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/ne2000-isa.c | 14 +++--- hw/ne2000.c | 77 +- hw/ne2000.h |8 + 3 files changed, 59 insertions(+), 40 deletions(-) diff

[PATCH v2 30/38] uhci: convert to memory API

2011-08-03 Thread Avi Kivity
Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/usb-uhci.c | 42 -- 1 files changed, 28 insertions(+), 14 deletions(-) diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c index da74c57..96a17bd 100644 ---

[PATCH v2 17/38] ide: convert to memory API

2011-08-03 Thread Avi Kivity
Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/ide/cmd646.c | 208 +++ hw/ide/pci.c| 25 --- hw/ide/pci.h| 19 - hw/ide/piix.c | 64 + hw/ide/via.c|

[PATCH v2 34/38] pci: convert pci rom to memory API

2011-08-03 Thread Avi Kivity
Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/pci.c | 20 +++- hw/pci.h |3 ++- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 6aca1af..481eb7e 100644 --- a/hw/pci.c +++ b/hw/pci.c

[PATCH v2 32/38] msix: convert to memory API

2011-08-03 Thread Avi Kivity
The msix table is defined as a subregion, to allow for a BAR that mixes device specific regions with the msix table. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/ivshmem.c| 11 + hw/msix.c | 64

[PATCH v2 37/38] pci: rename pci_register_bar_region() to pci_register_bar()

2011-08-03 Thread Avi Kivity
Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/ac97.c |4 ++-- hw/cirrus_vga.c |5 ++--- hw/e1000.c|5 ++--- hw/eepro100.c |7 +++ hw/es1370.c |2 +- hw/ide/cmd646.c | 14 +-

[PATCH v2 36/38] pci: fold BAR mapping function into its caller

2011-08-03 Thread Avi Kivity
There is only one function, so no need for a function pointer. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/pci.c | 25 + hw/pci.h |1 - 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/hw/pci.c

[PATCH v2 38/38] pci: remove support for pre memory API BARs

2011-08-03 Thread Avi Kivity
Not used anymore. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/pci.c | 33 ++--- 1 files changed, 2 insertions(+), 31 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 6ed08ae..e6a3e56 100644 --- a/hw/pci.c +++

[PATCH v2 35/38] pci: remove pci_register_bar()

2011-08-03 Thread Avi Kivity
Superceded by pci_register_bar_region(). The implementations are folded together. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/pci.c | 42 +- hw/pci.h |3 --- 2 files changed, 17 insertions(+), 28

[PATCH v2 23/38] ppc: convert to memory API

2011-08-03 Thread Avi Kivity
Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/cuda.c |6 ++- hw/escc.c | 42 +-- hw/escc.h |2 +- hw/heathrow_pic.c | 29 -- hw/ide.h |2 +- hw/ide/macio.c

[PATCH v2 26/38] i6300esb: convert to memory API

2011-08-03 Thread Avi Kivity
Also add missing destructor. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/wdt_i6300esb.c | 43 +-- 1 files changed, 29 insertions(+), 14 deletions(-) diff --git a/hw/wdt_i6300esb.c b/hw/wdt_i6300esb.c

[PATCH v2 25/38] pcnet: convert to memory API

2011-08-03 Thread Avi Kivity
Also related chips. Reviewed-by: Richard Henderson r...@twiddle.net Signed-off-by: Avi Kivity a...@redhat.com --- hw/lance.c | 31 ++- hw/pcnet-pci.c | 74 +-- hw/pcnet.h |4 ++- 3 files changed, 61

Re: qemu-kvm aborts - vhost_dev_unassign_memory: Assertion `to = 0' failed.

2011-08-03 Thread Michael S. Tsirkin
On Wed, Aug 03, 2011 at 02:48:05PM +0300, Avi Kivity wrote: On 08/01/2011 08:44 PM, David Ahern wrote: qemu-kvm.git as of: commit dacdc4b10bafbb21120e1c24a9665444768ef999 Merge: 7b69d4f 0af4922 Author: Avi Kivitya...@redhat.com Date: Sun Jul 31 11:42:26 2011 +0300 Merge branch

Re: [Qemu-devel] qemu-kvm aborts - vhost_dev_unassign_memory: Assertion `to = 0' failed.

2011-08-03 Thread Michael S. Tsirkin
On Mon, Aug 01, 2011 at 11:44:23AM -0600, David Ahern wrote: qemu-kvm.git as of: commit dacdc4b10bafbb21120e1c24a9665444768ef999 Merge: 7b69d4f 0af4922 Author: Avi Kivity a...@redhat.com Date: Sun Jul 31 11:42:26 2011 +0300 Merge branch 'upstream-merge' into next is aborting

Re: [PATCH v2 2/2] kvm tools: Add '--rootfs' and '--binsh'

2011-08-03 Thread Pekka Enberg
On 8/3/11 5:52 AM, Aneesh Kumar K.V wrote: On Tue, 2 Aug 2011 21:46:29 +0300, Sasha Levinlevinsasha...@gmail.com wrote: This patch adds 2 new flags: --rootfs [path] - Specifies a path to use as rootfs. The path will be mounted using virtio-9p and booted from. Easiest way to test it is to

Re: qemu-kvm aborts - vhost_dev_unassign_memory: Assertion `to = 0' failed.

2011-08-03 Thread David Ahern
On 08/03/2011 06:24 AM, Michael S. Tsirkin wrote: On Wed, Aug 03, 2011 at 02:48:05PM +0300, Avi Kivity wrote: On 08/01/2011 08:44 PM, David Ahern wrote: qemu-kvm.git as of: commit dacdc4b10bafbb21120e1c24a9665444768ef999 Merge: 7b69d4f 0af4922 Author: Avi Kivitya...@redhat.com Date: Sun

Re: [Autotest] [PATCH] KVM-test: Add hdparm subtest

2011-08-03 Thread Lukáš Doktor
Reviewed, looks sane. Lukáš Dne 2.8.2011 05:39, Amos Kong napsal(a): This test uses 'hdparm' to set disk device to low/high performance status, and compare the reading speed. The emulated device should pass all the tests. Signed-off-by: Feng Yangfy...@redhat.com Signed-off-by: Amos

[RFC PATCH 0/3] Avoid soft lockup message when KVM is stopped by host

2011-08-03 Thread Eric B Munson
This set is just a rough first pass at avoiding soft lockup warnings when a host pauses the execution of a guest. A flag is set by the host in the shared page used for the pvclock when the host goes to stop the guest. When the guest resumes and detects a soft lockup, this flag is checked and

[RFC PATCH 1/3] Add flag to indicate that a vm was stopped by the host

2011-08-03 Thread Eric B Munson
This flag will be used to check if the vm was stopped by the host when a soft lockup was detected. Signed-off-by: Eric B Munson emun...@mgebm.net --- arch/x86/include/asm/pvclock-abi.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm/pvclock-abi.h

[RFC PATCH 2/3] Add functions to check if the host has stopped the vm

2011-08-03 Thread Eric B Munson
When a host stops or suspends a VM it will set a flag to show this. The watchdog will use these functions to determine if a softlockup is real, or the result of a suspended VM. Signed-off-by: Eric B Munson emun...@mgebm.net --- arch/x86/include/asm/pvclock.h |3 +++

[RFC PATCH 3/3] Add check for suspended vm in softlockup detector

2011-08-03 Thread Eric B Munson
A suspended VM can cause spurious soft lockup warnings. To avoid these, the watchdog now checks if the kernel knows it was stopped by the host and skips the warning if so. Signed-off-by: Eric B Munson emun...@mgebm.net --- kernel/watchdog.c | 11 +++ 1 files changed, 11 insertions(+),

Re: [PATCH v2] memory: use signed arithmetic

2011-08-03 Thread Richard Henderson
On 08/03/2011 01:56 AM, Avi Kivity wrote: When trying to map an alias of a ram region, where the alias starts at address A and we map it into address B, and A B, we had an arithmetic underflow. Because we use unsigned arithmetic, the underflow converted into a large number which failed

Re: qemu-kvm aborts - vhost_dev_unassign_memory: Assertion `to = 0' failed.

2011-08-03 Thread Michael S. Tsirkin
On Wed, Aug 03, 2011 at 07:55:47AM -0600, David Ahern wrote: Tested-by: David Ahern daah...@cisco.com David Applied, thanks very much. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH 20/39] virtio-pci: convert to memory API

2011-08-03 Thread Michael S. Tsirkin
On Mon, Aug 01, 2011 at 01:23:22PM +0300, Michael S. Tsirkin wrote: On Mon, Aug 01, 2011 at 12:35:44PM +0300, Avi Kivity wrote: On 08/01/2011 11:26 AM, Michael S. Tsirkin wrote: static void virtio_write_config(PCIDevice *pci_dev, uint32_t address,

Re: [PATCH 20/39] virtio-pci: convert to memory API

2011-08-03 Thread Avi Kivity
On 08/03/2011 06:16 PM, Michael S. Tsirkin wrote: Well, the reason we have this logic here, I think, is to make sure it runs before the guest accesses the configuration with a write access. I'm not sure why we don't do this in the init callback - Anthony? So the following should do

Re: [PATCH 20/39] virtio-pci: convert to memory API

2011-08-03 Thread Michael S. Tsirkin
On Wed, Aug 03, 2011 at 06:23:41PM +0300, Avi Kivity wrote: On 08/03/2011 06:16 PM, Michael S. Tsirkin wrote: Well, the reason we have this logic here, I think, is to make sure it runs before the guest accesses the configuration with a write access. I'm not sure why we don't do

Re: [PATCHv3] virtio-spec: 64 bit features, used/avail event, fixes

2011-08-03 Thread Michael S. Tsirkin
On Thu, Jun 02, 2011 at 11:19:35AM +0930, Rusty Russell wrote: On Wed, 1 Jun 2011 13:25:48 +0300, Michael S. Tsirkin m...@redhat.com wrote: Add an option to modify the notificatin hand-off in virtio to be basically like Xen: each side published an index, the other side only triggers an

Re: [PATCHv3] virtio-spec: 64 bit features, used/avail event, fixes

2011-08-03 Thread Gerd Hoffmann
Hi, E.g. with 32 bridges, and 32 devices behind each one, the available 64K space gets us only 64 bytes per device. 15 bridges (with io window enabled) max, the smallest io window you can assign to a bridge is 4k, and you need some space for the devices on the root bus ... cheers,

Re: [PATCH v2 2/2] kvm tools: Add '--rootfs' and '--binsh'

2011-08-03 Thread Asias He
On 08/03/2011 02:46 AM, Sasha Levin wrote: This patch adds 2 new flags: --rootfs [path] - Specifies a path to use as rootfs. The path will be mounted using virtio-9p and booted from. Easiest way to test it is to mount the sample image we recommend with kvm tool

Re: [PATCH] cpu hotplug issue

2011-08-03 Thread Vasilis Liaskovitis
On Wed, Aug 03, 2011 at 12:42:11PM +0200, Jan Kiszka wrote: Why can't Seabios read to true number online CPUs from the PIIX4 device? The information is there already, no need for addition PV here. Where is it in PIIX4 device? PROC registers (or however they are called). In qemu-kvm,

Re: [PATCHv3] virtio-spec: 64 bit features, used/avail event, fixes

2011-08-03 Thread Michael S. Tsirkin
On Wed, Aug 03, 2011 at 06:15:33PM +0200, Gerd Hoffmann wrote: Hi, E.g. with 32 bridges, and 32 devices behind each one, the available 64K space gets us only 64 bytes per device. 15 bridges (with io window enabled) max, the smallest io window you can assign to a bridge is 4k, Hmm true,

Re: [PATCHv3] virtio-spec: 64 bit features, used/avail event, fixes

2011-08-03 Thread Michael S. Tsirkin
On Wed, Aug 03, 2011 at 06:15:33PM +0200, Gerd Hoffmann wrote: Hi, E.g. with 32 bridges, and 32 devices behind each one, the available 64K space gets us only 64 bytes per device. 15 bridges (with io window enabled) max, the smallest io window you can assign to a bridge is 4k, and you

[PATCH] powerpc/kvm: fix build errors with older toolchains

2011-08-03 Thread Nishanth Aravamudan
On a box with gcc 4.3.2, I see errors like: arch/powerpc/kvm/book3s_hv_rmhandlers.S:1254: Error: Unrecognized opcode: stxvd2x arch/powerpc/kvm/book3s_hv_rmhandlers.S:1316: Error: Unrecognized opcode: lxvd2x Signed-off-by: Nishanth Aravamudan n...@us.ibm.com ---

Re: [PATCH RFC net-next] virtio_net: refill buffer right after being used

2011-08-03 Thread Michael S. Tsirkin
On Fri, Jul 29, 2011 at 03:55:31PM -0700, Shirley Ma wrote: Resubmit it with a typo fix. Signed-off-by: Shirley Ma x...@us.ibm.com --- diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 0c7321c..c8201d4 100644 --- a/drivers/net/virtio_net.c +++

Re: [PATCH RFC net-next] virtio_net: refill buffer right after being used

2011-08-03 Thread Michael S. Tsirkin
On Sat, Jul 30, 2011 at 10:16:15PM -0700, Shirley Ma wrote: It averages the latency between each receive by filling only one set of buffers vs. either none buffers or 1/2 ring size buffers fill between receives. I see how the overhead of allocating memory is spread more evenly. Does this

[PATCH] KVM-test: Add subtest: usb v4

2011-08-03 Thread Lucas Meneghel Rodrigues
From: Amos Kong ak...@redhat.com This test adds a usb storage for the guest, and do some check from monitor and inside the guest. Changes from v1: - use old options to add a usb disk to guest '-usbdevice disk:format=qcow2:/tmp/usbdevice.qcow2' - identify device name of new disk by

Re: [PATCH] pci-assign: Do not expose MSI/MSI-X if the kernel does not support it

2011-08-03 Thread Marcelo Tosatti
On Tue, Aug 02, 2011 at 02:27:26PM +0200, Jan Kiszka wrote: Add checks for KVM_CAP_ASSIGN_DEV_IRQ (MSI) and KVM_CAP_DEVICE_MSIX, do not set up MSI/MSI-X if the required kernel features are missing. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- hw/device-assignment.c |6 --

Re: [PATCH 3/3] Fix TSC MSR read in nested SVM

2011-08-03 Thread Marcelo Tosatti
On Wed, Aug 03, 2011 at 01:34:58AM -0700, Zachary Amsden wrote: Caution: this requires more care. Pretty sure this breaks userspace suspend at the cost of supporting a not-so-reasonable hardware feature. On Tue, Aug 2, 2011 at 5:55 AM, Nadav Har'El n...@il.ibm.com wrote: When the TSC MSR

Re: [PATCH -next] kvm: uses TASKSTATS, depends on NET

2011-08-03 Thread Marcelo Tosatti
On Tue, Aug 02, 2011 at 12:54:31PM -0700, Randy Dunlap wrote: From: Randy Dunlap rdun...@xenotime.net CONFIG_TASKSTATS just had a change to use netlink, including a change to depends on NET. Since select does not follow dependencies, KVM also needs to depend on NET to prevent build errors

[PATCH] KVM test: Add hdparm subtest v2

2011-08-03 Thread Lucas Meneghel Rodrigues
From: Amos Kong ak...@redhat.com This test uses 'hdparm' to set disk device to low/high performance status, and compare the reading speed. The emulated device should pass all the tests. Changes from v1: * Little changes in message wording * Better logging of hdparm messages (better looking

Re: [Autotest] [PATCH] KVM-test: Add hdparm subtest

2011-08-03 Thread Lucas Meneghel Rodrigues
It does look sane to me too. However, I find this to work only under virtio_blk. (ide hard drive that qemu has doesn't have the needed ioctls for hdparm to work) Amos and Feng, I'll trust that this somehow should pass on non-virtio, so I won't restrict it to virtio_blk. I made some minor changes

Re: [Autotest] [PATCH] [NEW] cgroup test * general smoke_test + module dependend subtests (memory test included) * library for future use in other tests (kvm)

2011-08-03 Thread Lucas Meneghel Rodrigues
On Tue, Aug 2, 2011 at 11:50 AM, Lukas Doktor ldok...@redhat.com wrote: From: root r...@dhcp-26-193.brq.redhat.com Ok Lukas, give me some time to go through this, I have started this but will probably take a while to finish. Cheers! cgroup.py: * structure for different cgroup subtests *

Re: kvm PCI assignment VFIO ramblings

2011-08-03 Thread David Gibson
On Tue, Aug 02, 2011 at 09:44:49PM -0600, Alex Williamson wrote: On Wed, 2011-08-03 at 12:04 +1000, David Gibson wrote: On Tue, Aug 02, 2011 at 12:35:19PM -0600, Alex Williamson wrote: On Tue, 2011-08-02 at 12:14 -0600, Alex Williamson wrote: On Tue, 2011-08-02 at 18:28 +1000, David

[PATCH v1] qmp/hmp: add block_set_io_throttle and enhance query_block

2011-08-03 Thread Zhi Yong Wu
The brief intro: This patch is created based on the code V4 for block I/O throttling. It mainly adds a new qmp/hmp command block_set_io_throttle, and enhances query_block(qmp) and info block(hmp) to display current I/O throttling settings. Welcome to all kinds of comments from you.

[RFC PATCH 0/3] Avoid soft lockup message when KVM is stopped by host

2011-08-03 Thread Eric B Munson
This set is just a rough first pass at avoiding soft lockup warnings when a host pauses the execution of a guest. A flag is set by the host in the shared page used for the pvclock when the host goes to stop the guest. When the guest resumes and detects a soft lockup, this flag is checked and

[RFC PATCH 2/3] Add functions to check if the host has stopped the vm

2011-08-03 Thread Eric B Munson
When a host stops or suspends a VM it will set a flag to show this. The watchdog will use these functions to determine if a softlockup is real, or the result of a suspended VM. Signed-off-by: Eric B Munson emun...@mgebm.net --- arch/x86/include/asm/pvclock.h |3 +++

[RFC PATCH 3/3] Add check for suspended vm in softlockup detector

2011-08-03 Thread Eric B Munson
A suspended VM can cause spurious soft lockup warnings. To avoid these, the watchdog now checks if the kernel knows it was stopped by the host and skips the warning if so. Signed-off-by: Eric B Munson emun...@mgebm.net --- kernel/watchdog.c | 11 +++ 1 files changed, 11 insertions(+),

[PATCH] powerpc/kvm: fix build errors with older toolchains

2011-08-03 Thread Nishanth Aravamudan
On a box with gcc 4.3.2, I see errors like: arch/powerpc/kvm/book3s_hv_rmhandlers.S:1254: Error: Unrecognized opcode: stxvd2x arch/powerpc/kvm/book3s_hv_rmhandlers.S:1316: Error: Unrecognized opcode: lxvd2x Signed-off-by: Nishanth Aravamudan n...@us.ibm.com ---