Re: [PATCH] kvm tools: Use assert() helper to check a variable value

2011-12-19 Thread Ingo Molnar
* Cyrill Gorcunov wrote: > On Mon, Dec 19, 2011 at 09:13:28AM +0200, Pekka Enberg wrote: > > > > > >- BUILD_BUG_ON(i > E820_X_MAX); > > >+ assert(i <= E820_X_MAX); > > > > We should use BUG_ON() like tools/perf does. > > > > We dont have it yet. So I'll introduce this helper later, > but no

Re: [PATCH] kvm tools: Use assert() helper to check a variable value

2011-12-19 Thread Pekka Enberg
On Mon, Dec 19, 2011 at 09:13:28AM +0200, Pekka Enberg wrote: >> > >> >-    BUILD_BUG_ON(i > E820_X_MAX); >> >+    assert(i <= E820_X_MAX); >> >> We should use BUG_ON() like tools/perf does. On Mon, Dec 19, 2011 at 9:57 AM, Cyrill Gorcunov wrote: > We dont have it yet. So I'll introduce this help

Re: [PATCH] kvm tools: Use assert() helper to check a variable value

2011-12-19 Thread Cyrill Gorcunov
On Mon, Dec 19, 2011 at 10:19:43AM +0200, Pekka Enberg wrote: > On Mon, Dec 19, 2011 at 09:13:28AM +0200, Pekka Enberg wrote: > >> > > >> >-    BUILD_BUG_ON(i > E820_X_MAX); > >> >+    assert(i <= E820_X_MAX); > >> > >> We should use BUG_ON() like tools/perf does. > > On Mon, Dec 19, 2011 at 9:57

Re: [PATCH 3/8] KVM: MMU: do not add a nonpresent spte to rmaps of its child

2011-12-19 Thread Avi Kivity
On 12/19/2011 04:39 AM, Takuya Yoshikawa wrote: > (2011/12/16 19:15), Xiao Guangrong wrote: > >> -static void mmu_page_add_parent_pte(struct kvm_vcpu *vcpu, >> -struct kvm_mmu_page *sp, u64 *parent_pte) >> +static void mmu_page_add_set_parent_pte(struct kvm_vcpu *vcpu, >> +

Re: [RFC] virtio: use mandatory barriers for remote processor vdevs

2011-12-19 Thread Rusty Russell
On Mon, 19 Dec 2011 10:50:13 +0800, Amos Kong wrote: > The format is broken in webpage, attached the result file. > it's also available here: http://amosk.info/download/rusty-fix-perf.txt Thanks Amos. Linus, please apply. Fixes virtio-mmio without breaking virtio_pci performance. Thanks, Rusty

Re: [SeaBIOS PATCH v3] hotplug: Add device per func in ACPI DSDT tables

2011-12-19 Thread Amos Kong
On 14/12/11 09:06, Kevin O'Connor wrote: On Tue, Dec 06, 2011 at 07:32:55PM -0500, Amos Kong wrote: - Original Message - On Tue, Dec 06, 2011 at 01:39:35PM +0800, Amos Kong wrote: Only func 0 is registered to guest driver (we can only found func 0 in slot->funcs list of driver), the ot

Re: [PATCH 4/4] KVM: MMU: Make mmu_shrink() scan nr_to_scan shadow pages

2011-12-19 Thread Avi Kivity
On 12/16/2011 04:58 PM, Takuya Yoshikawa wrote: > > > > I'm not sure this is a meaningful test to verify this change is > > worthwhile, because while the shrinker tries to free a shadow page from > > one vm, the vm's position in the kvm list is changed, so the over time > > the shrinker will cycle

Re: [PATCH] kvm tools: Use assert() helper to check a variable value

2011-12-19 Thread Pekka Enberg
On Mon, Dec 19, 2011 at 10:25 AM, Cyrill Gorcunov wrote: >> You don't need to convert all of them at the same time but we're not >> adding new assert() calls. >> > > You both (Pekka and Ingo) know the way how to convince people ;) > Something like below? Perfect! I'll apply it later today. Thanks

Re: [Qemu-devel] [PATCH] virtio-serial: Allow one MSI-X vector per virtqueue

2011-12-19 Thread Zang Hongyong
于 2011/12/19,星期一 15:26, Amit Shah 写道: On (Mon) 19 Dec 2011 [14:09:43], Zang Hongyong wrote: 于 2011/12/16,星期五 17:39, Amit Shah 写道: On (Fri) 16 Dec 2011 [09:14:26], zanghongy...@huawei.com wrote: From: Hongyong Zang In pci_enable_msix(), the guest's virtio-serial driver tries to set msi-x with

Re: [PATCH 4/4] KVM: MMU: Make mmu_shrink() scan nr_to_scan shadow pages

2011-12-19 Thread Takuya Yoshikawa
(2011/12/19 17:43), Avi Kivity wrote: Well, if one guest is twice as large as other guests, then it will want twice as many shadow pages. So our goal should be to zap pages from the guest with the highest (shadow pages / memory) ratio. Can you measure whether there is a significant difference

Re: [PATCH 4/4] KVM: MMU: Make mmu_shrink() scan nr_to_scan shadow pages

2011-12-19 Thread Avi Kivity
On 12/19/2011 11:22 AM, Takuya Yoshikawa wrote: >> Yes, it's very conservative. But on the other hand the shrinker is >> tuned for dcache and icache, where there are usually tons of useless >> objects. If we have to free something, I'd rather free them instead of >> mmu pages which tend to get re

