aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2012-02-29fdc: take side count into accountHervé Poussineau1-6/+11
Floppies can be simple or double-sided. However, current code was only taking the common case into account (ie 2 sides). This repairs single-sided floppies, which where totally broken before this patch : for track > 0, wrong sector number was calculated, and data was read/written at wrong place on underlying device. Fortunately, only some 360 kB floppies are single-sided, so this bug was probably not seen much. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29memory: allow phys_map tree paths to terminate earlyAvi Kivity1-11/+17
When storing large contiguous ranges in phys_map, all values tend to be the same pointers to a single MemoryRegionSection. Collapse them by marking nodes with level > 0 as leaves. This reduces tree memory usage dramatically. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: unify PhysPageEntry::node and ::leafAvi Kivity1-20/+18
They have the same type, unify them. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: change phys_page_set() to set multiple pagesAvi Kivity1-18/+23
Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: switch phys_page_set() to a recursive implementationAvi Kivity1-26/+41
Setting multiple pages at once requires backtracking to previous nodes; easiest to achieve via recursion. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: replace phys_page_find_alloc() with phys_page_set()Avi Kivity1-11/+4
By giving the function the value we want to set, we make it more flexible for the next patch. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: simplify multipage/subpage registrationAvi Kivity1-55/+65
Instead of considering subpage on a per-page basis, split each section into a subpage head, multipage body, and subpage tail, and register each separately. This simplifies the registration functions. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: give phys_page_find() its own tree search loopAvi Kivity1-4/+13
We'll change phys_page_find_alloc() soon, but phys_page_find() doesn't need to bear the consequences. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: make phys_page_find() return a MemoryRegionSectionAvi Kivity1-139/+160
We no longer describe memory in terms of individual pages; use sections throughout instead. PhysPageDesc no longer used - remove. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: move tlb flush to MemoryListener commit callbackAvi Kivity1-8/+8
This way, if we have several changes in a single transaction, we flush just once. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: unify the two branches of cpu_register_physical_memory_log()Avi Kivity1-34/+15
Identical except that the second branch knows its not modifying an existing subpage. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: fix RAM subpages in newly initialized pagesAvi Kivity1-12/+10
If the first subpage installed in a page is RAM, then we install it as a full page, instead of a subpage. Fix by not special casing RAM. The issue dates to commit db7b5426a4b4242, which introduced subpages. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: compress phys_map node pointers to 16 bitsAvi Kivity1-9/+45
Use an expanding vector to store nodes. Allocation is baroque to g_renew() potentially invalidating pointers; this will be addressed later. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: store MemoryRegionSection pointers in phys_mapAvi Kivity1-80/+107
Instead of storing PhysPageDesc, store pointers to MemoryRegionSections. The various offsets (phys_offset & ~TARGET_PAGE_MASK, PHYS_OFFSET & TARGET_PAGE_MASK, region_offset) can all be synthesized from the information in a MemoryRegionSection. Adjust phys_page_find() to synthesize a PhysPageDesc. The upshot is that phys_map now contains uniform values, so it's easier to generate and compress. The end result is somewhat clumsy but this will be improved as we we propagate MemoryRegionSections throughout the code instead of transforming them to PhysPageDesc. The MemoryRegionSection pointers are stored as uint16_t offsets in an array. This saves space (when we also compress node pointers) and is more cache friendly. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: unify phys_map last level with intermediate levelsAvi Kivity1-43/+35
This lays the groundwork for storing leaf data in intermediate levels, saving space. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: remove first level of l1_phys_mapAvi Kivity1-21/+8
L1 and the lower levels in l1_phys_map are equivalent, except that L1 has a different size, and is always allocated. Simplify the code by removing L1. This leaves us with a tree composed solely of L2 tables, but that problem can be renamed away later. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: change memory registration to rebuild the memory map on each changeAvi Kivity1-1/+49
Instead of incrementally building the memory map, rebuild it every time. This allows later simplification, since the code need not consider overlaying a previous mapping. It is also RCU friendly. With large memory guests this can get expensive, since the operation is O(mem size), but this will be optimized later. As a side effect subpage and L2 leaks are fixed here. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: support stateless memory listenersAvi Kivity6-0/+88
Current memory listeners are incremental; that is, they are expected to maintain their own state, and receive callbacks for changes to that state. This patch adds support for stateless listeners; these work by receiving a ->begin() callback (which tells them that new state is coming), a sequence of ->region_add() and ->region_nop() callbacks, and then a ->commit() callback which signifies the end of the new state. They should ignore ->region_del() callbacks. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: split memory listener for the two address spacesAvi Kivity1-14/+66
The memory and I/O address spaces do different things, so split them into two memory listeners. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29xen: ignore I/O memory regionsAvi Kivity1-1/+1
Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: allow MemoryListeners to observe a specific address spaceAvi Kivity6-11/+46
Ignore any regions not belonging to a specified address space. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: drop AddressSpaceOpsAvi Kivity1-54/+2
All functionality has been moved to various MemoryListeners. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-02-29memory: use a MemoryListener for core memory map updates tooAvi Kivity3-26/+79
This transforms memory.c into a library which can then be unit tested easily, by feeding it inputs and listening to its outputs. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-02-29memory: don't pass ->readable attribute to cpu_register_physical_memory_logAvi Kivity3-4/+4
It can be derived from the MemoryRegion itself (which is why it is not used there). Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-02-29memory: add a readonly attribute to MemoryRegionSectionAvi Kivity2-0/+7
.readonly cannot be obtained from the MemoryRegion, since it is inherited from aliases (so you can have a MemoryRegion mapped RW at one address and RO at another). Record it in a MemoryRegionSection for listeners. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-02-29memory: move ioeventfd ops to MemoryListenerAvi Kivity5-56/+128
This way the accelerator (kvm) can handle them directly. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-02-29memory: code motion: move MEMORY_LISTENER_CALL()Avi Kivity1-32/+32
So it can be used in earlier code. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-02-29memory: switch memory listeners to a QTAILQAvi Kivity5-22/+55
This allows reverse iteration, which in turns allows consistent ordering among multiple listeners: l1->add l2->add l2->del l1->del Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-02-29memory: add shorthand for invoking a callback on all listenersAvi Kivity1-35/+19
Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-02-29memory: remove memory_region_set_offset()Avi Kivity2-25/+10
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 <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-02-29ioport: change portio_list not to use memory_region_set_offset()Avi Kivity2-7/+22
memory_region_set_offset() will be going away soon, so don't use it. Use an alias instead. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-02-28Move definition of HOST_LONG_BITS to qemu-common.hStefan Weil2-12/+9
Like the related macro TCG_TARGET_LONG, HOST_LONG_BITS can be determined by the C preprocessor. It is also not used in Makefiles. So there is no need to calculate it in configure, and it can be defined in qemu-common.h. Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-02-28target-xtensa: Clean includesStefan Weil3-3/+0
Remove some include statements which are not needed. Acked-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-02-28target-unicore32: Clean includesStefan Weil2-4/+2
The change in cpu.h is needed when HOST_LONG_BITS is defined in qemu-common.h. Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-02-28target-sh4: Clean includesStefan Weil1-6/+0
Remove some include statements which are not needed. Cc: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-02-28target-s390x: Clean includesStefan Weil3-10/+3
The change in cpu.h is needed when HOST_LONG_BITS is defined in qemu-common.h. Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-02-28target-ppc: Clean includesStefan Weil2-12/+0
Remove some include statements which are not needed. Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-02-28target-mips: Clean includesStefan Weil1-7/+0
Remove some include statements which are not needed. Cc: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-02-28target-microblaze: Clean includesStefan Weil4-17/+3
The change in cpu.h is needed when HOST_LONG_BITS is defined in qemu-common.h. Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-02-28target-m68k: Clean includesStefan Weil3-11/+1
config.h was missing in cpu.h. Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-02-28target-lm32: Clean includesStefan Weil3-13/+1
config.h was missing in cpu.h. Acked-by: Michael Walle <michael@walle.cc> Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-02-28target-i386: Clean includesStefan Weil2-7/+0
Remove some include statements which are not needed. Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-02-28target-cris: Clean includesStefan Weil4-16/+3
The change in cpu.h is needed when HOST_LONG_BITS is defined in qemu-common.h. Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com> Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-02-28target-arm: Clean includesStefan Weil1-5/+0
Remove some include statements which are not needed. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-02-28target-alpha: Clean includesStefan Weil2-5/+1
The change in cpu.h is needed when HOST_LONG_BITS is defined in qemu-common.h. Cc: Richard Henderson <rth@twiddle.net> Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-02-28Remove macro HOST_LONG_SIZEStefan Weil2-4/+2
HOST_LONG_SIZE is simply the size of a pointer value. There is no need for this macro. Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-02-28qxl: properly handle upright and non-shared surfacesGerd Hoffmann1-7/+13
Although qxl creates a shared displaysurface when the qxl surface is upright and doesn't need to be flipped there is no guarantee that the surface doesn't become unshared for some reason. Rename qxl_flip to qxl_blit and fix it to handle both flip and non-flip cases. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-28Error out when tls-channel option is used without TLSChristophe Fergeau1-1/+7
It's currently possible to setup spice channels using TLS when no TLS port has been specified (ie TLS is disabled). This cannot work, so better to error out in such a situation. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-28spice: use error_report to report errorsChristophe Fergeau1-11/+11
Error message reporting during spice startup wasn't consistent, it was done with fprintf(stderr, "") but sometimes the message didn't have a trailing \n. Using error_report make the intent of the message clearer and deal with the final \n for us. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-28qxl: add optinal 64bit vram barGerd Hoffmann2-7/+51
This patch adds an 64bit pci bar for vram. It is turned off by default. It can be enabled by setting the size of the 64bit bar to be larger than the 32bit bar. Both 32bit and 64bit bar refer to the same memory. Only the first part of the memory is available via 32bit bar. The intention is to allow large vram sizes for 64bit guests, by allowing the vram bar being mapped above 4G, so we don't have to squeeze it into the pci I/O window below 4G. With vram_size_mb=16 and vram64_size_mb=256 it looks like this: 00:02.0 VGA compatible controller: Red Hat, Inc. Device 0100 (rev 02) (prog-if 00 [VGA controller]) Subsystem: Red Hat, Inc Device 1100 Physical Slot: 2 Flags: fast devsel, IRQ 10 Memory at f8000000 (32-bit, non-prefetchable) [size=64M] Memory at fc000000 (32-bit, non-prefetchable) [size=16M] Memory at fd020000 (32-bit, non-prefetchable) [size=8K] I/O ports at c5a0 [size=32] Memory at ffe0000000 (64-bit, prefetchable) [size=256M] Expansion ROM at fd000000 [disabled] [size=64K] [ mapping above 4G needs patched seabios: http://www.kraxel.org/cgit/seabios/commit/?h=pci64 ]