aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2010-03-12Disable phsyical memory handling in userspace emulation.Paul Brook5-9/+21
Code to handle physical memory access is not meaningful in usrmode emulation, so disable it. Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-03-12Remove TLB from userspacePaul Brook4-3/+20
Remove TLB from userspace CPU structure. Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-03-12Add tb_page_addr_tPaul Brook3-37/+52
The page tracking code in exec.c is used by both userspace and system emulation. Userspace emulation uses it to track virtual pages, and system emulation to track ram pages. Introduce a new type to hold this kind of address. Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-03-12Fix last page errors in page_check_range and page_set_flags.Richard Henderson1-18/+36
The addr < end comparison prevents iterating over the last page in the guest address space; an iteration based on length avoids this problem. At the same time, assert that the given address is in the guest address space. Signed-off-by: Richard Henderson <rth@twiddle.net>
2010-03-12Implement multi-level page tables.Richard Henderson2-177/+275
Define L1_MAP_ADDR_SPACE_BITS to be either the virtual address size (in user mode) or physical address size (in system mode), and use that to size l1_map. This rewrites page_find_alloc, page_flush_tb, and walk_memory_regions. Use TARGET_PHYS_ADDR_SPACE_BITS for the physical memory map based off of l1_phys_map. This rewrites page_phys_find_alloc and phys_page_for_each. Signed-off-by: Richard Henderson <rth@twiddle.net>
2010-03-12linux-user: Fix mmap_find_vma returning invalid addresses.Richard Henderson3-33/+82
Don't return addresses that aren't properly aligned for the guest, e.g. when the guest has a larger page size than the host. Don't return addresses that are outside the virtual address space for the target, by paying proper attention to the h2g/g2h macros. At the same time, place the default mapping base for 64-bit guests (on 64-bit hosts) outside the low 4G. Consistently interpret mmap_next_start in the guest address space. Signed-off-by: Richard Henderson <rth@twiddle.net>
2010-03-12linux-user: Use h2g_valid in qemu_vmalloc.Richard Henderson1-5/+4
Signed-off-by: Richard Henderson <rth@twiddle.net>
2010-03-12Use TARGET_VIRT_ADDR_SPACE_BITS in h2g_valid.Richard Henderson1-5/+11
Previously, only 32-bit guests had a proper check for the validity of the virtual address. Extend that check to 64-bit guests with a restricted virtual address space. Signed-off-by: Richard Henderson <rth@twiddle.net>
2010-03-12Move TARGET_PHYS_ADDR_SPACE_BITS to target-*/cpu.h.Richard Henderson12-18/+63
Removes a set of ifdefs from exec.c. Introduce TARGET_VIRT_ADDR_SPACE_BITS for all targets other than Alpha. This will be used for page_find_alloc, which is supposed to be using virtual addresses in the first place. Signed-off-by: Richard Henderson <rth@twiddle.net>
2010-03-11target-ppc: fix evsrwu and evsrws (second try)Aurelien Jarno1-2/+2
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-11target-ppc: fix evsrwu and evsrwsAurelien Jarno1-2/+2
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-11target-ppc: fix evslw instructionAurelien Jarno1-1/+1
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-11audio: fix commentmalc1-1/+1
Signed-off-by: malc <av1474@comtv.ru>
2010-03-10QMP: Really move the RESET event to qemu_system_reset()Luiz Capitulino1-2/+1
Something bad has happened in the merge of commit 0ee44250, as the log message says it's supposed to be in qemu_system_reset() but it is do_vm_stop(). Possibly, it was a problem with the conflict resolution with ea375f9a (which has been merged first). This commit moves (again) the RESET event into qemu_system_reset(). Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-10target-i386: fix SIB decoding with index = 4Aurelien Jarno1-2/+2
A SIB byte with an index of 4 means "no scaled index", even if the scale value is not 0. In 64-bit mode, if REX.X is used, an index of 4 selects %r12. This is correctly handled by the computation of the index variable, which includes the index bits, and also the REX.X prefix: index = ((code >> 3) & 7) | REX_X(s); Thanks to Avi Kivity, Jamie Lokier and Malc for the analysis of the problem and the initial patch. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-09documentation: qemu_write_full don't work with non-blocking fd'sJuan Quintela1-0/+5
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09block: print errno on errorJuan Quintela1-2/+2
Now that we changed all create calls to return errno, just print it. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09vmdk: share cleanup codeJuan Quintela1-9/+4
cleanup code is identical for error/success cases. Only difference are goto labels. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09vmdk: fix double freeJuan Quintela1-1/+1
fail_gd error case would also free rgd_buf that was already freed Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09vmdk: make vmdk_snapshot_create return -errnoJuan Quintela1-21/+58
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09vmdk: return errno instead of -1Juan Quintela1-7/+7
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09qcow: return errno instead of -1Juan Quintela1-4/+4
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09qcow2: return errno instead of -1Juan Quintela1-9/+9
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09slirp: check system() successJuan Quintela1-1/+1
we shouldn't call W*() macros until we check that fork worked. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09cow: return errno instead of -1Juan Quintela1-3/+2
Remove not needed ret = 0 assignment. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09qemu-img rebase: Add -f optionKevin Wolf1-4/+16
Allow the user to specify the format of the image to rebase. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09configure: Fix code which creates config.mak filesStefan Weil1-2/+2
These files are created by configure and grow unnecessarily at each new call of configure: roms/seabios/config.mak roms/vgabios/config.mak libhw32/config.mak libhw64/config.mak libhw32/config.mak and libhw64/config.mak set compiler options, and the wrong old code results in very long command lines. The new code always writes a new config.mak instead of appending to an existing one. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09configure: Fix wrong stderr redirectionStefan Weil1-2/+2
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09QMP: Introduce WATCHDOG eventLuiz Capitulino4-0/+40
It's emitted whenever the watchdog device's timer expires. The action taken is provided in the 'data' member. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09Restore terminal attributes for tty based monitorShahar Havivi1-0/+8
Patch http://permalink.gmane.org/gmane.comp.emulators.qemu/63472 handle close when using tty devices (like /dev/ttyS0), yet tty based monitor are not restoring terminal attributes (as done with stdio based monitor), when closing qemu after that command: $ qemu -monitor /dev/tty the terminal is not responding until you write reset (blindly), this patch fix it Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09kbd keds: vncGerd Hoffmann2-1/+20
Use led status notification support in vnc. The qemu vnc server keeps track of the capslock and numlock states based on the key presses it receives from the vnc client. But this fails in case the guests idea of the capslock and numlock state changes for other reasons. One case is guest reboot (+ keyboard reset). Another case are more recent windows versions which reset capslock state before presenting the login screen. Usually guests use the keyboard leds to signal the capslock and numlock state to the user, so we can use this to better keep track of capslock and numlock state in the qemu vnc server. Also toggle the numlock and capslock states on keydown events (instead of keyup). Guests do the same. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09kbd leds: usb kbdGerd Hoffmann1-0/+8
Add led status notification support to the usb kbd driver. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09kbd leds: ps/2 kbdGerd Hoffmann1-0/+2
Add led status notification support to the ps/2 kbd driver. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09kbd leds: infrastructureGerd Hoffmann2-0/+46
Adds infrastructure for keyboard led status tracking to qemu. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09scsi: Make device scsi-disk reject /dev/sg*Markus Armbruster1-0/+5
You're supposed to use scsi-generic for that. Which rejects anything but /dev/sg*. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09qdev: Catch attempt to attach more than one device to a netdevMarkus Armbruster2-0/+8
Guest device and host netdev are peers, i.e. it's a 1:1 relation. However, we fail to enforce that: $ qemu -nodefaults --nographic -netdev user,id=net0 -device e1000,netdev=net0 -device virtio-net-pci,netdev=net0 -monitor stdio QEMU 0.12.50 monitor - type 'help' for more information (qemu) info network Devices not on any VLAN: net0: net=10.0.2.0, restricted=n peer=virtio-net-pci.0 e1000.0: model=e1000,macaddr=52:54:00:12:34:56 peer=net0 virtio-net-pci.0: model=virtio-net-pci,macaddr=52:54:00:12:34:57 peer=net0 It's all downhill from there. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09qdev: Improve diagnostics for bad property valuesMarkus Armbruster1-23/+34
Property "vlan" reports "failed to parse" even when the value parses just fine, but the result doesn't name an existing VLAN. Similarly, properties "drive", "chr" and "netdev" misleadingly report "failed to parse" when the value doesn't name an existing host device. Change PropertyInfo method parse to return an error code, so that qdev_prop_parse() can report the error more accurately. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-08virtio-pci: Use DEV_NVECTORS_UNSPECIFIED instead of -1 for virtio-serialAmit Shah1-3/+5
Use the named constant instead of -1. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reported-by: "Michael S. Tsirkin" <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-08qdev: Add a DEV_NVECTORS_UNSPECIFIED enum for unspecified nr of MSI vectorsAmit Shah4-6/+9
net.c used a constant to signify no MSI vectors were specified. Extend that to all qdev devices. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reported-by: "Michael S. Tsirkin" <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-08pcnet APROMWE bit location (retry)Chris Kilgour1-1/+1
According to AMD document 21485D pp.141, APROMWE is bit 8 of BCR2. Signed-off-by: Christopher Kilgour <techie@whiterocker.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-08move x509 file name defines to qemu-x509.hGerd Hoffmann2-6/+10
Want share them with vnc and spice. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-08adding helper pci functionsIzik Eidus1-0/+18
Signed-off-by: Izik Eidus <ieidus@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-08QMP: Introduce RTC_CHANGE eventLuiz Capitulino6-0/+32
Emitted whenever the RTC time changes. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-08QMP: Revamp the qmp-events.txt fileLuiz Capitulino1-37/+133
Now we can say it's useful, the following changes have been made: - Put events in alphabetical order - Add examples to all events - Document all 'data' members - Small corrections and cleanups Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-08QMP: Drop DEBUG eventLuiz Capitulino4-11/+0
This event has been introduced in the first round of QMP commits, turns out that it's based on the usage of the EXCP_DEBUG macro, which has discussable semantics when exposed through QMP. As libvirt doesn't use this, let's just drop it. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-08QMP: Move RESET event into qemu_system_reset()Luiz Capitulino1-1/+2
Nothing will change as that function is currently only called by the main loop code, but it's the right place for the RESET event, as it's where the reset is actually performed. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-08QMP: Move STOP event into do_vm_stop()Luiz Capitulino1-1/+1
I've introduced the STOP event in the main loop, this is wrong as it will be only emitted if the io thread is enabled. This fixes that by moving the STOP event to do_vm_stop(). Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-08block: Emit BLOCK_IO_ERROR before vm_stop() callLuiz Capitulino3-3/+3
The next commit will move the STOP event into do_vm_stop(), to have the expected event sequence we need to emit the I/O error event before calling vm_stop(). The expected sequence is: { "event": "BLOCK_IO_ERROR" [...] } { "event": "STOP" } Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-08Fix hanging user monitor when using balloon commandAdam Litke1-1/+1
This patch application failed. My patch adds a cb() call in do_balloon(), but the change in git has added the cb() call to do_info_balloon(). That is causing qemu segfaults. Applying the following should correct the damage. Thanks. Fix for commit: 5c366a8a3d7ac71beda8499caa815cb3ea95eb58 The cb() call is needed in do_balloon(), not do_info_balloon(). Signed-off-by: Adam Litke <agl@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-08sdl: improve grab exiting instructionsAnthony Liguori1-3/+3
It might not be obvious what "grab" is. Reported-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>