Re: [PATCH 4/4] KVM: MMU: Make mmu_shrink() scan nr_to_scan shadow pages

2011-12-19 Thread Takuya Yoshikawa
(2011/12/19 18:26), Avi Kivity wrote: On 12/19/2011 11:22 AM, Takuya Yoshikawa wrote: Yes, it's very conservative. But on the other hand the shrinker is tuned for dcache and icache, where there are usually tons of useless objects. If we have to free something, I'd rather free them instead of m

Re: [PATCH 4/4] KVM: MMU: Make mmu_shrink() scan nr_to_scan shadow pages

2011-12-19 Thread Avi Kivity
On 12/19/2011 11:56 AM, Takuya Yoshikawa wrote: > (2011/12/19 18:26), Avi Kivity wrote: >> On 12/19/2011 11:22 AM, Takuya Yoshikawa wrote: Yes, it's very conservative. But on the other hand the shrinker is tuned for dcache and icache, where there are usually tons of useless objects.

Re: Failure to compile qemu-kvm - "In file included from /home/ykaul/qemu-kvm/hw/pci.c:36:0: ./qmp-commands.h:3:1: error: expected identifier or ‘(’ before ‘{’ token"

2011-12-19 Thread Yaniv Kaul
ping? (still happens, latest git commit is fcfeed4a398a8524ce8f84eaaba984bd9c27354e ) On 11/20/2011 09:01 PM, Yaniv Kaul wrote: Latest git hash 1d1c8a498b7ce5c5636f1014f7ad18aa4e1acc0a (though I think it happened before that). ./configure command line: --target-list=x86_64-softmmu --enable-

Re: [PATCH 4/4] KVM: MMU: Make mmu_shrink() scan nr_to_scan shadow pages

2011-12-19 Thread Takuya Yoshikawa
(2011/12/19 19:03), Avi Kivity wrote: IMO, The goal should be restricted to emergencies. So possible solution may be: - we set the tuning parameters as conservative as possible - pick up a guest with relatively high ratio (I have to think more how to achieve this) - move th

Re: [PATCH 4/4] KVM: MMU: Make mmu_shrink() scan nr_to_scan shadow pages

2011-12-19 Thread Avi Kivity
On 12/19/2011 12:21 PM, Takuya Yoshikawa wrote: > (2011/12/19 19:03), Avi Kivity wrote: >>> IMO, The goal should be restricted to emergencies. >>> >>> So possible solution may be: >>> - we set the tuning parameters as conservative as possible >>> - pick up a guest with relatively high rat

Re: [PATCH] kvm tools: Use assert() helper to check a variable value

2011-12-19 Thread Ingo Molnar
* Cyrill Gorcunov wrote: > +# > +#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - > 2*!!(condition)])) > +#define BUG_ON(condition)assert(!(condition)) Just a sidenote, the patch is fine but the above will result in weird double negated assertion messages. it's better to just

Re: [PATCH] kvm tools: Use assert() helper to check a variable value

2011-12-19 Thread Cyrill Gorcunov
On Mon, Dec 19, 2011 at 11:40:09AM +0100, Ingo Molnar wrote: > > GDB will catch that signal. > Yeah, good point! Pekka, drop this patch please, I'll make new one at evening. Cyrill -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vg

Re: [PATCH] kvm tools: Use assert() helper to check a variable value

2011-12-19 Thread Ingo Molnar
* Cyrill Gorcunov wrote: > On Mon, Dec 19, 2011 at 11:40:09AM +0100, Ingo Molnar wrote: > > > > GDB will catch that signal. > > > > Yeah, good point! Pekka, drop this patch please, I'll make new one at evening. Patch is good as-is IMO - assert() was used before so it's not a regression per

Re: [PATCH] kvm tools: Use assert() helper to check a variable value

2011-12-19 Thread Pekka Enberg
* Cyrill Gorcunov wrote: On Mon, Dec 19, 2011 at 11:40:09AM +0100, Ingo Molnar wrote: GDB will catch that signal. Yeah, good point! Pekka, drop this patch please, I'll make new one at evening. On Mon, 19 Dec 2011, Ingo Molnar wrote: Patch is good as-is IMO - assert() was used before so i

Re: [PATCH] kvm tools: Use assert() helper to check a variable value

2011-12-19 Thread Cyrill Gorcunov
On Mon, Dec 19, 2011 at 11:50:31AM +0100, Ingo Molnar wrote: ... > > The tool-specific BUG() implementation can be added as a delta > on top of that. It's in fact better to keep those two steps > separate. > OK, will do on top. Cyrill -- To unsubscribe from this list: send the line "u

Re: Failure to compile qemu-kvm - "In file included from /home/ykaul/qemu-kvm/hw/pci.c:36:0: ./qmp-commands.h:3:1: error: expected identifier or ‘(’ before ‘{’ token"

2011-12-19 Thread Jan Kiszka
On 2011-12-19 11:14, Yaniv Kaul wrote: > ping? > (still happens, latest git commit is > fcfeed4a398a8524ce8f84eaaba984bd9c27354e ) > Tried this on a clean build repositor? If that doesn't help, check out of tree building. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competen

KVM PVDMA status?

2011-12-19 Thread Stephen Doyle
I have found a number of threads from 2007/2008 in the mailing list archives discussing patches for PVDMA support in KVM. From looking at the latest kernel source, it does not look like this feature is present. Can anybody provide a status on PVDMA support? Thanks, Steve -- To unsubscribe from th

Re: KVM PVDMA status?

