Re: [Qemu-devel] [ANNOUNCE] qemu-test: a set of tests scripts for QEMU

2011-12-29 Thread Avi Kivity
On 12/29/2011 07:14 PM, Anthony Liguori wrote: > On 12/29/2011 11:08 AM, Avi Kivity wrote: >> On 12/29/2011 06:53 PM, Anthony Liguori wrote: >>>> In what way is your specifically configured kernel's TCP stack better >>>> than the random distro's kerne

Re: [Qemu-devel] [ANNOUNCE] qemu-test: a set of tests scripts for QEMU

2011-12-29 Thread Avi Kivity
On 12/29/2011 06:53 PM, Anthony Liguori wrote: >> In what way is your specifically configured kernel's TCP stack better >> than the random distro's kernel's? > > > I firmly believe that with qtest we'll end up eventually building a > libOS to make it easier to write qtest tests. > > Overtime, that

Re: [Qemu-devel] [PATCH 2/2] umem: chardevice for kvm postcopy

2011-12-29 Thread Avi Kivity
On 12/29/2011 03:26 AM, Isaku Yamahata wrote: > This is a character device to hook page access. > The page fault in the area is reported to another user process by > this chardriver. Then, the process fills the page contents and > resolves the page fault. > > > +config UMEM > +tristate "/

Re: [Qemu-devel] [PATCH 0/2][RFC] postcopy migration: Linux char device for postcopy

2011-12-29 Thread Avi Kivity
On 12/29/2011 04:18 PM, Isaku Yamahata wrote: > > > > > > The issue is how to solve the page fault, not whether TASK_INTERRUPTIBLE > > > or > > > TASK_UNINTERRUPTIBLE. > > > I can think of several options. > > > - When daemon X is dead, all page faults are served by zero pages. > > > - When daemon

Re: [Qemu-devel] [PATCH 0/2][RFC] postcopy migration: Linux char device for postcopy

