Adding xhci support to seabios made it jump over the 128k line.
Changing the bios size breaks migration, so we have to keep a
128k seabios binary for old machine types. New machine types can
use a large 256k bios which should be big enougth for a while.
This patch updates the seabios build process to build seabios twice,
once full featured and once with xen and xhci turned off so the
resulting binary is small enougth to fit into 128k.
Updates seabios to git master snapshot. seabios is in freeze now,
update to final 1.7.4 will follow later this year.
Summary of major changes:
* Support for acpi table loading from qemu.
* Support for the xhci host adapter.
* Support for the pvscsi HBA.
* Various minor bug fixes.
* Lots of cleanups.
Full shortlog since 1.7.3 (note that some of these changes have been
cherry-picked into 1.7.3-stable):
Evgeny Budilovsky (1):
Add pvscsi boot support
Gerd Hoffmann (27):
coreboot: add cbmem console support
Add CONFIG_DEBUG_COREBOOT config option
apm: fix shutdown
ahci: add missing check for allocation failure
bochsvga: fallback to stdvga if dispi interface isn't present
Add generic qemu detection
Drop coreboot qemu detection
Add qemu detection to csm
uas: add (temporary) superspeed stopgap
usb: add usb_update_pipe()
usb: add xhci support
fix buildversion.sh
build: simplify cross builds
build: create output dirs in do-kconfig
build: explicitly set ROM size
Add qemu_cfg_e820 function.
Add support for etc/e820 fw_cfg file
pci: don't reorder entries when moving to 64bit list
pci: don't map usb host adapters above 4G
pci: align 64bit pci regions to 1G
pci: tweak + comment minimum allocations
pci: log pci windows
pci: map 64-bit BARs at location provided by emulator
ahci: zap real mode macros
ahci: remote some parentheses
ahci: alloc structs in high memory
add hw/serialio.c to SRC32SEG
Jonathan A. Kollasch (1):
vgahooks: add SM720 VGA BIOS hooks for WIN Enterprises MB-60470
Kevin O'Connor (80):
Fix USB EHCI detection that was broken in hlist conversion of PCIDevices.
Update README to include info on VARLOW variables.
PIC code cleanups.
Move internal timer code from clock.c to a new file timer.c.
Don't pass khz to pmtimer_setup - it's always PM_TIMER_FREQUENCY.
Add helper functions to convert timer irqs to milliseconds.
Improve accuracy of internal timers.
Rename cpu_khz to TimerKHz.
Shift CPU TSC down to reduce need for 64bit variables.
Rename check_timer() function (and similar) to irqtimer_check().
Rename check_tsc() (and similar) to timer_check() and use u32.
Separate out timer setup code.
Unify pmtimer_read() and pittimer_read() code.
Default unused UMB areas to be read-only.
Add missing mathcp_setup() call to CSM code.
Fix bug in CBFS file walking with compressed files.
Support custom boot menu prompt and custom boot menu key.
Minor cleanups to smm assembler.
Add config option to support memory allocations in 9-segment.
Minor - no need to declare MaxCountCPUs as VARFSEG.
Minor - simplify rom_reserve().
Rename tools/ directory to scripts/ directory.
Update kconfig to latest version.
build: Don't use vpath makefile directive.
Move code centered around specific hardware devices to src/hw/
Move code cenetered around firmware initialization to src/fw/
build: Reorder makefile source list to group like files together.
README: Update readme to note scripts/ directory rename and vgasrc/ directory.
vgabios: Rename stdvga_bpp_factor to stdvga_vram_ratio.
vgabios: Limit the range of the VBE number of "pages" parameter.
readme: Minor - fix typo in readme.
Split x86 specific functions out of util.c/h to new files x86.c/h.
Move keyboard calling code from util.c to boot.c.
Rename util.c to string.c and introduce string.h.
build: Perform compile checking on vgasrc code.
Move stacks.c definitions from util.h to new file stacks.h.
Move romfile definitions from util.h to new file romfile.h.
Move malloc code from pmm.c to new files malloc.c and malloc.h.
Move function definitions for output.c from util.h to new file output.h.
Move definition of struct segoff_s from farptr.h to types.h.
build: Fix import of gcc dependency files.
Move pirtable definitions from hw/pci.h to std/pirtable.h and util.h.
Move optionroms.h to std/optionrom.h and util.h.
Move vbe.h to std/vbe.h.
Move fw/LegacyBios.h to std/LegacyBios.h and remove csm.h.
Move fw/smbios.h to std/smbios.h.
Move fw/mptable.h to std/mptable.h.
Move fw/acpi.h to std/acpi.h.
Move pnpbios definition to new file std/pnpbios.h.
Move pmm definitions to new file std/pmm.h.
Split disk.h into block.h and std/disk.h.
Move standard bda type info from biosvar.h to std/bda.h.
Merge bmp.h, boot.h, jpeg.h, and post.h into util.h.
Sort the sections of util.h.
Move PIT setup from clock.c to hw/timer.c.
Rename hw/cmos.h to hw/rtc.h and copy RTC code from clock.c to hw/rtc.c.
Move dma code to new file hw/dma.c.
Remove ioport.h; disperse its contents to other header files.
Minor - update file comments in src/malloc.c.
Rename fields of 'struct chs_s' and use in floppy lba2chs().
Rearrange stack_hop_back() call in wait_irq, check_irqs, and _farcall16.
Minor - move call16 assembler in romlayout.S.
Make __call16 use C calling convention and support two passed parameters.
Update _farcall16() to pass segment of callregs explicitly.
Support call16() calls after entering 32bit mode from call32().
Run ahci code entirely in 32bit mode.
Build different final files for QEMU, coreboot, and CSM.
Convert op->drive_g from a 16bit pointer to a 32 bit "GLOBALFLAT" pointer.
megasas: Don't attempt to access 'struct pci_device' at runtime.
Minor - eliminate the SET_GLOBAL macro.
Move low-level hardware writing from output.c to new file hw/serialio.c.
vgabios: Load the DAC palette in "packed" modes on Cirrus and BochsVGA.
vgabios: Support custom fonts in vga framebuffer text writing.
vgabios: Add bochsvga "HDTV" resolutions.
vgabios: Avoid possible divide by zero in bochsvga_set_displaystart.
vgabios: Work around lack of support for "calll" in x86emu emulation.
Minor - update file comment on bootsplash.c.
vgabios: Support allocating an extra stack for vgabios calls and default on.
vgabios: Move initialization code to new file vgainit.c.
floppy: Minor - add warnings if timeouts occur.
Michael S. Tsirkin (6):
acpi: sync FADT flags from PIIX4 to Q35
acpi_extract.py: document DEVICE directives
biostables: support looking up RSDP
romfile_loader: utility to patch in-memory ROM files
acpi: load and link tables through romfile loader
acpi: strip compiler info in built-in DSDT if any
Paul Menzel (2):
ACPI DSDT: Make control method `IQCR` serialized
hw/usb-xhci.c: Code refactoring to not override initializers in `speed_from_xhci[16]`
Gerd Hoffmann [Tue, 15 Oct 2013 14:57:45 +0000 (16:57 +0200)]
add firmware to machine options
This patch adds firmware to the machine options. -bios <file> becomes a
shortcut for -machine firmware=<file>. Advantage is that the firmware
can be specified via config file as -machine is parsed using QemuOpts
and it is also possible to use different defaults for different
machine types (via QEMUMachine->default_machine_opts).
Max Reitz [Mon, 25 Nov 2013 19:28:56 +0000 (20:28 +0100)]
qemu-iotests: Fix test 041
Performing multiple drive-mirror blockjobs on the same qemu instance
results in the image file used for the block device being replaced by
the newly mirrored file, which is not what we want.
Fix this by performing one dedicated test per sync mode.
Max Reitz [Mon, 25 Nov 2013 19:28:55 +0000 (20:28 +0100)]
block/drive-mirror: Reuse backing HD for sync=none
For "none" sync mode in "absolute-paths" mode, the current image should
be used as the backing file for the newly created image.
The current behavior is:
a) If the image to be mirrored has a backing file, use that (which is
wrong, since the operations recorded by "none" are applied to the
image itself, not to its backing file).
b) If the image to be mirrored lacks a backing file, the target doesn't
have one either (which is not really wrong, but not really right,
either; "none" records a set of operations executed on the image
file, therefore having no backing file to apply these operations on
seems rather pointless).
For a, this is clearly a bugfix. For b, it is still a bugfix, although
it might break existing API - but since that case crashed qemu just
three weeks ago (before 1452686495922b81d6cf43edf025c1aef15965c0), we
can safely assume there is no such API relying on that case yet.
Alexander Graf [Mon, 25 Nov 2013 21:46:55 +0000 (22:46 +0100)]
PPC: BookE: Make FIT/WDT timers at best millisecond grained
The default granularity for the FIT timer on 440 is on every 0x1000th
transition of TB from 0 to 1. Translated that means 48828 times a second.
Since interrupts are quite expensive for 440 and we don't really care
about the accuracy of the FIT to that significance, let's force FIT and
WDT to at best millisecond granularity.
This basically restores behavior as it was in QEMU 1.6, where timers
could only deal with millisecond granularities at all.
This patch greatly improves performance with the 440 target and restores
roughly the same performance level that QEMU 1.6 had for me.
Alexander Graf [Mon, 25 Nov 2013 21:46:54 +0000 (22:46 +0100)]
PPC: Make BookE FIT/WDT timers more lazy
Today we fire FIT and WDT timer events every time the respective bit
position in TB flips from 0 -> 1.
However, there is no need to do this if the end result would be that
we're changing a TSR bit that is set to 1 to 1 again. No guest visible
change would have occured.
So whenever we see that the TSR bit to our timer is already set, don't
even bother to update the timer that would potentially fire it off.
However, we do need to make sure that we update our timer that notifies
us of the TB flip when the respective TSR bit gets unset. In that case
we do care about the flip and need to notify the guest again. So add
a callback into our timer handlers when TSR bits get unset.
This improves performance for me when the guest is busy processing things.
Anthony Liguori [Mon, 25 Nov 2013 17:49:42 +0000 (09:49 -0800)]
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
pc very last minute fixes for 1.7
This has a fix for a crasher bug with pci bridges,
boot failure fix for s390 on 32 bit hosts,
and fixes build for hosts with old glib.
There's also a fix for --iasl configure flag - it can be used
to work around broken iasl on some systems either
by using a non-standard iasl or by disabling it.
I've also reverted a e1000/rtl mac programming change
that seems slightly wrong and too risky for 1.8.
Signed-off-by: Michael S. Tsirkin <[email protected]>
# gpg: Signature made Mon 25 Nov 2013 03:40:07 AM PST using RSA key ID D28D5469
# gpg: Can't check signature: public key not found
# By Michael S. Tsirkin (5) and Bandan Das (1)
# Via Michael S. Tsirkin
* mst/tags/for_anthony:
configure: make --iasl option actually work
Revert "e1000/rtl8139: update HMP NIC when every bit is written"
acpi-build: fix build on glib < 2.14
acpi-build: fix build on glib < 2.22
pci: unregister vmstate_pcibus on unplug
s390x: fix flat file load on 32 bit systems
Anthony Liguori [Mon, 25 Nov 2013 17:41:24 +0000 (09:41 -0800)]
Merge remote-tracking branch 'bonzini/tags/for-anthony' into staging
Here are a bunch of 1.7-tagged patches that I was afraid
were getting forgotten or that did not have a clear maintainer responsible
for making a pull request.
# gpg: Signature made Thu 21 Nov 2013 08:40:59 AM PST using RSA key ID 9B4D86F2
# gpg: Can't check signature: public key not found
# By Peter Maydell (3) and others
# Via Paolo Bonzini
* bonzini/tags/for-anthony:
qga: Fix compiler warnings (missing format attribute, wrong format strings)
mips jazz: do not raise data bus exception when accessing invalid addresses
target-i386: yield to another VCPU on PAUSE
rng-egd: offset the point when repeatedly read from the buffer
rng-egd: remove redundant free
target-i386: Fix build by providing stub kvm_arch_get_supported_cpuid()
vfio-pci: Fix multifunction=on
atomic.h: Fix build with clang
pc: get rid of builtin pvpanic for "-M pc-1.5"
configure: Explicitly set ARFLAGS so we can build with GNU Make 4.0
sun4m: Add FCode ROM for TCX framebuffer
Tomoki Sekiyama [Fri, 1 Nov 2013 21:47:25 +0000 (17:47 -0400)]
qemu-ga: vss-win32: Install VSS provider COM+ application service
Currently, qemu-ga for Windows fails to execute guset-fsfreeze-freeze when
no user is logging in to Windows, with an error message:
{"error":{"class":"GenericError",
"desc":"failed to add C:\\ to snapshotset: (error: 8004230f)"}}
To enable guest-fsfreeze-freeze/thaw without logging in users, this installs
a service to execute qemu-ga VSS provider COM+ application that has full
access privileges to the local system. The service will automatically be
removed when the COM+ application is deregistered.
This patch replaces ICOMAdminCatalog interface with ICOMAdminCatalog2
interface that contains CreateServiceForApplication() method in addition.
Vlad Yasevich [Fri, 8 Nov 2013 02:13:09 +0000 (21:13 -0500)]
qdev-properties-system.c: Allow vlan or netdev for -device, not both
It is currently possible to specify things like:
-device e1000,netdev=foo,vlan=1
With this usage, whichever argument was specified last (vlan or netdev)
overwrites what was previousely set and results in a non-working
configuration. Even worse, when used with multiqueue devices,
it causes a segmentation fault on exit in qemu_free_net_client.
That patch treates the above command line options as invalid and
generates an error at start-up.
Stefan Weil [Sun, 17 Nov 2013 18:19:52 +0000 (19:19 +0100)]
qga: Fix compiler warnings (missing format attribute, wrong format strings)
gcc 4.8.2 reports this warning when extra warnings are enabled (-Wextra):
CC qga/commands.o
qga/commands.c: In function ‘slog’:
qga/commands.c:28:5: error:
function might be possible candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
g_logv("syslog", G_LOG_LEVEL_INFO, fmt, ap);
^
gcc 4.8.2 reports this warning when slog is declared with the
gnu_printf format attribute:
qga/commands-posix.c: In function ‘qmp_guest_file_open’:
qga/commands-posix.c:404:5: warning:
format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int64_t’ [-Wformat=]
slog("guest-file-open, handle: %d", handle);
^
On 32 bit hosts there are three more warnings which are also fixed here.
mips jazz: do not raise data bus exception when accessing invalid addresses
MIPS Jazz chipset doesn't seem to raise data bus exceptions on invalid accesses.
However, there is no easy way to prevent them. Creating a big memory region
for the whole address space doesn't prevent memory core to directly call
unassigned_mem_read/write which in turn call cpu->do_unassigned_access,
which (for MIPS CPU) raise an data bus exception.
Paolo Bonzini [Wed, 20 Nov 2013 11:54:02 +0000 (12:54 +0100)]
target-i386: yield to another VCPU on PAUSE
After commit b1bbfe7 (aio / timers: On timer modification, qemu_notify
or aio_notify, 2013-08-21) FreeBSD guests report a huge slowdown.
The problem shows up as soon as FreeBSD turns out its periodic (~1 ms)
tick, but the timers are only the trigger for a pre-existing problem.
Before the offending patch, setting a timer did a timer_settime system call.
After, setting the timer exits the event loop (which uses poll) and
reenters it with a new deadline. This does not cause any slowdown; the
difference is between one system call (timer_settime and a signal
delivery (SIGALRM) before the patch, and two system calls afterwards
(write to a pipe or eventfd + calling poll again when re-entering the
event loop).
Unfortunately, the exit/enter causes the main loop to grab the iothread
lock, which in turns kicks the VCPU thread out of execution. This
causes TCG to execute the next VCPU in its round-robin scheduling of
VCPUS. When the second VCPU is mostly unused, FreeBSD runs a "pause"
instruction in its idle loop which only burns cycles without any
progress. As soon as the timer tick expires, the first VCPU runs
the interrupt handler but very soon it sets it again---and QEMU
then goes back doing nothing in the second VCPU.
The fix is to make the pause instruction do "cpu_loop_exit".
Peter Maydell [Wed, 13 Nov 2013 23:09:07 +0000 (23:09 +0000)]
target-i386: Fix build by providing stub kvm_arch_get_supported_cpuid()
Fix build failures with clang when KVM is not enabled by
providing a stub version of kvm_arch_get_supported_cpuid().
We retain the compile time check that this function isn't
called when CONFIG_KVM is not set by guarding the stub with
ifndef __OPTIMIZE__ (we assume that an optimizing build will
do sufficient constant folding and dead code elimination to
remove the calls before linking).
Alex Williamson [Tue, 12 Nov 2013 18:53:24 +0000 (11:53 -0700)]
vfio-pci: Fix multifunction=on
When an assigned device is initialized it copies the device config
space into the emulated config space. Unfortunately multifunction is
setup prior to the device initfn and gets clobbered. We need to
restore it just like pci-assign does.
Peter Maydell [Tue, 22 Oct 2013 09:58:41 +0000 (10:58 +0100)]
atomic.h: Fix build with clang
clang defines __ATOMIC_SEQ_CST but its implementation of the
__atomic_exchange() builtin differs from that of gcc. Move the
__clang__ branch of the ifdef ladder to the top and fix its
implementation (there is no such builtin as __sync_exchange),
so we can compile with clang again.
Paolo Bonzini [Mon, 4 Nov 2013 13:30:48 +0000 (14:30 +0100)]
pc: get rid of builtin pvpanic for "-M pc-1.5"
This causes two slight backwards-incompatibilities between "-M pc-1.5"
and 1.5's "-M pc":
(1) a fw_cfg file is removed with this patch. This is only a problem
if migration stops the virtual machine exactly during fw_cfg enumeration.
(2) after migration, a VM created without an explicit "-device pvpanic"
will stop reporting panics to management.
The first problem only occurs if migration is done at a very, very
early point (and I'm not sure it can happen in practice for reasonable-size
VMs, since it will likely take more time to send the RAM to destination,
than it will take for BIOS to scan fw_cfg).
The second problem only occurs if the guest panics _and_ has a guest
driver _and_ management knows to look at the crash event, so it is
mostly theoretical at this point in time.
Thus keep the code simple, and pretend it was never broken.
Peter Maydell [Mon, 21 Oct 2013 20:03:06 +0000 (21:03 +0100)]
configure: Explicitly set ARFLAGS so we can build with GNU Make 4.0
Our rules.mak adds '-rR' to MAKEFLAGS to indicate that we will be
explicitly specifying everything and not relying on any default
variables or rules. However we were accidentally relying on the
default ARFLAGS ("rv"). This went unnoticed because of a bug in
GNU Make 3.82 and earlier which meant that adding -rR to MAKEFLAGS
only affected submakes, not the currently running instance.
Explicitly set ARFLAGS in config-host.mak, in the same way we
handle CFLAGS and LDFLAGS; this will allow us to work with
Make 4.0.
Thanks to Paul Smith for analyzing this bug for us.
Upstream OpenBIOS now implements SBus probing in order to determine the
contents of a physical bus slot, which is required to allow OpenBIOS to
identify the framebuffer without help from the fw_cfg interface.
SBus probing works by detecting the presence of an FCode program
(effectively tokenised Forth) at the base address of each slot, and if
present executes it so that it creates its own device node in the
OpenBIOS device tree.
The FCode ROM is generated as part of the OpenBIOS build and should
generally be updated at the same time.
Alex Williamson [Tue, 12 Nov 2013 18:53:24 +0000 (11:53 -0700)]
vfio-pci: Fix multifunction=on
When an assigned device is initialized it copies the device config
space into the emulated config space. Unfortunately multifunction is
setup prior to the device initfn and gets clobbered. We need to
restore it just like pci-assign does.
Peter Maydell [Tue, 22 Oct 2013 09:58:41 +0000 (10:58 +0100)]
atomic.h: Fix build with clang
clang defines __ATOMIC_SEQ_CST but its implementation of the
__atomic_exchange() builtin differs from that of gcc. Move the
__clang__ branch of the ifdef ladder to the top and fix its
implementation (there is no such builtin as __sync_exchange),
so we can compile with clang again.
Paolo Bonzini [Tue, 19 Nov 2013 16:49:46 +0000 (17:49 +0100)]
target-i386: do not override nr_cores for -cpu host
Commit 787aaf5 (target-i386: forward CPUID cache leaves when -cpu host is
used, 2013-09-02) brings bits 31..26 of CPUID leaf 04h out of sync with
the APIC IDs that QEMU reserves for each package. This number must come
from "-smp" options rather than from the host CPUID.
It also turns out that this unsyncing makes Windows Server 2012R2 fail
to boot.
mips jazz: do not raise data bus exception when accessing invalid addresses
MIPS Jazz chipset doesn't seem to raise data bus exceptions on invalid accesses.
However, there is no easy way to prevent them. Creating a big memory region
for the whole address space doesn't prevent memory core to directly call
unassigned_mem_read/write which in turn call cpu->do_unassigned_access,
which (for MIPS CPU) raise an data bus exception.
Paolo Bonzini [Wed, 20 Nov 2013 11:54:02 +0000 (12:54 +0100)]
target-i386: yield to another VCPU on PAUSE
After commit b1bbfe7 (aio / timers: On timer modification, qemu_notify
or aio_notify, 2013-08-21) FreeBSD guests report a huge slowdown.
The problem shows up as soon as FreeBSD turns out its periodic (~1 ms)
tick, but the timers are only the trigger for a pre-existing problem.
Before the offending patch, setting a timer did a timer_settime system call.
After, setting the timer exits the event loop (which uses poll) and
reenters it with a new deadline. This does not cause any slowdown; the
difference is between one system call (timer_settime and a signal
delivery (SIGALRM) before the patch, and two system calls afterwards
(write to a pipe or eventfd + calling poll again when re-entering the
event loop).
Unfortunately, the exit/enter causes the main loop to grab the iothread
lock, which in turns kicks the VCPU thread out of execution. This
causes TCG to execute the next VCPU in its round-robin scheduling of
VCPUS. When the second VCPU is mostly unused, FreeBSD runs a "pause"
instruction in its idle loop which only burns cycles without any
progress. As soon as the timer tick expires, the first VCPU runs
the interrupt handler but very soon it sets it again---and QEMU
then goes back doing nothing in the second VCPU.
The fix is to make the pause instruction do "cpu_loop_exit".
pc-bios/s390-zipl.rom is a flat image so it's expected that
loading it as elf will fail.
It should fall back on loading a flat file, but doesn't
on 32 bit systems, instead it fails printing:
qemu: hardware error: could not load bootloader 's390-zipl.rom'
The result is boot failure.
The reason is that a 64 bit unsigned interger which is set
to -1 on error is compared to -1UL which on a 32 bit system
with gcc is a 32 bit unsigned interger.
Since both are unsigned, no sign extension takes place and
comparison evaluates to non-equal.
There's no reason to do clever tricks: all functions
we call actually return int so just use int.
And then we can use == -1 everywhere, consistently.
Anthony Liguori [Thu, 21 Nov 2013 15:09:52 +0000 (07:09 -0800)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
# By Jan Kiszka (1) and others
# Via Gleb Natapov
* qemu-kvm/uq/master:
kvm: Fix uninitialized cpuid_data
pci-assign: Remove dead code for direct I/O region access from userspace
KVM: x86: fix typo in KVM_GET_XCRS
Anthony Liguori [Thu, 21 Nov 2013 15:08:47 +0000 (07:08 -0800)]
Merge remote-tracking branch 'jliu/or32' into staging
# By Sebastian Macke
# Via Jia Liu
* jliu/or32:
target-openrisc: Correct carry flag check of l.addc and l.addic test cases
target-openrisc: Correct memory bounds checking for the tlb buffers
openrisc-timer: Reduce overhead, Separate clock update functions
target-openrisc: Correct wrong epcr register in interrupt handler
target-openrisc: Remove executable flag for every page
target-openrisc: Remove unnecessary code generated by jump instructions
target-openrisc: Speed up move instruction
There are valid arguments backed by the spec to indicate why the version
of e1000 prior to cd5be582 was more correct: the high byte actually
includes a valid bit, this is why all guests write it last.
For rtl8139 there's actually a separate undocumented valid bit, but we
don't implement it yet.
To summarize all the drivers we know about behave in one way
that allows us to make an assumption about write order and avoid
spurious, incorrect mac address updates to the monitor.
Let's stick to the tried heuristic for 1.7 and
possibly revisit for 1.8.
g_array_get_element_size was only added in glib 2.14,
there's no way to find element size in with an older glib.
Fortunately we only use a single table (linker) where element size > 1.
Switch element size to 1 everywhere, then we can just look at len field
to get table size in bytes.
Add an assert to make sure we catch any violations of this rule.
pc-bios/s390-zipl.rom is a flat image so it's expected that
loading it as elf will fail.
It should fall back on loading a flat file, but doesn't
on 32 bit systems, instead it fails printing:
qemu: hardware error: could not load bootloader 's390-zipl.rom'
The result is boot failure.
The reason is that a 64 bit unsigned interger which is set
to -1 on error is compared to -1UL which on a 32 bit system
with gcc is a 32 bit unsigned interger.
Since both are unsigned, no sign extension takes place and
comparison evaluates to non-equal.
There's no reason to do clever tricks: all functions
we call actually return int so just use int.
And then we can use == -1 everywhere, consistently.
Sebastian Macke [Tue, 22 Oct 2013 00:12:40 +0000 (02:12 +0200)]
target-openrisc: Correct wrong epcr register in interrupt handler
This patch corrects several misbehaviors during an interrupt process.
Most of the time the pc is already correct and therefore no special treatment
of the exceptions is necessary.
Tested by checking crashing programs which otherwise work in or1ksim.
Sebastian Macke [Tue, 22 Oct 2013 00:12:38 +0000 (02:12 +0200)]
target-openrisc: Remove unnecessary code generated by jump instructions
The sr_f variable is only used for the l.bf and l.bnf instructions.
For clarity the code is also rewritten using a switch statement instead
of if chaining.
Sebastian Macke [Tue, 22 Oct 2013 00:12:37 +0000 (02:12 +0200)]
target-openrisc: Speed up move instruction
The OpenRISC architecture does not have its own move register
instruction. Instead it uses either "l.addi rd, r0, x" or
"l.ori rd, rs, 0" or "l.or rd, rx, r0"
The l.ori instruction is automatically optimized but not the l.addi instruction.
This patch optimizes for this special case.
Anthony Liguori [Tue, 19 Nov 2013 21:00:02 +0000 (13:00 -0800)]
Merge remote-tracking branch 'rth/tcg-ia64-17' into staging
# By Richard Henderson
# Via Richard Henderson
* rth/tcg-ia64-17:
tcg-ia64: Introduce tcg_opc_bswap64_i
tcg-ia64: Introduce tcg_opc_ext_i
tcg-ia64: Introduce tcg_opc_movi_a
tcg-ia64: Introduce tcg_opc_mov_a
tcg-ia64: Use A3 form of logical operations
tcg-ia64: Use SUB_A3 and ADDS_A4 for subtraction
tcg-ia64: Use ADDS for small addition
tcg-ia64: Avoid unnecessary stop bit in tcg_out_alu
tcg-ia64: Move AREG0 to R32
tcg-ia64: Simplify brcond
tcg-ia64: Handle constant calls
tcg-ia64: Use shortcuts for nop insns
tcg-ia64: Use TCGMemOp within qemu_ldst routines
Anthony Liguori [Tue, 19 Nov 2013 20:59:48 +0000 (12:59 -0800)]
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
pc last minute fixes for 1.8
This has a patch that drops an unused FW CFG entry.
I think it's best to include it before 1.7 to avoid
the need to maintain it in compat machine types.
There's also a doc bugfix by Amos: I'm guessing
doc fixes are still fair game even at this late stage.
Signed-off-by: Michael S. Tsirkin <[email protected]>
# gpg: Signature made Mon 18 Nov 2013 03:48:14 AM PST using RSA key ID D28D5469
# gpg: Can't check signature: public key not found
# By Amos Kong (1) and Igor Mammedov (1)
# Via Michael S. Tsirkin
* mst/tags/for_anthony:
doc: fix hardcoded helper path
pc: disable pci-info
Anthony Liguori [Tue, 19 Nov 2013 20:59:26 +0000 (12:59 -0800)]
Merge remote-tracking branch 'mjt/trivial-patches' into staging
# By Jan Krupa (4) and others
# Via Michael Tokarev
* mjt/trivial-patches:
hw/i386/Makefile.obj: use $(PYTHON) to run .py scripts consistently
configure: Use -B switch only for Python versions which support it
qga: Fix shutdown command of guest agent to work with SysV
console: Remove unused debug code
qga: Fix compilation for old versions of MinGW
.travis.yml: basic compile and check recipes
pci-assign: Fix error_report of pci-stub message
qapi: Fix comment for create-type to match code.
vl: fix build when configured with no graphic support
usb: drop unused USBNetState.inpkt field
qemu-char: add missing characters used in keymaps
qemu-char: add support for U-prefixed symbols
qemu-char: add Czech keymap file
qemu-char: add Czech characters to VNC keysyms
Anthony Liguori [Tue, 19 Nov 2013 20:59:09 +0000 (12:59 -0800)]
Merge remote-tracking branch 'kwolf/tags/for-anthony' into staging
Block fixes for 1.7.0
# gpg: Signature made Fri 15 Nov 2013 09:51:25 AM PST using RSA key ID C88F2FD6
# gpg: Can't check signature: public key not found
# By Max Reitz (3) and others
# Via Kevin Wolf
* kwolf/tags/for-anthony:
block: Fail if requested driver is not available
MAINTAINERS: add block driver sub-maintainers
qemu-img: Fix overwriting 'ret' before using
qemu-iotests: Test qcow2 count_contiguous_clusters()
qcow2: fix possible corruption when reading multiple clusters
qmp: access the local QemuOptsLists for drive option
MAINTAINERS: add block tree repo URLs
qemu-iotests: Extend 041 for unbacked mirroring
block/drive-mirror: Check for NULL backing_hd
qapi-schema: Update description for NewImageMode
block: Print its file name if backing file opening failed
Anthony Liguori [Tue, 19 Nov 2013 20:58:32 +0000 (12:58 -0800)]
Merge remote-tracking branch 'stefanha/net' into staging
# By Amos Kong (1) and Sebastian Huber (1)
# Via Stefan Hajnoczi
* stefanha/net:
virtio-net: fix the memory leak in rxfilter_notify()
smc91c111: Fix receive starvation
Anthony Liguori [Tue, 19 Nov 2013 20:57:16 +0000 (12:57 -0800)]
Merge remote-tracking branch 'agraf/tags/signed-ppc-for-upstream-1.7' into staging
Patch queue for ppc - 2013-11-08
These are two patches that will hopefully make it into 1.7. The SLOF update
fixes -append kernel command line argument passing into the guest kernel. The
other patch makes VIO devices appear when using -device '?'.
# gpg: Signature made Thu 07 Nov 2013 07:34:54 PM PST using RSA key ID 03FEDC60
# gpg: Can't check signature: public key not found
# By Alexey Kardashevskiy
# Via Alexander Graf
* agraf/tags/signed-ppc-for-upstream-1.7:
pseries: Update SLOF firmware image
spapr: add vio-bus devices to categories
Peter Lieven [Thu, 24 Oct 2013 07:21:29 +0000 (09:21 +0200)]
migration: drop MADVISE_DONT_NEED for incoming zero pages
The madvise for zeroed out pages was introduced when every transferred
zero page was memset to zero and thus allocated. Since commit 211ea740 we check for zeroness of a target page before we memset
it to zero. Additionally we memmap target memory so it is essentially
zero initialized (except for e.g. option roms and bios which are loaded
into target memory although they shouldn't).
It was reported recently that this madvise causes a performance degradation
in some situations. As the madvise should only be called rarely and if it's called
it is likely on a busy page (it was non-zero and changed to zero during migration)
drop it completely.
As a result, "make check" now tries to use graphics (GTK or SDL). Since
graphics are not used by the test and inappropriate for headless "make
check" runs, add the missing -display none.
This fixes "make check" in the QEMU buildbot.
-- Stefan]
Amos Kong [Tue, 22 Oct 2013 20:49:28 +0000 (04:49 +0800)]
doc: fix hardcoded helper path
The install directory of qemu-bridge-helper is configurable,
but we use a fixed path in the documentation.
DEFAULT_BRIDGE_HELPER macro isn't available in texi mode,
we should always use "/path/to/" prefix for dynamic paths
(e.g.: /path/to/image, /path/to/linux, etc).
tcg-ia64: Avoid unnecessary stop bit in tcg_out_alu
When performing an operation with two input registers, we'd leave
the stop bit (and thus an extra cycle) that's only needed when one
or the other input is a constant.
Since the move away from the global areg0, we're no longer globally
reserving areg0. Which means our use of R7 clobbers a call-saved
register. Shift areg0 into the windowed registers. Indeed, choose
the incoming parameter register that it comes to us by.
This requires moving the register holding the return address elsewhere.
Choose R33 for tidiness.
There was a misconception that a stop bit is required between a compare
and the branch that uses the predicate set by the compare. This lead to
the usage of an extra bundle in which to perform the compare. The extra
bundle left room for constants to be loaded for use with the compare insn.
If we pack the compare and the branch together in the same bundle, then
there's no longer any room for non-zero constants. At which point we
can eliminate half the function by not handling them.
Using only indirect calls results in 3 bundles (one to load the
descriptor address), and 4 stop bits. By looking through the
descriptor to the constants, we can perform the call with 2
bundles and only 1 stop bit.
Michael Tokarev [Sat, 16 Nov 2013 10:09:14 +0000 (14:09 +0400)]
hw/i386/Makefile.obj: use $(PYTHON) to run .py scripts consistently
$(PYTHON) is a Make variable which is set by configure.
In all other places over the tree, .py files are run from
Makefiles using this variable, except of a single leftover
in hw/i386/Makefile.obj (and a nearby place in there uses
$(PYTHON) correctly). Fix this leftover too.
whitearchey [Wed, 6 Nov 2013 01:54:04 +0000 (10:54 +0900)]
qga: Fix shutdown command of guest agent to work with SysV
For now guest agent uses following command to shutdown system:
shutdown -P +0 "blabla"
but this syntax works only with shutdown command from systemd or upstart,
because SysV shutdown requires -h switch.
Following patch changes the command so it works with systemd, upstart and SysV
With upstart/systemd qga use one of thee commands, depending on 'mode' parameter:
shutdown -P +0 "..."
shutdown -H +0 "..."
shutdown -r +0 "..."
SysV equivalents for these are:
shutdown -h -P +0 "..."
shutdown -h -H +0 "..."
shutdown -h -r +0 "..."
and these retain their meaning with upstart/systemd.
According to FreeBSD manpages, shutdown does not accept -P and -H options. Commands should be:
shutdown -p +0 "..."
shutdown -h +0 "..."
shutdown -r +0 "..."
shutdown in Solaris does not accept any of -hHpPr and does not accept time in "+0" format
Stefan Hajnoczi [Wed, 13 Nov 2013 09:33:10 +0000 (10:33 +0100)]
MAINTAINERS: add block driver sub-maintainers
There are a number of contributors who maintain block drivers (image
formats and protocols). They should be listed in the MAINTAINERS file
so that get_maintainer.pl lists them.
Note that commits are still merged through Kevin or Stefan's block tree
but the block driver sub-maintainers are usually the ones to review
patches.
Fam Zheng [Wed, 13 Nov 2013 12:26:49 +0000 (20:26 +0800)]
qemu-img: Fix overwriting 'ret' before using
This patch moves ret assignment after reporting original error.
We were lucky to pass qemu-iotests 048 (qemu-img compare case) but when
I tried to run with TEST_DIR=/tmp (tmpfs), it fails with a "wrong"
mismatch offset. This fixes two bugs.
In the first if branch, setting ret to 1 before using it makes dead code
in the next line: pnum is never added to mismatch offset even if ret was
0.
In the other if branch, currently the output error is always -4:
strerror(-4) -> Unknown error -4
Sebastian Huber [Thu, 14 Nov 2013 13:53:46 +0000 (14:53 +0100)]
smc91c111: Fix receive starvation
In case the smc91c111 interface signals that it cannot receive more
packets the packets are queued and further reception will be disabled.
In case the interface is again ready to receive packets notify the upper
layer.
Peter Lieven [Tue, 12 Nov 2013 12:48:07 +0000 (13:48 +0100)]
qcow2: fix possible corruption when reading multiple clusters
if multiple sectors spanning multiple clusters are read the
function count_contiguous_clusters should ensure that the
cluster type should not change between the clusters.
Especially the for-loop should break when we have one
or more normal clusters followed by a compressed cluster.
Unfortunately the wrong macro was used in the mask to
compare the flags.
This was discovered while debugging a data corruption
issue when converting a compressed qcow2 image to raw.
qemu-img reads 2MB chunks which span multiple clusters.
Amos Kong [Sat, 9 Nov 2013 04:15:47 +0000 (12:15 +0800)]
qmp: access the local QemuOptsLists for drive option
Currently we have three QemuOptsList (qemu_common_drive_opts,
qemu_legacy_drive_opts, and qemu_drive_opts), only qemu_drive_opts
is added to vm_config_groups[].
This patch changes query-command-line-options to access three local
QemuOptsLists for drive option, and merge the description items
together.