2011-12-19 Thread Avi Kivity
On 12/19/2011 01:57 PM, Stephen Doyle wrote: > I have found a number of threads from 2007/2008 in the mailing list > archives discussing patches for PVDMA support in KVM. From looking at > the latest kernel source, it does not look like this feature is > present. > > Can anybody provide a status on

Re: [PATCH 0/5 V5] Avoid soft lockup message when KVM is stopped by host

2011-12-19 Thread Amit Shah
On (Thu) 15 Dec 2011 [13:55:15], Avi Kivity wrote: > On 12/08/2011 01:34 PM, Amit Shah wrote: > > On (Mon) 05 Dec 2011 [15:18:59], Eric B Munson wrote: > > > When a guest kernel is stopped by the host hypervisor it can look like a > > > soft > > > lockup to the guest kernel. This false warning ca

Re: [PATCH 09/14] KVM: PPC: Add generic single register ioctls

2011-12-19 Thread Alexander Graf
On 23.11.2011, at 13:47, Marcelo Tosatti wrote: > On Wed, Nov 16, 2011 at 12:45:45AM +0100, Alexander Graf wrote: >> >> On 10.11.2011, at 18:35, Marcelo Tosatti wrote: >> >>> On Thu, Nov 10, 2011 at 05:49:42PM +0100, Alexander Graf wrote: >> Documentation/virtual/kvm/api.txt | 47 >>

Re: [PATCH 0/5 V5] Avoid soft lockup message when KVM is stopped by host

2011-12-19 Thread Avi Kivity
On 12/16/2011 11:31 AM, Marcelo Tosatti wrote: > > > > > > Slow enough that progress of the watchdog thread is unable to keep up > > > with timer interrupt processing. This is considered a hang and > > > should be reported. > > > > It's not a guest hang though! > > No, but your host system is in s

Re: [PATCH 0/5 V5] Avoid soft lockup message when KVM is stopped by host

2011-12-19 Thread Avi Kivity
On 12/19/2011 02:52 PM, Amit Shah wrote: > On (Thu) 15 Dec 2011 [13:55:15], Avi Kivity wrote: > > On 12/08/2011 01:34 PM, Amit Shah wrote: > > > On (Mon) 05 Dec 2011 [15:18:59], Eric B Munson wrote: > > > > When a guest kernel is stopped by the host hypervisor it can look like > > > > a soft > > >

Re: [PATCH 0/5 V5] Avoid soft lockup message when KVM is stopped by host

2011-12-19 Thread Avi Kivity
On 12/15/2011 08:53 PM, Eric B Munson wrote: > I am working on V7 to incorporate the __this_cpu_and suggestion, would you > consider that for inclusion and we can continue discussing the need for the > preemption notification work? Okay. > I think that having a guest complain when the > host is

[PATCH] virt-test: support static ip address in framework

2011-12-19 Thread Amos Kong
Sometime, we need to test with guest(s) which have static ip address(es). eg. No real/emulated DHCP server in test environment. eg. Test with old image we don't want to change the net config. eg. Test when DHCP exists problem. This is an example of using static ip address: 1. edit ifcfg-eth0 of gu

Re: [PATCH 1/3] KVM: PPC: e500: Fix TLBnCFG in KVM_CONFIG_TLB

2011-12-19 Thread Alexander Graf
On 29.11.2011, at 02:20, Scott Wood wrote: > The associativity, not just total size, can differ from the host > hardware. > > Signed-off-by: Scott Wood Thanks, applied to kvm-ppc-next. Alex -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord.

Re: [PATCH 2/3] KVM: booke: Add booke206 TLB trace

2011-12-19 Thread Alexander Graf
On 29.11.2011, at 02:20, Scott Wood wrote: > From: Liu Yu > Missing patch description. Alex > Signed-off-by: Liu Yu > [scottw...@freescale.com: made mas2 64-bit, and added mas8 init] > Signed-off-by: Scott Wood > --- > arch/powerpc/kvm/e500_tlb.c | 10 --- > arch/powerpc/kvm/trace.h

Re: [RFT PATCH] blkio: alloc per cpu data from worker thread context( Re: kvm deadlock)

2011-12-19 Thread Vivek Goyal
On Sun, Dec 18, 2011 at 03:25:48PM -0600, Nate Custer wrote: > > On Dec 16, 2011, at 2:29 PM, Vivek Goyal wrote: > > Thanks for testing it Nate. I did some debugging and found out that patch > > is doing double free on per cpu pointer hence the crash you are running > > into. I could reproduce thi

Re: [PATCH v3] KVM: PPC: Avoid patching paravirt template code

2011-12-19 Thread Alexander Graf
On 02.12.2011, at 07:22, Liu Yu wrote: > Currently we patch the whole code include paravirt template code. > This isn't safe for scratch area and has impact to performance. > > Signed-off-by: Liu Yu Thanks, applied to kvm-ppc-next. Please CC kvm@vger for KVM related patches in the future. A

Re: [PATCH 1/3] QEMU kvm: Syncing linux headers to 3.2.0-rc1

2011-12-19 Thread Alexander Graf
On 04.12.2011, at 19:25, Raghavendra K T wrote: > Update the kvm kernel headers to the 3.2.0-rc1 post using > scripts/update-linux-headers.sh script. > > Signed-off-by: Raghavendra K T > --- > diff --git a/linux-headers/asm-powerpc/kvm.h b/linux-headers/asm-powerpc/kvm.h > index fb3fddc..08fe69

Re: [PATCH 2/3] QEMU kvm: Syncing linux headers to support KICK_VCPU capability

