aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
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-11ppc: remove unused variablesBlue Swirl1-3/+0
Fix this error: /src/qemu/target-ppc/helper.c: In function 'booke206_tlb_to_page_size': /src/qemu/target-ppc/helper.c:1296:14: error: variable 'tlbncfg' set but not used [-Werror=unused-but-set-variable] Tested-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-02-11cfi02: Fix lazy ROMD switching - once againJan Kiszka1-0/+1
The conversion to memory regions broke lazy ROMD switching by forgetting to update the rom_mode state variable. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-02-11memory-region: Report if region is read-only or write-only on info mtreeJan Kiszka1-3/+11
Helpful to understand guest configurations of things like the i440FX's PAM or the state of ROM devices. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-02-11vga: Fix full updates in graphic modeJan Kiszka1-2/+3
This fixes the regression introduced by cd7a45c95e: We lost the or'ing with the full_update flag. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-02-11Fix memory dirty getting API change falloutBlue Swirl3-4/+4
Fix confusion in length calculation in commit cd7a45c95ecf2404810f3c6becb7cb83c5010ad8. Reported-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-02-09make: Remove duplicate use of GLIB_CFLAGSStefan Weil5-8/+0
Makefile, Makefile.hw, Makefile.target and libcacard/Makefile added GLIB_CFLAGS to QEMU_CFLAGS. Makefile.objs does this, too, and is included by all other Makefiles, so GLIB_CFLAGS were added twice (reported by malc). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: malc <av1474@comtv.ru>
2012-02-09ARM devboards: Set arm_sysctl properties before init, not afterPeter Maydell3-3/+3
The ARM devboard models (vexpress-a9, realview, versatilepb, etc) were accidentally trying to set one of the arm_sysctl properties after device init. This has now become a fatal error; set the property before device init where it should be done instead. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-02-08Merge remote-tracking branch 'bonzini/qdev-props-for-anthony' into stagingAnthony Liguori14-404/+823
* bonzini/qdev-props-for-anthony: (25 commits) qdev: remove unused fields from PropertyInfo qdev: initialize properties via QOM qdev: inline qdev_prop_set into qdev_prop_set_ptr qdev: access properties via QOM qdev: fix off-by-one qdev: let QOM free properties qdev: remove parse/print methods for pointer properties qdev: make the non-legacy pci address property accept an integer qdev: remove parse/print methods for mac properties qdev: remove print/parse methods from LostTickPolicy properties qdev: remove parse method for string properties qdev: allow reusing get/set for legacy property qdev: remove direct calls to print/parse qom: add property get/set wrappers for links qom: fix canonical paths vs. interfaces qom: use object_resolve_path_type for links qom: add object_resolve_path_type qom: fix off-by-one qom: add property get/set wrappers for C types qom: add QObject-based property get/set wrappers ...
2012-02-08Merge remote-tracking branch 'aneesh/for-upstream' into stagingAnthony Liguori8-34/+393
* aneesh/for-upstream: hw/9pfs: Remove O_NOATIME flag from 9pfs open() calls in readonly mode hw/9pfs: Update MAINTAINERS file fsdev: Fix parameter parsing for proxy helper hw/9pfs: Fix crash when mounting with synthfs hw/9pfs: Preserve S_ISGID hw/9pfs: Add new security model mapped-file.
2012-02-08Merge remote-tracking branch 'sweil/w32' into stagingAnthony Liguori2-3/+22
* sweil/w32: w32: Initialise critical section before starting thread (fix #922131) w32: Build windows and console executables
2012-02-07Restore consistent formattingmalc6-129/+129
Signed-off-by: malc <av1474@comtv.ru>
2012-02-07w32: Initialise critical section before starting thread (fix #922131)Stefan Weil1-2/+7
This patch was contributed by Bogdan Harjoc. I added some assertions. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-02-07w32: Build windows and console executablesStefan Weil1-1/+15
System emulation executables with SDL are typically windows executables. Sometimes console executables are more useful, so create both variants if linker option -mwindows was detected. v2: This version uses QEMU_PROGW / QEMU_PROG instead of QEMU_PROG / QEMU_PROGC. Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-02-07qdev: remove unused fields from PropertyInfoPaolo Bonzini3-60/+1
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-07qdev: initialize properties via QOMPaolo Bonzini3-21/+23
Similarly, use the object properties also to set the default values of the qdev properties. This requires reordering registration and initialization. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-07qdev: inline qdev_prop_set into qdev_prop_set_ptrPaolo Bonzini1-19/+7
qdev_prop_set is not needed anymore except for hacks, simplify it and inline it. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-07qdev: access properties via QOMPaolo Bonzini3-28/+59
Do not poke anymore in the struct when accessing qdev properties. Instead, ask the object to set the right value. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-07qdev: fix off-by-onePaolo Bonzini1-3/+3
Integer properties did not work. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-07qdev: let QOM free propertiesPaolo Bonzini3-15/+14
Drop the special free callback. Instead, register a "regular" release method in the non-legacy property. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-07qdev: remove parse/print methods for pointer propertiesPaolo Bonzini1-56/+72
Pointer properties (except for PROP_PTR of course) should not need a legacy counterpart. In the future, relative paths will ensure that QEMU will support the same syntax as now for drives etc.. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-07qdev: make the non-legacy pci address property accept an integerPaolo Bonzini1-19/+9
PCI addresses are set with qdev_prop_uint32. Thus we make the QOM property accept a device and function encoded in an 8-bit integer, instead of the magic dd.f hex string. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-07qdev: remove parse/print methods for mac propertiesPaolo Bonzini1-19/+42
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-07qdev: remove print/parse methods from LostTickPolicy propertiesPaolo Bonzini3-31/+33
Also generalize the code so that we can have more enum properties in the future. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-07qdev: remove parse method for string propertiesPaolo Bonzini1-11/+0
We need the print method to put double quotes, but parsing is not special. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-07qdev: allow reusing get/set for legacy propertyPaolo Bonzini1-4/+7
In some cases, a legacy property does need a special print method but not a special parse method. In this case, we can reuse the get/set from the static (non-legacy) property. If neither parse nor print is needed, though, do not register the legacy property at all. The previous patch ensures that the right fallback will be used. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-07qdev: remove direct calls to print/parsePaolo Bonzini3-29/+36
There's no need to call into ->parse and ->print manually. The QOM legacy properties do that for us. Furthermore, in some cases legacy and static properties have exactly the same behavior, and we could drop the legacy properties right away. Add an appropriate fallback to prepare for this. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-07qom: add property get/set wrappers for linksPaolo Bonzini2-0/+48
These can set a link to any object, as long as it is included in the composition tree. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-07qom: fix canonical paths vs. interfacesPaolo Bonzini1-0/+10
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-07qom: use object_resolve_path_type for linksPaolo Bonzini3-14/+24
This allows to restrict partial matches to objects of the expected type. It will let people use bare names to reference drives even though their name might be the same as a device's (e.g. -drive id=hd0,if=none,... -device ...,drive=hd0,id=hd0). As a useful byproduct, this fixes a problem with links of interface type. When a link property's type is an interface, the code expects the implementation object (not the parent object) to be stored in the variable. The parent object does not contain the right vtable. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-07qom: add object_resolve_path_typePaolo Bonzini2-10/+41
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-07qom: fix off-by-onePaolo Bonzini1-5/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>