KVM: PPC: Add level based interrupt logic
KVM on PowerPC used to have completely broken interrupt logic. Usually,interrupts work by having a PIC that pulls a line up/down, so the CPU knowsthat an interrupt is active. This line stays active until some action is...
vnc: use bswapNN() rather than bswap_NN()
bswap_NN() variants are not always available in CONFIG_MACHINE_BSWAP_H caseand bswapNN() are public APIs in "bswap.h".
Signed-off-by: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
vnc: tight: remove unused variable
Signed-off-by: Serge Ziryukin <ftrvxmtrx@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix ivshmem build on 32-bit hosts
stat() fields can be more or less anything depending on configuration, castexplicitly to uint64_t to avoid printf() format mismatches.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
virtio-9p: Make sure -virtfs option works correctly
When making copy of arguments we were doing partial copy
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hw/ivshmem.c don't check for negative values on unsigned data types
There is no need to check for dest < 0 or vector >= 0 as both areuint16_t.
This should fix problems with broken build with aggressive compilerflags. Reported by Xudong Hao <xudong.hao@intel.com>...
Change DPRINTF to do{}while(0) to avoid compiler warning
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
load_multiboot(): get_image_size() returns int
Do not store return of get_image_size() in a uint32_t as it makes itimpossible to detect error returns from get_image_size.
size_t is unsigned, change to ssize_t to handle errors from tight_compress_data()
Fix repeated typo: was "end if list" instead of "end of list"
Respect return value from nbd_client()
Remove unused argument for nbd_client()
Fix OpenBSD linker warning
Fix a warning from OpenBSD linker:../libhw32/vl.o(.text+0x5c3c): In function `main':/src/qemu/vl.c:2335: warning: sprintf() is often misused, please use snprintf()
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
acpi: fix file size check with -acpitable.
acpi table file can be modified during load so file size checkshould be more strict.pointer calculation should be after qemu_realloc(). not before realloc().
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
isapc: fix segfault.
https://bugs.launchpad.net/bugs/611646reports that ./i386-softmmu/qemu -M isapc segfaults.This patch fixes the segfault introduced byf885f1eaa8711c06033ceb1599e3750fb37c306f
It's because i440fx_state in pc_init1() isn't initialized....
Fix segfault in mmio subpage handling code.
It is possible that subpage mmio is registered over existing memorypage. When this happens "memory" will have real memory address and notindex into io_mem array so next access to the page will generatesegfault. It is uncommon to have some part of a page to be accessed as...
etraxfs_eth: correct use of ! and &
Combining bitwise AND and logical NOT is suspicious.
Fixed by this Coccinelle script:// From http://article.gmane.org/gmane.linux.kernel/646367@ expression E1,E2; @( !E1 & !E2 |- !E1 & E2+ !(E1 & E2))
@ expression E1,E2;
Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>...
Sparc: update OpenBIOS images to r859
Update Sparc32 and Sparc64 OpenBIOS images to SVN revision 859.
Bring also pc-bios/README up to date including the update performed by419ef5f1c6a9614e8ddcb0b0f826de692e7e4a43.
Fix "make install" with a cross toolchain
We must be able to use a non-native strip executable, but not allversions of 'install' support the --strip-program option (e.g.OpenBSD). Accordingly, we can't use 'install -s', and we must run stripseparately....
ppc4xx: correct SDRAM controller warning message condition
The message "Truncating memory to %d MiB to fit SDRAM controller limits" should be displayed only when a user chooses an amount of RAM whichcan't be represented by the PPC 4xx SDRAM controller (e.g. 129MB, which...
ppc4xx: don't unregister RAM at reset
The PowerPC 4xx SDRAM controller emulation unregisters RAM in its resetcallback. However, qemu_system_reset() is now called at initializationtime, so all RAM is unregistered before starting the guest (!).
Signed-off-by: Hollis Blanchard <hollis@penguinppc.org>
ppc4xx: load Bamboo kernel, initrd, and fdt at fixed addresses
We can't use the return value of load_uimage() for the kernel because itcan't account for BSS size, and the PowerPC kernel does not relocateblobs before zeroing BSS.
Instead, we now load at the fixed addresses chosen by u-boot (the normal...
PPC: Update openbios binary to r859
This updates the openBIOS binary to r589, adding support for PPC PV featurepass-through in KVM.
Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: Add PV hypercall transport through fw_cfg
On KVM for PPC we need to tell the guest which instructions to use whendoing a hypercall. The clean way to do this is to go through an ioctlfrom userspace and passing it on to the guest using the device tree....
Rearrange block headers
Changing block.h or blockdev.h resulted in recompiling most objects.
Move DriveInfo typedef and BlockInterfaceType enum definitionsto qemu-common.h and rearrange blockdev.h use to decrease churn.
Merge remote branch 'qemu-kvm/uq/master' into staging
QMP/monitor: update do_info_version() to output broken down version string
This code was originally developed by Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>...
QMP doc: Add 'Stability Considerations' section
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
QMP: Update README file
A number of changes I prefer to do in one shot:
- Fix example- Small clarifications- Add multiple monitors example- Add 'Development Process' section
VGA: Don't register deprecated VBE range
Old versions of the BOCHs VGA BIOS (cira 2003) made use of VBEregisters at 0xff80/81. In VBE API version 0xb0c2 these weremoved to 0x1ce/cf. Unfortunately, QEMU still registers handlersfor the old range. If a guest attempts to assign an I/O device...
QemuOpts: allow new option groups be registered at runtime.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
QemuOpts: make most qemu_*_opts static
Switch tree to lookup-by-name using qemu_find_opts().Also hook up virtfs options so qemu_find_opts works for them too.
compile -fsdev and -virtfs cmd line options unconditionally.
QMP: update 'query-version' documentation
Update the documentation of 'query-version' to output the string version brokendown.
Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vnc: check fd before calling qemu_set_fd_handler2() in vnc_client_write()
Setting fd = -1 to qemu_set_fd_handler2() causes bus error at FD_SETin main_loop_wait().
Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pckbd: support for commands 0xf0-0xff: Pulse output bit
I have a guest OS which sends the command 0xfd to the keyboardcontroller during initialization. To get rid of the message"qemu: unsupported keyboard cmd=0x%02x\n" I added support forthe pulse output bit commands....
arch_init: replace tabs by spaces.
exec: replace tabs by spaces.
exec: remove code duplication in qemu_ram_alloc() and qemu_ram_alloc_from_ptr()
Since most of the code in qemu_ram_alloc() andqemu_ram_alloc_from_ptr() are duplicated, letqemu_ram_alloc_from_ptr() to switch by checking void *host, and changeqemu_ram_alloc() to a wrapper....
target-i386: svm: Fix MSRPM check
Correct the calculation of the offset in the msrpmfor the MSR range 0 - 0x1fff.
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-serial: Cleanup on device hot-unplug
Free malloc'ed memory, unregister from savevm and clean up virtio-commonbits on device hot-unplug.
This was found performing a migration after device hot-unplug.
Reported-by: <lihuang@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>...
Replace qemu_malloc + memset with qemu_mallocz
Replace a qemu_malloc call, followed by a memset, with qemu_mallocz.
Found with this Coccinelle semantic patch, adapted fromCoccinelle test package rule 94:@type T;expression x;expression E;@
@type T;expression x;expression E;
- x = (T)qemu_malloc(E)...
Use ARRAY_SIZE macro
Replace array size calculations with ARRAY_SIZE macro.
Implemented with this Coccinelle semantic patch, adapted fromLinux kernel:@type T;T[] E;@
@type T;T[] E;
- (sizeof(E)/sizeof(*E))+ ARRAY_SIZE(E)
@type T;T[] E;@
- (sizeof(E)/sizeof(E[...]))...
Remove useless NULL check for qemu_strdup return value
Found with this Coccinelle semantic patch:@expression E;identifier ptr;identifier fn ~= "qemu_strn?dup";@
@expression E;identifier ptr;identifier fn ~= "qemu_strn?dup";
ptr = fn(E);-if (ptr == NULL) { ... }+ptr = fn(E);
Remove useless NULL checks for qemu_malloc return value
Found with this Coccinelle semantic patch:@expression E;identifier ptr;identifier fn ~= "qemu_mallocz*";@
@expression E;identifier ptr;identifier fn ~= "qemu_mallocz*";
QEMUFileBuffered: indicate that we're ready when the underlying file is ready
QEMUFileBuffered stops writing when the underlying QEMUFile is not ready,and tells its producer so. However, when the underlying QEMUFile becomesready, it neglects to pass that information along, resulting in stoppage...
rtc: Remove TARGET_I386 from qemu-config.c, enables driftfix
qemu-config.c doesn't contain any target-specific code, and theTARGET_I386 conditional code didn't get compiled as a result. Removingthis enables the driftfix parameter for rtc.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
set proper migration status on ->write error (v5)
If ->write fails, declare migration status as MIG_STATE_ERROR.
Also, in buffered_file.c, ->close the object in case of anerror.
Fixes "migrate -d "exec:dd of=file", where dd fails to open file.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>...
savevm: Reset last block info at beginning of each save
If we save more than once we need to reset the last block info or elseonly the first save has the actual block info and each subsequent savewill only use continue flags, making them unloadable independently....
sparc escc IUS improvements (SunOS 4.1.4 fix)
According to scc_escc_um.pdf: - Reset Highest IUS must update irq status to allow processing of the next priority interrupt. - rx interrupt has always higher priority than tx on same channel
The documentation only explicitly says that Reset Highest IUS...
Fix mingw32 build
Don't define qemu_chr_open_eventfd() on Windows.
win32: Avoid compiler warning (WIN32_LEAN_AND_MEAN redefined)
configure adds the macro WIN32_LEAN_AND_MEAN toQEMU_CFLAGS, and SDL_syswm.h defines it, too.
This results in a compiler warning (redefinition ofWIN32_LEAN_AND_MEAN in SDL_syswm.h. That warning prevents...
win32: Add missing function setenv
Mingw32 does not provide a declaration and implementation of functionsetenv (which is used in sdl.c), so this patch adds both.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Disable build of ivshmem on non-KVM systems
Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Add kvm_set_ioeventfd_mmio_long definition for non-KVM systems
TCG: Revert ppc64 tcg_out_movi32 change
3b6dac34161bc0a342336072643c2f6d17e0ec45 apparently broke the ppc64 TCG targetcompilation in the code path without guest base.
Reverting this line fixes the build.
Signed-off-by: Andreas F?rber <andreas.faerber@web.de>...
TCG: Fix Darwin/ppc calling convention recognition
5da79c86a3744e3a901c7986c109dd06951befd2 broke compilation on Mac OS X v10.5 ppc.Apple's GCC 4.0.1 does not define _CALL_DARWIN. Recognize APPLE again as well.
RESEND: Inter-VM shared memory PCI device
resend for bug fix related to removal of irqfd
Support an inter-vm shared memory device that maps a shared-memory object as aPCI device in the guest. This patch also supports interrupts between guest bycommunicating over a unix domain socket. This patch applies to the qemu-kvm...
Add qemu_ram_alloc_from_ptr function
Provide a function to add an allocated region of memory to the qemu RAM.
This patch is copied from Marcelo's qemu_ram_map() in qemu-kvm and given theclearer name qemu_ram_alloc_from_ptr().
Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca>...
Device specification for shared memory PCI device
Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add function to assign ioeventfd to MMIO.
Support marking a device as non-migratable
A non-migratable device should be removed before migration and re-added after.
Merge remote branch 'kwolf/for-anthony' into staging
microblaze: Fix the target version of stat64 struct
MicroBlaze needs TARGET_STAT64_HAS_BROKEN_ST_INO.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
audio/sdl: return on error
Signed-off-by: malc <av1474@comtv.ru>
mips: Add support for VInt and VEIC irq modes
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
audio/sdl: be more anal about errors
audio: make audio_pt_init block all signals
kvm: remove guest triggerable abort()
This abort() condition is easily triggerable by a guest if it configurespci bar with unaligned address that overlaps main memory.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
kvm: Don't walk memory_size == 0 slots in kvm_client_migration_log
If we've unregistered a memory area, we should avoid callingqemu_get_ram_ptr() on the left over phys_offset cruft in theslot array. Now that we support removing ramblocks, thephys_offset ram_addr_t can go away and cause a lookup fault...
sparc32: use FW_CFG_CMDLINE_SIZE
Add support for getting kernel command line size withFW_CFG_CMDLINE_SIZE.
block: Change bdrv_commit to handle multiple sectors at once
bdrv_commit copies the image to its backing file sector by sector, whichis (surprise!) relatively slow. Let's take a larger buffer and handle moresectors at once if possible.
With a 1G qcow2 file, this brought the time bdrv_commit takes down from...
loadvm: improve tests before bdrv_snapshot_goto()
This patch improves the resilience of the load_vmstate() function, doingfurther and better ordered tests.
In load_vmstate(), if there is any error on bdrv_snapshot_goto(), except if theerror is on VM state device, load_vmstate() will return zero and the VM will be...
block migration: replace tabs by spaces.
Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: Fix bdrv_has_zero_init
Assuming that any image on a block device is not properly zero-initialized isactually wrong: Only raw images have this problem. Any other image formatshouldn't care about it, they initialize everything properly themselves....
block: Change bdrv_eject() not to drop the image
bdrv_eject() gets called when a device model opens or closes the tray.
If the block driver implements method bdrv_eject(), that method getscalled. Drivers host_cdrom implements it, and it opens and closes the...
ide: Avoid canceling IDE DMA
The reason for not actually canceling the I/O is because withvirtualization and lots of VM running, a guest fs may mistake aoverload of the host, as an IDE timeout. So rather than canceling theI/O, it's safer to wait I/O completion and simulate that the I/O has...
fix last cpu timer initialization
The timer #0 is the system timer, so the timer #num_cpu is thetimer of the last CPU, and it must be initialized in slavio_timer_reset.
Don't mark non-existing timers as running.
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>...
Initialize a variable in all cases
Commit d167f9bc06a577d6c85b8ed6991c1efe175aae7d missed this one:/src/qemu/ui/vnc-enc-tight.c:1483: warning: 'ret' may be used uninitialized in this function
Fix uint8_t comparison with negative value
Commit 7bccf57383cca60a778d5c543ac80c9f62d89ef2 missed this one:/src/qemu/ui/vnc-enc-tight.c: In function 'send_sub_rect':/src/qemu/ui/vnc-enc-tight.c:1527: warning: comparison is always true due to limited range of data type...
Fix a warning on OpenSolaris
Add a missing #include statement to avoid a warning:/src/qemu/net/tap-solaris.c: In function 'tap_open':/src/qemu/net/tap-solaris.c:189: warning: implicit declaration of function 'error_report'
Correctly identify multiple cpus in SMP systems
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Remove unused constant
Remove unused constant MIPS_FCR0
jazz led: Fix debug prints
Add a macro to easily enable/disable debug printsAlso fix wrong printf formatters
xilinx-s3adsp: Add support for loading u-boot images.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
xilinx-s3adsp: Fix loading of raw binaries.
Set high to a word aligned address beyond loaded image.
Remove unused eventfd.h
This header is not present on my system and causes a buildfailure, but is also not used in these files, so remove it.
Signed-off-by: Mike McCormack <mikem@ring3k.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
migration: Accept 'cont' only after successful incoming migration
When a 'cont' is issued on a VM that's just waiting for an incomingmigration, the VM reboots and boots into the guest, possibly corruptingits storage since it could be shared with another VM running elsewhere....
mips64el: fulong: PCI_DEVFN() clean up.
Use PCI_DEVFN() where appropriate.The resulted stripped binary remains samewith/without thie patch.
Cc: Huacai Chen <zltjiangshi@gmail.com>Cc: Aurelien Jarno <aurelien@aurel32.net>Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
remove pointless if from vl.c
We already set sockets to nonzero in the code above.So this if statement always evaluates true. Remove it.
Signed-off-by: Joel Schopp <jschopp@austin.ibm.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
remove dead code from hw/loader.c
Removing dead code. Above we already continued whenrom->addr + valuegreaterthan0 < addr so this condition is always false.
fix variable type in qemu-io.c
The variable len can get a negative return value from cvtnum,which we check for, but which is impossible with the currentunsigned variable type. Currently the if(len < 0) check ispointless. This patch fixes that.
Signed-off-by: Joel Schopp <jschopp@austin.ibm.com>...
savevm: Fix memory leak of compat struct
Forgot to check for and free these.
Found-by: Zachary Amsden <zamsden@redhat.com>Signed-off-by: Alex Williamson <alex.williamson@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
virtio-serial: Check if more max_ports specified than we can handle
Currently virtio-serial supports a maximum of 31 ports. Specifying the'max_ports' parameter to be > 31 on the cmd line causes badness.
Ensure we initialise virtio-serial only if max_ports is within the...
Merge branch 'for-anthony' of git://repo.or.cz/qemu/kevin
linux-user: fix build on hosts not using guest base
Commit 68a1c816868b3e35a1da698af412b29e61b1948a broke qemu on hosts notusing guest base. It uses reserved_va unconditionally in mmap.c. Toavoid to many #ifdef #endif blocks, define RESERVED_VA as either...
linux-user: Protect against allocation failure in load_symbols.
Cc: malc <av1474@comtv.ru>Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: malc <av1474@comtv.ru>
cris: Correct settls1 testcase.
cris: Correct ADDO and ADDOQ testcases.
Verified on real HW.
linux-user: Re-use load_elf_image for the main binary.
This requires moving the PT_INTERP extraction and GUEST_BASEhandling into load_elf_image. Key this off a non-null pointerargument to receive the interpreter name.
Signed-off-by: Richard Henderson <rth@twiddle.net>...