Re: [Qemu-devel] [PATCH 0/6][v2] Check for supported SCSI commands

2011-07-26 Thread Hannes Reinecke
On 07/25/2011 06:04 PM, Markus Armbruster wrote: Hannes Reineckeh...@suse.de writes: Markus Armbruster pointed out that not every SCSI command is supported for a given device type. Based on his patch and suggestiongs this series cleans up the SCSI device type and adds a check for supported

Re: [Qemu-devel] [PATCH 5/6] scsi-disk: Remove 'drive_kind'

2011-07-26 Thread Hannes Reinecke
On 07/25/2011 05:59 PM, Markus Armbruster wrote: Hannes Reineckeh...@suse.de writes: Instead of using its own definitions scsi-disk should be using the device type of the parent device. Signed-off-by: Hannes Reineckeh...@suse.de --- hw/scsi-defs.h |6 +- hw/scsi-disk.c | 48

Re: [Qemu-devel] [PATCH 5/6] scsi-disk: Remove 'drive_kind'

2011-07-26 Thread Markus Armbruster
Hannes Reinecke h...@suse.de writes: On 07/25/2011 05:59 PM, Markus Armbruster wrote: Hannes Reineckeh...@suse.de writes: Instead of using its own definitions scsi-disk should be using the device type of the parent device. Signed-off-by: Hannes Reineckeh...@suse.de --- hw/scsi-defs.h

Re: Windows7 crashes inside the VM when starting a certain program

2011-07-26 Thread Jan Kiszka
On 2011-07-26 07:29, André Weidemann wrote: On 07.07.2011 07:26, André Weidemann wrote: Hi, I am running Windows7 x64 in a VM which crashes after starting a certain game. Actually there are two games both from the same company, that make the VM crash after starting them. Windows crashes

Re: [Qemu-devel] [PATCH 5/6] scsi-disk: Remove 'drive_kind'

2011-07-26 Thread Hannes Reinecke
On 07/26/2011 08:38 AM, Markus Armbruster wrote: Hannes Reineckeh...@suse.de writes: On 07/25/2011 05:59 PM, Markus Armbruster wrote: Hannes Reineckeh...@suse.de writes: Instead of using its own definitions scsi-disk should be using the device type of the parent device. Signed-off-by:

Re: [RFC v5 86/86] 440fx: fix PAM, PCI holes

