Re: [Qemu-devel] [PATCH] ivshmem: fix guest unable to start with ioeventfd

2012-01-13 Thread Cam Macdonell
Can this patch please be merged? It fixes an important regression with ioeventfd. Thanks, Cam On Thu, Nov 24, 2011 at 3:05 AM, wrote: > From: Hongyong Zang > > When a guest boots with ioeventfd, an error (by gdb) occurs: >  Program received signal SIGSEGV, Segmentation fault. >  0x006

Re: [Qemu-devel] [PATCH] ivshmem: fix guest unable to start with ioeventfd

2011-12-05 Thread Cam Macdonell
2011/12/2 Cam Macdonell : > 2011/11/30 Cam Macdonell : >> 2011/11/30 Zang Hongyong : >>> Can this bug fix patch be applied yet? >> >> Sorry, for not replying yet. I'll test your patch within the next day. > > Have you confirmed the proper receipt of inte

Re: [Qemu-devel] [PATCH] ivshmem: fix guest unable to start with ioeventfd

2011-12-02 Thread Cam Macdonell
2011/11/30 Cam Macdonell : > 2011/11/30 Zang Hongyong : >> Can this bug fix patch be applied yet? > > Sorry, for not replying yet. I'll test your patch within the next day. Have you confirmed the proper receipt of interrupts in the receiving guests? I can confirm the bug o

Re: [Qemu-devel] [PATCH] ivshmem: fix guest unable to start with ioeventfd

2011-11-30 Thread Cam Macdonell
2011/11/30 Zang Hongyong : > Can this bug fix patch be applied yet? Sorry, for not replying yet. I'll test your patch within the next day. > With this bug, guest os cannot successfully boot with ioeventfd. > Thus the new PIO DoorBell patch cannot be posted. Well, you can certainly post the new

Re: [Qemu-devel] [PATCH v2] ivshmem: add a new PIO BAR3(Doorbell) besides MMIO BAR0 to reduce notification time

2011-11-28 Thread Cam Macdonell
On Thu, Nov 17, 2011 at 10:50 PM, wrote: > From: Hongyong Zang > > This patch, adds a PIO BAR3 for guest notifying qemu. And we find the new > notification way of PIO BAR3 reduces 30% time in comparison with the original > MMIO BAR0 way. Come to think of it, should we bump the PIO to BAR4 so

Re: [Qemu-devel] [PATCH] ivshmem: fix guest unable to start with ioeventfd

2011-11-24 Thread Cam Macdonell
On Thu, Nov 24, 2011 at 3:05 AM, wrote: > From: Hongyong Zang > > When a guest boots with ioeventfd, an error (by gdb) occurs: >  Program received signal SIGSEGV, Segmentation fault. >  0x006009cc in setup_ioeventfds (s=0x171dc40) >      at /home/louzhengwei/git_source/qemu-kvm/hw/ivshme

Re: [Qemu-devel] [PATCH] ivshmem: use PIO for BAR0(Doorbell) instead of MMIO to reduce notification time

2011-11-15 Thread Cam Macdonell
On Sun, Nov 13, 2011 at 8:56 PM, wrote: > From: Hongyong Zang > > Ivshmem(nahanni) is a mechanism for sharing host memory with VMs running on > the same host. Currently, guest notifies qemu by reading or writing ivshmem > device's PCI MMIO BAR0(Doorbell). > > This patch, changes this PCI MMIO

Re: Questions regarding ivshmem spec