2011-12-19 Thread Alexander Graf
On 04.12.2011, at 19:26, Raghavendra K T wrote: > Update the kernel header that adds a hypercall to support pv-ticketlocks. > > Signed-off-by: Raghavendra K T > --- > diff --git a/linux-headers/asm-x86/kvm_para.h > b/linux-headers/asm-x86/kvm_para.h You're patching the synced kernel headers?

Re: [PATCH 3/3] QEMU kvm/i386 : Adding KICK_VCPU capability support in i386 target.

2011-12-19 Thread Alexander Graf
On 04.12.2011, at 19:26, Raghavendra K T wrote: > Extend the KVM Hypervisor to enable KICK_VCPU feature that allows > a vcpu to kick the halted vcpu to continue with execution in PV ticket > spinlock. > > Signed-off-by: Srivatsa Vaddagiri > Signed-off-by: Raghavendra K T > --- > diff --git a/t

[RFC 00/12] Overhaul of error handling and module init/uninit

2011-12-19 Thread Sasha Levin
This patch series is really a work in progress, but is mature enough to cover most of the different modules we have in the tool, and receive comments regarding the work done so far and any future work. There were three main goals while doing this work: 1. Less die(), more clean exits. We are not i

[RFC 01/12] kvm tools: Split kvm_cmd_run into init, work and uninit

2011-12-19 Thread Sasha Levin
Signed-off-by: Sasha Levin --- tools/kvm/builtin-run.c | 38 ++ 1 files changed, 30 insertions(+), 8 deletions(-) diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index 524ca16..0234879 100644 --- a/tools/kvm/builtin-run.c +++ b/tools/kvm/built

[RFC 02/12] kvm tools: Fixes for symbol resolving module

2011-12-19 Thread Sasha Levin
Fixes include: - Error handling - Cleanup - Standard init/uninit Signed-off-by: Sasha Levin --- tools/kvm/builtin-run.c| 31 ++--- tools/kvm/include/kvm/symbol.h |7 +++- tools/kvm/symbol.c | 59 +++- tools/kvm/x8

[RFC 03/12] kvm tools: Fixes for IRQ module

2011-12-19 Thread Sasha Levin
Fixes include: - Error handling - Cleanup - Standard init/uninit Signed-off-by: Sasha Levin --- tools/kvm/builtin-run.c | 10 +- tools/kvm/include/kvm/irq.h |3 ++- tools/kvm/x86/irq.c | 35 --- 3 files changed, 35 insertions(+), 13

[RFC 04/12] kvm tools: Fixes for UI modules

2011-12-19 Thread Sasha Levin
Fixes include: - Error handling - Cleanup - Standard init/uninit Signed-off-by: Sasha Levin --- tools/kvm/builtin-run.c | 35 ++- tools/kvm/framebuffer.c |9 - tools/kvm/hw/vesa.c | 11 +++ tools/k

[RFC 05/12] kvm tools: Fixes for ioport module

2011-12-19 Thread Sasha Levin
Fixes include: - Error handling - Cleanup - Standard init/uninit Signed-off-by: Sasha Levin --- tools/kvm/builtin-run.c | 11 ++ tools/kvm/hw/pci-shmem.c|7 +++- tools/kvm/hw/vesa.c |6 +++- tools/kvm/include/kvm/ioport.h

[RFC 06/12] kvm tools: Fixes for ioeventfd module

2011-12-19 Thread Sasha Levin
Fixes include: - Error handling - Cleanup - Standard init/uninit Signed-off-by: Sasha Levin --- tools/kvm/builtin-run.c | 12 ++- tools/kvm/include/kvm/ioeventfd.h |8 +- tools/kvm/ioeventfd.c | 158 ++--- tools/kvm/virtio/pci.c

[RFC 07/12] kvm tools: Fixes for serial module

2011-12-19 Thread Sasha Levin
Fixes include: - Error handling - Cleanup - Standard init/uninit Signed-off-by: Sasha Levin --- tools/kvm/builtin-run.c | 11 - tools/kvm/hw/serial.c | 43 ++ tools/kvm/include/kvm/8250-serial.h |3 +- 3 files changed,

[RFC 08/12] kvm tools: Fixes for mptable module

2011-12-19 Thread Sasha Levin
Fixes include: - Error handling - Cleanup - Standard init/uninit Signed-off-by: Sasha Levin --- tools/kvm/builtin-run.c |8 tools/kvm/include/kvm/kvm.h |3 ++- tools/kvm/powerpc/kvm.c |9 - tools/kvm/x86/include/kvm/mptable.h |3

[RFC 09/12] kvm tools: Fixes for ioeventfd module

2011-12-19 Thread Sasha Levin
Fixes include: - Error handling - Cleanup - Standard init/uninit Signed-off-by: Sasha Levin --- tools/kvm/builtin-run.c | 10 ++- tools/kvm/include/kvm/pci.h |5 ++- tools/kvm/pci.c | 58 +++ 3 files changed, 54 insertions(+)

[RFC 10/12] kvm tools: Fixes for disk image module

2011-12-19 Thread Sasha Levin
Fixes include: - Error handling - Cleanup - Standard init/uninit Signed-off-by: Sasha Levin --- tools/kvm/builtin-run.c| 27 +--- tools/kvm/disk/blk.c | 13 -- tools/kvm/disk/core.c | 76 ++-- tools/kvm/d

[RFC 11/12] kvm tools: Fixes for rtc module