2011-07-26 Thread Avi Kivity
On 07/26/2011 12:34 AM, Eric Northup wrote: On Wed, Jul 20, 2011 at 9:50 AM, Avi Kivitya...@redhat.com wrote: [...] @@ -130,7 +137,13 @@ static void pc_init1(MemoryRegion *system_memory, if (pci_enabled) { pci_bus = i440fx_init(i440fx_state,piix3_devfn, isa_irq, -

Re: virtagent for qemu-kvm ?

2011-07-26 Thread Stefan Hajnoczi
On Tue, Jul 26, 2011 at 6:58 AM, Prateek Sharma prate...@cse.iitb.ac.in wrote: On Tue, 26 Jul 2011, Stefan Hajnoczi wrote: On Tue, Jul 26, 2011 at 6:05 AM, Prateek Sharma prate...@cse.iitb.ac.in wrote: Hi all,    Is there any equivalent of qemu's virtagent in qemu-kvm?

[PATCH 1/1] The codes V2 for QEMU disk I/O limits.

2011-07-26 Thread Zhi Yong Wu
Welcome to give me your comments, thanks. Signed-off-by: Zhi Yong Wu wu...@linux.vnet.ibm.com --- Makefile.objs |2 +- block.c | 288 +++-- block.h |1 - block/blk-queue.c | 116 +

[PATCH 0/1] The intro for QEMU disk I/O limits

2011-07-26 Thread Zhi Yong Wu
The main goal of the patch is to effectively cap the disk I/O speed or counts of one single VM.It is only one draft, so it unavoidably has some drawbacks, if you catch them, please let me know. The patch will mainly introduce one block I/O throttling algorithm, one global timer and one block

[PATCH v2 0/1] The intro for QEMU disk I/O limits

2011-07-26 Thread Zhi Yong Wu
The main goal of the patch is to effectively cap the disk I/O speed or counts of one single VM.It is only one draft, so it unavoidably has some drawbacks, if you catch them, please let me know. The patch will mainly introduce one block I/O throttling algorithm, one global timer and one block

[PATCH v2 1/1] The codes V2 for QEMU disk I/O limits.

2011-07-26 Thread Zhi Yong Wu
Welcome to give me your comments, thanks. Signed-off-by: Zhi Yong Wu wu...@linux.vnet.ibm.com --- Makefile.objs |2 +- block.c | 288 +++-- block.h |1 - block/blk-queue.c | 116 +

Re: [Qemu-devel] [PATCH 01/23] Hierarchical memory region API

2011-07-26 Thread Avi Kivity
On 07/25/2011 09:41 PM, Anthony Liguori wrote: +/* Initialize a memory region + * + * The region typically acts as a container for other memory regions. + */ I'm also writing a fair bit of documentation right now. We should use a common format and declare that the doc format in

Re: [Qemu-devel] [PATCH 03/23] memory: merge adjacent segments of a single memory region

2011-07-26 Thread Avi Kivity
On 07/25/2011 09:48 PM, Anthony Liguori wrote: +/* Attempt to simplify a view by merging ajacent ranges */ +static void flatview_simplify(FlatView *view) +{ +unsigned i; +FlatRange *r1, *r2; + +for (i = 0; i + 1 view-nr; ++i) { +r1 =view-ranges[i]; +r2

Re: [Qemu-devel] [PATCH 06/23] memory: rename MemoryRegion::has_ram_addr to ::terminates

2011-07-26 Thread Avi Kivity
On 07/25/2011 09:56 PM, Anthony Liguori wrote: On 07/25/2011 09:02 AM, Avi Kivity wrote: I/O regions will not have ram_addrs, so this is a better name. Signed-off-by: Avi Kivitya...@redhat.com Reviewed-by: Anthony Liguori aligu...@us.ibm.com Although it seems squashable. Yeah, I'm loath

Re: Windows7 crashes inside the VM when starting a certain program

2011-07-26 Thread Gleb Natapov
On Tue, Jul 26, 2011 at 07:29:04AM +0200, André Weidemann wrote: On 07.07.2011 07:26, André Weidemann wrote: Hi, I am running Windows7 x64 in a VM which crashes after starting a certain game. Actually there are two games both from the same company, that make the VM crash after starting them.

Re: [Qemu-devel] [PATCH 11/23] memory: add ioeventfd support

2011-07-26 Thread Avi Kivity
On 07/25/2011 10:08 PM, Anthony Liguori wrote: +static void as_memory_ioeventfd_add(AddressSpace *as, MemoryRegionIoeventfd *fd) +{ +int r; + +if (!fd-match_data || fd-addr.size != 4) { +abort(); +} + +r = kvm_set_ioeventfd_mmio_long(fd-fd, fd-addr.start, fd-data,

Re: [Qemu-devel] [PATCH 12/23] memory: separate building the final memory map into two steps

2011-07-26 Thread Avi Kivity
On 07/25/2011 10:12 PM, Anthony Liguori wrote: On 07/25/2011 09:02 AM, Avi Kivity wrote: Instead of adding and deleting regions in one pass, do a delete pass followed by an add pass. This fixes the following case: from: 0x-0x0fff ram (a1) 0x1000-0x1fff mmio (a2) 0x2000-0x2fff

Re: [Qemu-devel] [PATCH 13/23] memory: document the memory API

2011-07-26 Thread Avi Kivity
On 07/25/2011 10:15 PM, Anthony Liguori wrote: +Region names + + +Regions are assigned names by the constructor. For most regions these are +only used for debugging purposes, but RAM regions also use the name to identify +live migration sections. This means that RAM region names

Re: [PATCH v3] pci: correct pci config size default for cap version 2 endpoints

2011-07-26 Thread Michael S. Tsirkin
On Mon, Jul 25, 2011 at 04:42:50PM -0400, Don Dutile wrote: On 07/25/2011 04:20 PM, Alex Williamson wrote: On Mon, 2011-07-25 at 15:37 -0400, Don Dutile wrote: On 07/24/2011 06:58 AM, Michael S. Tsirkin wrote: On Sun, Jul 24, 2011 at 11:41:10AM +0300, Michael S. Tsirkin wrote: On Sun, Jul 24,

Re: [Qemu-devel] [PATCH 14/23] memory: transaction API

2011-07-26 Thread Avi Kivity
On 07/25/2011 10:16 PM, Anthony Liguori wrote: On 07/25/2011 09:02 AM, Avi Kivity wrote: Allow changes to the memory hierarchy to be accumulated and made visible all at once. This reduces computational effort, especially when an accelerator (e.g. kvm) is involved. Useful when a single

Re: [Qemu-devel] [PATCH 15/23] exec.c: initialize memory map

2011-07-26 Thread Avi Kivity
On 07/25/2011 10:17 PM, Anthony Liguori wrote: +static void memory_map_init(void) +{ +system_memory = qemu_malloc(sizeof(*system_memory)); +memory_region_init(system_memory, system, UINT64_MAX); Would be nice to #define MEM_REG_SIZE_ALL UINT64_MAX Without reading the docs, it seems

Re: Windows7 crashes inside the VM when starting a certain program

2011-07-26 Thread André Weidemann
Hi, On 26.07.2011 12:08, Gleb Natapov wrote: On Tue, Jul 26, 2011 at 07:29:04AM +0200, André Weidemann wrote: On 07.07.2011 07:26, André Weidemann wrote: Hi, I am running Windows7 x64 in a VM which crashes after starting a certain game. Actually there are two games both from the same company,

Re: [Qemu-devel] [PATCH 16/23] ioport: register ranges by byte aligned addresses always

2011-07-26 Thread Avi Kivity
On 07/25/2011 10:20 PM, Anthony Liguori wrote: On 07/25/2011 09:02 AM, Avi Kivity wrote: The I/O port space is byte addressable, even for word and long accesses. An example is the VMware svga card, which has long ports on offsets 0, 1, and 2. Signed-off-by: Avi Kivitya...@redhat.com I've

Re: [Qemu-devel] [PATCH 19/23] pc: move global memory map out of pc_init1() and into its callers

2011-07-26 Thread Avi Kivity
On 07/25/2011 11:02 PM, Anthony Liguori wrote: On 07/25/2011 09:03 AM, Avi Kivity wrote: Signed-off-by: Avi Kivitya...@redhat.com What's the rationale here? Removing globals and making dependencies explicit. -- error compiling committee.c: too many arguments to function -- To unsubscribe

Re: [Qemu-devel] [PATCH 21/23] pci: add MemoryRegion based BAR management API

2011-07-26 Thread Avi Kivity
On 07/25/2011 11:20 PM, Anthony Liguori wrote: On 07/25/2011 09:03 AM, Avi Kivity wrote: Allow registering a BAR using a MemoryRegion. Once all users are converted, pci_register_bar() and pci_register_bar_simple() will be removed. Signed-off-by: Avi Kivitya...@redhat.com diff --git

Re: [Qemu-devel] KVM call agenda for July 26

2011-07-26 Thread Stefan Hajnoczi
On Tue, Jul 26, 2011 at 12:30 AM, Juan Quintela quint...@redhat.com wrote: Please send in any agenda items you are interested in covering. 0.15.0 release candidate testing * http://wiki.qemu.org/Planning/0.15/Testing * Please test hosts, targets, subsystems, or features you care about! * May

Re: [RFC PATCH 2/2] separate thread for VM migration

2011-07-26 Thread Paolo Bonzini
On 07/22/2011 09:58 PM, Umesh Deshapnde wrote: -qemu_mod_timer(s-timer, qemu_get_clock_ms(rt_clock) + 100); +qemu_mod_timer(s-timer, qemu_get_clock_ms(migration_clock) + 100); if (s-freeze_output) return; @@ -246,8 +246,10 @@ static void buffered_rate_tick(void *opaque)

[PATCH 0/11] KVM: x86: optimize for guest page written

2011-07-26 Thread Xiao Guangrong
Too keep shadow page consistency, we should write-protect the guest page if if it is a page structure. Unfortunately, even if the guest page structure is tear-down and is used for other usage, we still write-protect it and cause page fault if it is written, in this case, we need to zap the

[PATCH 01/11] KVM: MMU: avoid pte_list_desc run out in kvm_mmu_pte_write

2011-07-26 Thread Xiao Guangrong
kvm_mmu_pte_write is unsafe since we need to alloc pte_list_desc in the function when spte is prefetched, unfortunately, we can not know how many spte need to be prefetched on this path, that means we can use out of the free pte_list_desc object in the cache, and BUG_ON() is triggered, also some

[PATCH 02/11] KVM: x86: cleanup pio/pout emulated

2011-07-26 Thread Xiao Guangrong
Remove the same code between emulator_pio_in_emulated and emulator_pio_out_emulated Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/x86.c | 59 ++- 1 files changed, 26 insertions(+), 33 deletions(-) diff --git

[PATCH 03/11] KVM: x86: fast emulate repeat string write instructions

2011-07-26 Thread Xiao Guangrong
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 cache for 1024 times, it is terrible In fact,

[PATCH 04/11] KVM: MMU: do not mark access bit on pte write path

2011-07-26 Thread Xiao Guangrong
In current code, the accessed bit is always set when page fault occurred, do not need to set it on pte write path Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h |1 - arch/x86/kvm/mmu.c | 22 +- 2 files

[PATCH v2 00/23] Memory API, batch 1

2011-07-26 Thread Avi Kivity
This patchset contains the core of the memory API, with one device (usb-ohci) coverted for reference. The API is currently implemented on top of the old ram_addr_t/cpu_register_physical_memory() API, but the plan is to make it standalone later. The goals of the API are: - correctness: by

[PATCH v2 04/23] memory: merge adjacent segments of a single memory region

2011-07-26 Thread Avi Kivity
Simple implementations of memory routers, for example the Cirrus VGA memory banks or the 440FX PAM registers can generate adjacent memory regions which are contiguous. Detect these and merge them; this saves kvm memory slots and shortens lookup times. Signed-off-by: Avi Kivity a...@redhat.com

[PATCH v2 03/23] memory: implement dirty tracking

2011-07-26 Thread Avi Kivity
Currently dirty tracking is implemented by passing through all calls to the underlying cpu_physical_memory_*() calls. Reviewed-by: Anthony Liguori aligu...@us.ibm.com Signed-off-by: Avi Kivity a...@redhat.com --- memory.c | 39 +++ memory.h |1 + 2 files

[PATCH v2 01/23] Add memory API documentation

2011-07-26 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- docs/memory.txt | 172 +++ 1 files changed, 172 insertions(+), 0 deletions(-) create mode 100644 docs/memory.txt diff --git a/docs/memory.txt b/docs/memory.txt new file mode 100644 index

[PATCH v2 02/23] Hierarchical memory region API

2011-07-26 Thread Avi Kivity
The memory API separates the attributes of a memory region (its size, how reads or writes are handled, dirty logging, and coalescing) from where it is mapped and whether it is enabled. This allows a device to configure a memory region once, then hand it off to its parent bus to map it according

[PATCH v2 08/23] memory: late initialization of ram_addr

2011-07-26 Thread Avi Kivity
For non-RAM memory regions, we cannot tell whether this is an I/O region or an MMIO region. Since the qemu backing registration is different for the two, we have to defer initialization until we know which address space we are in. These shenanigans will be removed once the backing registration

[PATCH v2 05/23] Internal interfaces for memory API

2011-07-26 Thread Avi Kivity
get_system_memory() provides the root of the memory hierarchy. This interface is intended to be private between memory.c and exec.c. If this file is included elsewhere, it should be regarded as a bug (or TODO item). However, it will be temporarily needed for the conversion to hierarchical memory

[PATCH v2 06/23] memory: abstract address space operations

2011-07-26 Thread Avi Kivity
Prepare for multiple address space support by abstracting away the details of registering a memory range with qemu's flat representation into an AddressSpace object. Note operations which are memory specific are not abstracted, since they will never be called on I/O address spaces anyway.

[PATCH v2 09/23] memory: I/O address space support

2011-07-26 Thread Avi Kivity
Allow registering I/O ports via the same mechanism as mmio ranges. Reviewed-by: Anthony Liguori aligu...@us.ibm.com Signed-off-by: Avi Kivity a...@redhat.com --- exec-memory.h |3 ++ memory.c | 60 - memory.h |2 + 3

[PATCH v2 07/23] memory: rename MemoryRegion::has_ram_addr to ::terminates

2011-07-26 Thread Avi Kivity
I/O regions will not have ram_addrs, so this is a better name. Reviewed-by: Anthony Liguori aligu...@us.ibm.com Signed-off-by: Avi Kivity a...@redhat.com --- memory.c | 18 +- memory.h |2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/memory.c

[PATCH v2 15/23] exec.c: initialize memory map

2011-07-26 Thread Avi Kivity
Allocate the root memory region and initialize it. Signed-off-by: Avi Kivity a...@redhat.com --- exec.c | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/exec.c b/exec.c index 2160ded..d51502f 100644 --- a/exec.c +++ b/exec.c @@ -33,6 +33,8 @@ #include

[PATCH v2 12/23] memory: add ioeventfd support

2011-07-26 Thread Avi Kivity
As with the rest of the memory API, the caller associates an eventfd with an address, and the memory API takes care of registering or unregistering when the address is made visible or invisible to the guest. Signed-off-by: Avi Kivity a...@redhat.com --- memory.c | 224

[PATCH v2 14/23] memory: transaction API

2011-07-26 Thread Avi Kivity
Allow changes to the memory hierarchy to be accumulated and made visible all at once. This reduces computational effort, especially when an accelerator (e.g. kvm) is involved. Useful when a single register update causes multiple changes to an address space. Signed-off-by: Avi Kivity

[PATCH v2 11/23] memory: add backward compatibility for old mmio registration

2011-07-26 Thread Avi Kivity
This eases the transition to the new API. Reviewed-by: Anthony Liguori aligu...@us.ibm.com Signed-off-by: Avi Kivity a...@redhat.com --- memory.c | 10 ++ memory.h | 10 ++ 2 files changed, 20 insertions(+), 0 deletions(-) diff --git a/memory.c b/memory.c index

[PATCH v2 10/23] memory: add backward compatibility for old portio registration

2011-07-26 Thread Avi Kivity
Reviewed-by: Anthony Liguori aligu...@us.ibm.com Signed-off-by: Avi Kivity a...@redhat.com --- memory.c | 32 memory.h | 17 + 2 files changed, 49 insertions(+), 0 deletions(-) diff --git a/memory.c b/memory.c index df0ed0e..5f2c9ef 100644 ---

[PATCH v2 17/23] pc: grab system_memory

2011-07-26 Thread Avi Kivity
While eventually this should come from the machine initialization function, take a short cut to avoid converting all machines now. Reviewed-by: Anthony Liguori aligu...@us.ibm.com Signed-off-by: Avi Kivity a...@redhat.com --- hw/pc.c |3 ++- hw/pc.h |4 +++- hw/pc_piix.c |8

[PATCH v2 22/23] sysbus: add MemoryRegion based memory management API

2011-07-26 Thread Avi Kivity
Allow registering sysbus device memory using a MemoryRegion. Once all users are converted, sysbus_init_mmio() and sysbus_init_mmio_cb() will be removed. Reviewed-by: Anthony Liguori aligu...@us.ibm.com Signed-off-by: Avi Kivity a...@redhat.com --- hw/sysbus.c | 27 ---

[PATCH v2 16/23] ioport: register ranges by byte aligned addresses always

2011-07-26 Thread Avi Kivity
The I/O port space is byte addressable, even for word and long accesses. An example is the VMware svga card, which has long ports on offsets 0, 1, and 2. Reviewed-by: Anthony Liguori aligu...@us.ibm.com Signed-off-by: Avi Kivity a...@redhat.com --- ioport.c |4 ++-- 1 files changed, 2

[PATCH v2 19/23] pc: move global memory map out of pc_init1() and into its callers

2011-07-26 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- hw/pc_piix.c | 15 --- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hw/pc_piix.c b/hw/pc_piix.c index d83854c..f2d0476 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -68,7 +68,8 @@ static void ioapic_init(IsaIrqState

[PATCH v2 13/23] memory: separate building the final memory map into two steps

2011-07-26 Thread Avi Kivity
Instead of adding and deleting regions in one pass, do a delete pass followed by an add pass. This fixes the following case: from: 0x-0x0fff ram (a1) 0x1000-0x1fff mmio (a2) 0x2000-0x2fff ram (a3) to: 0x-0x2fff ram (b1) The single pass algorithm removed a1, added b2, then

[PATCH v2 23/23] usb-ohci: convert to MemoryRegion

2011-07-26 Thread Avi Kivity
Reviewed-by: Anthony Liguori aligu...@us.ibm.com Signed-off-by: Avi Kivity a...@redhat.com --- hw/usb-ohci.c | 42 +- 1 files changed, 17 insertions(+), 25 deletions(-) diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c index 8491d59..337b250 100644 ---

[PATCH v2 18/23] pc: convert pc_memory_init() to memory API

2011-07-26 Thread Avi Kivity
Reviewed-by: Anthony Liguori aligu...@us.ibm.com Signed-off-by: Avi Kivity a...@redhat.com --- hw/pc.c | 59 --- hw/pc.h |1 + 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 369566a..1c9d89a

[PATCH v2 21/23] pci: add MemoryRegion based BAR management API

2011-07-26 Thread Avi Kivity
Allow registering a BAR using a MemoryRegion. Once all users are converted, pci_register_bar() and pci_register_bar_simple() will be removed. Reviewed-by: Anthony Liguori aligu...@us.ibm.com Signed-off-by: Avi Kivity a...@redhat.com --- hw/pci.c | 47

[PATCH v2 20/23] pci: pass address space to pci bus when created

2011-07-26 Thread Avi Kivity
This is now done sloppily, via get_system_memory(). Eventually callers will be converted to stop using that. Reviewed-by: Anthony Liguori aligu...@us.ibm.com Signed-off-by: Avi Kivity a...@redhat.com --- hw/apb_pci.c |2 ++ hw/bonito.c|4 +++- hw/grackle_pci.c |5

[PATCH 05/11] KVM: MMU: cleanup FNAME(invlpg)

2011-07-26 Thread Xiao Guangrong
Directly Use mmu_page_zap_pte to zap spte in FNAME(invlpg), also remove the same code between FNAME(invlpg) and FNAME(sync_page) Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 16 ++-- arch/x86/kvm/paging_tmpl.h | 42

[PATCH 06/11] KVM: MMU: fast prefetch spte on invlpg path

2011-07-26 Thread Xiao Guangrong
Fast prefetch spte for the unsync shadow page on invlpg path Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h |4 +--- arch/x86/kvm/mmu.c | 38 +++--- arch/x86/kvm/paging_tmpl.h | 23

[PATCH 07/11] KVM: MMU: remove unnecessary kvm_mmu_free_some_pages

2011-07-26 Thread Xiao Guangrong
In kvm_mmu_pte_write, we do not need to alloc shadow page, so calling kvm_mmu_free_some_pages is really unnecessary Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/mmu.c

[PATCH 08/11] KVM: MMU: split kvm_mmu_pte_write function

2011-07-26 Thread Xiao Guangrong
kvm_mmu_pte_write is too long, we split it for better readable Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 180 1 files changed, 111 insertions(+), 69 deletions(-) diff --git a/arch/x86/kvm/mmu.c

[PATCH 09/11] KVM: MMU: remove the mismatch shadow page

2011-07-26 Thread Xiao Guangrong
If the shadow page has different cpu mode with current vcpu, we do better remove them since the OS does not changes cpu mode frequently Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 26 +++--- 1 files changed, 19 insertions(+), 7

[PATCH 10/11] KVM: MMU: fix detecting misaligned accessed

2011-07-26 Thread Xiao Guangrong
Sometimes, we only modify the last one byte of a pte to update status bit, for example, clear_bit is used to clear r/w bit in linux kernel and 'andb' instruction is used in this function, in this case, kvm_mmu_pte_write will treat it as misaligned access, and the shadow page table is zapped

Re: [Qemu-devel] [PATCH 00/23] Memory API, batch 1

2011-07-26 Thread Avi Kivity
On 07/25/2011 11:23 PM, Anthony Liguori wrote: Very nice series. Despite my lack of exciting over ioeventfd and coalescing, if you fix the few minor comments, this should be a no brainer to merge. Thanks; v2 posted. Note that this patchset has a logical dependency on my [PATCH]

Re: [PATCH v2 04/23] memory: merge adjacent segments of a single memory region

2011-07-26 Thread Paolo Bonzini
On 07/26/2011 01:26 PM, Avi Kivity wrote: +while (i view-nr) { +j = i + 1; +while (j view-nr +can_merge(view-ranges[j-1], view-ranges[j])) { +view-ranges[i].addr.size += view-ranges[j].addr.size; +++j; +} +++i; if (j

Re: [PATCH v2 04/23] memory: merge adjacent segments of a single memory region

2011-07-26 Thread Avi Kivity
On 07/26/2011 02:36 PM, Paolo Bonzini wrote: On 07/26/2011 01:26 PM, Avi Kivity wrote: +while (i view-nr) { +j = i + 1; +while (j view-nr + can_merge(view-ranges[j-1], view-ranges[j])) { +view-ranges[i].addr.size += view-ranges[j].addr.size; +++j;

Re: [Qemu-devel] [PATCH 14/23] memory: transaction API

2011-07-26 Thread Avi Kivity
On 07/26/2011 01:48 PM, Avi Kivity wrote: On 07/25/2011 10:16 PM, Anthony Liguori wrote: On 07/25/2011 09:02 AM, Avi Kivity wrote: Allow changes to the memory hierarchy to be accumulated and made visible all at once. This reduces computational effort, especially when an accelerator (e.g. kvm)

Re: [PATCH V2] device-assignment pci: correct pci config size default for cap version 2 endpoints

2011-07-26 Thread Michael S. Tsirkin
On Mon, Jul 25, 2011 at 02:14:28PM -0600, Alex Williamson wrote: On Sun, 2011-07-24 at 11:36 +0300, Michael S. Tsirkin wrote: On Thu, Jul 21, 2011 at 11:02:53AM -0600, Alex Williamson wrote: This is crazy, why would we only test this for PCI_CAP_ID_EXP? If the test is going to go in

Re: [PATCH v2 04/23] memory: merge adjacent segments of a single memory region

2011-07-26 Thread Paolo Bonzini
On 07/26/2011 01:38 PM, Avi Kivity wrote: if (j != i) { +memmove(view-ranges[i], view-ranges[j], +(view-nr - j) * sizeof(view-ranges[j])); +view-nr -= j - i; +} } Seems to work both ways? Sure, but you're pointlessly memmove-ing memory over itself.

Re: [PATCH v2 04/23] memory: merge adjacent segments of a single memory region

2011-07-26 Thread Avi Kivity
On 07/26/2011 02:51 PM, Paolo Bonzini wrote: On 07/26/2011 01:38 PM, Avi Kivity wrote: if (j != i) { +memmove(view-ranges[i], view-ranges[j], +(view-nr - j) * sizeof(view-ranges[j])); +view-nr -= j - i; +} } Seems to work both ways? Sure, but you're

Re: [PATCH 03/11] KVM: x86: fast emulate repeat string write instructions

2011-07-26 Thread Gleb Natapov
On Tue, Jul 26, 2011 at 07:26:46PM +0800, Xiao Guangrong wrote: We usually use repeat string instructions to clear the page, for example, By we do you mean Linux guest? we call memset to clear a page table, stosb is used in this function, and repeated for 1024 times, that means we should

[PATCH 11/11] KVM: MMU: improve write flooding detected

2011-07-26 Thread Xiao Guangrong
Detecting write-flooding does not work well, when we handle page written, if the last speculative spte is not accessed, we treat the page is write-flooding, however, we can speculative spte on many path, such as pte prefetch, page synced, that means the last speculative spte may be not point to

Re: [PATCH 6/6] scsi-disk: Check for supported commands

2011-07-26 Thread Kevin Wolf
Am 22.07.2011 16:51, schrieb Hannes Reinecke: Not every command is support for any device type. This patch adds a check for rejecting unsupported commands. Signed-off-by: Hannes Reinecke h...@suse.de --- hw/scsi-disk.c | 104 +++- 1

Re: [PATCH 6/6] scsi-disk: Check for supported commands

2011-07-26 Thread Hannes Reinecke
On 07/26/2011 03:07 PM, Kevin Wolf wrote: Am 22.07.2011 16:51, schrieb Hannes Reinecke: Not every command is support for any device type. This patch adds a check for rejecting unsupported commands. Signed-off-by: Hannes Reineckeh...@suse.de --- hw/scsi-disk.c | 104

Re: [Qemu-devel] [PATCH 6/6] scsi-disk: Check for supported commands

2011-07-26 Thread Christoph Hellwig
On Fri, Jul 22, 2011 at 04:51:17PM +0200, Hannes Reinecke wrote: Not every command is support for any device type. This patch adds a check for rejecting unsupported commands. Signed-off-by: Hannes Reinecke h...@suse.de This seems to conflic with Markus' series. But if we want to invest any

Re: [PATCH 6/6] scsi-disk: Check for supported commands

2011-07-26 Thread Kevin Wolf
Am 22.07.2011 16:51, schrieb Hannes Reinecke: Not every command is support for any device type. This patch adds a check for rejecting unsupported commands. Signed-off-by: Hannes Reinecke h...@suse.de We do emulate SEEK (6), but it's not in your scsi_cmd_table at all. --- hw/scsi-disk.c |

Re: [PATCH 0/6][v2] Check for supported SCSI commands

2011-07-26 Thread Kevin Wolf
Am 22.07.2011 16:51, schrieb Hannes Reinecke: Markus Armbruster pointed out that not every SCSI command is supported for a given device type. Based on his patch and suggestiongs this series cleans up the SCSI device type and adds a check for supported commands. Hannes Reinecke (6):

Re: [PATCH 03/11] KVM: x86: fast emulate repeat string write instructions

2011-07-26 Thread Avi Kivity
On 07/26/2011 03:27 PM, Gleb Natapov wrote: On Tue, Jul 26, 2011 at 07:26:46PM +0800, Xiao Guangrong wrote: We usually use repeat string instructions to clear the page, for example, By we do you mean Linux guest? we call memset to clear a page table, stosb is used in this function, and

Re: virtagent for qemu-kvm ?

2011-07-26 Thread Michael Roth
On 07/26/2011 03:24 AM, Stefan Hajnoczi wrote: On Tue, Jul 26, 2011 at 6:58 AM, Prateek Sharmaprate...@cse.iitb.ac.in wrote: On Tue, 26 Jul 2011, Stefan Hajnoczi wrote: On Tue, Jul 26, 2011 at 6:05 AM, Prateek Sharmaprate...@cse.iitb.ac.in wrote: Hi all, Is there any equivalent of

Re: [PATCH 6/6] scsi-disk: Check for supported commands

2011-07-26 Thread Hannes Reinecke
On 07/26/2011 03:46 PM, Kevin Wolf wrote: Am 22.07.2011 16:51, schrieb Hannes Reinecke: Not every command is support for any device type. This patch adds a check for rejecting unsupported commands. Signed-off-by: Hannes Reineckeh...@suse.de We do emulate SEEK (6), but it's not in your

Re: [Qemu-devel] [PATCH v2 04/23] memory: merge adjacent segments of a single memory region

2011-07-26 Thread Richard Henderson
On 07/26/2011 04:36 AM, Paolo Bonzini wrote: On 07/26/2011 01:26 PM, Avi Kivity wrote: +while (i view-nr) { +j = i + 1; +while (j view-nr +can_merge(view-ranges[j-1], view-ranges[j])) { +view-ranges[i].addr.size += view-ranges[j].addr.size;

Re: [PATCH V2] device-assignment pci: correct pci config size default for cap version 2 endpoints

2011-07-26 Thread Alex Williamson
On Tue, 2011-07-26 at 14:42 +0300, Michael S. Tsirkin wrote: On Mon, Jul 25, 2011 at 02:14:28PM -0600, Alex Williamson wrote: On Sun, 2011-07-24 at 11:36 +0300, Michael S. Tsirkin wrote: On Thu, Jul 21, 2011 at 11:02:53AM -0600, Alex Williamson wrote: This is crazy, why would we only

Re: [Qemu-devel] [PATCH v2 04/23] memory: merge adjacent segments of a single memory region

2011-07-26 Thread Avi Kivity
On 07/26/2011 06:41 PM, Richard Henderson wrote: On 07/26/2011 04:36 AM, Paolo Bonzini wrote: On 07/26/2011 01:26 PM, Avi Kivity wrote: +while (i view-nr) { +j = i + 1; +while (j view-nr + can_merge(view-ranges[j-1],view-ranges[j])) { +

Re: [PATCH v2 0/7] qemu-kvm: device assignment cleanups and upstream diff reductions

2011-07-26 Thread Alex Williamson
On Thu, 2011-07-21 at 20:14 +0200, Jan Kiszka wrote: Update of the unmerged half of this series. It logically depends on pci: Common overflow prevention, but not mechanically. Changes in this release only affect the 6th patch. It gained support for 3-byte config space accesses, received a fix

Re: [patch v2] x86: kvm: x86: fix information leak to userland

2011-07-26 Thread Alexander Graf
On 30.10.2010, at 20:54, Vasiliy Kulikov wrote: Structures kvm_vcpu_events, kvm_debugregs, kvm_pit_state2 and kvm_clock_data are copied to userland with some padding and reserved fields unitialized. It leads to leaking of contents of kernel stack memory. We have to initialize them to zero.

Re: [patch v2] x86: kvm: x86: fix information leak to userland

2011-07-26 Thread Avi Kivity
On 07/26/2011 08:05 PM, Alexander Graf wrote: struct kvm_pit_state2 { struct kvm_pit_channel_state channels[3]; __u32 flags; __u32 reserved[9]; }; So memset(ps-reserved) would give you the a __u32 **, no? Same goes for all the other array sets in here. Or am I

Re: [patch v2] x86: kvm: x86: fix information leak to userland

2011-07-26 Thread Vasiliy Kulikov
Alexander, On Tue, Jul 26, 2011 at 19:05 +0200, Alexander Graf wrote: @@ -2623,6 +2626,7 @@ static void kvm_vcpu_ioctl_x86_get_debugregs(struct kvm_vcpu *vcpu, dbgregs-dr6 = vcpu-arch.dr6; dbgregs-dr7 = vcpu-arch.dr7; dbgregs-flags = 0; + memset(dbgregs-reserved, 0,

Re: [patch v2] x86: kvm: x86: fix information leak to userland

2011-07-26 Thread Alexander Graf
On 26.07.2011, at 19:24, Avi Kivity wrote: On 07/26/2011 08:05 PM, Alexander Graf wrote: struct kvm_pit_state2 { struct kvm_pit_channel_state channels[3]; __u32 flags; __u32 reserved[9]; }; So memset(ps-reserved) would give you the a __u32 **, no? Same goes for

Re: [patch v2] x86: kvm: x86: fix information leak to userland

2011-07-26 Thread Alexander Graf
On 26.07.2011, at 19:28, Vasiliy Kulikov wrote: Alexander, On Tue, Jul 26, 2011 at 19:05 +0200, Alexander Graf wrote: @@ -2623,6 +2626,7 @@ static void kvm_vcpu_ioctl_x86_get_debugregs(struct kvm_vcpu *vcpu, dbgregs-dr6 = vcpu-arch.dr6; dbgregs-dr7 = vcpu-arch.dr7;

[PATCH] KVM test: Add subtest nmi_watchdog

2011-07-26 Thread Lucas Meneghel Rodrigues
From: Amos Kong ak...@redhat.com Uses kernel supported nmi_watchdog to test the nmi support of kvm, check the nmi count in Linux platform through /proc/interrupts. Changes from v2: * Updated the test to use more current KVM autotest API Signed-off-by: Amos Kong ak...@redhat.com ---

Re: [Autotest] [PATCH] KVM test: Add subtest nmi_watchdog

2011-07-26 Thread Lucas Meneghel Rodrigues
On 07/26/2011 03:25 PM, Lucas Meneghel Rodrigues wrote: From: Amos Kongak...@redhat.com Uses kernel supported nmi_watchdog to test the nmi support of kvm, check the nmi count in Linux platform through /proc/interrupts. Hi Amos, applied your test, thanks! Changes from v2: * Updated the

Re: [Autotest] [Autotest PATCH] KVM-test: TSC drift test

2011-07-26 Thread Lucas Meneghel Rodrigues
On Thu, Apr 21, 2011 at 4:33 AM, Amos Kong ak...@redhat.com wrote: This case is used to test the drift between host and guest. Use taskset to make tsc program execute in a single cpu. If the drift ratio bigger than 10%, then fail this case. Hi Amos, per the last conversation we've had about

Re: [PATCH v2 1/1] The codes V2 for QEMU disk I/O limits.

2011-07-26 Thread Marcelo Tosatti
On Tue, Jul 26, 2011 at 04:59:06PM +0800, Zhi Yong Wu wrote: Welcome to give me your comments, thanks. Signed-off-by: Zhi Yong Wu wu...@linux.vnet.ibm.com --- Makefile.objs |2 +- block.c | 288 +++-- block.h |

[PATCH] dev-assignment: handle device with incorrect PCIe Cap structure size

2011-07-26 Thread Donald Dutile
The bcm5761 provides a PCIe Cap structure (capid=0x10) that is invalid, providing one that is 8 bytes shorter than the v2 PCIe spec defines. This leads to a memory corruption when mapped for device-assigment. Add a check in assigned_device_pci_cap_init() to correct this hw error for this device,

Re: [PATCH] dev-assignment: handle device with incorrect PCIe Cap structure size

2011-07-26 Thread Alex Williamson
On Tue, 2011-07-26 at 18:08 -0400, Donald Dutile wrote: The bcm5761 provides a PCIe Cap structure (capid=0x10) that is invalid, providing one that is 8 bytes shorter than the v2 PCIe spec defines. This leads to a memory corruption when mapped for device-assigment. Add a check in

#2330;#2375;#2340;#2366;#2357;#2344;#2368;!

2011-07-26 Thread WEBMAIL CUSTOMER CARE
#2312;#2350;#2375;#2354; #2330;#2375;#2340;#2366;#2357;#2344;#2368; #2310;#2346;#2325;#2366; #2312; - #2350;#2375;#2354; #2326;#2366;#2340;#2366; #2344;#2367;#2359;#2381;#2325;#2381;#2352;#2367;#2351;#2325;#2352;#2339;. #2325;#2371;#2346;#2351;#2366; #2343;#2381;#2351;#2366;#2344;

Re: [PATCH 03/11] KVM: x86: fast emulate repeat string write instructions

2011-07-26 Thread Xiao Guangrong
On 07/26/2011 08:27 PM, Gleb Natapov wrote: On Tue, Jul 26, 2011 at 07:26:46PM +0800, Xiao Guangrong wrote: We usually use repeat string instructions to clear the page, for example, By we do you mean Linux guest? I do not know other guests except linux, but, generally rep instruction is not

Re: [PATCH 03/11] KVM: x86: fast emulate repeat string write instructions

2011-07-26 Thread Gleb Natapov
On Wed, Jul 27, 2011 at 09:47:52AM +0800, Xiao Guangrong wrote: On 07/26/2011 08:27 PM, Gleb Natapov wrote: On Tue, Jul 26, 2011 at 07:26:46PM +0800, Xiao Guangrong wrote: We usually use repeat string instructions to clear the page, for example, By we do you mean Linux guest? I do not