QMP: Add "Downstream extension of QMP" to spec
Signed-off-by: Markus Armbruster <armbru@redhat.com>
microblaze: Update elf machine nums.
189 was allocated in upstream binutils.
0xbaab was the old temporary value. Still used by some tools and thelinux kernel.
I've seen 115 in older gdb versions, but lets ignore that one.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
microblaze: Add linux-user core dumping support.
Fix cross compilation
This patch enhances the algorithm which finds the correct settings for SDL.For cross compilations (when cross_prefix is set), it looks for sdl-configwith cross prefix. Here is the complete search order:
$(cross_prefix}pkg-config (old, only used for cross compilation)...
tcg-i386: Allocate call-saved registers first.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg-i386: Tidy initialization of tcg_target_call_clobber_regs.
Setting the registers one by one is easier to read, and getsoptimized by the compiler just the same.
target-s390: enable SIGP Initial Reset
For SMP to work with KVM, we need to properly emulate the SIGP Initial ResetCommand. Recent (2.6.32) kernels issue that before the SIGP Reset command thatactually wakes up the vcpu.
This patch makes -smp work on S390x....
target-ppc: remove dead code
This function had been disabled from the beginning:see 9fddaa0c0cabb610947146a79b4a9a38b0a216e5
cpu_reset() function is in target-ppc/helper.c
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>Acked-by: Alexander Graf <agraf@suse.de>...
target-s390: add firmware code
This patch adds a firmware blob to the S390 target. The blob is a simpleimplementation of a virtio client that tries to read the second stagebootloader from sectors described as of offset 0x20 in the MBR.
In combination with an updated zipl this allows for booting from virtio...
PPC/KVM: make iothread work
When running with --enable-io-thread the timer we have doesn't help,because it doesn't wake up the CPU thread. So instead we need toactually kick it.
While at it I refined the logic a bit to not dumbly trigger a timerevery 500ms, but rather do it more often after an interrupt got injected....
fix chardev_init for win32
chardev_init functions use socket,so socket_init() shoud be placed atthe front of chardev_init on win32.
Signed-off-by: TeLeMan <geleman@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
qemu-sockets: avoid strlen of NULL pointer
If the user wants to create a chardev of type socket but forgets to give ahost= option, qemu_opt_get returns NULL. This NULL pointer is then fed intostrlen a few lines below without a check which results in a segfault....
linux-user: rlimit conversion between host and target.
rlim_t conversion between host and target added.Otherwise there are some incorrect case like- RLIM_INFINITY on 32bit target > 64bit host. RLIM_INFINITY on 64bit host > mips and sparc target ? Big value(for 32bit target) on 64bit host -> 32bit target....
Compile acpi_piix4, apm and pm_smbus only once
12 compilations less for the full build.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge remote branch 'kwolf/for-anthony' into staging
Merge remote branch 'mst/for_anthony' into staging
bochs: use qemu block API
Use bdrv_pwrite to access the backing device instead of pread, andconvert the driver to implementing the bdrv_open method which givesit an already opened BlockDriverState for the underlying device.
Signed-off-by: Christoph Hellwig <hch@lst.de>...
block: Avoid unchecked casts for AIOCBs
Use container_of for one direction and &acb->common for the other one.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: Fix protocol detection for Windows devices
We can't assume the file protocol for Windows devices, they need the samedetection as other files for which an explicit protocol is not specified.
block: Fix bdrv_commit
When reopening the image, don't guess the driver, but use the same driver aswas used before. This is important if the format=... option was used for thatimage.
block/vdi: Allow disk images of size 0
Even it is not very useful, users may create images of size 0.
Without the special option CONFIG_ZERO_MALLOC, qemu_malloczaborts execution when it is told to allocate 0 bytes,so avoid this kind of call.
Cc: Kevin Wolf <kwolf@redhat.com>...
parallels: use pread
Use pread instead of lseek + read in preparation of using the qemublock API.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
parallels: use qemu block API
block/vpc: Fix conversion from size to disk geometry
The VHD algorithm calculates a disk geometrywhich is usually smaller than the requested size.
QEMU tried to round up but failed for certain sizes:
qemu-img create -f vpc disk.vpc 9437184would create an image with 9435136 bytes...
dmg: fix reading of uncompressed chunks
When dmg_read_chunk encounters an uncompressed chunk it currentlycalls read without any previous adjustment of the file postion.
This seems very wrong, and the "reference" implementation indmg2img does a search to the same offset as done in the various...
dmg: use pread
Use pread instead of lseek + read in preparation of using the qemublock API. Note that dmg actually uses the implicit file offseta lot in dmg_open, and we had to replace it with an offset variable.
dmg: use qemu block API
Dmg actually does an lseek to a negative offset in the open routine,...
block/vdi: Fix image opening and creation for odd disk sizes
The fix is based on a patch from Kevin Wolf. Here his comment:
"The number of blocks needs to be rounded up to cover all of the virtual harddisk. Without this fix, we can't even open our own images if their size is not...
use qemu_free() instead of free()
There is a call to free() where qemu_free() should instead be used.
Signed-off-by: Bruce Rogers <brogers@novell.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Fix docs for block stats monitor command
The 'parent' field in the 'query-blockstats' monitor command ispart of the top level block device QDict, not part of the 2ndlevel 'stats' QDict.
block: Remove special case for vvfat
The special case doesn't really us buy anything. Without it vvfat works moreconsistently as a protocol. We get raw on top of vvfat now, which works justas well as using vvfat directly.
block: Remove semicolon in BDRV_SECTOR_MASK macro
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-nbd: Improve error reporting
- use err(3) instead of errx(3) if errno is available to report why failed- let fail prior to daemon(3) if opening a nbd file is likely to fail after daemonizing to avoid silent failure exit- add missing 'ret = 1' when unix_socket_outgoing failed...
cloop: use pread
cloop: use qemu block API
ide: Fix ide_dma_cancel
When cancelling a request, bdrv_aio_cancel may decide that it waits forcompletion of a request rather than for cancellation. IDE therefore can'tabandon its DMA status before calling bdrv_aio_cancel; otherwise the callbackof a completed request would use invalid data....
bochs: use pread
sparc: move DT and QT defines to op_helper.c
sparc64: fix TT_WOTHER value
- fix off by one error in spill trap number bit for other window (must be bit 5)- fixes invalid instruction issue with HelenOS
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
sparc64: fix mmu demap operand typo
- must use store address operand to demap, not store value
Update to a hopefully more future proof FSF address
See also 70539e1850ddd3a7ee6f9a8db7bd8e81b85225a4,8167ee883931cb20c6264fc19d040ce2dc6ceaaa,530e7615ce3c01882e582c84dc6304ab98a3d5c5 andfad6cb1a565bb73f83fc0e2654489457b489e436.
Trim unnecessary includes
mc146818rtc: remove #ifdef DEBUG_CMOS.
remove #ifdef DEBUG_CMOS by using macro.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
apm: remove #ifdef DEBUG.
remove #ifdef DEBUG by using macro.
acpi_piix4: remove #ifdef DEBUG.
removed #ifdef DEBUG by using macro.
pm_smbus: remove #ifdef DEBUG.
pci hotadd, acpi_piix4: remove global variables
remove global variables, gpe and pci0_status by moving theminto PIIX4PMState.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>...
pci hotplug: add argument to pci hot plug callback.
Add argument, DeviceState*, to pci hot plug callback.The argument will be used later to remove global variable.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>...
acpi_piix4: qdevfy.
qdevfy acpi_piix4.
rtc: make rtc_xxx accept/return ISADevice instead of RTCState.
To match rtc_xxx with qdev, make rtc_xxx accept and return ISADeviceinstead of RTCState.
pc: move rtc declarations from pc.h into a dedicated header file.
Move rtc_xxx declarations from pc.h into mc146818rtc.h.
pc: split out piix specific part from pc.c into pc_piix.c
Finally, we can safely split out the piix specific part from pc.cinto pc_piix.c.
pc: split out pci device init from pc_init1() into pc_pci_device_init()
Split out pci device initialization from pc_init1() into pc_pci_device_init().and removed unnecessary braces.
pc: split out basic device init from pc_init1() into pc_basic_device_init()
Split out basic device, i.e. legacy devices like floppy, initializationfrom pc_init1() into pc_basic_device_init().Later it will be used.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
pc: split out vga initialization from pc_init1() into pc_vga_init().
Split out vga initialization which is independent of piixfrom pc_init1() as pc_vga_init().Later it will be used.
pc: split out memory allocation from pc_init1() into pc_memory_init()
Split out memory allocation and rom/bios loading which doesn't dependon piix from pc_init1() into pc_memory_init().Later it will be used.
pc: split out cpu initialization from pc_init1() into pc_cpus_init().
split out cpu initialization which is piix independent from pc_init1()into pc_cpus_init(). Later it will be used.
pc: make pc_init1() not refer ferr_irq directly.
By introducing a registering function, make pc_init1() not refer toferr_irq directly in order to make ferr_irq piix independent.Later pc_init1() will be split out into another file keeping ferr_irqstatic....
pc: introduce a function to allocate cpu irq.
Introduce a function, pc_allocate_cpu_irq(), to allocate cpu irqin order to make pic_irq_request() piix independent.Later piix code will be split out to another file keeping pic_irq_request()static.
pc: remove global variable rtc_state by using qemu_irq.
Remove the reference to the global variable, rtc_state, by passingfunction argument to cmos_init_hd(), cmos_init().
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Cc: Paolo Bonzini <bonzini@gnu.org>...
pc: remove a global variable, floppy_controller.
Remove a global variable, floppy_controller.Since it is unnecessarily global, make it local and pass it asa function argument.
pc: make an unnecessary global variable, pit, local.
remove unnecessary global static variables, pit.Make it local.
pc, i440fx: Make smm enable/disable function i440fx independent.
make cpu_smm_update() generic to be independent on i440fx byregistering a callback.
pc: initialize ioapic before use.
The changeset of 2c8d9340203c7f19265fd4cb2341f568217a3af6prevents isa_irq_handler() from NULL refering of IsaIrqState::ioapic.However it would be better to initialize the member before reference.
acpi: split acpi.c into the common part and the piix4 part.
Split acpi.c into the common part and the piix4 specific part.The common part will be used later.
acpi: add acpi constants from linux header files and use them.
add acpi constants from linux header files andreplace the old constants with them.The acpi constants will be used by other file.
acpi: split out apm register emulation from acpi.c
Split out apm register emulation for acpi.c into apm.c.The apm emulation will be used later.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>Cc: Aurelien Jarno <aurelien@aurel32.net>...
acpi: split out piix4 smbus routines from acpi.c into pm_smbus.c
Split out piix4 smbus routines from acpi.c into pm_smbus.c anduse it.The split out smbus emulation will be used later.
mc146818rtc: Register vmstate via qdev
After defining the required alias ID, we can push vmstate registrationof mc146818rtc to qdev.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
fdc: Register vmstate via qdev
Establish vmstate containers for ISA and sysbus variant, define theiobase as instance ID alias, and let qdev do the vmstate registrationwork.
serial: Register vmstate via qdev
At least for isa-serial, we can already let qdev do the vmstateregistration for us. It just takes wrapping vmstate for theencapsulating ISASerialState and defining the proper instance IDaliases.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
vmstate: Add support for alias ID
Some legacy users (mostly PC devices) of vmstate_register manageinstance IDs on their own, and that unfortunately in a way that isincompatible with automatically generated ones. This so far preventsswitching those users to vmstates that are registered by qdev....
vmstate: Drop unused post_save handler
No device makes use of it anymore.
sh: sm501: add 2D engine support
In linux kernel v2.6.33, sm501 frame buffer driver modified to support2D graphics engine on sm501 chip. One example is "fill rectangle" operation.But current qemu's sm501 emulation doesn't support it. This results ingraphics console disturbance....
tmp105: update the register in post_load where it needs updating.
This was the only user of .post_save as noticed by Jan Kiszka andseems to have been added there wrongly during conversion toVMStateDescription.
Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
cpus: add one 'const'
e1000: make some tables 'const'
ide: make a table 'const'
vga: make some tables 'const'
Compile virtio-9p-debug and virtio-9p-local once
Merge remote branch 'qemu-kvm/uq/master' into staging
Update SeaBIOS
- 7d09d0e Fix virtio compile errors on various gcc versions. - 89acfa3 Support for booting from virtio disks - 6d66316 smbios: avoid counting io hole as ram - e5cd945 Fix error causing USB HID "boot" protocol to not be enabled. - 0e88576 Add support for USB mice....
apb: don't use any static state
pckbd: don't use any static state
target-sparc: Fix wrong printf argument
cpu_get_ccr() returns a target_ulong, so a type cast is needed to avoidwrong output on big endian hosts. We could also use TARGET_FMT_lx,but that would print 8 instead of 2 digits.
Cc: Blue Swirl <blauwirbel@gmail.com>...
Update OpenBIOS images to r771
virtio-net: return with value in void function
virtio-net has return with value in a void function.No idea why does it compile with gcc,but this isn't standard C.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
virtio: invoke set_features on load
After migration, vhost was not getting featuresacked because set_features callback was never invoked.The fix is just to invoke that callback.
Reported-by: David L Stevens <dlstevens@us.ibm.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
pci: irq_state vmstate breakage
Code for saving irq_state got vm_statemacros wrong, passing in the wrong parameter.As a result, we both saved a wrong valueand restored it to a wrong offset.
This leads to device and bus irq counts gettingout of sync, which in turn leads to interrupts getting lost or...
pci: cleanly backout of pci_qdev_init()
If the init function of a device fails, as might happen with deviceassignment, we never undo the work done by do_pci_register_device().This not only causes a bit of a memory leak, but also leaves a boguspointer in the bus devices array that can cause a segfault or...
kvm: fix 80000001.EDX supported bit filtering
On AMD some bits from 1.EDX are reported in 80000001.EDX. The mask usedto copy bits from 1.EDX to 80000001.EDX is incorrect resulting inunsupported features passed into a guest.
Signed-off-by: Gleb Natapov <gleb@redhat.com>...
Do not stop VM if emulation failed in userspace.
Continue vcpu execution in case emulation failure happened while vcpuwas in userspace. In this case #UD will be injected into the guestallowing guest OS to kill offending process and continue.
make SIG_IPI to tcg vcpu thread reliable
Store tcg loop exit request on a global variable, and transfer it toper-CPUState exit_request after assignment of cpu_single_env.
This makes exit request signal from robust. Drop the timedlock hack.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>...
standardize on qemu_cpu_kick for signalling cpu thread(s)
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
port qemu-kvm's on_vcpu code
run_on_cpu allows to execute work on a given CPUState context.
kvm: synchronize state from cpu context
It is not safe to retrieve the KVM internal state of a given cpuwhile its potentially modifying it.
Queue the request to run on cpu context, similarly to qemu-kvm.
add cpu_is_stopped helper
move stop/stopped CPU_COMMON fields after area zeroed by reset
cpu_reset zeroes CPUState upto breakpoints member. Contents ofstop/stopped should not be zeroed on cpu_reset.
kvm: validate context for kvm cpu get/put operations
Validate that KVM vcpu state is only read/written from cpu thread itselfor that cpu is stopped.
kvm: enable smp > 1
Process INIT/SIPI requests and enable -smp > 1.