2011-12-19 Thread Sasha Levin
Fixes include: - Error handling - Cleanup - Standard init/uninit Signed-off-by: Sasha Levin --- tools/kvm/builtin-run.c | 10 +- tools/kvm/hw/rtc.c | 27 +++ tools/kvm/include/kvm/rtc.h |5 - 3 files changed, 36 insertions(+), 6 deletio

Re: [PATCH 3/3] QEMU kvm/i386 : Adding KICK_VCPU capability support in i386 target.

2011-12-19 Thread Avi Kivity
On 12/19/2011 03:54 PM, Alexander Graf wrote: > On 04.12.2011, at 19:26, Raghavendra K T wrote: > > > Extend the KVM Hypervisor to enable KICK_VCPU feature that allows > > a vcpu to kick the halted vcpu to continue with execution in PV ticket > > spinlock. > > > > Signed-off-by: Srivatsa Vaddagiri

[RFC 12/12] kvm tools: Fixes for ioeventfd module

2011-12-19 Thread Sasha Levin
Fixes include: - Error handling - Cleanup - Standard init/uninit Signed-off-by: Sasha Levin --- tools/kvm/builtin-run.c |8 ++- tools/kvm/include/kvm/kvm.h |6 +- tools/kvm/include/kvm/virtio-pci.h |1 + tools/kvm/include/kvm/virtio-rng.h |4 +- tools

Re: [PATCH 3/3] QEMU kvm/i386 : Adding KICK_VCPU capability support in i386 target.

2011-12-19 Thread Alexander Graf
On 19.12.2011, at 14:59, Avi Kivity wrote: > On 12/19/2011 03:54 PM, Alexander Graf wrote: >> On 04.12.2011, at 19:26, Raghavendra K T wrote: >> >>> Extend the KVM Hypervisor to enable KICK_VCPU feature that allows >>> a vcpu to kick the halted vcpu to continue with execution in PV ticket >>> sp

Re: [PATCH 3/3] QEMU kvm/i386 : Adding KICK_VCPU capability support in i386 target.

2011-12-19 Thread Jan Kiszka
On 2011-12-19 15:03, Alexander Graf wrote: > > On 19.12.2011, at 14:59, Avi Kivity wrote: > >> On 12/19/2011 03:54 PM, Alexander Graf wrote: >>> On 04.12.2011, at 19:26, Raghavendra K T wrote: >>> Extend the KVM Hypervisor to enable KICK_VCPU feature that allows a vcpu to kick the halte

[PATCH 00/23] Remove cpu_get_physical_page_desc()

2011-12-19 Thread Avi Kivity
cpu_get_physical_page_desc() exposes the internals of the memory core to callers; as such it prevents the refactoring planned there. This patchset converts all callers memory API equivalents and removes the function. The conversion leaves a lot of potential for further cleanups; the MemoryListene

[PATCH 03/23] memory: add memory_region_is_ram()