2011-12-29 Thread Avi Kivity
On 12/29/2011 03:26 AM, Isaku Yamahata wrote: > This is Linux kernel driver for qemu/kvm postcopy live migration. > This is used by qemu/kvm postcopy live migration patch. > > TODO: > - Consider FUSE/CUSE option > So far several mmap patches for FUSE/CUSE are floating around. (their > purpose i

Re: [Qemu-devel] [ANNOUNCE] qemu-test: a set of tests scripts for QEMU

2011-12-29 Thread Avi Kivity
On 12/29/2011 07:49 PM, Peter Maydell wrote: > On 29 December 2011 17:26, Avi Kivity wrote: > > On 12/29/2011 07:22 PM, Peter Maydell wrote: > >> My guess is that a serious attempt at tests covering all the > >> functionality of a device is probably approximately doubli

Re: [Qemu-devel] [ANNOUNCE] qemu-test: a set of tests scripts for QEMU

2012-01-01 Thread Avi Kivity
On 12/29/2011 11:10 PM, Peter Maydell wrote: > > > Even if that turns out to be the case, it's fine. Better to > > have a few good devices than dozens of bad ones. > > This is easier to say on the x86 side of the fence, since > most of the devices you need are already in the codebase and > nobody

Re: [Qemu-devel] [PATCH 1/4] rtc: fix 12-hour mode

2012-01-01 Thread Avi Kivity
On 11/21/2011 08:00 PM, Paolo Bonzini wrote: > Hours in 12-hour mode are in the 1-12 range, not 0-11. > > @@ -320,7 +324,8 @@ static void rtc_copy_date(RTCState *s) > s->cmos_data[RTC_HOURS] = rtc_to_bcd(s, tm->tm_hour); > } else { > /* 12 hour format */ > -s->cmos_da

[Qemu-devel] [PATCH] Fix wrong region_offset when overlaying a page with another

2012-01-01 Thread Avi Kivity
cpu_register_physical_memory_log() does not update region_offset if a page was previously registered for the same address. This could cause mmio accesses going to the wrong place, by using the old region_offset. Signed-off-by: Avi Kivity --- Once qemu-test is merged, remind me to post a

[Qemu-devel] [PATCH 00/16] Kill old-style I/O dispatch

2012-01-02 Thread Avi Kivity
This patchset removes I/O dispatch through CPU{Read,Write}Func and replaces it with direct dispatch through MemoryRegions (except for MemoryRegionOps::old_mmio, of course). Avi Kivity (16): memory: move endianness compensation to memory core exec: make phys_page_find() return a temporary

[Qemu-devel] [PATCH 04/16] memory: remove MemoryRegion::backend_registered

2012-01-02 Thread Avi Kivity
;fake" regions, like watchpoints or IO_MEM_UNASSIGNED. Remove backend_registered and always initialize the region. If it turns out to be part of the I/O address space, we've wasted an I/O slot, but that's not too bad. In any case this will be optimized later on. Signed-off-by: Avi K

[Qemu-devel] [PATCH 08/16] Convert IO_MEM_{RAM, ROM, UNASSIGNED, NOTDIRTY} to MemoryRegions

2012-01-02 Thread Avi Kivity
Convert the fixed-address IO_MEM_RAM, IO_MEM_ROM, IO_MEM_UNASSIGNED, and IO_MEM_NOTDIRTY io handlers to MemoryRegions. These aren't real regions, since they are never added to the memory hierarchy, but they allow reuse of the dispatch functionality. Signed-off-by: Avi Kivity --- cpu-com

[Qemu-devel] [PATCH 15/16] Drop IO_MEM_ROMD

2012-01-02 Thread Avi Kivity
Unlike ->readonly, ->readable is not inherited from aliase, so we can simply query the memory region. Signed-off-by: Avi Kivity --- cpu-common.h |3 --- exec.c | 22 +- memory.c |5 +++-- memory.h |1 + 4 files changed, 17 insertions(

[Qemu-devel] [PATCH 12/16] Convert io_mem_watch to be a MemoryRegion

2012-01-02 Thread Avi Kivity
Signed-off-by: Avi Kivity --- exec.c | 73 ++- 1 files changed, 26 insertions(+), 47 deletions(-) diff --git a/exec.c b/exec.c index cc70134..fc1dcb7 100644 --- a/exec.c +++ b/exec.c @@ -212,7 +212,7 @@ CPUReadMemoryFunc

[Qemu-devel] [PATCH 14/16] Remove IO_MEM_SUBPAGE

2012-01-02 Thread Avi Kivity
Replace with a MemoryRegion flag. Signed-off-by: Avi Kivity --- cpu-common.h |1 - exec.c | 10 +- memory.c |1 + memory.h |1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cpu-common.h b/cpu-common.h index 98dddfe..ffb0a44 100644 --- a/cpu

[Qemu-devel] [PATCH 16/16] Remove IO_MEM_SHIFT

2012-01-02 Thread Avi Kivity
We no longer use any of the lower bits of a ram_addr, so we might as well use them for the io table index. This increases the number of potential I/O handlers by a factor of 8. Signed-off-by: Avi Kivity --- cpu-all.h |2 +- cpu-common.h |2 -- exec.c | 32

[Qemu-devel] [PATCH 09/16] Switch cpu_register_physical_memory_log() to use MemoryRegions

2012-01-02 Thread Avi Kivity
Still internally using ram_addr. Signed-off-by: Avi Kivity --- exec-obsolete.h | 24 +++- exec.c | 24 +++- memory.c| 44 3 files changed, 38 insertions(+), 54 deletions(-) diff --git a

[Qemu-devel] [PATCH 05/16] Fix wrong region_offset when overlaying a page with another

2012-01-02 Thread Avi Kivity
cpu_register_physical_memory_log() does not update region_offset if a page was previously registered for the same address. This could cause mmio accesses going to the wrong place, by using the old region_offset. Signed-off-by: Avi Kivity --- exec.c |1 + 1 files changed, 1 insertions(+), 0

[Qemu-devel] [PATCH 03/16] memory: move mmio access to functions

2012-01-02 Thread Avi Kivity
Currently mmio access goes directly to the io_mem_{read,write} arrays. In preparation for eliminating them, add indirection via a function. Signed-off-by: Avi Kivity --- exec-all.h |7 - exec.c | 54 ++-- memory.c

[Qemu-devel] [PATCH 07/16] Uninline get_page_addr_code()

2012-01-02 Thread Avi Kivity
Its use of IO_MEM_ROM and friends will later cause #include loops; and it is too large to merit inlining. Signed-off-by: Avi Kivity --- exec-all.h | 26 +- exec.c | 26 ++ 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a

[Qemu-devel] [PATCH 10/16] Convert the subpage wrapper to be a MemoryRegion

2012-01-02 Thread Avi Kivity
Signed-off-by: Avi Kivity --- exec.c | 70 --- 1 files changed, 18 insertions(+), 52 deletions(-) diff --git a/exec.c b/exec.c index c8c839a..fb8c23e 100644 --- a/exec.c +++ b/exec.c @@ -2472,6 +2472,7 @@ static inline void

[Qemu-devel] [PATCH 13/16] Direct dispatch through MemoryRegion

2012-01-02 Thread Avi Kivity
Now that all mmio goes through MemoryRegions, we can convert io_mem_opaque to be a MemoryRegion pointer, and remove the thunks that convert from old-style CPU{Read,Write}MemoryFunc to MemoryRegionOps. Signed-off-by: Avi Kivity --- exec-all.h |4 +- exec-obsolete.h |5 +- exec.c

[Qemu-devel] [PATCH 06/16] Avoid range comparisons on io index types

2012-01-02 Thread Avi Kivity
The code sometimes uses range comparisons on io indexes (e.g. index =< IO_MEM_ROM). Avoid these as they make moving to objects harder. Signed-off-by: Avi Kivity --- exec-all.h |2 +- exec.c | 37 - memory.c |

[Qemu-devel] [PATCH 11/16] Convert IO_MEM_SUBPAGE_RAM to be a MemoryRegion

2012-01-02 Thread Avi Kivity
Signed-off-by: Avi Kivity --- cpu-common.h |1 - exec.c | 72 +++-- 2 files changed, 24 insertions(+), 49 deletions(-) diff --git a/cpu-common.h b/cpu-common.h index fd787b9..98dddfe 100644 --- a/cpu-common.h +++ b/cpu-common.h

[Qemu-devel] [PATCH 02/16] exec: make phys_page_find() return a temporary

2012-01-02 Thread Avi Kivity
Instead of returning a PhysPageDesc pointer, return a temporary. This lets us move away from actually storing PhysPageDesc's, and instead sythesising them when needed. Signed-off-by: Avi Kivity --- exec.c | 148 +--- 1 files ch

[Qemu-devel] [PATCH 01/16] memory: move endianness compensation to memory core

2012-01-02 Thread Avi Kivity
Instead of doing device endianness compensation in cpu_register_io_memory(), do it in the memory core. Signed-off-by: Avi Kivity --- exec-obsolete.h |2 +- exec.c | 142 --- memory.c| 37 -- 3 files changed

Re: [Qemu-devel] [PATCH 06/16] Avoid range comparisons on io index types

2012-01-03 Thread Avi Kivity
On 01/02/2012 11:58 PM, Richard Henderson wrote: > On 01/03/2012 03:33 AM, Avi Kivity wrote: > > -if ((pd & ~TARGET_PAGE_MASK) > IO_MEM_ROM && !(pd & IO_MEM_ROMD)) { > > +if (!is_ram_rom(pd) && !(pd & IO_MEM_ROMD)) { > > /

Re: [Qemu-devel] [PATCH 08/16] Convert IO_MEM_{RAM, ROM, UNASSIGNED, NOTDIRTY} to MemoryRegions

2012-01-03 Thread Avi Kivity
On 01/03/2012 12:16 AM, Richard Henderson wrote: > On 01/03/2012 03:33 AM, Avi Kivity wrote: > > -if (is_ram_rom_romd(pd)) { > > +if (!is_ram_rom_romd(pd)) { > > Should be merged with a previous patch. > Fixed. -- error compiling committee.c: too many arguments to function

Re: [Qemu-devel] [PATCH] Fix wrong region_offset when overlaying a page with another

2012-01-03 Thread Avi Kivity
On 01/02/2012 07:49 PM, Andreas Färber wrote: > Am 01.01.2012 18:23, schrieb Avi Kivity: > > cpu_register_physical_memory_log() does not update region_offset > > if a page was previously registered for the same address. This > > could cause mmio accesses going to the wron

[Qemu-devel] [PATCH] vga: optimize ppm_save() divisions

2012-01-03 Thread Avi Kivity
ppm_save() spends upwards of 50% of its time doing divisions. Replace them with shifts. Signed-off-by: Avi Kivity --- hw/vga.c | 10 -- 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/vga.c b/hw/vga.c index ca79aa1..a228cde 100644 --- a/hw/vga.c +++ b/hw/vga.c

Re: [Qemu-devel] [PULL][v2] Remove cpu_get_physical_page_desc

2012-01-03 Thread Avi Kivity
On 01/03/2012 07:06 PM, Anthony Liguori wrote: > On 12/27/2011 09:38 AM, Avi Kivity wrote: >> Changes since first posting: fold a fixup patch into its parent patch, >> style fixes. >> >> I didn't get much review or testing for vhost or Xen, due to various >&g

Re: [Qemu-devel] [PULL][v2] Remove cpu_get_physical_page_desc

2012-01-03 Thread Avi Kivity
On 01/03/2012 07:09 PM, Avi Kivity wrote: > (strange, I was 100% sure I tested Xen). > Ah, we have different CONFIG_XEN_CTRL_INTERFACE_VERSIONs. -- error compiling committee.c: too many arguments to function

Re: [Qemu-devel] [PULL][v2] Remove cpu_get_physical_page_desc

2012-01-03 Thread Avi Kivity
On 01/03/2012 07:16 PM, Avi Kivity wrote: > On 01/03/2012 07:09 PM, Avi Kivity wrote: > > (strange, I was 100% sure I tested Xen). > > > > Ah, we have different CONFIG_XEN_CTRL_INTERFACE_VERSIONs. > Updated branch pushed - changed the signature of an empty-bodied function

[Qemu-devel] [PULL] Memory API: live migration and dispatch

2012-01-04 Thread Avi Kivity
separate patchsets. Avi Kivity (26): memory: introduce memory_region_name() vmstate, memory: decouple vmstate from memory API Store MemoryRegion in RAMBlock Switch ram_save to the memory API Sort RAMBlocks by ID for migration, not by ram_addr Remove support for

Re: [Qemu-devel] [PATCH v5 2/9] Add rle_encode and rle_decode functions Implement Run Length Encoding compression

2012-01-04 Thread Avi Kivity
On 01/03/2012 05:34 PM, Orit Wasserman wrote: > > +/* XBRLE (Xor Based Run-Length Encoding) */ > +static int rle_encode(uint8_t *src, int slen, uint8_t *dst, int dlen) > +{ > +int d = 0, ch_run = 0, i; > +uint8_t prev = 0, ch = 0; > + > +for (i = 0; i <= slen; i++) { > +if (i

Re: [Qemu-devel] [PATCH v5 0/9] XBZRLE delta for live migration of large memory apps

2012-01-04 Thread Avi Kivity
On 01/03/2012 05:34 PM, Orit Wasserman wrote: > Signed-off-by: Benoit Hudzia > Signed-off-by: Petter Svard > Signed-off-by: Aidan Shribman > Looks like the original authorship (From: ) and signoffs were lost in the actual patches. -- error compiling committee.c: too many arguments to function

Re: [Qemu-devel] [PATCH v5 2/9] Add rle_encode and rle_decode functions Implement Run Length Encoding compression

2012-01-04 Thread Avi Kivity
On 01/04/2012 03:35 PM, Stefan Hajnoczi wrote: > > I think we should specialize this for out case, where we expect runs of > > zeros (so no need to encode the repeated byte) and runs of non-repeating > > nonzeros. I propose this encoding: > > > > page = zrun > > | zrun nzrun > > | zru

[Qemu-devel] [PATCH master/stable-1.0] pci: fix corrupted pci conf index register by unaligned write

2012-01-04 Thread Avi Kivity
://bugs.launchpad.net/qemu/+bug/897771 Reported-by: Andreas Gustafsson Signed-off-by: Avi Kivity --- hw/pci_host.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/pci_host.c b/hw/pci_host.c index 44c6c20..8041778 100644 --- a/hw/pci_host.c +++ b/hw/pci_host.c @@ -101,6 +101,9

Re: [Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen.

2012-01-04 Thread Avi Kivity
On 01/04/2012 06:38 PM, Stefano Stabellini wrote: > > > I suggest doing the following: > > > > 1. keep cirrus code unchanged > > 2. when the framebuffer is first mapped into physical memory (as known > > by your CPUPhysMemoryClient), copy it into a temporary buffer, map the > > guest memory into m

Re: [Qemu-devel] [PATCH 17/23] xen: convert to MemoryListener API

2012-01-04 Thread Avi Kivity
On 01/04/2012 08:06 PM, Stefano Stabellini wrote: > On Mon, 19 Dec 2011, Avi Kivity wrote: > > -static int xen_log_start(CPUPhysMemoryClient *client, target_phys_addr_t > > phys_addr, ram_addr_t size) > > +static void xen_log_start(Mem

Re: [Qemu-devel] [PATCH] Rename target_phys_addr_t to Phys

2012-01-04 Thread Avi Kivity
On 01/04/2012 09:50 PM, Peter Maydell wrote: > On 4 January 2012 19:32, Avi Kivity wrote: > > The name 'Phys' conveys exactly the same information as > > 'target_phys_addr_t': > > > > - it has to be a physical address (no such thing as physical d

Re: [Qemu-devel] vhost broken?

2012-01-05 Thread Avi Kivity
a02000 vm_flags:00100073 anon_vma:88001f928ec0 > mapping:(null) index:7fc464a02 > Pid: 555, comm: udevd Not tainted 2.6.32-220.el6.x86_64 #1 > > bisecting points to this commit: > > commit 04097f7c5957273c578f72b9bd603ba6b1d69e33 > Author: Avi Kivity > Date: Sun Dec

Re: [Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen.

2012-01-05 Thread Avi Kivity
On 01/05/2012 02:30 PM, Stefano Stabellini wrote: > > > > > > I cannot see how this is going to fix the save/restore issue we are > > > trying to solve. > > > The problem, unfortunately very complex, is that at restore time the > > > videoram is already allocated at the physical address it was mapp

Re: [Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen.

2012-01-05 Thread Avi Kivity
On 01/05/2012 03:17 PM, Stefano Stabellini wrote: > > > The "solution" I am proposing is introducing an early_savevm set of > > > save/restore functions so that at restore time we can get to know at > > > what address the videoram is mapped into the guest address space. Once we > > > know the addre

Re: [Qemu-devel] [PATCH 02/18] ppc_prep: convert to memory API

2012-01-05 Thread Avi Kivity
On 01/05/2012 04:45 PM, Andreas Färber wrote: > Am 17.10.2011 16:02, schrieb Avi Kivity: > > Signed-off-by: Avi Kivity > > This one originally broke the prep machine: > Instructions on how to reproduce, please. -- error compiling committee.c: too many arguments to function

Re: [Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen.

2012-01-05 Thread Avi Kivity
On 01/05/2012 04:34 PM, Stefano Stabellini wrote: > On Thu, 5 Jan 2012, Avi Kivity wrote: > > On 01/05/2012 03:17 PM, Stefano Stabellini wrote: > > > > > The "solution" I am proposing is introducing an early_savevm set of > > > > > save/restore fun

Re: [Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen.

2012-01-05 Thread Avi Kivity
On 01/05/2012 05:53 PM, Stefano Stabellini wrote: > > > This involves: > > - adding vmstate to xen-all.c so it can migrate the xen vram address > > Easy so far. > > > > - making sure the memory core doesn't do mappings during restore (can be > > done by wrapping restore with > > memory_region_trans

Re: [Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen.

2012-01-05 Thread Avi Kivity
On 01/05/2012 07:21 PM, Stefano Stabellini wrote: > > > BTW what you are suggesting is not so different from what was done by > > > Anthony in the last patch series he sent. See the following (ugly) patch > > > to cirrus-vga.c to avoid accessing s->vga.vram_ptr before restore is > > > completed and

Re: [Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen.

2012-01-06 Thread Avi Kivity
On 01/05/2012 08:49 PM, Jan Kiszka wrote: > To me this still sounds like a cirrus-only xen workaround that > nevertheless spreads widely. It is. > Again, what speaks against migrating the information Xen needs before > creating the machine or a single device? That would only introduce a > generic

Re: [Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen.

2012-01-06 Thread Avi Kivity
On 01/06/2012 02:22 PM, Jan Kiszka wrote: > > > > Adding more concepts, just to work around a bug (and this is really a > > bug in the qemu/xen interface) makes it harder to refactor things later on. > > Well, it's at least only a single concept, one that could even be used > independently of Xen

Re: [Qemu-devel] [PATCH master/stable-1.0] pci: fix corrupted pci conf index register by unaligned write

2012-01-08 Thread Avi Kivity
On 01/08/2012 11:17 AM, Michael S. Tsirkin wrote: > On Thu, Jan 05, 2012 at 04:14:29PM +0100, Stefan Weil wrote: > > Am 04.01.2012 15:47, schrieb Michael S. Tsirkin: > > >On Wed, Jan 04, 2012 at 04:28:42PM +0200, Avi Kivity wrote: > > >>Commit d0ed8076cbdc261 converte

Re: [Qemu-devel] [PATCH] Rename target_phys_addr_t to Phys

2012-01-08 Thread Avi Kivity
On 01/07/2012 07:44 PM, Blue Swirl wrote: > > Making the build faster (by killing libhw32/libhw64) would be a good > > justification for this type of change IMHO. > > The original reason was to avoid 64 bit arithmetic on 32 bit hosts. > Now that 128 bit arithmetic is used for memory API, it probabl

Re: [Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen.

2012-01-08 Thread Avi Kivity
On 01/06/2012 04:40 PM, Stefano Stabellini wrote: > Avi, if you think that early_savevm is a decent solution, we'll start > working on it. I don't like early_savevm because it complicates life for devices, for what is a localized problem. But if everything else is even more complicated maybe we

Re: [Qemu-devel] [PATCH master/stable-1.0] pci: fix corrupted pci conf index register by unaligned write

2012-01-08 Thread Avi Kivity
On 01/08/2012 12:12 PM, Michael S. Tsirkin wrote: > > > > > > > And the check for unaligned writes is, well, unusual :-) > > > > What's unusual? > > > > > > > This seems to be how memory API behaves ... right, Avi? > > > Maybe this should be documented somewhere. > > > > Document what? > > That

Re: [Qemu-devel] [PATCH] memory: Fix assertion for flash devices

2012-01-08 Thread Avi Kivity
On 01/07/2012 01:13 PM, Stefan Weil wrote: > There is a regression since commit c5705a7728b4a6bc9e4f2d35911adbaf28042b25 > or some other recent change. > > System emulation with a flash device raises an assertion in function > qemu_ram_set_idstr because no new_block is found at the requested addr.

Re: [Qemu-devel] [PATCH 0/2] memory: Fix 'Kill old-style I/O dispatch'

2012-01-08 Thread Avi Kivity
On 01/07/2012 10:45 AM, Andreas Färber wrote: > Hello, > > This series fixes endianness issues in the memory core. > Apparently the actual byte swapping had not yet been tested. /me hangs head. But strangely, sparc-test, mips-test, and ppc-virtex-ml507 (after the idstr fix) all boot for me. > To

Re: [Qemu-devel] [Bug] System emulation with flash broken?

2012-01-08 Thread Avi Kivity
ke the problem started with >> this change: >> >> c5705a7728b4a6bc9e4f2d35911adbaf28042b25 >> Author: Avi Kivity 2011-12-20 14:59:12 >> vmstate, memory: decouple vmstate from memory API >> >> I first noticed the problem with my AR7 emulation (not part >> of offic

Re: [Qemu-devel] [PATCH v4 2/2] hw/integratorcp: Simplify flash remap code

2012-01-08 Thread Avi Kivity
On 01/07/2012 06:09 PM, Peter Maydell wrote: > On 7 January 2012 04:40, Andreas Färber wrote: > > I noticed you're dropping a comment about tlb_flush(). Is that because > > it was dead code, or does the Memory API take care of it for us? > > (I assume the former because memory_region_set_enabled()

Re: [Qemu-devel] [PATCH v4 2/2] hw/integratorcp: Simplify flash remap code

2012-01-08 Thread Avi Kivity
On 01/08/2012 01:19 PM, Andreas Färber wrote: > > > > Correct, and the memory core will flush the tlb, so all is well. > > Hm, I had grep'ed for tlb_flush in memory.* without a hit... > I would've assumed to find tlb_flush_all() somewhere. > It's at then end of cpu_register_physical_memory_log(),

Re: [Qemu-devel] [PATCH 1/2] m48t59: drop obsolete address base arithmetic

2012-01-08 Thread Avi Kivity
On 01/08/2012 01:43 PM, Blue Swirl wrote: > On Sun, Jan 8, 2012 at 02:48, Andreas Färber wrote: > > Am 07.01.2012 18:29, schrieb Blue Swirl: > >> On Thu, Jan 5, 2012 at 17:45, Andreas Färber wrote: > >>> Am 15.10.2011 15:50, schrieb Blue Swirl: > Remove now incorrect address base arithmetic,

[Qemu-devel] [PATCH] Fix vmstate_register_ram() for rom/device regions

2012-01-08 Thread Avi Kivity
rom/device regions have a ram_addr that is composed of both an I/O handler (low bits) and RAM region (high bits); but qemu_ram_set_idstr() excepts just a RAM region. Mask the I/O handler to make it happy. Signed-off-by: Avi Kivity --- savevm.c |2 +- 1 files changed, 1 insertions(+), 1

Re: [Qemu-devel] [Bug] System emulation with flash broken?

2012-01-08 Thread Avi Kivity
On 01/08/2012 02:23 PM, Gerhard Wiesinger wrote: > On Sun, 8 Jan 2012, Avi Kivity wrote: > >> On 01/07/2012 08:03 PM, Gerhard Wiesinger wrote: >>> On Fri, 6 Jan 2012, Stefan Weil wrote: >>> >>>> Hello Avi, >>>> >>>> latest QEMU see

Re: [Qemu-devel] [PATCH master/stable-1.0] pci: fix corrupted pci conf index register by unaligned write

2012-01-08 Thread Avi Kivity
On 01/08/2012 02:45 PM, Michael S. Tsirkin wrote: > On Sun, Jan 08, 2012 at 12:48:05PM +0200, Avi Kivity wrote: > > On 01/08/2012 12:12 PM, Michael S. Tsirkin wrote: > > > > > > > > > > > And the check for unaligned writes is, well, u

[Qemu-devel] [PULL] memory core fixes

2012-01-08 Thread Avi Kivity
Please pull from git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git memory/urgent to receive fixes for recent memory core breakages. Andreas Färber (2): memory: Fix memory_region_wrong_endianness() memory: Fix adjust_endianness() Avi Kivity (2): kvm: fix build error in ppc

Re: [Qemu-devel] [PATCH] Fix vmstate_register_ram() for rom/device regions

2012-01-08 Thread Avi Kivity
On 01/08/2012 05:50 PM, Andreas Färber wrote: > Am 08.01.2012 13:31, schrieb Avi Kivity: > > rom/device regions have a ram_addr that is composed of both an I/O handler > > (low bits) and RAM region (high bits); but qemu_ram_set_idstr() excepts just > > expects :) - if you c

[Qemu-devel] [PATCH 0/2] Remove memory_region_set_offset()

2012-01-08 Thread Avi Kivity
memory_region_set_offset() is used in only one place, and is deprecated. Remove the single use and the function itself. Avi Kivity (2): ioport: change portio_list not to use memory_region_set_offset() memory: remove memory_region_set_offset() ioport.c | 25

[Qemu-devel] [PATCH 2/2] memory: remove memory_region_set_offset()

2012-01-08 Thread Avi Kivity
memory_region_set_offset() complicates the API, and has been deprecated since its introduction. Now that it is no longer used, remove it. Signed-off-by: Avi Kivity --- memory.c | 26 ++ memory.h |9 - 2 files changed, 10 insertions(+), 25 deletions

[Qemu-devel] [PATCH 1/2] ioport: change portio_list not to use memory_region_set_offset()

2012-01-08 Thread Avi Kivity
memory_region_set_offset() will be going away soon, so don't use it. Use an alias instead. Signed-off-by: Avi Kivity --- ioport.c | 25 +++-- ioport.h |1 + 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ioport.c b/ioport.c index 36fa3a4..50

Re: [Qemu-devel] [PATCH 0/2] Remove memory_region_set_offset()

2012-01-09 Thread Avi Kivity
On 01/08/2012 08:59 PM, Andreas Färber wrote: > Am 08.01.2012 18:57, schrieb Avi Kivity: > > memory_region_set_offset() is used in only one place, and is deprecated. > > Remove the single use and the function itself. > > Does the removal of the offset mean that memory

[Qemu-devel] [PATCH 3/3] vhost: improve region filtering

2012-01-09 Thread Avi Kivity
vhost memory management doesn't care about non-memory (e.g. PIO) or non-RAM regions. Adjust the filtering to reflect that, and move it earlier so it applies to mem_sections too. Signed-off-by: Avi Kivity --- hw/vhost.c | 19 +++ 1 files changed, 15 insertions(+), 4 dele

Re: [Qemu-devel] [PATCH 2/4] memory: change dirty setting APIs to take a size

2012-01-09 Thread Avi Kivity
On 01/08/2012 11:10 PM, Blue Swirl wrote: > Instead of each target knowing or guessing the guest page size, > just pass the desired size of dirtied memory area. This should also > improve performance due to memset() optimizations. > > diff --git a/exec-obsolete.h b/exec-obsolete.h > index f8af27e..

[Qemu-devel] [PATCH 2/3] vhost: fix mem_sections memory corruption

2012-01-09 Thread Avi Kivity
A memset() used to delete an entry in an array did not take into account the array element's size. Signed-off-by: Avi Kivity --- hw/vhost.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/vhost.c b/hw/vhost.c index 541c716..d924fb0 100644 --- a/hw/vhost.c +++

[Qemu-devel] [PATCH 1/3] vhost: fix incorrect userspace address

2012-01-09 Thread Avi Kivity
MemoryListener::region_add() gives us a slice of a MemoryRegion, not a region. Adjust the userspace address to reflect that. Signed-off-by: Avi Kivity --- hw/vhost.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/vhost.c b/hw/vhost.c index cd56e75..541c716 100644

Re: [Qemu-devel] [PATCH 3/3] vhost: improve region filtering

2012-01-09 Thread Avi Kivity
On 01/09/2012 03:28 PM, Michael S. Tsirkin wrote: > On Mon, Jan 09, 2012 at 02:04:54PM +0200, Avi Kivity wrote: > > vhost memory management doesn't care about non-memory (e.g. PIO) or non-RAM > > regions. Adjust the filtering to reflect that, and move it earlier so it > &g

[Qemu-devel] [PATCH 0/3] Fix vhost after memory API breakage

2012-01-09 Thread Avi Kivity
The memory API adjustments broke vhost, this series puts it back together again. There is still a lot of room for simplification (for example split/merge can no longer occur with the memory API), this is left for later. Avi Kivity (3): vhost: fix incorrect userspace address vhost: fix

[Qemu-devel] [PULL] Fix vhost-net after the MemoryListener trauma

2012-01-09 Thread Avi Kivity
Please pull from: git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git fix-vhost-after-memory-listener to fix vhost-net after the MemoryListener changes. Michael reviewed and acked all three patches. Avi Kivity (3): vhost: fix incorrect userspace address vhost: fix mem_sections

Re: [Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen.

2012-01-09 Thread Avi Kivity
On 01/09/2012 05:28 PM, Jan Kiszka wrote: > On 2012-01-09 16:25, Stefano Stabellini wrote: > > On Sun, 8 Jan 2012, Avi Kivity wrote: > >> On 01/06/2012 04:40 PM, Stefano Stabellini wrote: > >>> Avi, if you think that early_savevm is a decent solution, we'll star

Re: [Qemu-devel] Please read: make check framework

2012-01-09 Thread Avi Kivity
On 01/09/2012 06:04 PM, Anthony Liguori wrote: > Hi, > > I'm going to apply this series quickly and will start running 'make > check-quick' as part a sniff test before pushing patches. > > I'd like to request that all maintainers/submaintainers do the same > and that everyone contributes unit tests

Re: [Qemu-devel] [PATCH 0/2][RFC] postcopy migration: Linux char device for postcopy

2012-01-12 Thread Avi Kivity
On 01/03/2012 04:25 PM, Andrea Arcangeli wrote: > > > > So the problem is if we do it in > > > userland with the current functionality you'll run out of VMAs and > > > slowdown performance too much. > > > > > > But all you need is the ability to map single pages in the address > > > space. > > >

Re: [Qemu-devel] [PATCH 0/2][RFC] postcopy migration: Linux char device for postcopy

2012-01-12 Thread Avi Kivity
On 01/04/2012 05:03 AM, Isaku Yamahata wrote: > Yes, it's quite doable in user space(qemu) with a kernel-enhancement. > And it would be easy to convert a separated daemon process into a thread > in qemu. > > I think it should be done out side of qemu process for some reasons. > (I just repeat same

Re: [Qemu-devel] [PATCH] Fix qapi code generation fix

2012-01-12 Thread Avi Kivity
On 12/28/2011 12:26 PM, Avi Kivity wrote: > The fixes to qapi code generation had multiple bugs: > - the Null class used to drop output was missing some methods > - in some scripts it was never instantiated, leading to a None return, > which is missing even more methods > - t

Re: [Qemu-devel] [PATCH] vga: optimize ppm_save() divisions

2012-01-12 Thread Avi Kivity
On 01/03/2012 03:32 PM, Avi Kivity wrote: > ppm_save() spends upwards of 50% of its time doing divisions. Replace them > with shifts. > > Pings. -- error compiling committee.c: too many arguments to function

Re: [Qemu-devel] [PATCH 21/21] postcopy: implement postcopy livemigration

2012-01-12 Thread Avi Kivity
On 01/04/2012 05:29 AM, Isaku Yamahata wrote: > On Thu, Dec 29, 2011 at 06:06:10PM +0200, Avi Kivity wrote: > > On 12/29/2011 03:26 AM, Isaku Yamahata wrote: > > > This patch implements postcopy livemigration. > > > > > > > > > +/* RAM is

Re: [Qemu-devel] State of KVM bits in linux-headers

2012-01-12 Thread Avi Kivity
ays just get Acked-by's from the appropriate maintainers. > > That's just as good as going through the tree. > > So every time we change headers, I just require Avi's ack and then he can't > complain on those patches later? Good idea! :) Of course I can compla

Re: [Qemu-devel] [PATCH v3 3/8] prep_pci: Update I/O to MemoryRegion ops

2012-01-15 Thread Avi Kivity
On 01/13/2012 05:09 AM, Andreas Färber wrote: > Convert to new-style read/write callbacks. > > > -static uint32_t PPC_PCIIO_readl (void *opaque, target_phys_addr_t addr) > +static uint64_t ppc_pci_io_read(void *opaque, target_phys_addr_t addr, > +unsigned int size)

Re: [Qemu-devel] [PATCH][v9] megasas: LSI Megaraid SAS HBA emulation

2012-01-15 Thread Avi Kivity
On 01/13/2012 06:54 PM, Andreas Färber wrote: > > +static void megasas_unmap_sgl(struct megasas_cmd_t *cmd) > > +{ > > +int i, is_write = megasas_frame_is_write(cmd); > > + > > +for (i = 0; i < cmd->iov_cnt; i++) { > > +cpu_physical_memory_unmap(cmd->iov[i].iov_base, > > cmd->iov[i

Re: [Qemu-devel] [PATCH 13/23] kvm: convert to MemoryListener API

2012-01-15 Thread Avi Kivity
On 01/15/2012 12:52 PM, Jan Kiszka wrote: > On 2012-01-15 11:49, Jan Kiszka wrote: > > On 2011-12-19 15:13, Avi Kivity wrote: > >> Drop the use of cpu_register_phys_memory_client() in favour of the new > >> MemoryListener API. The new API simplifies the caller, since th

Re: [Qemu-devel] [PATCH 2/3] acpi_piix4: Add stub functions for CPU eject callback

2012-01-15 Thread Avi Kivity
On 01/13/2012 01:11 PM, Vasilis Liaskovitis wrote: > Signed-off-by: Vasilis Liaskovitis > --- > hw/acpi_piix4.c | 15 +++ > 1 files changed, 15 insertions(+), 0 deletions(-) > > diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c > index d5743b6..8bf30dd 100644 > --- a/hw/acpi_piix4.c >

Re: [Qemu-devel] [PATCH 13/23] kvm: convert to MemoryListener API

2012-01-15 Thread Avi Kivity
On 01/15/2012 02:40 PM, Jan Kiszka wrote: > On 2012-01-15 13:35, Avi Kivity wrote: > > On 01/15/2012 12:52 PM, Jan Kiszka wrote: > >> On 2012-01-15 11:49, Jan Kiszka wrote: > >>> On 2011-12-19 15:13, Avi Kivity wrote: > >>>> Drop the use of cpu_regis

Re: [Qemu-devel] [PATCH 13/23] kvm: convert to MemoryListener API

2012-01-15 Thread Avi Kivity
On 01/15/2012 02:49 PM, Avi Kivity wrote: > On 01/15/2012 02:40 PM, Jan Kiszka wrote: > > On 2012-01-15 13:35, Avi Kivity wrote: > > > On 01/15/2012 12:52 PM, Jan Kiszka wrote: > > >> On 2012-01-15 11:49, Jan Kiszka wrote: > > >>> On 2011-12-19 15:1

[Qemu-devel] [PATCH] kvm: flush the dirty log when unregistering a slot

2012-01-15 Thread Avi Kivity
Otherwise, the dirty log information is lost in the kernel forever. Fixes opensuse-12.1 boot screen, which changes the vga windows rapidly. Signed-off-by: Avi Kivity --- This patch gives me a deja vu - I'm sure I've fixed exactly the same issue before. Please test. kvm-all.c |

[Qemu-devel] [PULL] Fix for kvm dirty logging

2012-01-15 Thread Avi Kivity
kvm dirty logging is broken in the presence of memory slots being removed; this breaks opensuse's boot screen. Following patch fixes: git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git memory/urgent Avi Kivity (1): kvm: flush the dirty log when unregistering a slot kvm-all.c |

Re: [Qemu-devel] [PATCH] kvm: flush the dirty log when unregistering a slot

2012-01-15 Thread Avi Kivity
On 01/15/2012 04:40 PM, Gerhard Wiesinger wrote: > On Sun, 15 Jan 2012, Jan Kiszka wrote: > >> On 2012-01-15 15:17, Avi Kivity wrote: >>> Otherwise, the dirty log information is lost in the kernel forever. >>> >>> Fixes opensuse-12.1 boot screen

Re: [Qemu-devel] [PATCH 2/3] acpi_piix4: Add stub functions for CPU eject callback

2012-01-16 Thread Avi Kivity
On 01/16/2012 01:32 PM, Vasilis Liaskovitis wrote: > On Sun, Jan 15, 2012 at 02:38:52PM +0200, Avi Kivity wrote: > > On 01/13/2012 01:11 PM, Vasilis Liaskovitis wrote: > > > Signed-off-by: Vasilis Liaskovitis > > > --- > > > hw/acpi_piix4.c | 15 ++

[Qemu-devel] Offline for a bit

2012-01-16 Thread Avi Kivity
I'll be offline until next Monday (inclusive). Please send kvm patches to Marcelo, as usual. Urgent or non-core memory API fixes can go to Anthony, I'll review core memory patches, if any, when I return. -- error compiling committee.c: too many arguments to function

Re: [Qemu-devel] [PATCH][v9] megasas: LSI Megaraid SAS HBA emulation

2012-01-16 Thread Avi Kivity
On 01/16/2012 04:05 PM, Alexander Graf wrote: > > > > But the emulation itself would be pretty pointless to split up ... > > You could add the header in a separate first patch :) > > That makes reviewing harder, not easier. -- error compiling committee.c: too many arguments to function

Re: [Qemu-devel] [PATCH v3 3/8] prep_pci: Update I/O to MemoryRegion ops

2012-01-16 Thread Avi Kivity
On 01/16/2012 05:08 PM, Andreas Färber wrote: > Am 15.01.2012 10:19, schrieb Avi Kivity: > > On 01/13/2012 05:09 AM, Andreas Färber wrote: > >> Convert to new-style read/write callbacks. > >> > >> > >> -static uint32_t PPC_PCIIO_readl (void *opaque, t

Re: [Qemu-devel] [PATCH][v9] megasas: LSI Megaraid SAS HBA emulation

2012-01-16 Thread Avi Kivity
On 01/16/2012 05:35 PM, Alexander Graf wrote: > On 16.01.2012, at 15:50, Avi Kivity wrote: > > > On 01/16/2012 04:05 PM, Alexander Graf wrote: > >>> > >>> But the emulation itself would be pretty pointless to split up ... > >> > >&

Re: [Qemu-devel] [PATCH][v9] megasas: LSI Megaraid SAS HBA emulation

2012-01-16 Thread Avi Kivity
On 01/16/2012 05:39 PM, Alexander Graf wrote: > Oh well, isn't it great how everyone is different? Everyone except me. -- error compiling committee.c: too many arguments to function

Re: [Qemu-devel] [PATCH 1/6] qtest: add test framework

2012-01-16 Thread Avi Kivity
On 01/16/2012 06:59 PM, Stefan Hajnoczi wrote: > > +} > > +qtest_send_prefix(chr); > > +qtest_send(chr, "OK 0x%04x\n", value); > > Endianness is a little weird here. memory.c will byteswap if target > and device endianness differ. > > Imagine the case where we're on an x86

<    3   4   5   6   7   8   9   10   11   12   >