2011-08-30 Thread Cam Macdonell
On Thu, Aug 25, 2011 at 7:29 AM, Sasha Levin wrote: > Hello, > > I am looking to implement an ivshmem device for KVM tools, the purpose > is to provide same functionality as QEMU and interoperability with QEMU. > > Going through the spec (I found here: > https://gitorious.org/nahanni/guest-code/bl

Re: Questions regarding ivshmem spec

2011-08-29 Thread Cam Macdonell
On Mon, Aug 29, 2011 at 9:25 AM, Sasha Levin wrote: > On Thu, 2011-08-25 at 16:29 +0300, Sasha Levin wrote: >> Hello, >> >> I am looking to implement an ivshmem device for KVM tools, the purpose >> is to provide same functionality as QEMU and interoperability with QEMU. > > [snip] > >> 1. File han

Re: [Qemu-devel] [PATCH] RFC: delay pci_update_mappings for 64-bit BARs

2010-12-14 Thread Cam Macdonell
On Mon, Dec 13, 2010 at 8:00 PM, Isaku Yamahata wrote: > On Mon, Dec 13, 2010 at 03:43:44PM -0700, Cam Macdonell wrote: >> Do not call pci_update_mappings on the lower 32-bits of a 64-bit bar.  Wait >> for the upper 32 or else Qemu will try to map on just the lower 32 which is &g

[PATCH] RFC: delay pci_update_mappings for 64-bit BARs

2010-12-13 Thread Cam Macdonell
Do not call pci_update_mappings on the lower 32-bits of a 64-bit bar. Wait for the upper 32 or else Qemu will try to map on just the lower 32 which is probably going to corrupt memory. I was encountering crashes when mapping certain PCI region sizes. The problem turns out that pci_update_mapp

[PATCH 1/2] add qemu_ram_free_from_ptr

2010-11-30 Thread Cam Macdonell
add function to free memory from Qemu that was added via qemu_ram_alloc_from_ptr. Name is a little weird. This is copied from qemu_ram_unmap from qemu-kvm. Signed-off-by: Cam Macdonell --- cpu-common.h |1 + exec.c | 13 + 2 files changed, 14 insertions(+), 0

[PATCH 2/2] Unregister shared memory on unplug.

2010-11-30 Thread Cam Macdonell
This allows 'peer' ivshmem guests to detach from shared memory before migration and re-attach after migration is complete. Signed-off-by: Cam Macdonell --- hw/ivshmem.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/ivshmem.c b/hw/ivshmem.c ind

[PATCH 0/2] fixups for ivshmem unplug/migration

2010-11-30 Thread Cam Macdonell
We added qemu_ram_alloc_from_ptr, but we need its corresponding "free" function. With that, we can properly remove the ivshmem memory on unplug. Cam Macdonell (2): add qemu_ram_free_from_ptr Unregister shared memory on unplug. cpu-common.h |1 + exec.c | 13 +++

[PATCH] Use signed 16-bit values for ivshmem register writes

2010-08-30 Thread Cam Macdonell
fixes gcc 4.1 warning Signed-off-by: Cam Macdonell --- hw/ivshmem.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ivshmem.c b/hw/ivshmem.c index bbb5cba..fa9c684 100644 --- a/hw/ivshmem.c +++ b/hw/ivshmem.c @@ -181,8 +181,8 @@ static void ivshmem_io_writel(void

Re: [qemu-kvm PATCH 0/3] small qemu-kvm cleanups

2010-08-23 Thread Cam Macdonell
On Mon, Aug 23, 2010 at 12:49 AM, Avi Kivity wrote: >  On 08/23/2010 09:45 AM, Paolo Bonzini wrote: >> >> On 08/17/2010 01:29 PM, Avi Kivity wrote: >>> >>> On 08/12/2010 06:29 PM, Paolo Bonzini wrote: Nothing earth shattering. :) Paolo Bonzini (3): move kvm_set_irqfd to kv

Re: [Qemu-devel] [PATCH 1/2] Add kvm_set_ioeventfd_mmio_long definition for non-KVM systems

2010-08-14 Thread Cam Macdonell
On Sat, Aug 14, 2010 at 11:24 AM, Andreas Färber wrote: > Am 11.08.2010 um 20:16 schrieb Cam Macdonell: > >> --- >> kvm-stub.c |    5 + >> 1 files changed, 5 insertions(+), 0 deletions(-) >> >> diff --git a/kvm-stub.c b/kvm-stub.c >> index 3378bd3..d

[PATCH 2/2] RESEND: Disable build of ivshmem on non-KVM systems

2010-08-14 Thread Cam Macdonell
Signed-off-by: Cam Macdonell --- Makefile.target |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile.target b/Makefile.target index b791492..c8281e9 100644 --- a/Makefile.target +++ b/Makefile.target @@ -191,7 +191,7 @@ obj-y += rtl8139.o obj-y += e1000.o

[PATCH 1/2] RESEND: Add kvm_set_ioeventfd_mmio_long definition for non-KVM systems

2010-08-14 Thread Cam Macdonell
Signed-off-by: Cam Macdonell --- kvm-stub.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/kvm-stub.c b/kvm-stub.c index 3378bd3..d45f9fa 100644 --- a/kvm-stub.c +++ b/kvm-stub.c @@ -136,3 +136,8 @@ int kvm_set_ioeventfd_pio_word(int fd, uint16_t addr, uint16_t val

Re: [Qemu-devel] [PATCH 1/2] Add kvm_set_ioeventfd_mmio_long definition for non-KVM systems

2010-08-11 Thread Cam Macdonell
On Wed, Aug 11, 2010 at 2:28 PM, Stefan Weil wrote: > Am 11.08.2010 20:16, schrieb Cam Macdonell: >> >> --- >> kvm-stub.c | 5 + >> 1 files changed, 5 insertions(+), 0 deletions(-) >> >> diff --git a/kvm-stub.c b/kvm-stub.c >> index 3378bd3..d4

[PATCH 1/2] Add kvm_set_ioeventfd_mmio_long definition for non-KVM systems

2010-08-11 Thread Cam Macdonell
--- kvm-stub.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/kvm-stub.c b/kvm-stub.c index 3378bd3..d45f9fa 100644 --- a/kvm-stub.c +++ b/kvm-stub.c @@ -136,3 +136,8 @@ int kvm_set_ioeventfd_pio_word(int fd, uint16_t addr, uint16_t val, bool assign) { return -

[PATCH 2/2] Disable build of ivshmem on non-KVM systems

2010-08-11 Thread Cam Macdonell
--- Makefile.target |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile.target b/Makefile.target index b791492..c8281e9 100644 --- a/Makefile.target +++ b/Makefile.target @@ -191,7 +191,7 @@ obj-y += rtl8139.o obj-y += e1000.o # Inter-VM PCI shared memory -obj-y

Re: [Qemu-devel] [PATCH v8 5/5] RESEND: Inter-VM shared memory PCI device

2010-08-11 Thread Cam Macdonell
On Wed, Aug 11, 2010 at 4:35 AM, Stefan Weil wrote: > Am 27.07.2010 18:54, schrieb Cam Macdonell: >> >> resend for bug fix related to removal of irqfd >> >> Support an inter-vm shared memory device that maps a shared-memory object >> as a >> PCI device

[PATCH v8 5/5] RESEND: Inter-VM shared memory PCI device

2010-07-27 Thread Cam Macdonell
server, sample programs and init scripts are in a git repo here: www.gitorious.org/nahanni Signed-off-by: Cam Macdonell --- Makefile.target |3 + hw/ivshmem.c| 828 +++ qemu-char.c |6 + qemu-char.h |3 + qemu

[PATCH v8 5/5] Inter-VM shared memory PCI device

2010-07-26 Thread Cam Macdonell
git repo here: www.gitorious.org/nahanni Signed-off-by: Cam Macdonell --- Makefile.target |3 + hw/ivshmem.c| 834 +++ qemu-char.c |6 + qemu-char.h |3 + qemu-doc.texi | 43 +++ 5 files changed, 889

[PATCH v8 4/5] Support marking a device as non-migratable

2010-07-26 Thread Cam Macdonell
A non-migratable device should be removed before migration and re-added after. Signed-off-by: Cam Macdonell --- hw/hw.h |2 ++ savevm.c | 44 +--- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index c2de6fe

[PATCH v8 3/5] Add function to assign ioeventfd to MMIO.

2010-07-26 Thread Cam Macdonell
Signed-off-by: Cam Macdonell --- kvm-all.c | 32 kvm.h |1 + 2 files changed, 33 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 7635f2f..d9a5dd0 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1241,6 +1241,38 @@ int

[PATCH v8 2/5] Device specification for shared memory PCI device

2010-07-26 Thread Cam Macdonell
Signed-off-by: Cam Macdonell --- docs/specs/ivshmem_device_spec.txt | 96 1 files changed, 96 insertions(+), 0 deletions(-) create mode 100644 docs/specs/ivshmem_device_spec.txt diff --git a/docs/specs/ivshmem_device_spec.txt b/docs/specs

[PATCH v8 1/5] Add qemu_ram_alloc_from_ptr function

2010-07-26 Thread Cam Macdonell
Provide a function to add an allocated region of memory to the qemu RAM. This patch is copied from Marcelo's qemu_ram_map() in qemu-kvm and given the clearer name qemu_ram_alloc_from_ptr(). Signed-off-by: Cam Macdonell --- cpu-common.h |2 ++ exec.c |

[PATCH v8 0/5] Inter-VM Shared Memory Device

2010-07-26 Thread Cam Macdonell
than one register per eventfd - remove writing arbitrary values to eventfds. Only values of 1 are now written to ensure correct usage Cam Macdonell (5): Provide a function to add an allocated region of memory to the qemu RAM. Device specification for shared memory PCI device A

Re: [Qemu-devel] [PATCH v7 0/4] Inter-VM shared memory device

2010-07-26 Thread Cam Macdonell
On Mon, Jul 26, 2010 at 2:41 PM, Anthony Liguori wrote: > On 07/26/2010 03:27 PM, Avi Kivity wrote: >> >>  On 07/26/2010 10:41 PM, Anthony Liguori wrote: >>> >>> kvm_set_irqfd() is fine, it just needs to be ported.  It should be there >>> due to vhost though? >>> >> >> It should, but isn't. >> >>>

Re: [Qemu-devel] [PATCH v7 0/4] Inter-VM shared memory device

2010-07-26 Thread Cam Macdonell
On Mon, Jul 26, 2010 at 2:11 PM, Avi Kivity wrote: >  On 07/26/2010 11:03 PM, Cam Macdonell wrote: >> >>> Please add qemu_ram_map() as a separate patch to avoid interdependencies. >>>  Try to keep it at the same place etc., that will reduce merge >>> diffic

Re: [Qemu-devel] [PATCH v7 0/4] Inter-VM shared memory device

2010-07-26 Thread Cam Macdonell
On Mon, Jul 26, 2010 at 1:51 PM, Avi Kivity wrote: >  On 07/26/2010 10:01 PM, Cam Macdonell wrote: >> >>> Is this against qemu.git or qemu-kvm.git?  It depends on functions like >>> qemu_ram_map() which are not present in qemu.git (and are present in >>> qem

Re: [Qemu-devel] [PATCH v7 0/4] Inter-VM shared memory device

2010-07-26 Thread Cam Macdonell
On Mon, Jul 26, 2010 at 7:48 AM, Anthony Liguori wrote: > On 06/15/2010 03:23 PM, Cam Macdonell wrote: >> >> Latest patch for PCI shared memory device that maps a host shared memory >> object >> to be shared between guests >> > > Is this against qemu.git or

[BUG?] vhost assert error with < 4GB of RAM

2010-07-20 Thread Cam Macdonell
I think I've found a bug when running a guest with vhost with less than 4GB of RAM. If a guest has less than 4GB of RAM, then above_4g_mem_size is 0 for this call to cpu_register_physical_memory() in pc_memory_init() from hw/pc.c:922 #if TARGET_PHYS_ADDR_BITS > 32 cpu_register_physical_memory

[PATCH v7 RESEND 4/4] Inter-VM shared memory PCI device

2010-07-08 Thread Cam Macdonell
=,id= The shared memory server, sample programs and init scripts are in a git repo here: www.gitorious.org/nahanni Signed-off-by: Cam Macdonell --- Makefile.target |3 + hw/ivshmem.c| 842 +++ qemu-char.c |6 + qemu-char.h

Re: [Qemu-devel] KVM call minutes for July 6

2010-07-06 Thread Cam Macdonell
On Tue, Jul 6, 2010 at 8:46 AM, Juan Quintela wrote: > > Today was a short call as Anthony didn't attend. > > - Jes reminded people that Linux Plumbers deadline is July 19th > - Qemu 0.13 (from the agenda, we didn't discuss it without Anthony). > > List of patches missing commit/comment/review fro

[PATCH v7 RESEND 4/4] Inter-VM shared memory PCI device

2010-06-23 Thread Cam Macdonell
, sample programs and init scripts are in a git repo here: www.gitorious.org/nahanni Signed-off-by: Cam Macdonell --- Makefile.target |3 + hw/ivshmem.c| 828 +++ qemu-char.c |6 + qemu-char.h |3 + qemu-doc.texi

Re: [PATCH RFC] Mark a device as non-migratable

2010-06-15 Thread Cam Macdonell
On Tue, Jun 15, 2010 at 10:32 AM, Anthony Liguori wrote: > On 06/15/2010 11:16 AM, Cam Macdonell wrote: >> >> How does this look for marking the device as non-migratable?  It adds a >> field >> 'no_migrate' to the SaveStateEntry and tests for it in vmstate_sav

[PATCH v7 0/4] Inter-VM shared memory device

2010-06-15 Thread Cam Macdonell
n guest joined (let application handle it) v4: - moved to single Doorbell register and use datamatch to trigger different VMs rather than one register per eventfd - remove writing arbitrary values to eventfds. Only values of 1 are now written to ensure correct usage Cam Macdonell

[PATCH v7 1/4] Device specification for shared memory PCI device

2010-06-15 Thread Cam Macdonell
Signed-off-by: Cam Macdonell --- docs/specs/ivshmem_device_spec.txt | 96 1 files changed, 96 insertions(+), 0 deletions(-) create mode 100644 docs/specs/ivshmem_device_spec.txt diff --git a/docs/specs/ivshmem_device_spec.txt b/docs/specs

[PATCH v7 4/4] Inter-VM shared memory PCI device

2010-06-15 Thread Cam Macdonell
repo here: www.gitorious.org/nahanni Signed-off-by: Cam Macdonell --- Makefile.target |3 + hw/ivshmem.c| 823 +++ qemu-char.c |6 + qemu-char.h |3 + qemu-doc.texi | 43 +++ 5 files changed, 878 insertions

[PATCH v7 2/4] Add function to assign ioeventfd to MMIO.

2010-06-15 Thread Cam Macdonell
Signed-off-by: Cam Macdonell --- kvm-all.c | 32 kvm.h |1 + 2 files changed, 33 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 47f58a6..2982631 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1257,6 +1257,38 @@ int

[PATCH v7 3/4] Support marking a device as non-migratable

2010-06-15 Thread Cam Macdonell
A non-migratable device should be removed before migration and re-added after. Signed-off-by: Cam Macdonell --- hw/hw.h |1 + savevm.c | 32 +--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index d78d814..894e6b0 100644

[PATCH RFC] Mark a device as non-migratable

2010-06-15 Thread Cam Macdonell
How does this look for marking the device as non-migratable? It adds a field 'no_migrate' to the SaveStateEntry and tests for it in vmstate_save. This would replace anything that touches memory. Cam --- hw/hw.h |1 + savevm.c | 32 +--- 2 files changed, 30 in

Re: [Qemu-devel] [PATCH v6 6/6] the stand-alone shared memory server for inter-VM shared memory

2010-06-14 Thread Cam Macdonell
On Mon, Jun 14, 2010 at 9:53 AM, Anthony Liguori wrote: > On 06/04/2010 04:45 PM, Cam Macdonell wrote: >> >> this code is a standalone server which will pass file descriptors for the >> shared >> memory region and eventfds to support interrupts between guests using &

Re: [Qemu-devel] [PATCH v6 4/6] Add support for marking memory to not be migrated. On migration, memory is checked for the NO_MIGRATION_FLAG.

2010-06-14 Thread Cam Macdonell
On Mon, Jun 14, 2010 at 9:51 AM, Anthony Liguori wrote: > On 06/04/2010 04:45 PM, Cam Macdonell wrote: >> >> This is useful for devices that do not want to take memory regions data >> with them on migration. >> --- >>  arch_init.c  |   28 ---

Re: [PATCH v6 0/6] Inter-VM Shared Memory Device with migration support

2010-06-11 Thread Cam Macdonell
Hi Anthony, Is my implementation of master/peer roles acceptable? I realize with Alex's RAMList changes I may need to modify my patch, but is the approach of marking memory non-migratable an acceptable implementation? Thanks, Cam On Fri, Jun 4, 2010 at 3:45 PM, Cam Macdonell wrote: >

Re: [Qemu-devel] [RFC PATCH 2/6] ram_blocks: Convert to a QLIST

2010-06-09 Thread Cam Macdonell
On Tue, Jun 8, 2010 at 1:15 PM, Alex Williamson wrote: > This makes the RAM block list easier to manipulate.  Also incorporate > relevant variables into the RAMList struct. > > Signed-off-by: Alex Williamson > --- > >  arch_init.c |   14 ++- >  cpu-all.h   |   28 --- >

Re: [Qemu-devel] [PATCH v6 5/6] Inter-VM shared memory PCI device

2010-06-07 Thread Cam Macdonell
On Sat, Jun 5, 2010 at 3:44 AM, Blue Swirl wrote: > On Fri, Jun 4, 2010 at 9:45 PM, Cam Macdonell wrote: >> Support an inter-vm shared memory device that maps a shared-memory object as >> a >> PCI device in the guest.  This patch also supports interrupts between guest &

[PATCH v6] Shared memory uio_pci driver

2010-06-04 Thread Cam Macdonell
* UIO IVShmem Driver + * + * (C) 2009 Cam Macdonell + * based on Hilscher CIF card driver (C) 2007 Hans J. Koch + * + * Licensed under GPL version 2 only. + * + */ + +#include +#include +#include +#include + +#include + +#define IntrStatus 0x04 +#define IntrMask 0x00 + +struct ivshmem_info { +

[PATCH v6 6/6] the stand-alone shared memory server for inter-VM shared memory

2010-06-04 Thread Cam Macdonell
this code is a standalone server which will pass file descriptors for the shared memory region and eventfds to support interrupts between guests using inter-VM shared memory. --- contrib/ivshmem-server/Makefile | 16 ++ contrib/ivshmem-server/README | 30 +++ contrib/ivshmem-

[PATCH v6 5/6] Inter-VM shared memory PCI device

2010-06-04 Thread Cam Macdonell
: + * Cam Macdonell + * + * Based On: cirrus_vga.c + * Copyright (c) 2004 Fabrice Bellard + * Copyright (c) 2004 Makoto Suzuki (suzu) + * + * and rtl8139.c + * Copyright (c) 2006 Igor Kovalenko + * + * This code is licensed under the GNU GPL v2. + */ +#include

[PATCH v6 4/6] Add support for marking memory to not be migrated. On migration, memory is checked for the NO_MIGRATION_FLAG.

2010-06-04 Thread Cam Macdonell
This is useful for devices that do not want to take memory regions data with them on migration. --- arch_init.c | 28 cpu-all.h|2 ++ cpu-common.h |2 ++ exec.c | 12 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/

[PATCH v6 0/6] Inter-VM Shared Memory Device with migration support

2010-06-04 Thread Cam Macdonell
n guest joined (let application handle it) v4: - moved to single Doorbell register and use datamatch to trigger different VMs rather than one register per eventfd - remove writing arbitrary values to eventfds. Only values of 1 are now written to ensure correct usage Cam Macdonell

[PATCH v6 3/6] Change phys_ram_dirty to phys_ram_status

2010-06-04 Thread Cam Macdonell
phys_ram_dirty are 8-bit values storing 3 dirty bits. Change to more generic phys_ram_flags and use lower 4-bits for dirty status and leave upper 4 for other uses. The names of functions may need to be changed as well, such as c_p_m_get_dirty(). --- cpu-all.h | 16 +--- exec.c

[PATCH v6 2/6] Add function to assign ioeventfd to MMIO.

2010-06-04 Thread Cam Macdonell
--- kvm-all.c | 32 kvm.h |1 + 2 files changed, 33 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 47f58a6..2982631 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1257,6 +1257,38 @@ int kvm_set_signal_mask(CPUState *env, const sigset_

[PATCH v6 1/6] Device specification for shared memory PCI device

2010-06-04 Thread Cam Macdonell
--- docs/specs/ivshmem_device_spec.txt | 96 1 files changed, 96 insertions(+), 0 deletions(-) create mode 100644 docs/specs/ivshmem_device_spec.txt diff --git a/docs/specs/ivshmem_device_spec.txt b/docs/specs/ivshmem_device_spec.txt new file mode 100644 i

[PATCH RFC 2/2] Add support for marking memory to not be migrated

2010-05-23 Thread Cam Macdonell
Non-migrated memory is useful for devices that do not want to take memory region data with them on migration. As suggested by Avi, an alternative approach could add a "flags" parameter to cpu_register_physical_memory() rather than explicityly call cpu_mark_pages_no_migrate(). However, having a se

[PATCH RFC 1/2] Change phys_ram_dirty to phys_ram_status

2010-05-23 Thread Cam Macdonell
The phys_ram_dirty array consists of 8-bit values for storing 3 dirty bits. Change to more generic phys_ram_flags and use lower 4-bits for dirty status and leave upper 4 for other uses of marking memory pages. One potential use for upper bits is to mark certain device pages to not be migrated. So

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-18 Thread Cam Macdonell
On Mon, May 10, 2010 at 10:52 AM, Anthony Liguori wrote: >> Yes, I think the ack is the way to go, so the guest has to be aware of >> it.  Would setting a flag in the driver-specific config space be an >> acceptable ack that the shared region is now mapped? >> > > You know it's mapped because it's

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-13 Thread Cam Macdonell
On Mon, May 10, 2010 at 5:59 AM, Avi Kivity wrote: > On 04/21/2010 08:53 PM, Cam Macdonell wrote: >> + >> +        /* allocate/initialize space for interrupt handling */ >> +        s->eventfds = qemu_mallocz(s->nr_alloc_guests * sizeof(int *)); >> +        

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-12 Thread Cam Macdonell
On Wed, May 12, 2010 at 9:49 AM, Avi Kivity wrote: > On 05/10/2010 07:48 PM, Cam Macdonell wrote: >> >> On Mon, May 10, 2010 at 10:40 AM, Avi Kivity  wrote: >> >>> >>> On 05/10/2010 06:41 PM, Cam Macdonell wrote: >>> >>>> >>>

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-12 Thread Cam Macdonell
On Tue, May 11, 2010 at 12:13 PM, Avi Kivity wrote: > On 05/11/2010 08:05 PM, Anthony Liguori wrote: >> >> On 05/11/2010 11:39 AM, Cam Macdonell wrote: >>> >>> Most of the people I hear from who are using my patch are using a peer >>> model to share da

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-11 Thread Cam Macdonell
On Tue, May 11, 2010 at 11:05 AM, Anthony Liguori wrote: > On 05/11/2010 11:39 AM, Cam Macdonell wrote: >> >> Most of the people I hear from who are using my patch are using a peer >> model to share data between applications (simulations, JVMs, etc). >> But guest-to-hos

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-11 Thread Cam Macdonell
On Tue, May 11, 2010 at 9:51 AM, Anthony Liguori wrote: > On 05/11/2010 09:53 AM, Avi Kivity wrote: >> >> On 05/11/2010 05:17 PM, Cam Macdonell wrote: >>> >>>> The master is the shared memory area.  It's a completely separate entity >>>> that

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-11 Thread Cam Macdonell
On Tue, May 11, 2010 at 8:03 AM, Avi Kivity wrote: > On 05/11/2010 04:10 PM, Anthony Liguori wrote: >> >> On 05/11/2010 02:59 AM, Avi Kivity wrote: (Replying again to list) What data structure would you use?  For a lockless ring queue, you can only support a single produce

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-10 Thread Cam Macdonell
On Mon, May 10, 2010 at 5:59 AM, Avi Kivity wrote: > On 04/21/2010 08:53 PM, Cam Macdonell wrote: >> >> Support an inter-vm shared memory device that maps a shared-memory object >> as a >> PCI device in the guest.  This patch also supports interrupts between >>

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-10 Thread Cam Macdonell
On Mon, May 10, 2010 at 11:52 AM, Anthony Liguori wrote: > On 05/10/2010 12:43 PM, Cam Macdonell wrote: >> >> On Mon, May 10, 2010 at 11:25 AM, Anthony Liguori >>  wrote: >> >>> >>> On 05/10/2010 11:59 AM, Avi Kivity wrote: >>> &

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-10 Thread Cam Macdonell
On Mon, May 10, 2010 at 11:25 AM, Anthony Liguori wrote: > On 05/10/2010 11:59 AM, Avi Kivity wrote: >> >> On 05/10/2010 06:38 PM, Anthony Liguori wrote: >>> > Otherwise, if the BAR is allocated during initialization, I would have > to use MAP_FIXED to mmap the memory.  This is what I did

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-10 Thread Cam Macdonell
On Mon, May 10, 2010 at 10:40 AM, Avi Kivity wrote: > On 05/10/2010 06:41 PM, Cam Macdonell wrote: >> >>> What would happen to any data written to the BAR before the the handshake >>> completed?  I think it would disappear. >>> >> >> But, the

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-10 Thread Cam Macdonell
On Mon, May 10, 2010 at 9:38 AM, Anthony Liguori wrote: > On 05/10/2010 10:28 AM, Avi Kivity wrote: >> >> On 05/10/2010 06:22 PM, Cam Macdonell wrote: >>> >>>> >>>>> + >>>>> +    /* if the position is -1, then

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-10 Thread Cam Macdonell
On Mon, May 10, 2010 at 9:28 AM, Avi Kivity wrote: > On 05/10/2010 06:22 PM, Cam Macdonell wrote: >> >>> >>>> + >>>> +    /* if the position is -1, then it's shared memory region fd */ >>>> +    if (incoming_posn == -1) { >&g

Re: [PATCH v5 2/5] Support adding a file to qemu's ram allocation

2010-05-10 Thread Cam Macdonell
On Mon, May 10, 2010 at 4:39 AM, Avi Kivity wrote: > On 04/21/2010 08:53 PM, Cam Macdonell wrote: >> >> This avoids the need of using qemu_ram_alloc and mmap with MAP_FIXED to >> map a >> host file into guest RAM.  This function mmaps the opened file anywhere >>

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-10 Thread Cam Macdonell
On Mon, May 10, 2010 at 5:59 AM, Avi Kivity wrote: > On 04/21/2010 08:53 PM, Cam Macdonell wrote: >> >> Support an inter-vm shared memory device that maps a shared-memory object >> as a >> PCI device in the guest.  This patch also supports interrupts between >>

Re: [PATCH v5 3/5] Add functions for assigning ioeventfd and irqfds.

2010-05-10 Thread Cam Macdonell
On Mon, May 10, 2010 at 4:43 AM, Avi Kivity wrote: > On 04/21/2010 08:53 PM, Cam Macdonell wrote: >> >> Generic functions to assign irqfds and ioeventfds. >> >> > > Signoff. > >>  } >> >>  #ifdef KVM_IOEVENTFD >> +int kvm_set_irqfd

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-06 Thread Cam Macdonell
On Thu, May 6, 2010 at 11:32 AM, Anthony Liguori wrote: > On 04/21/2010 12:53 PM, Cam Macdonell wrote: >> >> Support an inter-vm shared memory device that maps a shared-memory object >> as a >> PCI device in the guest.  This patch also supports interrupts between >&g

Re: [Qemu-devel] Re: How to map PCI memory into the VM without trapping

2010-05-06 Thread Cam Macdonell
On Wed, May 5, 2010 at 5:20 PM, Frank Berreth wrote: > Hi there, > this is just an update if you are interested in the outcome. I turns out > that my initial assumption that there would be page faults/trapping on the > memory pages was false. The reason the throughput is so low is because the > me

[PATCH v5 4/5] RESEND: Inter-VM shared memory PCI device

2010-05-05 Thread Cam Macdonell
: + * Cam Macdonell + * + * Based On: cirrus_vga.c and rtl8139.c + * + * This code is licensed under the GNU GPL v2. + */ +#include +#include +#include +#include +#include +#include +#include "hw.h" +#include "console.h" +#include "pc.h" +#include "pci.

Re: [PATCH 10/10] introduce qemu_ram_map

2010-04-27 Thread Cam Macdonell
On Mon, Apr 26, 2010 at 11:59 AM, Marcelo Tosatti wrote: > Which allows drivers to register an mmaped region into ram block mappings. > To be used by device assignment driver. > > CC: Cam Macdonell > Signed-off-by: Marcelo Tosatti > --- >  cpu-common.h |    1 + &

Re: [PATCH 10/10] introduce qemu_ram_map

2010-04-27 Thread Cam Macdonell
On Mon, Apr 26, 2010 at 12:54 PM, Anthony Liguori wrote: > On 04/26/2010 01:49 PM, Marcelo Tosatti wrote: >> >> On Mon, Apr 26, 2010 at 01:27:30PM -0500, Anthony Liguori wrote: >> >>> >>> On 04/26/2010 12:59 PM, Marcelo Tosatti wrote: >>> Which allows drivers to register an mmaped region

Re: [PATCH v4] Shared memory uio_pci driver

2010-04-23 Thread Cam Macdonell
On Mon, Apr 12, 2010 at 2:57 PM, Avi Kivity wrote: > > There is work now to bring msi to the generic pci 2.3 driver, perhaps we can > use that instead.  From a quick look it looks fine. > I'd be interested to follow this development. I can't find anything on LKML, is it being discussed anywhere?

[PATCH v5 3/5] RESEND: function for assigning ioeventfds.

2010-04-21 Thread Cam Macdonell
Apologies, I wasn't on the latest KVM HEAD and so missed that Michael had added an irqfd assignment function (and a more correct one at that). So now this patch has just one function. --- kvm-all.c | 26 ++ kvm.h |7 +++ 2 files changed, 33 insertions(+), 0

[PATCH v5 5/5] shared memory server for inter-VM shared memory

2010-04-21 Thread Cam Macdonell
this code is a standalone server which will pass file descriptors for the shared memory region and eventfds to support interrupts between guests using inter-VM shared memory. --- contrib/ivshmem-server/Makefile | 16 ++ contrib/ivshmem-server/README | 30 +++ contrib/ivshmem-

[PATCH v5 4/5] Inter-VM shared memory PCI device

2010-04-21 Thread Cam Macdonell
+= ivshmem.o + # Hardware support obj-i386-y = pckbd.o dma.o obj-i386-y += vga.o diff --git a/hw/ivshmem.c b/hw/ivshmem.c new file mode 100644 index 000..f8d8fdb --- /dev/null +++ b/hw/ivshmem.c @@ -0,0 +1,727 @@ +/* + * Inter-VM Shared Memory PCI device. + * + * Author: + * Cam Macdonell

[PATCH v5 3/5] Add functions for assigning ioeventfd and irqfds.

2010-04-21 Thread Cam Macdonell
Generic functions to assign irqfds and ioeventfds. --- kvm-all.c | 44 kvm.h | 14 ++ 2 files changed, 58 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index fb8d4b8..d5c7775 100644 --- a/kvm-all.c +++ b/kvm-all.

[PATCH v5 0/5] PCI Shared Memory device

2010-04-21 Thread Cam Macdonell
. Only values of 1 are now written to ensure correct usage Cam Macdonell (5): Device specification for shared memory PCI device Support adding a file to qemu's ram allocation Adds two new functions for assigning ioeventfd and irqfds. Inter-VM shared memory PCI device the stand-

[PATCH v5 1/5] Device specification for shared memory PCI device

2010-04-21 Thread Cam Macdonell
--- docs/specs/ivshmem_device_spec.txt | 91 1 files changed, 91 insertions(+), 0 deletions(-) create mode 100644 docs/specs/ivshmem_device_spec.txt diff --git a/docs/specs/ivshmem_device_spec.txt b/docs/specs/ivshmem_device_spec.txt new file mode 100644 i

[PATCH v5 2/5] Support adding a file to qemu's ram allocation

2010-04-21 Thread Cam Macdonell
This avoids the need of using qemu_ram_alloc and mmap with MAP_FIXED to map a host file into guest RAM. This function mmaps the opened file anywhere and adds the memory to the ram blocks. Usage is qemu_ram_mmap(fd, size, MAP_SHARED, offset); --- cpu-common.h |2 ++ exec.c | 36 +

Re: [PATCH v4 3/3] Inter-VM shared memory PCI device

2010-04-14 Thread Cam Macdonell
On Mon, Apr 12, 2010 at 2:56 PM, Avi Kivity wrote: > On 04/08/2010 01:52 AM, Cam Macdonell wrote: >> >> Support an inter-vm shared memory device that maps a shared-memory object >> as a >> PCI device in the guest.  This patch also supports interrupts between >>

Re: [PATCH v4 1/3] Device specification for shared memory PCI device

2010-04-12 Thread Cam Macdonell
On Mon, Apr 12, 2010 at 3:34 PM, Avi Kivity wrote: > On 04/08/2010 01:51 AM, Cam Macdonell wrote: > > (sorry about the late review) > >> + >> +Regular Interrupts >> +-- >> + >> +If regular interrupts are used (due to either a guest not su

[PATCH v4] Shared memory uio_pci driver

2010-04-07 Thread Cam Macdonell
--git a/drivers/uio/uio_ivshmem.c b/drivers/uio/uio_ivshmem.c new file mode 100644 index 000..42ac9a7 --- /dev/null +++ b/drivers/uio/uio_ivshmem.c @@ -0,0 +1,252 @@ +/* + * UIO IVShmem Driver + * + * (C) 2009 Cam Macdonell + * based on Hilscher CIF card driver (C) 2007 Hans J. Koch + * + * Licensed

[PATCH v4 3/3] Inter-VM shared memory PCI device

2010-04-07 Thread Cam Macdonell
obj-i386-y += vga.o diff --git a/hw/ivshmem.c b/hw/ivshmem.c new file mode 100644 index 000..2ec6c2c --- /dev/null +++ b/hw/ivshmem.c @@ -0,0 +1,700 @@ +/* + * Inter-VM Shared Memory PCI device. + * + * Author: + * Cam Macdonell + * + * Based On: cirrus_vga.c and rtl8139.c + * + * This

[PATCH v4 2/3] Support adding a file to qemu's ram allocation

2010-04-07 Thread Cam Macdonell
This avoids the need of using qemu_ram_alloc and mmap with MAP_FIXED to map a host file into guest RAM. This function mmaps the opened file anywhere and adds the memory to the ram blocks. Usage is qemu_ram_mmap(fd, size, MAP_SHARED, offset); --- cpu-common.h |1 + exec.c | 33 ++

[PATCH v4 1/3] Device specification for shared memory PCI device

2010-04-07 Thread Cam Macdonell
--- docs/specs/ivshmem_device_spec.txt | 85 1 files changed, 85 insertions(+), 0 deletions(-) create mode 100644 docs/specs/ivshmem_device_spec.txt diff --git a/docs/specs/ivshmem_device_spec.txt b/docs/specs/ivshmem_device_spec.txt new file mode 100644 i

[PATCH v4 0/3] PCI Shared memory device

2010-04-07 Thread Cam Macdonell
eventfds. Only values of 1 are now written to ensure correct usage Cam Macdonell (3): Device specification for shared memory PCI device Support adding a file to qemu's ram allocation Inter-VM shared memory PCI device Makefile.target|3 + cpu-com

Re: [GSoC 2010][RESEND] Shared memory transport between guest(s) and host

2010-04-07 Thread Cam Macdonell
On Wed, Apr 7, 2010 at 5:30 AM, Mohammed Gamal wrote: > Hi, > I am interested in the "Shared memory transport between guest(s) and > host" project for GSoC 2010. The description of the project is pretty > straightforward, but I am a little bit lost on some parts: > > 1- Is there any documentation

device limit for kvm_io_bus

2010-03-30 Thread Cam Macdonell
Hi, I'm trying to use ioeventfds for notification between guests. After assigning a handful of ioeventfds I was getting a "no space left on device error". The culprit seems to be that only 6 devices are allowed for a guest on the kvm IO bus. The comment indicates a somewhat low number was chose

Re: [PATCH v3 1/1] Shared memory uio_pci driver

2010-03-30 Thread Cam Macdonell
On Mon, Mar 29, 2010 at 2:59 PM, Avi Kivity wrote: > On 03/28/2010 10:48 PM, Cam Macdonell wrote: >> >> On Sat, Mar 27, 2010 at 11:48 AM, Avi Kivity  wrote: >> >>> >>> On 03/26/2010 07:14 PM, Cam Macdonell wrote: >>> >>>> >>&

Re: [PATCH v3 1/1] Shared memory uio_pci driver

2010-03-28 Thread Cam Macdonell
On Sat, Mar 27, 2010 at 11:48 AM, Avi Kivity wrote: > On 03/26/2010 07:14 PM, Cam Macdonell wrote: >> >>> I'm not familiar with the uio internals, but for the interface, an >>> ioctl() >>> on the fd to assign an eventfd to an MSI vector.  Similar to io

  1   2   >