2011-12-19 Thread Avi Kivity
Signed-off-by: Avi Kivity --- memory.c |8 memory.h | 10 ++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/memory.c b/memory.c index d8b7c27..6fd31d4 100644 --- a/memory.c +++ b/memory.c @@ -831,6 +831,7 @@ void memory_region_init(MemoryRegion *mr, mr

[PATCH 02/23] sysbus: add sysbus_address_space()

2011-12-19 Thread Avi Kivity
Given a bus device, retrieves the memory address space for its bus. Signed-off-by: Avi Kivity --- hw/sysbus.c |5 + hw/sysbus.h |1 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/hw/sysbus.c b/hw/sysbus.c index b315a8c..492a7c6 100644 --- a/hw/sysbus.c +++ b/hw/sysb

[PATCH 09/23] memory: add API for observing updates to the physical memory map

2011-12-19 Thread Avi Kivity
Add an API that allows a client to observe changes in the global memory map: - region added (possibly with logging enabled) - region removed (possibly with logging enabled) - logging started on a region - logging stopped on a region - global logging started - global logging removed This API

[PATCH 16/23] memory: temporarily add memory_region_get_ram_addr()

2011-12-19 Thread Avi Kivity
This is a layering violation, but needed while the code contains naked calls to qemu_get_ram_ptr() and the like. Signed-off-by: Avi Kivity --- memory.c |6 ++ memory.h | 10 ++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/memory.c b/memory.c index 2dcbf80..41

[PATCH 05/23] memory: add memory_region_is_rom()

2011-12-19 Thread Avi Kivity
Signed-off-by: Avi Kivity --- memory.c |5 + memory.h |9 + 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/memory.c b/memory.c index 6fd31d4..c57b7de 100644 --- a/memory.c +++ b/memory.c @@ -1073,6 +1073,11 @@ bool memory_region_is_ram(MemoryRegion *mr) r

[PATCH 04/23] framebuffer: drop use of cpu_get_physical_page_desc()

2011-12-19 Thread Avi Kivity
cpu_get_physical_page_desc() is tied into the memory core's innards, replace it with uses of the API. Signed-off-by: Avi Kivity --- hw/framebuffer.c | 30 +- hw/framebuffer.h |3 +++ hw/milkymist-vgafb.c |2 +- hw/omap_lcdc.c |4 +++- hw/pl

[PATCH 01/23] memory: introduce memory_region_find()

2011-12-19 Thread Avi Kivity
Given an address space (represented by the top-level memory region), returns the memory region that maps a given range. Useful for implementing DMA. The implementation is a simplistic binary search. Once we have a tree representation this can be optimized. Signed-off-by: Avi Kivity --- memory

[PATCH 07/23] framebuffer: drop use of cpu_physical_sync_dirty_bitmap()

2011-12-19 Thread Avi Kivity
Replace with memory API equivalent. Signed-off-by: Avi Kivity --- hw/framebuffer.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/framebuffer.c b/hw/framebuffer.c index 3f4e773..b43bcdf 100644 --- a/hw/framebuffer.c +++ b/hw/framebuffer.c @@ -50,7 +50,6 @@ void fram

[PATCH 10/23] memory: add memory_region_is_logging()

2011-12-19 Thread Avi Kivity
Signed-off-by: Avi Kivity --- memory.c |5 + memory.h |9 + 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/memory.c b/memory.c index ee9053a..2e5ff43 100644 --- a/memory.c +++ b/memory.c @@ -1107,6 +1107,11 @@ bool memory_region_is_ram(MemoryRegion *mr) r

[PATCH 17/23] xen: convert to MemoryListener API

2011-12-19 Thread Avi Kivity
Signed-off-by: Avi Kivity --- trace-events |2 +- xen-all.c| 137 ++ 2 files changed, 81 insertions(+), 58 deletions(-) diff --git a/trace-events b/trace-events index bf1cf57..728df97 100644 --- a/trace-events +++ b/trace-events @@

[PATCH 22/23] sparc: avoid cpu_get_physical_page_desc()

2011-12-19 Thread Avi Kivity
This reaches into the innards of the memory core, which are being changed. Switch to a memory API version. Signed-off-by: Avi Kivity --- target-sparc/mmu_helper.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/target-sparc/mmu_helper.c b/target-sparc/mmu_helper.c i

[PATCH 19/23] kvm: avoid cpu_get_physical_page_desc()

2011-12-19 Thread Avi Kivity
This reaches into the innards of the memory core, which are being changed. Switch to a memory API version. Signed-off-by: Avi Kivity --- kvm-all.c | 27 ++- 1 files changed, 10 insertions(+), 17 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 138e0a2..d94710c 10

[PATCH 15/23] xen, vga: add API for registering the framebuffer

2011-12-19 Thread Avi Kivity
Xen currently uses the name of a memory region to determine whether it is the framebuffer. Replace with an explicit API. Signed-off-by: Avi Kivity --- hw/vga.c |2 ++ hw/xen.h |3 +++ xen-all.c |6 ++ xen-stub.c |4 4 files changed, 15 insertions(+), 0 deletions(-)

[PATCH 23/23] Remove cpu_get_physical_page_desc()

2011-12-19 Thread Avi Kivity
No longer used. Signed-off-by: Avi Kivity --- cpu-common.h |1 - exec.c | 11 --- 2 files changed, 0 insertions(+), 12 deletions(-) diff --git a/cpu-common.h b/cpu-common.h index eee2faf..3fe44d2 100644 --- a/cpu-common.h +++ b/cpu-common.h @@ -38,7 +38,6 @@ typedef unsigned

[PATCH 11/23] kvm: switch kvm slots to use host virtual address instead of ram_addr_t

2011-12-19 Thread Avi Kivity
This simplifies a later switch to the memory API in slot management. Signed-off-by: Avi Kivity --- kvm-all.c | 29 + kvm.h |4 ++-- memory.c |6 +++--- target-i386/kvm.c |7 +++ 4 files changed, 25 insertions(+), 21 delet

[PATCH 18/23] memory: remove CPUPhysMemoryClient

2011-12-19 Thread Avi Kivity
No longer used. Signed-off-by: Avi Kivity --- cpu-all.h |6 -- cpu-common.h| 23 exec-obsolete.h |3 - exec.c | 169 ++- memory.c| 12 5 files changed, 5 insertions(+), 208 deletions(-) dif

[PATCH 20/23] vhost: avoid cpu_get_physical_page_desc()

2011-12-19 Thread Avi Kivity
This reaches into the innards of the memory core, which are being changed. Switch to a memory API version. Signed-off-by: Avi Kivity --- hw/vhost.c | 47 +++ hw/vhost.h |2 ++ 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/hw/vh

[PATCH 21/23] virtio-balloon: avoid cpu_get_physical_page_desc()

2011-12-19 Thread Avi Kivity
This reaches into the innards of the memory core, which are being changed. Switch to a memory API version. Signed-off-by: Avi Kivity --- hw/virtio-balloon.c | 14 ++ 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c index e24

[PATCH 12/23] fixup: listener fixes

2011-12-19 Thread Avi Kivity
--- memory.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/memory.c b/memory.c index c08186d..2dcbf80 100644 --- a/memory.c +++ b/memory.c @@ -708,13 +708,13 @@ static void memory_listener_update_region(FlatRange *fr, AddressSpace *as, .address_space = as

[PATCH 13/23] kvm: convert to MemoryListener API

2011-12-19 Thread Avi Kivity
Drop the use of cpu_register_phys_memory_client() in favour of the new MemoryListener API. The new API simplifies the caller, since there is no need to deal with splitting and merging slots; however this is not exploited in this patch. Signed-off-by: Avi Kivity --- kvm-all.c | 107

[PATCH 14/23] vhost: convert to MemoryListener API

2011-12-19 Thread Avi Kivity
Drop the use of cpu_register_phys_memory_client() in favour of the new MemoryListener API. The new API simplifies the caller, since there is no need to deal with splitting and merging slots; however this is not exploited in this patch. Signed-off-by: Avi Kivity --- hw/vhost.c | 126 +++

[PATCH 06/23] loader: remove calls to cpu_get_physical_page_desc()

2011-12-19 Thread Avi Kivity
cpu_get_physical_page_desc() is tied into the memory core's innards, replace it with uses of the API. Signed-off-by: Avi Kivity --- hw/loader.c |9 + 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/loader.c b/hw/loader.c index 9bbcddd..7af5411 100644 --- a/hw/loader

[PATCH 08/23] memory: replace cpu_physical_sync_dirty_bitmap() with a memory API

2011-12-19 Thread Avi Kivity
The function is still used as the implementation. Signed-off-by: Avi Kivity --- arch_init.c |6 ++ cpu-all.h |3 --- exec-obsolete.h |3 +++ memory.c|4 memory.h| 10 ++ 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/a

FreeBSD guest with VTD NIC not passing traffic

2011-12-19 Thread Shashidhar Patil
Hi, I am running Ubuntu 10.10 (amd64) on a 2 socket nehalem based server with IOH 5520. 5520 supports VTD. I enabled DMAR with intel_iommu=on. The box has intel 82599 adapter which I assigned through VT-D to FreeBSD 8.2 running as guest os. The ixgbe driver detects the device and the driver

Re: [PATCH] kvm: ensure that debugfs entries have been created

2011-12-19 Thread Yang Hamo Bai
On Thu, Dec 15, 2011 at 2:23 PM, Hamo wrote: > by checking the return value from kvm_init_debug, we > can ensure that the entries under debugfs for KVM have > been created correctly. > > Signed-off-by: Yang Bai > --- >  virt/kvm/kvm_main.c |   26 +++--- >  1 files changed, 23

Re: [Qemu-devel] [PATCH 12/23] fixup: listener fixes

2011-12-19 Thread Peter Maydell
On 19 December 2011 14:13, Avi Kivity wrote: > --- This is a rather uninformative commit message -- was this patch intended to be in this series? -- PMM >  memory.c |    7 --- >  1 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/memory.c b/memory.c > index c08186d..2dcbf80 1

Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find()

2011-12-19 Thread Anthony Liguori
On 12/19/2011 08:13 AM, Avi Kivity wrote: Given an address space (represented by the top-level memory region), returns the memory region that maps a given range. Useful for implementing DMA. The implementation is a simplistic binary search. Once we have a tree representation this can be optimi

Re: [Qemu-devel] [PATCH 12/23] fixup: listener fixes

2011-12-19 Thread Avi Kivity
On 12/19/2011 04:32 PM, Peter Maydell wrote: > On 19 December 2011 14:13, Avi Kivity wrote: > > --- > > This is a rather uninformative commit message -- was this patch > intended to be in this series? > It was intended to be merged into patch 9. Will fix for the next round. -- error compiling

Re: [Qemu-devel] [PATCH 00/23] Remove cpu_get_physical_page_desc()

2011-12-19 Thread Anthony Liguori
On 12/19/2011 08:13 AM, Avi Kivity wrote: cpu_get_physical_page_desc() exposes the internals of the memory core to callers; as such it prevents the refactoring planned there. This patchset converts all callers memory API equivalents and removes the function. The conversion leaves a lot of poten

Re: [Android-virt] [PATCH v5 11/13] ARM: KVM: Support SMP hosts

2011-12-19 Thread Christoffer Dall
On Mon, Dec 19, 2011 at 1:15 AM, Antonios Motakis wrote: > On 12/11/2011 11:25 AM, Christoffer Dall wrote: >> WARNING: This code is in development and guests do not fully boot on SMP >> hosts yet. > Hello, > > What would still be needed to fully booted SMP? For example, are there > identified crit

Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find()

2011-12-19 Thread Avi Kivity
On 12/19/2011 04:50 PM, Anthony Liguori wrote: >> +static int cmp_flatrange_addr(const void *_addr, const void *_fr) >> +{ >> +const AddrRange *addr = _addr; >> +const FlatRange *fr = _fr; > > > Please don't prefix with an underscore. Why not? It's legal according to the standards, if tha

Re: [PATCH v3 04/14] KVM: PPC: Keep page physical addresses in per-slot arrays

2011-12-19 Thread Alexander Graf
On 12.12.2011, at 23:28, Paul Mackerras wrote: > This allocates an array for each memory slot that is added to store > the physical addresses of the pages in the slot. This array is > vmalloc'd and accessed in kvmppc_h_enter using real_vmalloc_addr(). > This allows us to remove the ram_pginfo fi

Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find()

2011-12-19 Thread Anthony Liguori
On 12/19/2011 09:04 AM, Avi Kivity wrote: On 12/19/2011 04:50 PM, Anthony Liguori wrote: +static int cmp_flatrange_addr(const void *_addr, const void *_fr) +{ +const AddrRange *addr = _addr; +const FlatRange *fr = _fr; Please don't prefix with an underscore. Why not? It's legal acc

Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find()

2011-12-19 Thread Avi Kivity
On 12/19/2011 05:10 PM, Anthony Liguori wrote: > On 12/19/2011 09:04 AM, Avi Kivity wrote: >> On 12/19/2011 04:50 PM, Anthony Liguori wrote: +static int cmp_flatrange_addr(const void *_addr, const void *_fr) +{ +const AddrRange *addr = _addr; +const FlatRange *fr = _fr;

Re: [Android-virt] [PATCH v5 11/13] ARM: KVM: Support SMP hosts

2011-12-19 Thread Marc Zyngier
On 19/12/11 14:57, Christoffer Dall wrote: > On Mon, Dec 19, 2011 at 1:15 AM, Antonios Motakis > wrote: >> On 12/11/2011 11:25 AM, Christoffer Dall wrote: >>> WARNING: This code is in development and guests do not fully boot on SMP >>> hosts yet. >> Hello, >> >> What would still be needed to fully

Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find()

2011-12-19 Thread Anthony Liguori
On 12/19/2011 09:17 AM, Avi Kivity wrote: On 12/19/2011 05:10 PM, Anthony Liguori wrote: On 12/19/2011 09:04 AM, Avi Kivity wrote: On 12/19/2011 04:50 PM, Anthony Liguori wrote: +static int cmp_flatrange_addr(const void *_addr, const void *_fr) +{ +const AddrRange *addr = _addr; +const

Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find()

2011-12-19 Thread Avi Kivity
On 12/19/2011 05:25 PM, Anthony Liguori wrote: >> I rather like the pattern >> >> void callback(void *_foo) >> { >> Foo *foo = _foo; >> >> ... >> } >> >> If the consensus is that we don't want it, I'll change it, but I do >> think it's useful. > > > I dislike enforci

Re: [Android-virt] [PATCH v5 11/13] ARM: KVM: Support SMP hosts

2011-12-19 Thread Antonios Motakis
On 12/19/2011 04:19 PM, Marc Zyngier wrote: On 19/12/11 14:57, Christoffer Dall wrote: You should simply start booting a UP guest on an SMP host, see where it crashes and start tracking it down. For the time being, I've yet to see UP guest crashing on SMP host. On the model, that is... La

Re: [Android-virt] [PATCH v5 11/13] ARM: KVM: Support SMP hosts

2011-12-19 Thread Marc Zyngier
On 19/12/11 15:30, Antonios Motakis wrote: > On 12/19/2011 04:19 PM, Marc Zyngier wrote: >> On 19/12/11 14:57, Christoffer Dall wrote: >>> >>> >>> You should simply start booting a UP guest on an SMP host, see where >>> it crashes and start tracking it down. >> For the time being, I've yet to see U

Re: [Android-virt] [PATCH v5 11/13] ARM: KVM: Support SMP hosts

2011-12-19 Thread Christoffer Dall
On Mon, Dec 19, 2011 at 10:37 AM, Marc Zyngier wrote: > On 19/12/11 15:30, Antonios Motakis wrote: >> On 12/19/2011 04:19 PM, Marc Zyngier wrote: >>> On 19/12/11 14:57, Christoffer Dall wrote: You should simply start booting a UP guest on an SMP host, see where it crashes and s

Re: [Android-virt] [PATCH v5 11/13] ARM: KVM: Support SMP hosts

2011-12-19 Thread Antonios Motakis
On 12/19/2011 04:40 PM, Christoffer Dall wrote: On Mon, Dec 19, 2011 at 10:37 AM, Marc Zyngier wrote: On 19/12/11 15:30, Antonios Motakis wrote: On 12/19/2011 04:19 PM, Marc Zyngier wrote: On 19/12/11 14:57, Christoffer Dall wrote: You should simply start booting a UP guest on an SMP host,

Re: [Android-virt] [PATCH v5 11/13] ARM: KVM: Support SMP hosts

2011-12-19 Thread Marc Zyngier
On 19/12/11 15:42, Antonios Motakis wrote: > On 12/19/2011 04:40 PM, Christoffer Dall wrote: >> On Mon, Dec 19, 2011 at 10:37 AM, Marc Zyngier wrote: >>> On 19/12/11 15:30, Antonios Motakis wrote: On 12/19/2011 04:19 PM, Marc Zyngier wrote: > On 19/12/11 14:57, Christoffer Dall wrote: >>>

Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find()

2011-12-19 Thread Avi Kivity
On 12/19/2011 05:28 PM, Avi Kivity wrote: > > > > But it should be at least be documented and used consistently. > > Will update both. Updated patchset in qemu-kvm.git page_desc. Will refrain from reposting until some time has passed for review. -- error compiling committee.c: too many argument

Re: [PATCH v3 12/14] KVM: Add barriers to allow mmu_notifier_retry to be used locklessly

2011-12-19 Thread Alexander Graf
On 12.12.2011, at 23:37, Paul Mackerras wrote: > This adds an smp_wmb in kvm_mmu_notifier_invalidate_range_end() and an > smp_rmb in mmu_notifier_retry() so that mmu_notifier_retry() will give > the correct answer when called without kvm->mmu_lock being held. > PowerPC Book3S HV KVM wants to use

Re: [Android-virt] [PATCH v5 11/13] ARM: KVM: Support SMP hosts

2011-12-19 Thread Peter Maydell
2011/12/19 Christoffer Dall : > ok, just reproduced. > > Using the AEM v7 model, 2 cores, attached guest and host config. > > Host running on the v5 of the KVM/ARM branch, found here: > https://github.com/virtualopensystems/linux-kvm-arm > > Guest kernel revision: f6b252b6b92671d2633008408c06d35c26

Re: [PATCH v3 12/14] KVM: Add barriers to allow mmu_notifier_retry to be used locklessly

2011-12-19 Thread Avi Kivity
On 12/19/2011 07:18 PM, Alexander Graf wrote: > On 12.12.2011, at 23:37, Paul Mackerras wrote: > > > This adds an smp_wmb in kvm_mmu_notifier_invalidate_range_end() and an > > smp_rmb in mmu_notifier_retry() so that mmu_notifier_retry() will give > > the correct answer when called without kvm->mmu_

  1   2   >