This adds a few more vpath suffixes and points the remaining two paths
explicitly to $(SRC_PATH) in order to eliminate the VPATH assignment
from config-host.mak.
Signed-off-by: Paolo Bonzini <[email protected]>
Cc: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Move multiboot loading code into separate files as suggested by Alex Graf.
Signed-off-by: Adam Lackorzynski <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The gdt address calculation in linuxboot.bin is broken in two ways: first
it loads %cs into %eax, but that instruction leaves the high bits of %eax
undefined and we did not clear them. Secondly, we completely ignore the
incorrect %eax, and use the undefined %ebx instead.
With these issues fixed, linuxboot works again.
Signed-off-by: Avi Kivity <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Some commands return a QList of QDicts, which is valid,
but will trig the assert().
Just drop it.
Reported-by: Nathan Baum <[email protected]>
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The disk image I created from my old laptop disk with VBoxManage
internalcommand converthd obviously was not a multiple of 1MB as when
created from scratch. This fixes QEMU refusing it. We still require the
size to be a multiple of sector size though.
It then boots correctly.
Allow opening VDI images with size not multiple of 1MB (as when converted from a raw disk).
Signed-off-by: François Revol <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
When vhost is bound to a backend device, we need to stop polling it when
vhost is started, and restart polling when vhost is stopped.
Add an API for that for use by vhost, and implement in tap backend.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add generic support for debugging consoles (simple I/O ports which
when written to cause debugging output to be written to a target.)
The current implementation matches Bochs' port 0xe9, allowing the same
debugging code to be used for both Bochs and Qemu.
There is no vm state associated with the debugging port, simply
because it has none -- the entire interface is a single, stateless,
write-only port.
Most of the code was cribbed from the serial port driver.
v2: removed non-ISA variants (they can be introduced when/if someone
wants them, using code from the serial port); added configurable
readback (Bochs returns 0xe9 on a read from this register, mimic that
by default) This retains the apparently somewhat controversial user
friendly option, however.
v3: reimplemented the user friendly option as a synthetic option
("-debugcon foo" basically ends up being a parser-level shorthand for
"-chardev stdio,id=debugcon -device isa-debugcon,chardev=debugcon") --
this dramatically reduced the complexity while keeping the same level
of user friendliness.
v4: spaces, not tabs.
v5: update to match current top of tree. Calling qemu_chr_open()
already during parsing no longer works; defer until we are parsing the
other console-like devices.
Signed-off-by: H. Peter Anvin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This makes rebuilds after source updates easier
for most users (who don't edit config-devices.mak).
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The vpath directive has two advantages over the VPATH variable:
1) it allows to skip searching of .o files; 2) the default semantics
are to append to the vpath, so there is no confusion between "VPATH=xyz"
and "VPATH+=xyz".
Since "vpath %.c %.h PATH" is not valid, I'm introducing a wrapper
macro to append one or more directories to the vpath.
Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Juan has contributed a cool Makefile infrastructure that enables us to drop
static libraries completely:
Move shared obj-y definitions to Makefile.objs, prefixed {common-,hw-,user-},
and link those object files directly into the executables.
Replace HWLIB by HWDIR, specifying only the directory.
Drop --whole-archive and ARLIBS in Makefiles and configure.
Drop GENERATED_HEADERS dependency in rules.mak, since this rebuilds all
common objects after generating a target-specific header; add dependency
rules to Makefile and Makefile.target instead.
v2:
- Don't try to include /config.mak for user emulators
- Changes to user object paths ("Quickfix for libuser.a drop") were obsoleted
by "user_only: compile everything with -fpie" (Kirill A. Shutemov)
v3:
- Fix dependency modelling for tools
- Remove comment on GENERATED_HEADERS obsoleted by this patch
Signed-off-by: Andreas Färber <[email protected]>
Cc: Blue Swirl <[email protected]>
Cc: Palle Lyckegaard <[email protected]>
Cc: Ben Taylor <[email protected]>
Cc: Juan Quintela <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
02c2b87 introduced a regression whereas the foreground color in a hextile
update was not being properly invalidated leading to artifacts.
It's still necessary to explicitly invalidate the foreground color with a
SubrectColoured tile even though we no longer send a foreground color as
part of the tile.
Reported-by: Mark Cave-Ayland <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Disable the nice resize animation, to avoid drawing glitches
following a guest's screen size change.
Based on patch by Juha Riihimäki.
Signed-off-by: Andreas Färber <[email protected]>
Cc: Juha Riihimäki <[email protected]>
Cc: Alexander Graf <[email protected]>
Cc: Mike Kronenberg <[email protected]>
Signed-off-by: malc <[email protected]>
The application is not very useful once the guest window is closed.
QEMU is not a document-based application; terminating it automatically
saves the user another action and resembles SDL behavior.
v2:
- Use delegate method, suggested by Juha Riihimäki.
Signed-off-by: Andreas Färber <[email protected]>
Cc: Juha Riihimäki <[email protected]>
Signed-off-by: malc <[email protected]>
When QEMU was launched in no-graphic, Curses or VNC mode,
don't run it as a Cocoa application.
Based on patch by Alexander Graf.
v1:
- Avoid type mismatch warning for argv
- Drop noCocoa variable
- Coding Style changes
Signed-off-by: Andreas Färber <[email protected]>
Cc: Alexander Graf <[email protected]>
Cc: Mike Kronenberg <[email protected]>
Signed-off-by: malc <[email protected]>
NSView's enterFullScreenMode:withOptions: and
exitFullScreenModeWithOptions: are available on v10.5
and later only. Undefined methods raise warnings and
undefined constants result in errors.
Reported by Ryan Schmidt.
While at it, avoid a warning on v10.3.9,
where MAC_OS_X_VERSION_10_4 is not defined.
Spotted by John Arbuckle.
Fix associated comments.
Signed-off-by: Andreas Färber <[email protected]>
Cc: John Arbuckle <[email protected]>
Cc: Ryan Schmidt <[email protected]>
Cc: Mike Kronenberg <[email protected]>
Signed-off-by: malc <[email protected]>
Add const for "qemu" character literal, to avoid:
warning: initialization discards qualifiers from pointer target type
An earlier patch by John proposed to use char[5]. Since we do not modify
the text and later copy it into malloc'ed memory, marking it as const
seems sufficient.
Signed-off-by: Andreas Färber <[email protected]>
Cc: John Arbuckle <[email protected]>
Signed-off-by: malc <[email protected]>
Make cocoa_keycode_to_qemu static, to avoid:
warning: no previous prototype for ‘cocoa_keycode_to_qemu’
Signed-off-by: Andreas Färber <[email protected]>
Cc: John Arbuckle <[email protected]>
Signed-off-by: malc <[email protected]>
- this fixes stepping with gdb, where do_unassigned_access
may be called from gdb handler, outside of generated code
Signed-off-by: Igor V. Kovalenko <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
- extended range of MMU related traps which use MMU global registers,
as listed in Ultrasparc-IIi document
- no visible changes, since emulation do not cause added traps
Signed-off-by: Igor V. Kovalenko <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Similarly to what is done in 32938e127f
for "jmp im", trunc the immediate to 32-bit when not running in 64-bit
mode.
Reported-by: Kevin O'Connor <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
According to C99, realloc(non_null, 0) != free(non_null), that's why
it is forbidden in QEMU.
When there are no symbols, nsyms equals to 0. Free the syms structure
and set it to NULL instead of reallocating it with a size of 0.
This fixes -kernel with stripped kernels.
Signed-off-by: Aurelien Jarno <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
In qemu-kvm this place looks even more "interesting":
-runas user Change to user id user just before starting the VM.
-readconfig <file>
-writeconfig <file>
read/write config file-no-kvm disable KVM hardware virtualization
-no-kvm-irqchip disable KVM kernel mode PIC/IOAPIC/LAPIC
-no-kvm-pit disable KVM kernel mode PIT
Signed-off-by: Michael Tokarev <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Returns an unsigned version of a signed condition;
returns the original condition otherwise.
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
CC block.o
cc1: warnings being treated as errors
block.c: In function 'bdrv_open2':
block.c:400: error: ignoring return value of 'realpath', declared with attribute warn_unused_result
Signed-off-by: Kirill A. Shutemov <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
CC block/bochs.o
cc1: warnings being treated as errors
block/bochs.c: In function 'seek_to_sector':
block/bochs.c:202: error: ignoring return value of 'read', declared with attribute warn_unused_result
make: *** [block/bochs.o] Error 1
Signed-off-by: Kirill A. Shutemov <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
CC savevm.o
cc1: warnings being treated as errors
savevm.c: In function 'file_put_buffer':
savevm.c:342: error: ignoring return value of 'fwrite', declared with attribute warn_unused_result
make: *** [savevm.o] Error 1
Signed-off-by: Kirill A. Shutemov <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
CC slirp/misc.o
cc1: warnings being treated as errors
slirp/misc.c: In function 'fork_exec':
slirp/misc.c:209: error: ignoring return value of 'write', declared with attribute warn_unused_result
make: *** [slirp/misc.o] Error 1
Signed-off-by: Kirill A. Shutemov <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
CC i386-softmmu/pc.o
cc1: warnings being treated as errors
/usr/src/RPM/BUILD/qemu-0.11.92/hw/pc.c: In function 'load_multiboot':
/usr/src/RPM/BUILD/qemu-0.11.92/hw/pc.c:614: error: ignoring return value of 'fread', declared with attribute warn_unused_result
/usr/src/RPM/BUILD/qemu-0.11.92/hw/pc.c: In function 'load_linux':
/usr/src/RPM/BUILD/qemu-0.11.92/hw/pc.c:888: error: ignoring return value of 'fread', declared with attribute warn_unused_result
/usr/src/RPM/BUILD/qemu-0.11.92/hw/pc.c:889: error: ignoring return value of 'fread', declared with attribute warn_unused_result
make[1]: *** [pc.o] Error 1
Signed-off-by: Kirill A. Shutemov <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
CC libuser/path.o
cc1: warnings being treated as errors
/usr/src/RPM/BUILD/qemu-0.11.92/path.c: In function 'new_entry':
/usr/src/RPM/BUILD/qemu-0.11.92/path.c:49: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
make[1]: *** [path.o] Error 1
Signed-off-by: Kirill A. Shutemov <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Store the register values in native endianness, by dropping all the
endianness conversion functions, and converting the endianness in
dbdma_readl/dbdma_writel instead.
Also guard the endianness conversion with TARGET_WORDS_BIGENDIAN to
simulate the backward connection of the bus.
Signed-off-by: Aurelien Jarno <[email protected]>
Similarly to what has been done in e405a2ba91,
ignore rom intended to be loaded by the bios in find_rom() and rom_copy().
Signed-off-by: Aurelien Jarno <[email protected]>
The first such option rom will load at address 0, which isn't very nice,
and the second will report a conflict and abort, which is horrible.
Signed-off-by: Avi Kivity <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Link to data sheet at intel.com so people can find it.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
basename() needs #include <libgen.h>.
No prototype for daemon() is available on Solaris, but link
succeeds.
Signed-off-by: Blue Swirl <[email protected]>
use range helper function in i440fx_write_config().
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Define symbolic value in i440fx configuration space
for 0x59, 0x5f and 0x7f and use them.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
use range helper function in msix_write_config().
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
use range helper function in pm_write_config().
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
They call only pci_default_{read, write}_config().
So they aren't necessary.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
include pci_regs.h and remove duplicated defines.
And remove unused PCI_REVISION and PCI_SUBDEVICE_ID.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Import Linux pci_regs.h. Later PCI register definitions in pci.h
will be eliminated.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
To match Linux PCI register definition,
rename PCI_SUBVENDOR_ID to PCI_SUBSYSTEM_VENDOR_ID.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
PCIBus::config_reg isn't used anymore, so remove it.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
PCI_STATUS_DEVSEL is unused, and it also
has a different name in pci_regs.h
Remove.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Juan Quintela <[email protected]>
Acked-by: Glauber Costa <[email protected]>
No functional changes. I verified that the generated binary
does not change.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Juan Quintela <[email protected]>
Acked-by: Glauber Costa <[email protected]>
No functional changes. I verified that the generated binary
does not change.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Juan Quintela <[email protected]>
Acked-by: Glauber Costa <[email protected]>
No functional changes. I verified that the generated binary
does not change.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Juan Quintela <[email protected]>
Acked-by: Glauber Costa <[email protected]>
No functional changes. I verified that the generated binary
does not change.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Juan Quintela <[email protected]>
Acked-by: Glauber Costa <[email protected]>
No functional changes. I verified that the generated binary
does not change.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Juan Quintela <[email protected]>
Acked-by: Glauber Costa <[email protected]>
No functional changes. I verified that the generated binary
does not change.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Juan Quintela <[email protected]>
Acked-by: Glauber Costa <[email protected]>
No functional changes. I verified that the generated binary
does not change.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Juan Quintela <[email protected]>
Acked-by: Glauber Costa <[email protected]>
No functional changes. I verified that the generated binary
does not change.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Juan Quintela <[email protected]>
Acked-by: Glauber Costa <[email protected]>
No functional changes. I verified that the generated binary
does not change.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Juan Quintela <[email protected]>
Acked-by: Glauber Costa <[email protected]>
No functional changes. I verified that the generated binary
does not change in meaningful ways.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Juan Quintela <[email protected]>
Acked-by: Glauber Costa <[email protected]>
No functional changes. I verified that the generated binary
does not change.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Juan Quintela <[email protected]>
Acked-by: Glauber Costa <[email protected]>
No functional changes. I verified that the generated binary
does not change.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Juan Quintela <[email protected]>
Acked-by: Glauber Costa <[email protected]>
No functional changes. I verified that the generated binary
does not change.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Juan Quintela <[email protected]>
Acked-by: Glauber Costa <[email protected]>
No functional changes. I verified that the generated
object binary does not change.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Juan Quintela <[email protected]>
Acked-by: Glauber Costa <[email protected]>
When an non-existent USB device is specified on the command line,
print "qemu: could not add USB device 'X'".
Likewise for the usb_{add,del} monitor commands.
Signed-off-by: Scott Tsai <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Split out tcg_out_cmp and properly handle immediate arguments.
Fix constraints on brcond to match what SUBCC accepts.
Add tcg_out_brcond2_i32 for 32-bit host.
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
The test TCG_TARGET_REG_BITS==64 is exactly the feature that we
are checking for, whereas something involving __sparc_v9__ or
__sparc_v8plus__ should be reserved for something ISA related,
as with SMULX.
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Generate sign-extended 32-bit constants with SETHI+XOR.
Otherwise tidy the routine to avoid the need for
conditional compilation and code duplication with movi_imm32.
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
We were unnecessarily restricting imm13 constants to 12 bits.
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Add core tile memeory to the RealView PBX-A9 board. Document the
memeory maps that are known to work with the qemu bootloader.
Signed-off-by: Paul Brook <[email protected]>
For what I know DCR is always 32 bits wide, so we should also use uint32_t to
pass it along the stacks.
This fixes a warning when compiling qemu-system-ppc64 with KVM enabled, making
it compile without --disable-werror
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Fix the alternate time base the same way as the default timebase. SPR_ATBL
should return a 64-bit value on 64 bit implementations.
Signed-off-by: Aurelien Jarno <[email protected]>
On PPC we have a 64-bit time base. Usually (PPC32) this is accessed using
two separate 32 bit SPR accesses to SPR_TBU and SPR_TBL.
On PPC64 the SPR_TBL register acts as 64 bit though, so we get the full
64 bits as return value. If we only take the lower ones, fine. But Linux
wants to see all 64 bits or it breaks.
This patch makes PPC64 Linux work even after TB crossed the 32-bit boundary,
which usually happened a few seconds after bootup.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Alpha always used 32-bit uids, but never renamed the syscalls
to match i386 when 32-bit uids were added there. This enables
the proper bits in syscall.c.
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Also change the New World default CPU to 970FX for ppc64,
since the G4 is a 32-bit CPU.
Signed-off-by: Andreas Färber <[email protected]>
Acked-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
ROMs need to be loaded if they are anywhere in the requested area, not
only at the very beginning. This fixes Multiboot with ELF kernels that
have more than one program header.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
There's no sense in separately declaring target_{elf_greg,uid,gid,pid}_t
for every architecture. Just declare them once with appropriate
USE_UID16 handling.
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
It was possible to load roms at address 0, but commit
632cf034b4 started to forbid that, which
broke at least ARM versatile.
Signed-off-by: Aurelien Jarno <[email protected]>
Force_sig should be always called with TARGET_ signals.
Not that it really matters with SEGV, so this patch is
just for cleanup and improving consistency.
Signed-off-by: Riku Voipio <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
mmap_lock() can be called while tb_lock() is being held. To
avoid deadlock when one thread is holding mmap_lock and another
tb_lock, _always_ lock first tb_lock().
Signed-off-by: Riku Voipio <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Fixes receiving signals when guest code is being executed in a tight
loop. For an example, try interrupting the following code with ctrl-c.
http://nchipin.kos.to/test-loop.c
The tight loop is ofcourse brainless, but it is also exactly how the waitpid* testcases
are implemented.
Signed-off-by: Riku Voipio <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
We really need compile _all_ sources for user target with -fpie when
use --enable-user-pie.
It's regression introduced by commit add16157d7.
Signed-off-by: Kirill A. Shutemov <[email protected]>
Cc: Blue Swirl <[email protected]>
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
When using the escc with Linux, we need interrupts. So instead of creating
a dummy device, let's just map them to the openpic we have anyways.
This makes Linux on PPC64 with console=ttyPZ0 work.
Obviously, this change needs to be reflected in openbios. Patch for that
follows this one. Please update the binary then.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
When lowering an IRQ line, we search for the line we're supposed to lower.
Usually we run into an optimization there that queues up interrupts. This
queue ends with -1. Unfortunately we didn't set the first item to -1.
This patch fixes this, making interrupts work on PPC64.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
This reverts commit 3a4921047d.
From Luiz:
do_migrate_set_speed() accepts a suffix for the 'value' argument and this is
not good for QMP. We will have to add a new argument type to handle that and
this will have to wait for 0.13.
Signed-off-by: Anthony Liguori <[email protected]>
Otherwise, the driver does not work in Linux after the INT_DISABLE changes in
PCI.
Michael Tsirkin had a patch to do this, I'm not sure what happened to it.
Signed-off-by: Anthony Liguori <[email protected]>
This makes do_balloon() accept megabyte values from the user
Monitor while accepting byte values for QMP.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This is a target long value in megabytes which should be
converted to bytes.
It will be used by handlers which accept a megabyte value
when in "user mode".
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
- Remove "draft" status
- Change default success response to be json-object
- Change error and event data member to be a json-object
- Update examples
- Add new section "Compatibility Considerations"
- Other fixes and clarifications
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Currently, when a regular command doesn't have any data to output,
QMP will emit:
{ "return": "OK" }
Returning an empty dict is better though, because dicts can support
some protocol changes in a compatible way.
So, with this commit we will return:
{ "return": {} }
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Looks like I dropped this check when addressing the 'query-'
commands request.
QMP should only handle converted commands, obviously.
Reported-by: Markus Armbruster <[email protected]>
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
My segment sync patch broke compilation on PPC32, because it was trying to
sync the SLB even though ppc32 CPUs don't have an SLB.
So let's only sync it when we're on a PP64 one!
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Convert musb fifo to 8bit to allow 8/16/32bit access
MUSB allows reading and writing to the fifo in 32/16/8 bit
width. The Linux kernel does this sometimes, most usually at
the end of writing the packet to allow packet to end at a
odd bytecount.
Convert the fifo to 8bit allows removing lots of shifts
which shows that the fifo is more natural as 8bit.
While at it, add multiple missing register definitions and
and cleanup debug prints.
Signed-off-by: Riku Voipio <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
The limit of iomem areas is quite low. Without the
debug print, it is quite hard to figure out why more
devices are not getting registered.
Signed-off-by: Riku Voipio <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
At least under some mingw compilers slirp networking fails without declaring
these fields packed.
From: Juha Riihimäki <[email protected]>
Signed-off-by: Juha Riihimäki <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Explicit read/write locking pidfile under WIN32 is bit extreme
nobody get the chance to read the pidfile. Convert to a write-only lock.
Also, creating pidfile was disabled along with daemonize under
WIN32. Enable it, but do not enable daemon support which doesn't
exist under WIN32 atm.
From: Juha Riihimäki <[email protected]>
Signed-off-by: Juha Riihimäki <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Now that we load the option roms via fw_cfg, we can stop copying
them to the 0xc000 -> 0xe000. The patch does just that.
Also the rom loader gets simplified as all remaining users of the
rom loader load the bits at a fixed address so the packing and
aligning logic can go away.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
roms: use fw_cfg for vgabios and option rom loading, additionally to
deploying them the traditional way (copy to 0xc0000 -> 0xe0000 range).
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch adds a file transfer interface to fw_cfg. Intended to be
used for passing non-pci option roms and vgabios to seabios. Namespace
is modeled after the existing cbfs filesystem support in seabios.
Reading the new FW_CFG_FILE_DIR entry returns a file list.
Fields there are in network byte order (aka bigendian).
aliguori: fix fw_cfg.h for multiboot.bin, add proper fw_cfg.h declarations,
quiet fprintf() in fw_cfg.c
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch adds a romfile property to the pci bus. It allows to specify
a romfile to load into the rom bar of the pci device. The default value
comes from a new field in PCIDeviceInfo. The property allows to change
the file and also to disable the rom loading using an empty string.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Currently, we preload option roms into the option rom space in memory. This
prevents DDIM from functioning correctly which severely limits the number
of roms we can support.
This patch introduces a pci_add_option_rom() which registers the
PCI_ROM_ADDRESS bar which points to our option rom. It also converts over
the cirrus vga adapter, the rtl8139, virtio, and the e1000 to use this
new mechanism.
The result is that PXE boot functions even with three unique types of cards.
Signed-off-by: Anthony Liguori <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
SCSI controllers have no trouble existing without any attached
disks. This could be achieved with the (legacy) monitor syntax
pci_add pci_addr=auto storage if=scsi
This is now denied with
scsi requires a backing file/device.
failed to add if=scsi
There is no need for this denial and it breaks compatability
with existing QEMU usage, so remove the check for presence
of a drive.
Signed-off-by: Daniel P. Berrange <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Floppy used the io_base address to register savevm region.
This reverts commit 2966b390d0.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This allows to suspend command interpretation and execution
synchronously, e.g. during migration.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This reverts commit ebbc8a3d8e.
As suggested by Jan Kiszka,
"It was obsoleted by d1793b836f8f123b961c613de1bb1c0c185c84cc and now
saves/restores a useless field."
Signed-off-by: Anthony Liguori <[email protected]>
The cursor pixmap size we calculate later ends up being 4096 dwords
long by the looks of it. This boots an F12 LiveCD now.
Signed-off-by: Dave Airlie <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch enables dirty log tracking whenever it's needed and disables it
when it is not.
We unconditionally enable dirty log tracking on reset, restart dirty log
tracking when PCI IO regions are remapped, and disable/enable it based on
commands from the guest.
Rebased-by: Dave Airlie <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
VMware VGA requires that the depth presented to the guest is the same as the
DisplaySurface that it renders to. This is because it performs a very simple
memcpy() to blit from one surface to another.
We currently hardcode a 24-bit depth. The surface allocator for SDL may, and
usually will, allocate a surface with a different depth causing screen
corruption.
This changes the code to allocate the DisplaySurface before initializing the
device which allows the depth of the DisplaySurface to be used instead of
hardcoding something.
Signed-off-by: Anthony Liguori <[email protected]>
Apparently, VBE maps the VGA vram to a fixed physical location. KVM requires
that all mappings of the VGA vram have dirty tracking enabled on them. Any
access to the VGA vram through the VBE mapping currently fails to result in
dirty page tracking updates causing a black screen.
This is the true root cause of VMware VGA not working correctly under KVM and
likely also an issue with some of the std-vga black screen issues too.
Cirrus does not enable VBE so it would not be a problem when using Cirrus.
Signed-off-by: Anthony Liguori <[email protected]>
Rebased-by: Dave Airlie <[email protected]>
Add a error message in case we fail to parse a qdev property.
Also make qemu not abort() in case setting a global property can't be
set. This used to be a clear programming error. The introduction of
the -global switch changed that though, so better exit instead (after
printing the new error message).
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Rebased to master, adapted to device renaming by armbru,
no other changes.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Split default_drive into default_{floppy,cdrom,sdcard}.
Also add QEMUMachine flags to disable them per machine.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The monitor_vprintf() function now touches the 'mon' pointer
before calling monitor_puts(), this causes block migration
to segfault as its functions call monitor_printf() with a
NULL 'mon'.
To fix the problem this commit moves the 'mon' NULL check
from monitor_puts() to monitor_vprintf().
This can potentially hide bugs, but for some reason this has
been the behavior for a long time.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The monitor_read_command() function is readline specific
and should only be used when readline is available.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
do_balloon() should check for ballooning availability as
do_info_balloon() does.
Noted by Daniel P. Berrange <[email protected]>.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Monitor's eject command uses 'filename' for the device name
argument, but 'device' is a better name.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Key replacement should not update the dictionary's size.
This commit also adds a test for the bug.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
If a UNIX migration command is attempt to a UNIX socket which does
not exist, then the monitor is suspended, but never resumed. This
prevents any further use of the monitor
* migration-unix.c: Only call migrate_fd_monitor_suspend() once
connected to the UNIX socket.
Signed-off-by: Daniel P. Berrange <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The multiboot implementation assumed that there is only one program header
(which contains the entry point) and that the entry point is at the start of
the code. This doesn't hold true generally and caused too little data to be
loaded.
Fix the loading code to pass the whole loaded data to the Multiboot Option ROM.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Part of the first patch of the -drive rerror series has been merged once more
on top of the rest of the series. This effectively disables the rerror option
and always goes with the default value. Reverting the commit re-enables the
option.
This reverts commit fc072ec4df.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The %gs segment that was used was not matching the comments.
I just moved the GDT descriptor on the stack instead.
Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
hw_breakpoint_type and hw_breakpoint_len used the wrong index multiplier
to extract type and len.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Marcelo correctly remarked that there are usage conflicts between QEMU
core code and KVM /wrt exception_index. So spend a separate field and
also save/restore it properly.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This violates the RFB specification (section 6.6.4). It happens to work with
most clients but it's still wrong.
Reported-by: Yaniv Kaul <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Currently only the S390 KVM target works. To keep users from accidently not
using KVM, let's not even initialize the machine when KVM is not used.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Currently we always set the "config space changed" bit to 1 when triggering
any virtio interrupt. While that worked in 2.6.27, newer kernels interpret
that value as "only the config space changed and nothing else happened".
Since we usually trigger interrupts to tell the guest that something did
happen, we just not tell it the config space changed for now until we
implement the correct callback for that.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
When going through the default devices, we don't initialize the virtio
console, unless we're doing -nographic.
I suppose that's just a leftover from the recent code restructuring, so
let's put it in.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
We used to always create one single virtio console device. This breaks when
either zero of multiple virtio console devices are requested, so let's use
the same code as on x86.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
We were being a bit too nice and didn't give the guest an invalid instruction
interrupt.
While that works, it's not exactly the fastest thing to do, since now the
guest doesn't know that we're not really implementing that instruction, so it
continues doing it.
We run into this with the set_page_unstable hint instruction. So let's bail out
in these cases.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
If QEMU finds newer kernel header files on compilation time, it will use
advertised features like pipe2 or SOCK_CLOEXEC by just doing a compile test.
If later the executables are executed on an older kernel (<2.6.27,
like Xen Dom0 2.6.18), then QEMU will fail on opening sockets and creating
pipes and returns the rather unspecific "qemu_init_main_loop failed".
This patch fixes this by checking the return values of these calls
for EINVAL and ENOSYS and falling back to the older versions automatically.
Signed-off-by: Andre Przywara <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Make libuser.a depend on $(GENERATED_HEADERS) too so make -j won't start
building it before the headers exist. (There may be more bugs like this
but at least this makes (g)make -j4 started from scratch on a quadcore
now always complete here again.)
Signed-off-by: Juergen Lock <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
There was a bug in float32_to_s that incorrectly mapped a zero exponent
to 0x38. This meant 0.0f != 0. At the same time, fix a generic type
punning bug in helper_memory_to_s and helper_s_to_memory.
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
We were missing the 0xc0000000 mask, leading to incorrect results.
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
The old fcmov implementation had a typo:
- tcg_gen_mov_i64(cpu_fir[rc], cpu_fir[ra]);
which moved the condition, not the second source, to the destination.
But it's also easy to implement the simplified fp comparison inline.
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
"Old" compilers obviously are not able to recognise
that all cases are handled here:
qemu/target-alpha/helper.c:70: error: ‘round_mode’ may be used uninitialized in this function
A small modification helps the compiler to do its jobs.
gcc-4.4 does not need this, but is still not standard on all platforms.
Signed-off-by: Stefan Weil <[email protected]>
Acked-by: Laurent Desnogues <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
nd->model keeps dynamically allocated model names.
So casting of a constant string is wrong here.
Signed-off-by: Stefan Weil <[email protected]>
Acked-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
4Kc, 4KEc cores do not support MIPS16, so not only the
CP0_Config1 had to be fixed (see previous patch),
but also MIPS16 instructions must not be executed.
(Hint from Nathan Froyd, thanks).
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
I need to see EAR register in output because I need to parse irqsoff problem.
Signed-off-by: Michal Simek <[email protected]>
Signed-off-by: Edgar E. Iglesias <[email protected]>
Similar in difficulty to ext*l, already expanded.
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Similar in difficulty to ext*l, already expanded.
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
When emulating user-mode only, there's no reason to exit
the translation block to effect a call_pal. We can generate
a move to/from the unique slot directly.
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
The instructions use a disp21 like all other branch insns,
not the disp16 that was being passed.
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
The architecture manual specifies the EXT instructions
in terms of the ZAPNOT operation; writing it that way in
the translator makes things a bit clearer.
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
The vast majority of zap instructions have an immediate operand,
since zapnot is the canonical method to zero-extend from u16 or u32.
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Generic disassembly was incorrectly keyed on ALPHA_DEBUG_DISAS
rather than the generic DEBUG_DISAS. Use qemu_log_mask for
additional LOG_DISAS output. Delete some random insn_count
logging noise from gen_intermediate_code_internal.
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Running programs with the MIPS user-mode emulator fails during dynamic
loading, as floating-point instructions are not enabled in in
env->hflags. Move the code for doing so from fpu_init to cpu_reset so
the MIPS_HFLAG_{FPU,F64} setting doesn't get clobbered by cpu_reset
setting env->hflags to MIPS_HFLAG_UM.
The same end can be achieved by swapping the ordering of fpu_init and
cpu_reset in cpu_mips_init, but it seemed better to consolidate the
CONFIG_USER_ONLY code into a single location.
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
The CPUID features QEMU presented to the guest were not up-to-date
with QEMU's emulated feature set.
Add the missing bits of recent (and not so recent) additions to
QEMU's emulation engine.
For stability reasons only the user mode usable bits are exposed for
now, features like Monitor or CR8LEG are left out.
Signed-off-by: Andre Przywara <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
1. Add correct definitions of error numbers.
2. Implement SYS_osf_sigprocmask
3. Implement SYS_osf_get/setsysinfo for IEEE_FP_CONTROL.
This last requires exposing the FPCR value to do_syscall.
Since this value is actually split up into the float_status,
expose routines from helper.c to access it.
Finally, also add a float_exception_mask field to float_status.
We don't actually use it to control delivery of exceptions to
the emulator yet, but simply hold the value that we placed there
when loading/storing the FPCR.
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
The only thing to do here is to expose the current processor mode to GDB
and to set the processor mode properly when we change the PC.
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
There's no good way to add this incrementally, so we do it all at once.
The only changes to shared code are in handle_delay_slot. We need to
flip ISAMode when doing a jump-and-exchange. We also need to set
ISAMode the low bit of the target address for jump-to-register.
Also, since we're now adding bits that can be in MIPS_HFLAG_BMASK_EXT,
make sure we use MIPS_HFLAG_BMASK_BASE in the places where we just want
basic information about a branch.
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Move delay slot handling to common code whose invocation can be
controlled from gen_intermediate_code_internal.
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
This is a common pattern in existing code. We'll also use it to
implement the mips16 SAVE/RESTORE instructions.
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
It's easier to implement mips16 shift instructions if we're not
examining the opcode inside gen_shift_{imm,}. So move ROTR and ROTRV
and do the special-case handling of SRL and SRLV inside decode_opc.
Likewise for their 64-bit counterparts.
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
We need to stash the operating mode into the low bit of the error PC and
restore it on return from interrupts.
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
We create separate masks for the "basic" branch hflags and the
"extended" branch hflags and define MIPS_HFLAG_BMASK as the logical or
of those two. This is done to avoid churning the codebase in lots of
different places.
We also make the execution mode an hflag under MIPS_HFLAG_TMASK
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
This is a workaround only, and is a partial revert
of a few changes to BMDMAState which removed pci_dev
field on the way.
- cmd646 pci_from_bm() expects bm->unit value to
correspond with bm data being passed to callback
as opaque pointer. This breaks when write to dma
control register of second channel happens when no
dma operation is in progress, so bm->unit is zero
for second channel, and pci_from_bm() returns garbage
pointer. Crash happens shortly after that while
dereferencing that pointer.
v0->v1: cleaned up dead code from pci_from_bm.
Signed-off-by: Igor V. Kovalenko <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
s390 code has an obvious typo, which results in:
hw/s390-virtio.c: At top level:
hw/s390-virtio.c:249: error: request for member ‘no_vga’ in something not a structure or union
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Building on 32 bit host we get:
hw/s390-virtio.c: In function ‘s390_init’:
hw/s390-virtio.c:184: error: integer constant is too large for ‘unsigned long’ type
64 bit values must be ULL.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Don't define C99 math functions on OpenSolaris (Solaris 11),
which still ships GCC 3.4.3. This fixes redefinition warnings.
Spotted by Palle Lyckegaard.
Signed-off-by: Andreas Färber <[email protected]>
Cc: Palle Lyckegaard <[email protected]>
Cc: Ben Taylor <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Avoid an unresolved symbol error for TFR,
which is defined in sysemu.h.
Based on patch by Palle Lyckegaard.
Signed-off-by: Andreas Färber <[email protected]>
Cc: Palle Lyckegaard <[email protected]>
Cc: Ben Taylor <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Stepping through the SS-5's OBP initialization routines
it looks like reading fdc main status register should
clear the fd interrupt.
The patch doesn't fix problems with fdc on sparc platform,
it only fixes fdc detection.
Signed-off-by: Artyom Tarasenko <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Implement a stub for the AFX register on SparcStation-5.
This stub is needed for running the original SS-5 OBP
instead of OpenBIOS (which allows to boot Solaris 2.5.1
and Solaris 2.6 kernels).
Signed-off-by: Artyom Tarasenko <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
According to the SCSI-2 specification,
http://ldkelley.com/SCSI2/SCSI2/SCSI2/SCSI2-08.html#8.2.5 ,
"if the allocation length of the command descriptor block (CDB) is too
small to transfer all of the parameters, the additional length shall
not be adjusted to reflect the truncation."
The 36 mandatory bytes of response are written to outbuf, and then
only the length requested in CDB is transferred.
Signed-off-by: Artyom Tarasenko <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Currently, the msrs involved in setting up pvclock are not saved over
migration and/or save/restore. This patch puts their value in special
fields in our CPUState, and deal with them using vmstate.
kvm also has to account for it, by including them in the msr list
for the ioctls.
This is a backport from qemu-kvm.git
[v2: sucessfully build without kerneldir ]
Signed-off-by: Glauber Costa <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Return a QDict with server information. Connected clients are returned
as a QList of QDicts.
The new functions (vnc_qdict_remote_addr(), vnc_qdict_local_addr() and
put_addr_qdict()) are used to insert 'host' and 'service' information
in the returned QDict.
This patch is big, but I don't see how to split it.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Return a QDict with information about the just added device.
This commit should not change user output.
Please, note that this patch does not do error handling
conversion. In error conditions the handler still calls
monitor_printf().
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Each device is represented by a QDict. The returned QObject is a QList
of all devices.
This commit should not change user output.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Each device statistic information is stored in a QDict and
the returned QObject is a QList of all devices.
This commit should not change user output.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Each block device information is stored in a QDict and the
returned QObject is a QList of all devices.
This commit should not change user output.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Return a QDict, which may contain up to more two QDicts, depending
on the type of migration we're performing.
IMPORTANT: as a QInt stores a int64_t integer, RAM values are going
to be stored as int64_t and not as uint64_t as they are today. If
this is a problem QInt will have to be changed.
This commit should not change user output.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Each mouse is represented by a QDict, the returned QObject is a QList of
all mice.
This commit should not change user output.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
snprintf() is used because the UUID_FMT is too complex for
qobject_from_jsonf().
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
All 'info' commands should use QDict, this commit also kills
monitor_print_qobject() as do_info_version() doesn't use it
anymore (and no handler will).
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Should return a QDict and should not print the user protocol bits
(eg. "c|cont").
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Monitor commands should always return values in bytes and info
commands should always return a QDict.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This is a helper function that does type checking before retrieving
a QBool from the dictionary.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The capslock tracking logic added by commit
6b1325029d doesn't work correctly for vnc
clients without EXT_KEY_EVENT support. The reason is that qemu converts
keysyms for letters to lowercase for the keysym2scancode lookup. It
then also passes the lowercase value down to do_key_event(), but the
capslock tracking code needs it with the correct case to work properly.
This patch adds a new variable for the lowercase keysym so we'll keep
the unmodified value for do_key_event().
The keysym2scancode is not needed with EXT_KEY_EVENT capable clients
like any app based on the gtk-vnc widget, so I missed that case in
testing ...
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch fills the DriveInfo->unit after hotplugging a scsi disk.
It makes a difference when auto-assigning a scsi id, where unit was
left filled with '-1' instead of the actual scsi id.
With this patch applied the the drive naming logic in drive_init() works
as good as it did in previous releases. Which means it works fine with
a single scsi bus.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Current PCI code will simply hw_error() and thus abort in case no free
PCI slot is available or the requested PCI slot is already in use by
another device. For the hotplug case this behavior is not acceptable.
This patch makes qemu pass up the error properly, so the calling code
can decide whenever it wants to exit with an error (on startup) or
whenever it wants to continue (hotplug).
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The PCI bus on x86 requires ACPI for hotplug support, thus disbling ACPI
also disables hotplug for the PCI bus. This patch makes qemu check
whenever the PCI bus in question can handle hotplug before trying to add
devices. This is needed because qdev will abort() on any attempt to
hotplug devices into a non-hotpluggable bus.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
All "normal" system emulation targets in qemu I'm aware of display
output on either VGA or serial output.
Our S390x virtio machine doesn't have such kind of legacy hardware. So
instead we need to default to a virtio console.
Add flags to QEMUMachine to indicate which kind of default devices make
sense for the machine in question. Use it for S390x: enable virtcon,
disable serial, parallel and vga.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch adds a variable default_virtcon which says whenever a default
virtio console should be added. It is disabled by default, followup
patch will enable it for s390. It is cleared when qemu finds
'-virtiocon', '-device virtio-console-s390' or '-device
virtio-console-pci' on the command line.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch reworks the -monitor handling:
- It adds a new "mon" QemuOpts list for the monitor(s).
- It adds a monitor_parse() function to parse the -monitor switch.
- It adds a mon_init function to initialize the monitor(s) from the
"mon" QemuOpts list.
- It winds up everything and removes the old bits.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add a default_drive variable which specified whenever the default drives
(cdrom, floppy, sd) should be created. It is cleared when the new
-nodefaults switch is specified on the command line.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add a default_net variable which specified whenever a default network
should be created. It is cleared in case any -net option is specified
and it is also added to the new -nodefaults switch.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add global command line option to disable default devices.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Qemu creates a vga display for you in case you didn't specify one on the
command line. Right now this is tied to the '-vga <type>' command line
switch, which in turn causes trouble if you are creating your gfx card
using '-device VGA,<props>'.
This patch adds a variable default_vga which says whenever a default
serial line should be added. It is enabled by default. It is cleared
when qemu finds '-vga' or '-device {VGA,Cirrus VGA,QEMUware SVGA}' on
the command line.
'-device VGA' still doesn't work though due to a initialization order
issue (vga must init before calling i440fx_init_memory_mappings).
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The logic in this code obviously predates the multiple monitor
capability of qemu and looks increasingly silly these days.
I think the intention of this piece of code is to get a reasonable
default for the -nographic case: have monitor and serial line muxed
on stdio.
With the new default_serial and default_monitor variables we have now
doing just that became much easier ;)
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch makes the monitor default device configuration work like the
default serial and parallel port devices. It adds a variable
default_monitor which says whenever a default monitor should be added.
It is enabled by default. It is cleared when qemu finds '-monitor' on
the command line.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Qemu creates a default parallel port for you in case you didn't specify
one on the command line. Right now this is tied to the '-parallel
<chardev>' command line switch, which in turn causes trouble if you are
creating your parallel port via '-device isa-parallel,<props>'.
This patch adds a variable default_parallel which says whenever a default
parallel port should be added. It is enabled by default. It is cleared
when qemu finds '-parallel' or '-device isa-parallel' on the command line.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Qemu creates a default serial line for you in case you didn't specify
one on the command line. Right now this is tied to the '-serial
<chardev>' command line switch, which in turn causes trouble if you are
creating your serial line via '-device isa-serial,<props>'.
This patch adds a variable default_serial which says whenever a default
serial line should be added. It is enabled by default. It is cleared
when qemu finds '-serial' or '-device isa-serial' on the command line.
Part of the patch is some infrastructure for the '-device $driver'
checking (default_driver_check function) which will also be used by the
other patches of this series.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Make the 'vc' chardev backend print a title line with the chardev name
after initialization, using CharDriverState->label.
This replaces the banner printing code in vl.c.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The patch decuples the -chardev switch and the actual chardev
initialization. Without this patch qemu ignores chardev entries
coming via -readconfig.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
i.e. -global PCI.<property>=<value> will set a default property for all
PCI devices. Also works for the compat properties used by machine
types.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch adds infrastructure and command line option for setting
global defaults for device properties, i.e. you can for example use
-global virtio-blk-pci.vectors=0
to turn off msi by default for all virtio block devices. The config
file syntax is:
[global]
driver = "virtio-blk-pci"
property = "vectors"
value = "0"
This can also be used to set properties for devices which are not
created via -device but implicitly via machine init, i.e.
-global isa-fdc,driveA=<name>
This patch uses the mechanism which configures properties for the
compatibility machine types (pc-0.10 & friends). The command line
takes precedence over the machine type values.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch renames the compat properties into global properties and
makes them more generic. The compatibility stuff is only one of
multiple possible users now.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
As KVM now makes use of exception_index to keep pending exceptions, we
have to save&restore this field as well.
NOTE: We have to nail the arch-independent exception_index down to a
certain bit width for proper vmstate processing, namely to 32 bit.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Device names with whitespace require quoting in the shell and in the
monitor. Some of the offenders are also overly long. Some have a
more convenient alias, some don't.
The place for verbose device names is DeviceInfo member desc. The
name should be short & sweet.
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Using the qdev name for the product description makes for inconvenient
qdev names.
Put the product description in new USBDeviceInfo member product_desc.
Make usb_qdev_init() use it. No user or guest visible change, since
the value is still the same.
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
It's not a device name, it's the USB product description string.
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
On hosts without high-res timers it is impossible to inject rtc interrupt
faster then 1kHz. Windows sometimes configures RTC to generate 1kHz
interrupts, so we can't inject missed interrupts when running on such
hosts. Always injecting an interrupt on REG_C read is also not an option
since Windows wait for REG_C to become zero with interrupt disabled
during boot. This patch uses mixed approach: accelerate timer + inject
up to 1000 interrupts on REG_C read.
Signed-off-by: Gleb Natapov <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
migrating between hosts which have different features
might break silently, if the migration destination
does not support some features supported by source.
Prevent this from happening by comparing acked feature
bits with the mask supported by the device.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This just adds the rom file to the vmware SVGA chipset so it boots.
Signed-off-by: Dave Airlie <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
qemu_malloc() does not allow size=0 to be passed in and aborts on this behavior.
Unfortunately, there is good reason to believe that within qemu, there are a
number of, so far, undetected places that assume size=0 can be safely passed.
Since we do not want to abort unnecessarily in production builds, return
qemu_malloc(1) whenever the version file indicates that this is a production
build.
Signed-off-by: Anthony Liguori <[email protected]>
Instruct make to remove any rule target on error. This prevetns
situation where there was an error during build but generated file still
stays behind.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Also affects do_change(), because the two share eject_device().
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Also fix the odd typoe and clean up whitespace.
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The do_cont() function will ask the user to enter a password if a
device is encrypted.
This is invalid under QMP, so we raise a QERR_DEVICE_ENCRYPTED
error.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
When using encrypted disk images, QEMU will prompt the user
for passwords when started.
This makes sense for the user protocol, but doesn't for QMP.
The solution is to have Monitor command which allows the user
or a Client to set passwords in advance, so that we avoid
the prompt completely.
This is what block_passwd does, for example:
(QEMU) block_passwd ide0-hd0 foobar
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Interrupt disable bit is mandatory in PCI spec.
Implement it to make devices spec compliant.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Isaku Yamahata <[email protected]>
interrupt status is a mandatory feature in PCI spec,
so devices must implement it to be spec compliant.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Isaku Yamahata <[email protected]>
This rearranges code in preparation for interrupt state
implementation.
Changes:
- split up bus walk away from interrupt handling
into a subroutine
- change irq_state from an array to bitmask
- verify that irq_state values are 0 or 1 on load
There are no functional changes.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Isaku Yamahata <[email protected]>
Function mask is a mandatory feature in MSIX
spec so not implementing it is a spec violation.
Implement.
Signed-off-by: Michael S. Tsirkin <[email protected]>
rename ENABLE_OFFSET -> CONTROL_OFFSET, since
same byte includes function mask.
This is in preparation for function mask support.
Signed-off-by: Michael S. Tsirkin <[email protected]>
The multicore CPUID code detects whether the guest is an Intel or an
AMD CPU, because the Linux kernel is picky about the CmpLegacy bit.
KVM by default passes through the host's vendor, which was not
catched by the code. So fork out the vendor determining bits into a
separate function to be used from both places and always get the real
vendor.
This fixes KVM's multicore setup on Intel CPUs.
Signed-off-by: Andre Przywara <[email protected]>
Reported-by: Dietmar Maurer <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
KVM_GET_MSR_INDEX_LIST returns -E2BIG when the provided space is too
small for all MSRs. But this is precisely the error we trigger with the
initial request in order to obtain that size. Do not fail in that case.
This caused a subtle corruption of the guest state as MSR_STAR was not
properly saved/restored. The corruption became visible with latest kvm
optimizing the MSR updates.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch adds information about who handles what when it comes to S390.
I'll gladly support anything that's related to the device emulation model and
S390 KVM parts.
Since this patchset doesn't implement S390 CPU emulation, I left that part
with a question mark. As soon as Uli's patchset gets committed I'd recommend
setting him there.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
All "normal" system emulation targets in qemu I'm aware of display output
on either VGA or serial output.
Our S390x virtio machine doesn't have such kind of legacy hardware. So
instead we need to default to a virtio console.
I'm not particularly proud of this patch. It would be a lot better to
have something in the machine description that tells us about the default
terminal.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
In order to debug funny kernel breakages it's always good to have a working
gdb stub around.
While Uli's patches don't include one one, I needed one that's at least good
enough for 'bt' and some variable examinations during early bootup.
So here it is - the absolute basics to get the qemu gdb stub running with s390x
targets.
Sgined-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
In order to use the new S390x virtio bus we just introduced, we also
need a machine description that sets up the machine according to our
PV specification.
Let's add that machine description and be happy!
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
On S390x we don't want to go through the hassle of emulating real existing
hardware, because we don't need to for running Linux.
So let's instead implement a machine that is 100% based on VirtIO which we
fortunately implement already.
This patch implements the bus that is the groundwork for such an S390x
virtio machine.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Let's enable the basics for system emulation so we can run virtual machines
with KVM!
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
KVM on S390x requires the virtual address space of the guest's RAM to be
within the first 256GB.
The general direction I'd like to see KVM on S390 move is that this requirement
is losened, but for now that's what we're stuck with.
So let's just hack up qemu_ram_alloc until KVM behaves nicely :-).
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
S390x was one of the first platforms that received support for KVM back in the
day. Unfortunately until now there hasn't been a qemu implementation that would
enable users to actually run guests.
So let's include support for KVM S390x in qemu!
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Qemu won't let us run a KVM target without having host TCG support. Well, for
now we don't have any so let's implement a fake target that only stubs out
everything.
I tried to keep the patch as close to Uli's source as possible, so whenever
he feels like it he can easily diff his version against this one.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
This patch makes configure aware of S390 hosts and guests. When not explicitly
defined using --target-list= no S390 targets will be built though.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Because Qemu currently requires a TCG target to exist and there are quite some
useful helpers here to lay the groundwork for out KVM target, let's create a
stub TCG emulation target for S390X CPUs.
This is required to make tcg happy. The emulation target itself won't work
though.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
This implements the audio control or volume read support as needed by
some systems. A Conectiva Parolin system required this to detect an IDE
device as CD-ROM, through the CDVOLREAD ioctl.
Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Some PAGE constants were used instead of the macros we already have
defined in internal.h.
Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
* buf was too small for longer register names.
* Use consistent upper case for nouns in register names.
* Use better name for array with e100 register names.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Since commit a992fe3d0f
config-devices.h is no longer used.
So there is no need to keep the dependency rules
any longer.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This should avoid truncating the register name when debugging.
Signed-off-by: David Benjamin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
In mb_mod_length a return value is stored that is negative in error case. With
an unsigned type the check goes wrong.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Checking for nbytes < 0 is pointless as long as it's a size_t. If we want to
use negative numbers for error codes, we should use signed types.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch fixes the follow error when LSI_DEBUG is set.
CC libhw64/lsi53c895a.o
cc1: warnings being treated as errors
qemu/hw/lsi53c895a.c: In function 'lsi_io_mapfunc':
qemu/hw/lsi53c895a.c:1932: error: format '%08x' expects type 'unsigned int', but argument 2 has type 'pcibus_t'
qemu/hw/lsi53c895a.c: In function 'lsi_ram_mapfunc':
/qemu/hw/lsi53c895a.c:1947: error: format '%08x' expects type 'unsigned int', but argument 2 has type 'pcibus_t'
qemu/hw/lsi53c895a.c: In function 'lsi_mmio_mapfunc':
qemu/hw/lsi53c895a.c:1957: error: format '%08x' expects type 'unsigned int', but argument 2 has type 'pcibus_t'
make[1]: *** [lsi53c895a.o] Error 1
make: *** [subdir-libhw64] Error 2
Signed-off-by: Ryan Harper <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Make using mingw32 on windows fails when running grep "=y$$".
The command is expanded to grep "=y$ and the missing "
results in an error.
I don't expect a file config-devices.mak with =y somewhere in
the middle of a line (they are always at the end of the line),
so simplifying the regular expression to =y seems to be permitted.
This avoids problems with wrong expansion.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Make using mingw32 on windows does not preserve $@ in macros
when they are modified using this pattern:
target: macro += something
This behaviour results in an error when QEMU_CFLAGS containing
"-MMD -MP -MT $@" is modified for compilation of source files
which use SDL: $@ will expand to nothing, -MT no longer has
the correct argument (it will take the next one from the command
line) and the build will fail or run with a wrong command line.
The problem is fixed by using a new macro QEMU_DGFLAGS
which is not modified by a target rule.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
A code review run by Steve Grubb complained about code in e1000.c:
In hw/e1000.c at line 89, vlan is declared to be 4 bytes.
At line 382 is an attempt to do a memmove over it with a size of 12.
This was fixed by splitting the memmove in two calls and
adding a comment to the declaration of vlan and data.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
While trying to run -kernel with -bios pc-bios/pcbios.bin, I realized
that I was actually writing data to %es, but only set up %ds to a 32-bit
segment we want to write to.
So at the end of the day the data hasn't actually been copied. Oops.
So here's a fix to set ES instead of DS, which makes -kernel work with
BOCHS bios again (and actually makes the code do the correct thing)!
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Commit 26a9e82a has the following flaws:
* It enabled DEBUG.
* It referenced two properties by the wrong name in
usb_host_device_open(), which crashes with "qdev_prop_set: property
"USB Host Device.bus" not found".
* It broke "-usbdevice host:auto:..." by calling parse_filter()
incorrectly.
* It broke parsing of "-usbdevice host:BUS.ADDR" and "-usbdevice
host:VID:PRID" with a trivial pasto.
* It broke wildcards in "-usbdevice host:auto:...". Before, the four
filter components were stored as int, and the wildcard was encoded
as -1. The faulty commit changed storage to uint32_t, and the
wildcard encoding to 0. But it failed to update parse_filter()
accordingly.
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Valid description taken from qemu-img.texi, although it would be better
to have this information recorded in only one place.
Signed-off-by: Pierre Riteau <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
To avoid the build failing with:
gcc -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-
builtin -I/export/home/andreas/QEMU/qemu -Wall -Wstrict-prototypes -
Werror -fomit-frame-pointer -fno-builtin -I/export/home/andreas/QEMU/
qemu -c -o multiboot.o multiboot.S
/var/tmp//ccd3aWyk.s: Assembler messages:
/var/tmp//ccd3aWyk.s:15: Error: value of 512 too large for field of 1
bytes at 0000000000000002
gmake[1]: *** [multiboot.o] Error 1
disable recursion into pc-bios/optionrom, as done for Darwin already.
Signed-off-by: Andreas Faerber <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Either rename variables and functions to refer to write errors (which is what
they actually do) or introduce a parameter to distinguish reads and writes.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Vendor identification, product identification and product revision level
should be padded with spaces without a terminating NULL character, see
SCSI-2 standard, 8.2.5.1 Standard INQUIRY data.
Signed-off-by: Laszlo Ast <[email protected]>
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch extends the qemu-kvm state sync logic with support for
KVM_GET/SET_VCPU_EVENTS, giving access to yet missing exception,
interrupt and NMI states.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Some recent change made PPC guests always start at address 0x0 because env
isn't synced to kvm_state on first bootup.
I'm not sure if this is the correct bugfix, but at least it makes PPC boot
again with KVM enabled.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
While x86 only needs to sync cr0-4 to know all about its MMU state and enable
qemu to resolve virtual to physical addresses, we need to sync all of the
segment registers on PPC to know which mapping we're in.
So let's grab the segment register contents to be able to use the "x" monitor
command and also enable the gdbstub to resolve virtual addresses.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Cirrus vga has a copy of many PCI macros,
and it doesn't even use them. Clean up.
We also don't need to override header type
as it is NORMAL by default.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
PCI memory should be disabled at reset, otherwise
we might claim transactions at address 0.
I/O should also be disabled, although for cirrus
it is harmless to enable it as we do not
have I/O bar.
Note: bios fix needed for this patch to work
was already applied:
previously bios incorrently assumed that it does not
need to enable i/o unless device has i/o bar.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We're leaking file descriptors to child processes. Set FD_CLOEXEC on file
descriptors that don't need to be passed to children to stop this misbehaviour.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
I haven't heard yet of anyone using qemu-img to copy an image to a real floppy,
but it's a valid use case.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Currently qcow2 unnecessarily rounds up the length of the backing format string
to the next multiple of 8. At the same time, the array in BlockDriverState can
only hold 15 characters, so in effect backing formats with 9 characters or more
don't work (e.g. host_device).
Save the real string length and things start to work for all valid image format
names.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
rerror controls the action to be taken when an error occurs while accessing the
guest image file. It corresponds to werror which already controls the action
take for write errors.
This purely introduces parsing rerror command line option into the right
structures, real support for it in the device emulation is added in the
following patches.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Either rename variables and functions to refer to write errors (which is what
they actually do) or introduce a parameter to distinguish reads and writes.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
As we may do more than one migration (cancellation, live backup), reset
bytes_transferred on stage 1.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The opts id is always allocated via qemu_strdup, so it need not be
const, but it has to be released on opts deletion.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The effect of this patch with current block migration is that its stage
2, ie. the first full walk-through of the block devices will be
performed completely before RAM migration starts. This ensures that
continuously changing RAM pages are not re-synchronized all the time
while block migration is not completed.
Future versions of block migration which will respect the specified
downtime will generate a different pattern: After RAM migration has
started as well, block migration may also continue to inject dirty
blocks into the RAM stream once it detects that the number of pending
blocks would extend the downtime unacceptably.
Note that all this relies on the current registration order: block
before RAM migration.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
No need to migrate emptiness (risking divide by zero later on).
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
4K is too small for efficiently saving and restoring multi-GB block
devices.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Inject progress report in percentage into the block live stream. This
can be read out and displayed easily on restore.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Report progress of an outgoing live migration to the monitor instead of
stdout.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
In order to allow proper progress reporting to the monitor that
initiated the migration, forward the monitor reference through the
migration layer down to SaveLiveStateHandler.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
So far progress reporting only works for the first block device. Fix
this by keeping an overall sum of sectors to be migratated, calculating
the sum of all processed sectors, and finally basing the progress
display on those values.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Introduce qemu_savevm_state_cancel and inject a stage -1 to cancel a
live migration. This gives the involved subsystems a chance to clean up
dynamically allocated resources. Namely, the block migration layer can
now free its device descriptors and pending blocks.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Besides catching real errors, this also allows to interrrupt the qemu
process during restore.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Based on the original patch by Pierre Riteau: Use a common blk_send
function to transmit a block.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We already save total_sectors in BlkMigDevState, let's use this value
during the migration and avoid to recalculate it needlessly.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
In case we restart a migration, submitted, read_done, transferred, and
print_completion need to be reinitialized to 0.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
No need to push block_mig_state to the heap and, thus, establish an
indirection.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This switches the dirty bitmap to a true bitmap, reducing its footprint
(specifically in caches). It moreover fixes off-by-one bugs in
set_dirty_bitmap (nb_sectors+1 were marked) and bdrv_get_dirty (limit
check allowed one sector behind end of drive). And is drops redundant
dirty_tracking field from BlockDriverState.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Instead of duplicating the definition of constants or introducing
trivial retrieval functions move the SECTOR constants into the public
block API. This also obsoletes sector_per_block in BlkMigState.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
qemu_fclose frees the passed file structure, but do_migrate_set_speed
may access it later on. Fix it by setting file NULL in
migrate_fd_cleanup and checking for this.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
When the size that we want to transmit is in another field, but in an
unit different that bytes
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Support for buffer that are pointed by a pointer (i.e. not embedded)
where the size that we want to use is a field in the state.
We also need a new place to store where to start in the middle of the
buffer, as now it is a pointer, not the offset of the 1st field.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Seeking on vmstate save/load does not work if the underlying file is a
stream. We could try to make all QEMUFile* forward-seek-aware, but first
attempts in this direction indicated that it's saner to convert the few
qemu_fseek-on-vmstates users to plain reads/writes.
This fixes various subtle vmstate corruptions where unused fields were
involved.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The critical part of this change is how to deal with simultaneaous
generation of interrupts. The only (normal) case when this happens in
the emulation is near simultaneous reselection + selection. If selection
comes first, there is no problem, since the target attempting
reselection loses the arbitration (in the emulation it only means that
the reselect function will not be started). In the worst case the host
adapter is reselected, but the device driver already started a
selection, so we jump to the alternative address to handle the
situation.
The SCRIPTS code can trigger another interrupt to notify the driver that
the new task has to be postponed. I suppose that on real hardware there
is enough time after the reselection interrupt to set the SIP bit before
the next interrupt comes, so it would result in 2 stacked interrupts (a
SCSI and a DMA one). However, in the emulation there is no interrupt
stacking, so there is a good chance that the 2 interrupts will get to
the interrupt handler at the same time.
Nevertheless, it should not make a big difference in interrupt handling,
since in both cases both interrupts have to be fetched first, and after
that the new task (that failed during the selection phase) has to be
prepared/reset for a later restart, and the reconnected device has to be
serviced.
The changes do not modify the host adapter's behavior if this interrupt
is not enabled.
See also LSI53C895A technical manual, SCID and SIEN0.
Signed-off-by: Laszlo Ast <[email protected]>
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add READ_16 + friends to scsi-defs.h, scsi_command_name() and the
request parsing helper functions.
Use them in scsi-disk.c too.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Move REPORT_LUNS emulation from scsi_send_command() to
scsi_disk_emulate_command().
Also add REPORT_LUNS to scsi-defs.h and scsi_command_name().
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Move SERVICE_ACTION_IN emulation from scsi_send_command() to
scsi_disk_emulate_command().
Also add SERVICE_ACTION_IN to scsi-defs.h and scsi_command_name().
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Move GET_CONFIGURATION emulation from scsi_send_command() to
scsi_disk_emulate_command().
Also add GET_CONFIGURATION to scsi-defs.h and scsi_command_name().
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Move READ_TOC emulation from scsi_send_command() to
scsi_disk_emulate_command(). Add scsi_disk_emulate_read_toc() function
which holds the longisch READ_TOC emulation code.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Move MODE_SENSE emulation from scsi_send_command() to
scsi_disk_emulate_command(). Create two helper functions:
mode_sense_page() which writes the actual mode pages and
scsi_disk_emulate_mode_sense() which holds the longish MODE_SENSE
emulation code, calling into mode_sense_page() as needed.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Move INQUIRY emulation from scsi_send_command() to
scsi_disk_emulate_command(). Also split the longish INQUITY emulation
code into the new scsi_disk_emulate_inquiry() function. Serial number
handling is slightly changed, we don't copy it any more but look it up
directly in DriveInfo which we have at hand anyway.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add new scsi_disk_emulate_command() function, which will -- when
finished -- handle all scsi disk command emulation except actual I/O
(READ+WRITE commands) which goes to the block layer. The function
builds on top of the new SCSIRequest struct.
SCSI command emulation code is moved over from scsi_send_command() in
steps to ease review and make it easier to pin down regressions (if any)
using bisect. This patch moves over TEST_UNIT_READY only.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Also add and use the scsi_req_complete() helper function for calling the
completion callback.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add helper functions for scsi request parsing to common code. Getting
command length, transfer size, and linear block address is handled.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Largely based on <scsi/scsi.h> from linux. Added into the tree so we
can use the defines everywhere, not just in scsi-generic.c (which is
linux-specific).
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Create generic functions to allocate, find and release SCSIRequest
structs. Make scsi-disk and scsi-generic use them.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Changes:
* Move from open-coded lists to QTAILQ macros.
* Move the struct elements to the common data structures
(SCSIDevice + SCSIRequest).
* Drop free request pools.
* Fix request cleanup in the destroy callback.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Rename the SCSIRequest structs in scsi-disk.c and scsi-generic.c to
SCSIDiskReq and SCSIGenericReq. Create a SCSIRequest struct and move
the common elements over.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Also delete the leftover and unused scsi-disk.h file.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Print an error if the user specifies vnet_hdr=1 on the cmdline.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
net_tap_init() always sets vnet_hdr using qemu_opt_get_bool(), but
initialize it in net_init_tap() just to reduce confusion.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This avoids the "TUNSETOFFLOAD ioctl() failed: Invalid argument" message
on kernels without TUNSETOFFLOAD support.
Signed-off-by: Pierre Riteau <[email protected]>
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
vnet_hdr is initialized at 1 by default. We need to reset it to 0 if
the kernel doesn't support IFF_VNET_HDR.
Signed-off-by: Pierre Riteau <[email protected]>
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add a NetClientInfo pointer to VLANClientState and use that
for the typecode and function pointers.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
... and VLANClientState::opaque and qemu_find_vlan_client().
All of these are now unused
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Common state for all NICs.
The opaque member will replace the opaque member in VLANClientState
since only NICs need it.
The conf member will allow us to iterate over NICs, access the MAC
addr for the NIC and send a packet from each NIC in qemu_announce_self().
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Nothing qdev specific about this, make it available throughtout.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
A replacement for qemu_new_vlan_client(), using NetClientInfo to
replace most arguments.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This structure holds data which is common to all instances of a given
net client type/model.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Since 1cc33683, this field is not set for most devices, so just
remove it and its remaining few uses.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This is probably a little drastic, but the includes in this file are
now totally out of control when compared with what includes are
actually needed.
This may break the build on e.g. *BSD, but it will be easily fixed by
re-instating an include.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
A Python script which uses qmp.py to print some simple VM info.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This is a very simple shell written in Python for demonstration
purposes.
Unfortunately it's a bit awkward right now, as the user has
to specify the arguments names and the printed data can be
a raw dictionary or list, like the following example:
(QEMU) pci_add pci_addr=auto type=nic
{u'slot': 5, u'bus': 0, u'domain': 0, u'function': 0}
(QEMU)
It's worth to note that the shell is broken into two files.
One is the shell itself, the other is the QMP class which
handles the communication with QEMU.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We still have handlers which will call monitor print functions
in several places. Usually to report errors.
If they do this when we are in control mode, we will be emitting
garbage to our clients.
To avoid this problem, this commit adds a way to disable those
functions. If any of them is called when in control mode, we will
emit a generic error.
Although this is far from the perfect solution, it guarantees
that only JSON is sent to Clients.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Debug, shutdown, reset, powerdown and stop are all basic events,
as they are very simple they can be added in the same commit.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Asynchronous events are generated with a call to
monitor_protocol_event().
This function builds the right data-type and emit the event
right away. The emitted data is always a JSON object and its
format is as follows:
{ "event": json-string,
"timestamp": { "seconds": json-number, "microseconds": json-number },
"data": json-value }
This design is based on ideas by Amit Shah <[email protected]>.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The 'info' command makes sense for the user protocol, but for QMP
it doesn't, as its return data is not well defined. That is, it
can return anything.
To fix this Avi proposes having 'query-' commands when in protocol
mode. For example, 'info balloon' would become 'query-balloon'.
The right way of supporting this would probably be to move all
info handlers to qemu-monitor.hx, add a flags field to mon_cmd_t
to identify them and then modify do_info() to do its search based
on that flag.
Unfortunately, this would require a big change in the Monitor.
To make things simpler for now, this commit takes a different
approach: a check for commands starting with "query-" is added to
toplevel QMP code, if it's true we setup things so that do_info()
is called with the appropriate arguments.
This is a hack, but is a temporary one and guarantees that query-
commands will work from the first day.
Also note that 'info' is not allowed in protocol mode.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The JSON stream parser is used to do QMP input. When there
are enough characters to be parsed it calls Monitor's
handle_qmp_command() function to handle the input.
This function's job is to check if the input is correct and
call the appropriate handler. In other words, it does for QMP
what handle_user_command() does for the user protocol.
This means that handle_qmp_command() also has to parse the
(ugly) "args_type" format to able to get the arguments names
and types expected by the handler.
The format to input commands in QMP is as follows:
{ "execute": json-string,
"id": json-value, "arguments": json-object }
Please, note that this commit also adds "id" support.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit adds specific QMP checks to do_info(), so that
it behaves as expected in QMP mode.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
In the new Monitor output is always performed by only two
functions: do_info() and monitor_call_handler().
To support QMP output, we modify those functions to check if we
are in control mode. If so, we call monitor_protocol_emitter()
to emit QMP output, otherwise we do regular output.
QMP has two types of responses to issued commands: success and
error. The outputed data is always a JSON object.
Success responses have the following format:
{ "return": json-value, "id": json-value }
Error responses have the following format:
{ "error": { "class": json-string,
"desc": json-string,
"data": json-value } "id": json-value }
Please, note that the "id" key is part of the input code, and
thus is not added in this commit.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit adds initial QMP support in QEMU. It's important
to notice that most QMP code will be part of the Monitor.
Input will be read by monitor_control_read(). Currently it
does nothing but next patches will add proper input support.
The function monitor_json_emitter(), as its name implies, is
used by the Monitor to emit JSON output. In this commit it's
used by monitor_control_event() to print our greeting message.
Finally, control mode support is also added to monitor_init(),
allowing QMP to be really enabled.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Only QERR_QMP_BAD_INPUT_OBJECT is QMP specific, the others can
be used in different contexts by other subsystems.
Please, note that QERR_JSON_PARSING signals any parsing error
from the json parser. We will need it until the parser gets
updated to use QError.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
List QMP available commands. Only valid in control mode, where
has to be used as 'query-commands.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
As this series will add a new kind of Monitor command, it's better
to rename monitor_handle_command() to what it really is:
handle_user_command().
This will avoid confusion.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit moves the loop which searches for the command
entry corresponding to a command name to its own function.
It will be used by QMP code as well.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit moves the code which calls Monitor handlers to
its own function, as it will be used by QMP code as well.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit adds a flag called 'control' to the '-monitor'
command-line option. This flag enables control mode.
The syntax is:
qemu [...] -monitor control,<device>
Where <device> is a chardev (excluding 'vc', for obvious reasons).
For example:
$ qemu [...] -monitor control,tcp:localhost:4444,server
Will run QEMU in control mode, waiting for a client TCP connection
on localhost port 4444.
NOTE: I've tried using QemuOpts for this, but turns out that it
will try to parse the device part, which should be untouched.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This flag will be set when Monitor enters "control mode", in
which the output will be defined by the QEMU Monitor Protocol.
This also introduces a macro to check if the flag is set.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Please, note that we will lose the "Try -device '?' for a list"
hint as it's qdev specific.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit adds QError support in the Monitor.
A QError member is added to the Monitor struct. This new member
stores error information and is also used to check if an error
has occurred when the called handler returns.
Additionally, a new macro called qemu_error_new() is introduced.
It builds on top of the QemuErrorSink API and should be used in
place of qemu_error().
When all conversion to qemu_error_new() is done, qemu_error() can
be turned private.
Basically, Monitor's error flow is something like this:
1. An error occurs in the handler, it calls qemu_error_new()
2. qemu_error_new() builds a new QError object and stores it in
the Monitor struct
3. The handler returns
4. Top level Monitor code checks the Monitor struct and calls
qerror_print() to print the error
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
QError is a high-level data type which represents an exception
in QEMU, it stores the following error information:
- class Error class name (eg. "ServiceUnavailable")
- description A detailed error description, which can contain
references to run-time error data
- filename The file name of where the error occurred
- line number The exact line number of the error
- function The function name of where the error occurred
- run-time data Any run-time error data
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Note that we can now write qstring_from_str() as a wrapper.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
It accepts a va_list and will be used by QError. Also simplifies
the code a little, as the other qobject_from_() functions can
use it.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
With the recent device handling changes the I2C slave addressing code
was broken. With current code, if a slave with the correct address is
not found on the bus the last scanned slave on the bus will be
addressed. This is wrong. Please find attached a patch to fix it.
Signed-off-by: Juha Riihimäki <[email protected]>
Acked-by: Riku Voipio <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Use the correct qdev property type for these devices.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
rtl8139.c is using malloc()/free() instead of qemu_malloc()/qemu_free().
Fix it.
Signed-off-by: Jean-Christophe DUBOIS <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
xen_backend.c is using qemu_free() instead of free().
Fix it.
Signed-off-by: Jean-Christophe DUBOIS <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
scsi-generic.c is using free() instead of qemu_free().
Fix it.
Signed-off-by: Jean-Christophe DUBOIS <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
nseries.c is using free() instead of qemu_free().
Fix it.
Signed-off-by: Jean-Christophe DUBOIS <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
bt-l2cap.c is using free() instead of qemu_free().
Fix it.
Signed-off-by: Jean-Christophe DUBOIS <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
nand.c is using free() instead of qemu_free().
Fix it.
Signed-off-by: Jean-Christophe DUBOIS <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
baum.c is using free() instead of qemu_free().
Fix it.
Signed-off-by: Jean-Christophe DUBOIS <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
acpi.c is using free() instead of qemu_free().
Fix it.
Signed-off-by: Jean-Christophe DUBOIS <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
pci code had a TODO to move apb specific
pci bridge initialization to apb_pci.
Implement this and remove the TODO.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
linux-user build on fedora 11 breaks because fallocate
is broken on that system if -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
are specified, which is what QEMU uses.
We do have a configure check to catch this and disable fallocate,
however, it turns out that default QEMU_CFLAGS/LDFLAGS were assigned in
script *after* all compiler checks: so during checks we were not running
compiler with same flags that we used for build later.
Fix this by moving QEMU_CFLAGS to before compiler checks, and using
comple_prog when checking for fallocate. This also fixes the fact that
we do some compiler checks while assigning the flags, right below a
comment that says "no cc tests beyond this point".
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Anthony Liguori's patch fixes the problems with
vga display in graphical mode and SeaBIOS.
I only adapted some values for vga-pci.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Thanks to f527c57935
(fix parallel build), these prerequisites
are redundant now and can be removed.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
PCI spec states:
if a masked vector has its Pending bit set, and the associated
underlying interrupt events are somehow satisfied (usually by software
though the exact manner is function-specific), the function must clear
the Pending bit, to avoid sending a spurious interrupt message later
when software unmasks the vector.
In our case this happens if vector becomes unused.
Clear pending bit in this case.
Signed-off-by: Michael S. Tsirkin <[email protected]>
On reset, we currently clear all bits in msix control register *except*
enable bit. This is wrong: the spec says we should clear writeable
bits: function mask and enable bit.
Correct this.
Signed-off-by: Michael S. Tsirkin <[email protected]>
msix state is managed by OS, not the
driver, so it's wrong to touch it
on io from driver.
Mark all vectors unused instead.
Signed-off-by: Michael S. Tsirkin <[email protected]>
goto into scope is evil. rearrange pci_bridge_filter
so that we always go to end of function on error.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Isaku Yamahata <[email protected]>
This patch replaces magic number, 256, with ARRAY_SIZE().
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Split bar address math into a separate function.
In particular, this gets rid of an ugly forward goto
into scope that we have there.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Isaku Yamahata <[email protected]>
This patch moves two typedefs, PCIHostState and PCIExpressHost to
qemu-common.h for consistency as PCIBus and PCIDevice are typedefed
in qemu-common.h.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
This patch removes some comment which should go into commit log
in pci.h.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
This patch replaces for loop by memset in pci_init_wmask().
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
including pci_host.h isn't needed by pci.c.
This patch kills it.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
This patch removes unnecessary & 0xff in pci_dev_find_by_addr().
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
This patch renames pci_find_host_bus() to pci_find_root_bus()
as suggested by "Michael S. Tsirkin" <[email protected]>.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Because pci_sub_bus() is used only once so eliminate it
by open coding as suggested by "Michael S. Tsirkin" <[email protected]>.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
pci_host_data_register_io_memory and its variants are too long a bit.
So shorten them. Now they are
pci_host_{conf, data}_register_{mmio, mmio_noswap, ioport}()
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
This patch renames pci_addr_to_dev(), pcie_mmcfg_addr_to_dev()
to pci_dev_find_by_addr(), pcie_dev_find_by_mmcfg_addr()
as "Michael S. Tsirkin" <[email protected]> suggested.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
This patch removes pci_addr_to_config() and open code it
as suggested by Michael S. Tsirkin <[email protected]>.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Remove switch on length: we don't care about
high bits for value, so just return all ones
if no device. And add one assert().
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Isaku Yamahata <[email protected]>
Now pci host stuff has been moved from pci.[hc] to pci_host.[hc]
so the declaration of pci_data_{read, write}() should be in
pci_host.h
This patch moves them from pci.h to pci_host.h for consistency.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
It printed wrong limit value of bridge.
This patch fixes it.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
pci.h declares some functions which aren't
defined in pci.h. Clean up moving things
to appropriate headers, and update all users.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Based on a patch from Arnaud Patard (Rtp) <[email protected]>
A few words about design choices:
* Two registers, at and t0, are reserved for TCG internal use. They are
useful for bswap and 64-bit ops.
* Most ops supports a constant argument with value 0, which is actually
mapped to the zero register.
* While the at register is available for constant loading, ops only
support a limited range of constants. TCG does a better job doing the
register allocation and constant loading by itself. There are plenty of
registers available anyway.
Signed-off-by: Aurelien Jarno <[email protected]>
Currently the ll/sc instructions use the virtual address in both
user and system mode. Use the physical address insteead in system
mode.
Signed-off-by: Aurelien Jarno <[email protected]>
This causes ctrl+alt+u or ctrl+alt+f to not work when windows hasn't been
resized first. Other graphic emulators do resize the screen on
hw_invalidate.
This reverts commit 0bd8246bfe.
Fix cpu_get_real_ticks:
- check should be done on __mips and not __mips_isa_rev
- linux kernels >= 2.6.25 are emulating the 2 needed rdhwr functions
so it's safe to use rdhwr.
This is better than what's currently in but it doesn't mean it works nicely
Some tests needs to be done imho
Signed-off-by: Arnaud Patard <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
In a bunch of places, 64 is used as value of _NSIG but it's wrong
at least on MIPS were _NSIG is 128.
Based on a patch from Arnaud Patard <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
This includes the following changes:
42bc394 Make sure to reenable ata interrupts even on error.
494dfc6 Move SeaBIOS post/boot stack to avoid conflict with gPXE.
3133e38 Test for broken gcc -combine on FC12.
Signed-off-by: Anthony Liguori <[email protected]>
Reqrite bitbanging I2C implementation. New code improves stop/start
condition handling, and gives more accurate input line level.
Introduce intermediate abstraction layer for I2C bitbanging that
is not connected via a GPIO port.
Signed-off-by: Paul Brook <[email protected]>
Add makefile dependencies for target specific device configs.
These will copy the default config if none exists, obsoleting the old
configure time code. If a config already exists but is older than the
default then print a warning.
Also remove config-devices.h. Code does not and should not care which
devices are being built.
Signed-off-by: Paul Brook <[email protected]>
There is no reason to have it disabled on this platform.
Signed-off-by: Hervé Poussineau <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Depending on the CPU, CP0_LLAddr is either read-only or read-write,
and the returned value can be shifted by a variable amount of bits.
Signed-off-by: Aurelien Jarno <[email protected]>
Signed-off-by: Hervé Poussineau <[email protected]>
The variable CP0_LLAddr represent the full lladdr, not the actual
register value, which is only part of this value and depends on the
CPU.
Signed-off-by: Aurelien Jarno <[email protected]>
In the spirit of ff56954baf, fix the
build of linuxboot.S with old as(1) (as found in some BSD base systems)
by emitting the bytes of the insn it doesn't like instead.
Signed-off-by: Juergen Lock <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Handle ifname on FreeBSD hosts; if no ifname is given, always start
the search from tap0. (Simplified/cleaned up version of what has been
in the FreeBSD ports for a long time.)
Signed-off-by: Juergen Lock <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
net/tap-bsd.c was assuming IFF_VNET_HDR was always available, which
I think isn't true on any BSD.
Signed-off-by: Juergen Lock <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
GCC 3.3.5 generates warnings for static forward declarations of data, so
rearrange code to use static forward declarations of functions instead.
Use <getopt.h> for optind instead of local definition.
Signed-off-by: Blue Swirl <[email protected]>
* Replace vill -> will.
* Comment was formatted to make it more readable
and to conform to the coding standard, too.
* Description of foo="" was completed.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Since c32d766af1, qemu-io should be
portable. It is currently built only on linux and mingw32.
This patch enables qemu-io on all platforms. Tested on FreeBSD.
Signed-off-by: Aurelien Jarno <[email protected]>
Link with -lpulse in addition to -lpulse-simple, needed when --no-add-needed
is passed to the linker (gold default).
Signed-off-by: Aurelien Jarno <[email protected]>
We should install linuxboot.bin too, so let's add it to the to-be-installed
blobs.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We already have a working multiboot implementation that uses fw_cfg to get
its kernel module etc. data in int19 runtime now.
So what's missing is a working linux boot option rom. While at it I figured it
would be a good idea to take the opcode generator out of pc.c and instead use
a proper option rom, like we do with multiboot.
So here it is - an fw_cfg using option rom for -kernel with linux!
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We will have a linux boot option rom soon, so let's take all functionality
that might be useful for both to a header file that both roms can include.
That way we only have to write fw_cfg access code once.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Right now we load the guest kernel to RAM, fire off the BIOS, hope it
doesn't clobber memory and run an option rom that jumps into the kernel.
That breaks with SeaBIOS, as that clears memory. So let's read all
kernel, module etc. data using the fw_cfg interface when in the int19
handler.
This patch implements said mechanism for multiboot.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We have several rom helpers currently, but none of them can get us
code that spans several roms into a pointer.
This patch introduces a function that copies over rom contents.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
By reusing the qjson test suite. After checking that we can demarshal, marshal
again and compared to the expected decoded value. This doesn't work so well
for floats because they cannot be accurately represented in decimal but we
try our best.
Signed-off-by: Anthony Liguori <[email protected]>
This adds iterator support to QDict, it will be used by the
(to be introduced) QError module.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This is the third and final stage of the JSON parser. It parses lexical tokens
performing grammar validation and creating the final QObject representation. It
uses a recursive decent parser.
Signed-off-by: Anthony Liguori <[email protected]>
The second stage of our JSON parser is a simple state machine that identifies
individual JSON values by counting the levels of nesting of tokens. It does
not perform grammar validation. We use this to emit a full JSON value to the
parser.
Signed-off-by: Anthony Liguori <[email protected]>
Our JSON parser is a three stage parser. The first stage tokenizes the stream
into a set of lexical tokens. Since the lexical grammar is regular, we can
use a finite state machine to model it. The state machine will emit tokens
as they are identified.
Signed-off-by: Anthony Liguori <[email protected]>
This makes lists no longer invariant. It's a very useful bit of functionality
though.
To deal with the fact that lists are no longer invariant, introduce a deep
copy mechanism for lists.
Signed-off-by: Anthony Liguori <[email protected]>
We have a function for this which does not issue annoying warnings.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Drop interrupt_bitmap from the cpustate and solely rely on the integer
interupt_injected. This prepares us for the new injected-interrupt
interface, which will deprecate the bitmap, while preserving
compatibility.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch adds the option to activate non-shared storage migration from the
monitor.
The migration command is as follows:
(qemu) migrate -d tcp:0:4444 # for ordinary live migration
(qemu) migrate -d -b tcp:0:4444 # for live migration with complete storage copy
(qemu) migrate -d -i tcp:0:4444 # for live migration with incremental storage copy, storage is cow based.
Changes from v4:
- Minor coding style issues.
Signed-off-by: Liran Schour <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch introduces block migration called during live migration. Block
are being copied to the destination in an async way. First the code will
transfer the whole disk and then transfer all dirty blocks accumulted during
the migration.
Still need to improve transition from the iterative phase of migration to the
end phase. For now transition will take place when all blocks transfered once,
all the dirty blocks will be transfered during the end phase (guest is
suspended).
Changes from v4:
- Global variabels moved to a global state structure allocated dynamically.
- Minor coding style issues.
- Poll block.c for tracking of dirty blocks instead of manage it here.
Signed-off-by: Liran Schour <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
To support live migration without shared storage we need to be able to trace
writes to disk while migrating. This Patch expose dirty block tracking per
device to be polled from upper layer.
Changes from v4:
- Register dirty tracking for each block device.
- Minor coding style issues.
- Block.c will now manage a dirty bitmap per device once
bdrv_set_dirty_tracking() is called. Bitmap is polled by the upper
layer (block-migration.c).
Signed-off-by: Liran Schour <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This function sends out the OPENED event to backends that
have drive the chardevs. The 'reset' is now a historical
artifact and we can now just call the function for what it
is.
Signed-off-by: Amit Shah <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The initial_reset sent to chardevs doesn't do much other than setting
a bool to true. Char devices are interested in the open event and
that gets sent whenever the device is opened.
Moreover, the reset logic breaks as and when qemu's bh scheduling
changes.
Signed-off-by: Amit Shah <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
chardevs have a 'can_read' function via which backends specify
the amount of data they can receive. When can_read returns > 0,
apps can start sending data. However, each chardev driver here
allows a max. of 1k bytes inspite of the backend being able to
receive more.
The best we can do here is to allocate s->max_size bytes from
the heap on each call (which is the number returned by the
backend from the can_read call).
This is an intermediate step to bump up the bytes written in
each call to 4k.
Signed-off-by: Amit Shah <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Before 2e29bd0478, Uni-North host and AGP
bridge were using the same devfn, 11 << 3. The net effect was that only
AGP bridge was visible. This was changed in the commit to 13 << 3 for AGP.
Some of the later crashes happened due to NULL pointer dereferences generated
by 07b7d05377 and insufficient return value
checks.
Disable host device and revert AGP to 11 << 3.
Signed-off-by: Blue Swirl <[email protected]>
Only two callers of pci_create_simple/pci_register_device bothered
to check the return value. Other cases were prone to crashing with
spurious NULL pointer dereferences.
Make QEMU exit with an error message when devfn is attempted to
be duplicated, also applies to case when the bus is full. Remove
checks.
Signed-off-by: Blue Swirl <[email protected]>
Remove cpu_mips_register()
- move mmu_init(), fpu_init() and mvp_init() into cpu_mips_init()
- move the other parts in cpu_mips_init()
Reported-by: Blue Swirl <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
This patch fixes clean in case of missing directories and
also adds code to distclean that removes the following files:
qemu-monitor.texi roms/seabios/config.mak roms/vgabios/config.mak
Signed-off-by: Magnus Damm <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Add the sh4 target to the monitor disassembly function,
and remove a duplicate "0x" printout from the sh4 dis-
assembly code.
Signed-off-by: Magnus Damm <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Change 260c0cd3d9
(pci: use range helper functions) introduced a
bug which made pci cirrus vga on mips malta
(and maybe other pci devices) fail.
Don't change addr - its original value is needed
by ranges_overlap() and range_covers().
Signed-off-by: Stefan Weil <[email protected]>
Acked-by: Ryan Harper <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Because of a typo, structure field vga_bios_size was not initialized
properly and a bogus BAR6 for the nonexistent VGA BIOS appeared.
The bug was uncovered by c169998802.
Signed-off-by: Blue Swirl <[email protected]>
Allow the user to specify the number of cores present on the
RealView EB + ARM11MPCore board. Also split into its own config
rather than guessing from the CPU name.
Signed-off-by: Paul Brook <[email protected]>
When code was transformed to use qdev_reset/vmstate registration, vmstate
was passed a variable of the wrong type
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
When capslock is toggled while the vnc window hasn't the focus qemu
will miss the state change. Add sanity checks for the capslock state
and toggle it if needed, so hosts and guests idea of capslock state
stay in sync. Simliar logic for numlock is present in qemu already.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
While writing working on an e1000 driver for my university's OS I
noticed that some registers aren't readable in QEMU, but they should
be readable as stated in Intels Driver Developer Manual (and also
verified on real hardware).
Signed-off-by: Anthony Liguori <[email protected]>
We need to signal not only write errors, but also read errors to the guest
driver. This fixes a regression introduced by 869a5c6d.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
When creating a snapshot we can run into the situation that the first disk
doesn't have a snapshot, but the second one does have one with the same name as
the new snapshot.
In this case, qemu doesn't recognize that there is a snapshot to be
overwritten, so it starts to save the new snapshot and errors out later when it
tries to snapshot the second image. With this patch, snapshots on secondary
images are overwritten just like on the first image.
Reported-by: Juan Quintela <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
commit b04c4134d6
broke incoming migration. After talking with Gleb, code was intended
to be the way is in this fix. This fixes migration here.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Based on a ideas of Daniel Jacobowitz + Stefan Weil
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
A bus may have hotplugging enabled but not have the 'unplug'
callback defined, which would lead to a crash on trying to
unplug a device on the bus.
Fix by introducing an assert to check if the callback is valid.
Signed-off-by: Amit Shah <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
* Remove 2nd entry for pxe-pcnet.bin.
This kind of error can be avoided by sorting
entries. So all pxe-*.bin entries are now sorted
alphabetically.
* Rename pxe-eepro100.bin -> pxe-i82559er.bin.
This change completes another patch which did
the rename on the pxe image for i82559er.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Some devices did not have an initialisation value
for entry ".exit". This is fixed here.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
* Rename pxe-eepro100.bin to pxe-i82559er.bin.
The other devices supported by eepro100.c need
additional pxe boot ROM images.
* Call rom_add_option during initialisation.
The code won't work with two or more different
eepro100 devices, because it only adds one option
ROM, but this use case is perhaps never needed.
Using this patch, model=i82559er at least works partially.
For full support, more eepro100 patches are needed
(will follow later, can be fetched from ar7 branch
of QEMU).
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Replace
GEN config-all-devices.mak
by
GEN config-all-devices.mak
Like this, the logging output is column aligned.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Many (most?) serial interfaces have a programmable
clock which provides the reference frequency ("baudbase").
So a fixed baudbase which is only set once can be wrong.
omap1.c is an example which could use the new interface
to change baudbase when the programmable clock changes.
ar7 system emulation (still not part of standard QEMU)
is similar to omap and already uses serial_set_frequency.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Make MPCore secondary cpu initialization work with the new reset
handling. Also change the inital FLAG value from 3 to zero to match
recent kenrels.
Signed-off-by: Paul Brook <[email protected]>
rom_+add_file/rom_add_blob only work correctly if called before
load_all_roms. Enforce this rather than silently accepting and putting
the rom in the wrong place at reset.
Signed-off-by: Paul Brook <[email protected]>
Since 45a50b1 load_image_targphys should only be called once.
ARM boards incorrectly call it every time the system is reset.
Signed-off-by: Paul Brook <[email protected]>
Adds -readconfig and -writeconfig command line switches to read/write
QemuOpts from config file.
In theory you should be able to do:
qemu < machine config cmd line switches here > -writeconfig vm.cfg
qemu -readconfig vm.cfg
In practice it will not work. Not all command line switches are
converted to QemuOpts, so you'll have to keep the not-yet converted ones
on the second line. Also there might be bugs lurking which prevent even
the converted ones from working correctly.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add functions to parse QemuOpts from a git-style config file.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add a function to write the QemuOpts configuration to a git-style
config file.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Factor out the QemuOptsList search code for upcoming users.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Explain the existing format specific options that can be used with qemu-img
create/convert -o ...
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The old options are still supported for compatibility, but they are
inconsistent (for example create -b vs. convert -B for backing files) and
incomplete (-F only exists for create) which tends to confuse people. Remove
all references to the old options from the documentation to guide users to the
more consistent -o options.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The description of the image formats is too long to be a subitem of a parameter
description. It will become even longer when we include the options provided by
the respective format.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Now qemu_error can be called also from shared files, e.g. block.c.
Signed-off-by: Naphtali Sprei <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
* Add device properties (size of statistical data,
extended tcb support) to EEPRO100State and set
these values for the different devices.
* Fix PCI configuration for existing devices.
* Add initialisation code for missing devices.
* Remove function device_supports_eTxCB.
It is no longer needed.
* Fix dump of statistical data. It now respects
the real size of the statistical data.
An endianess issue was fixed here, too.
* CU_SHOWSTATS, CU_DUMPSTATS now write a
completion value after the statistical data.
There is no need to keep this value in
eepro100_stats_t, so member "complete"
could be removed.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
make pci_info_device() print out bridge's filtering value like
io base/limit, subbus and subordinate bus.
Signed-off-by: Isaku Yamahata <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch implements pci bridge filtering.
TODO: currently almost all the map funcions assumes
filtered_size == size and addr & ~(size - 1) == addr.
However with bridge filtering, they aren't always true.
Teach them such cases, such that filtered_size < size and
addr & (size - 1) != 0.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
split out device iteration logic from pci_for_each_device().
factored out function, pci_for_each_device_under_bus() will be used later.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Remove one indentation of pci_update_mappings.
Just for cosmetics, no logic change.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
- Only sets default subsystem id for header type 00.(normal header type)
because header type 01 doesn't have subsystem id, and uses the register
for other purpose. So setting default subsystem id doesn't make sense.
- initialize wmask more for header type 01.(bridge header type)
Without those wmasks, linux was confused not boot,
and lspci was confused not to print out expected IO/memory range.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
When updated ROM expantion address of header type 0, it missed
to update mappings.
Add PCI_ROM_ADDRESS check whether to call pci_update_mappings()
Also update pci mapping when PCI_ROM_ADDRESS1 is written for header type 1.
pci_update_mapping() path isn't performance critical,
so call it even independent of header type.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
add helper function to check ranges overlap suggested by
Michael S. Tsirkin <[email protected]>.
His original suggestion was to use [first, last], however I chosen
to use offset, length pair, i.e. [offset, offset + length)
because pci configuration space related functions all uses offset and length
pair, so it helps to avoid to type constant twice.
Cc: Michael S. Tsirkin <[email protected]>
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch adds common routines for pcie host bridge and pcie mmcfg.
This will be used by q35 based chipset emulation.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
VMSTATE_BUFFER_UNSAFE_INFO for as a buffer with specified VMStateInfo.
It will be used later.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
change the first argument, void *opaque to PCIBus *s
of the pci_data_{read, write}.
They aren't used as direct callback so the argument type
don't have to be void*. So change it to the right type.
Signed-off-by: Isaku Yamahata <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Move pci host stuff from pci.c to pci_host.c.
And add some comments.
Later pcie host bridge functions will be defined in pcie_host.c
not to bloat pci.c.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
factor out the logic which converts io port address into pci device
and offset in PCI configuration space.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch sorts out/enhances pci code to track pci bus topology
more accurately.
- Track host bus bridge with pci domain number. Although the
current qemu implementation supports only pci domian 0 yet.
- Track pci bridge parent-child relationship.
When looking down from pci host bus for pci sub bus, be aware of
secondary bus/subordinate bus.
Thus pci configuration transaction is more accurately emulated.
This patch adds new member to PCIBus to track pci bus topology.
Since qdev already tracks down bus relationship, those new member
wouldn't be necessary.
However it would be addressed later because not all the pci device
isn't converted to qdev yet.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Since It can be retrieved from pci configuration space,
the member is unnecessary.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
implemented pci 64bit bar support.
The tricky bit is pci_update_mapping().
An OS is allowed to set the BAR such that OS can't address the area
pointed by BAR. It doesn't make sense, though.
In that case, don't map the BAR.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch is preliminary for 64bit bar.
For 64bit bar support, change pcibus_t which represents
pci bus addr/size from uint32_t to uint64_t.
And also change FMT_pcibus for printf.
In pci_update_mapping() checks 32bit overflow.
So the check must be updated too.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch is preliminary for 64bit BAR.
Later pcibus_t will be changed from uint32_t to uint64_t.
Introduce FMT_PCIBUS for printf format for pcibus_t.
Signed-off-by: Isaku Yamahata <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch is preliminary for 64 bit BAR support.
Introduce dedicated type, pcibus_t, to represent pci bus address/size
instead of uint32_t.
Later this type will be changed to uint64_t.
Signed-off-by: Isaku Yamahata <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
split static functions in pci_host.h into pci_host.c and
pci_host_template.h.
Later a structures declared in pci_host.h, PCIHostState, will be used.
However pci_host.h doesn't allow to include itself easily. This patches
addresses it.
pci_host.h includes functions which are instantiated in .c by including
pci_host.h with typedefing pci_addr_t.
pci_addr_t is per pci host bridge and is typedef'ed to uint32_t for ioio
or target_phys_addr_t for mmio in .c file.
That prevents from including pci_host.h to use PCIHostState because of
requiring type, pci_addr_t.
Its purpose to include is to instantiate io function for mmio or ioio
depending on which pci host bridge requires ioio or mmio.
To avoid including code, we always instantiate both version.
Signed-off-by: Isaku Yamahata <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
make pci_bar() aware of header type 1. When PCI_ROM_SLOT
it should return PCI_ROM_ADDRESS1 (!= PCI_ROM_ADDRESS)
Signed-off-by: Isaku Yamahata <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch cleans up pci_default_read_config() removing
ugly length and range check.
Suggested by "Michael S. Tsirkin" <[email protected]>
Signed-off-by: Isaku Yamahata <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
make constants for pci base address match pci_regs.h by
renaming PCI_ADDRESS_SPACE_xxx to PCI_BASE_ADDRESS_SPACE_xxx.
Signed-off-by: Isaku Yamahata <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
- use symbolic constant
- use helper function pci_set_xxx()
- removed lines which initializes to 0.
It is unnecessary because it is already zeroed.
- add some comments on command registers.
Some initial values are suspicious because they seems to
be specific to apb_pci.c which is the only user of pci bridge right now.
For now don't touch those values to avoid breakage.
Signed-off-by: Isaku Yamahata <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
use pci_[gs]et_{byte, word, long}() to access pci configuration
space.
Signed-off-by: Isaku Yamahata <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
add helper functions to get/set PCIDevice::config
Those will be used later.
Signed-off-by: Isaku Yamahata <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
define a constant to represent a unmapped bar instead of -1 and use it.
Signed-off-by: Isaku Yamahata <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
use PCI_SLOT() and PCI_FUNC() where appropriate instead of
direct use of bit operation.
Signed-off-by: Isaku Yamahata <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
introduce constant PCI_NUM_PINS for the number of interrupt pins, 4.
and use it.
Signed-off-by: Isaku Yamahata <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This is needed also for qemu-io, but not for qemu-nbd.
Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Since config-host.h is generated by the Makefile (1215c6e76),
building (only) qemu-img fails:
[user@f12-uri qemu]$ make distclean (or git clone qemu)
[user@f12-uri qemu]$ ./configure ...
[user@f12-uri qemu]$ make qemu-img
GEN config-all-devices.mak
GEN qemu-img-cmds.h
CC qemu-img.o
In file included from qemu-img.c:24:
qemu-common.h:32:25: error: config-host.h: No such file or directory
Signed-off-by: Uri Lublin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch is a followup to 8eca6b1bc7,
fixing crashes when guests with 2.6.25 virtio drivers have saturated
virtio network connections.
https://bugs.edge.launchpad.net/ubuntu/+source/qemu-kvm/+bug/458521
That patch should have been whitelisting *_HOST_* rather than the the
*_GUEST_* features.
I tested this by running an Ubuntu 8.04 Hardy guest (2.6.24 kernel +
2.6.25-virtio driver). I saturated both the incoming, and outgoing
network connection with nc, seeing sustained 6MB/s up and 6MB/s down
bitrates for ~20 minutes. Previously, this crashed immediately. Now,
the guest does not crash and maintains network connectivity throughout
the test.
Signed-off-by: Dustin Kirkland <[email protected]>
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
A size of 0 should be valid and cannot be treated as "missing value". Use -1
for this purpose instead.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Okay, let's try re-enabling the drain-entire-queue behaviour, with a
difference - before each subsequent packet, use qemu_can_send_packet()
to check that we can send it. This is similar to how we check before
polling the tap fd and avoids having to drop a packet if the receiver
cannot handle it.
This patch should be a performance improvement since we no longer have
to go through the mainloop for each packet.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We should only return zero from receive() for a condition which we'll
get notification of when it changes. Currently, we're returning zero
if the guest driver is not ready, but we won't ever flush our queue
when that status changes.
Also, don't check buffer space in can_receive(), but instead just allow
receive() to return zero when this condition occurs and have the caller
handle queueing the packet.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Now that we disable any receiver whose queue is full, we do not require
senders to handle a zero return by supplying a sent callback.
This is a second step towards allowing can_receive() handlers to return
true even if no buffer space is available.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
If a receiver returns zero, that means its queue is full and it will
notify us when room is available using qemu_flush_queued_packets().
Take note of that and disable that receiver until it flushes its queue.
This is a first step towards allowing can_receive() handlers to return
true even if no buffer space is available.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
If qemu_send_packet_async() returns zero, it means the packet has been
queued and the sent callback will be invoked once it has been flushed.
This is only possible where the NIC's receive() handler returns zero
and promises to notify the networking core that room is available in its
queue again.
In the case where the receive handler does not have this capability
(and its queue fills up) it returns -1 and the networking core does not
queue up the packet. This condition is indicated by a -1 return from
qemu_send_packet_async().
Currently, tap handles this condition simply by dropping the packet. It
should do its best to avoid getting into this situation by checking such
NIC's have room for a packet before copying the packet from the tap
interface.
tap_send() used to achieve this by only reading a single packet before
returning to the mainloop. That way, tap_can_send() is called before
reading each packet.
tap_send() was changed to completely drain the tap interface queue
without taking into account the situation where the NIC returns an
error and the packet is not queued. Let's start fixing this by
reverting to the previous behaviour of reading one packet at a time.
Reported-by: Scott Tsai <[email protected]>
Tested-by: Sven Rudolph <[email protected]>
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We have code for a quite a few block formats. While I trust that all
of these formats are useful at least for some people in some
circumstances, some of them are of a kind that friends don't let
friends use in production.
This patch provides an optional block format whitelist, default off.
If a whitelist is configured with --block-drv-whitelist, QEMU proper
can use only whitelisted formats. Other programs, like qemu-img, are
not affected.
Drivers for formats off the whitelist still participate in format
probing, to ensure all programs probe exactly the same. Without that,
QEMU proper would be prone to treat images with a format off the
whitelist as raw when the image's format is probed.
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
These devices are created automatically, and attempting to create
another one with -device fails with "qemu: hardware error:
register_ioport_write: invalid opaque".
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This is a slightly revised patch for adding readonly flag to the -drive command.
Even though this patch is "stand-alone", it assumes a previous related patch (in Anthony staging tree), that passes
the readonly attribute of the drive to the guest OS, applied first.
This enables sharing same image between guests, with readonly access.
Implementaion mark the drive as read_only and changes the flags when actually opening the file.
The readonly attribute of a qcow also passed to it's base file.
For ide that cannot pass the readonly attribute to the guest OS, disallow the readonly flag.
Also, return error code from bdrv_truncate for readonly drive.
Signed-off-by: Naphtali Sprei <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Images with disk size 0 may be used for
VM snapshots, but not to save normal block data.
It is possible to create such images using
qemu-img, but opening them later fails.
So even "qemu-img info image.qcow2" is not
possible for an image created with
"qemu-img create -f qcow2 image.qcow2 0".
This is fixed here.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
b55a37c981 moved the call to cpu_reset
to user emulators. But cpu_copy also initializes a CPU structure, so add the
call also there.
Signed-off-by: Blue Swirl <[email protected]>
Problem: x86 systems could not survive a few system_resets.
Clear most of IDE state when reset. Implement the missing reset handlers.
Signed-off-by: Blue Swirl <[email protected]>
There is absolutely no need to call reset functions when initializing
devices. Since we are already registering them, calling qemu_system_reset()
should suffice. Actually, it is what happens when we reboot the machine,
and using the same process instead of a special case semantics will even
allow us to find bugs easier.
Furthermore, the fact that we initialize things like the cpu quite early,
leads to the need to introduce synchronization stuff like qemu_system_cond.
This patch removes it entirely. All we need to do is call qemu_system_reset()
only when we're already sure the system is up and running
I tested it with qemu (with and without io-thread) and qemu-kvm, and it
seems to be doing okay - although qemu-kvm uses a slightly different patch.
[ v2: user mode still needs cpu_reset, so put it in ifdef. ]
[ v3: leave qemu_system_cond for now. ]
Signed-off-by: Glauber Costa <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
The page 108 of the SPARC Version 8 Architecture Manual describes
that addcc and addxcc shall compute carry flag the same way.
The page 110 claims the same about subcc and subxcc instructions.
This patch fixes carry computation in corner cases and removes redundant code.
The most visible effect of the patch is enabling Solaris boot when using OBP.
Signed-off-by: Artyom Tarasenko <[email protected]>
[[email protected]: cleaned up formatting]
Signed-off-by: Blue Swirl <[email protected]>
This patch adds SHDC support (-sd sd.img, where sd.img is
larger than 1GB) to qemu.
Signed-off-by: Jason S. McMullan <[email protected]>
Signed-off-by: Andrzej Zaborowski <[email protected]>
You would only see this error on a fresh clone when srcdir == objdir. configure
will fail because roms/pcbios doesn't exist.
git submodule integration doesn't cleanup very well when switching between
branches so you'll get an roms/pcbios directory from normal operations if you
switch between old branches.
Thanks to a mistake in configure, if you build outside of srcdir, you'll also
get a valid roms/pcbios.
Signed-off-by: Anthony Liguori <[email protected]>
commit 71f4effce7
Author: Alexander Graf <[email protected]>
Date: Fri Oct 30 22:27:00 2009 +0100
Unbreak tap compilation on OS X
Broke the build on Linux due to a bad #if guard
Signed-off-by: Anthony Liguori <[email protected]>
Currently compiling the tap sources breaks on Mac OS X. This is because of:
1) tap-linux.h requiring Linux includes
2) typos
3) missing #includes
This patch adds what's necessary to compile tap happily on Mac OS X.
I haven't tested if using tap actually works, but I don't think that's a
major issue as that code was probably seriously untested before already.
I didn't split the patch, because it's only a few lines of code and
splitting is probably not worth the effort here.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
SeaBIOS is a port of pc-bios to GCC. Besides using a more modern tool chain,
SeaBIOS introduces a number of new features including PMM support, better
BEV and BCV support, and better PnP support.
Signed-off-by: Anthony Liguori <[email protected]>
This commit:
commit 97b15621
virtio: use qdev properties for configuration.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
makes a guest using virtio-net see an empty macaddr because we never
copy the macaddr into the location that virtio_net_get_config() uses.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Fixes a couple of issues with msix table access:
- With misbehaving guests, misaligned 4 byte access could overflow
msix table and cause qemu to segfault. Since PCI spec requires
host to only issue dword-aligned accesses, as a fix,
it's enough to mask the address low bits.
- Tables use pci format, not native format, and so
we must use pci_[sg]et_long on read/write.
Reported-by: Juan Quintela <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
wmb must be at least a compiler barrier, even without SMP.
Further, we likely need some rmb()/mb() as well:
I have not audited the code but lguest has mb(),
add a comment for now.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The context parameter in paio_submit isn't used anyway, so there is no reason
why block drivers should need to remember it. This also avoids passing a Linux
AIO context to paio_submit (which doesn't do any harm as long as the parameter
is unused, but it is highly confusing).
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Serial frames always start with a start bit.
This bit was missing in frame size calculation.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
* Allow any speed value which is defined for Linux
(and possibly other systems).
* Compare int values instead of double values.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Changes:
* We don't create/delete devices, we attach/detach them instead.
* The separate autofilter list is gone, we simply walk the list
of devices directly instead.
* Autofiltering is done unconditionally now. Non-auto device scan
code got dropped.
* Autofiltering turns off the timer if there is nothing to do, it
runs only in case there are unattached host devices.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Hook up usb_msd_init.
Also rework handling of encrypted block devices,
move the code out vl.c.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add a auto_attach field to USBDevice, which is enabled by default.
USB drivers can clear this field in case they do *not* want the device
being attached (i.e. plugged into a usb port) automatically after
successfull init().
Use cases (see next patches):
* attaching encrypted mass storage devices.
* -usbdevice host:...
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patchs adds infrastructure to handle -usbdevice via qdev callbacks.
USBDeviceInfo gets a name field (for the -usbdevice driver name) and a
callback for -usbdevice parameter parsing.
The new usbdevice_create() function walks the qdev driver list and looks
for a usb driver with a matching name. When a parameter parsing
callback is present it is called, otherwise the device is created via
usb_create_simple().
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The pc bios shows up in 'info roms' now.
Note that the BIOS is mapped to two places: The complete rom at the top
of the memory, and the first 128k at 0xe0000. Only the first place is
listed in 'info roms'.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The rom_add_vga() and rom_add_option() macros are transformed into
functions. They look at the new rom_enable_driver_roms variable
and only do something if it is set to non-zero, making vga+option rom
loading runtime option. pc_init() sets rom_enable_driver_roms to 1.
With this in place we can move the rom loading calls from pc.c to the
individual drivers.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
So I can add a tap-linux.c and use CONFIG_LINUX to pull it in
in Makefile
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Okay, this makes the tap options available on AIX even though there's
no support, but if we want to do it right we should have not compile
the tap code at all on AIX using e.g. CONFIG_TAP.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
If we tell the guest we support UFO and then migrate to host which
doesn't support it, we will find ourselves in grave difficulties.
Prevent this scenario by adding a flag to virtio-net's savevm format
which indicates whether the device requires host UFO support.
[v2:
- add has_ufo uint8_t field for ease of vmstate conversion
- use qemu_error()
]
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Enable UFO on the host tap device if supported and allow setting UFO
on virtio-net in the guest.
Signed-off-by: Sridhar Samudrala <[email protected]>
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
With the latest GSO/csum offload patches, any guest using an unpatched version
of dhclient (any Ubuntu guest, for instance), will no longer be able to get
a DHCP address.
dhclient is actually at fault here. It uses AF_PACKET to receive DHCP responses
but does not check auxdata to see if the packet has a valid csum. This causes
it to throw out the DHCP responses it gets from the virtio interface as there
is not a valid checksum.
Fedora has carried a patch to fix their dhclient (it's needed for Xen too) but
this patch has not made it into a release of dhclient. AFAIK, the patch is in
the dhclient CVS but I cannot confirm since their CVS is not public.
This patch, suggested by Rusty, looks for UDP packets (of a normal MTU) and
explicitly adds a checksum to them if they are missing one.
This allows unpatched dhclients to continue to work without needing to update
the guest kernels.
Signed-off-by: Anthony Liguori <[email protected]>
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We query the guest's feature set to see if it supports offload and,
if so, we enable those features on the tap interface.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This API allows virtio-net to enable various offload features on a
tap interface - e.g. to tell the host kernel it can pass up partial
checksums to userspace.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
With '-netdev tap,id=foo -nic model=virtio,netdev=foo' virtio-net can
detect that its peer (i.e. the tap backend) supports vnet headers
and advertise to the guest that it can send packets with partial
checksums and/or TSO packets.
One complication is that if we're migrating and the source host
supports IFF_VNET_HDR but the destination host doesn't, we can't then
stop the guest from using those features. In this scenario, we just
fail the migration.
[v2:
- add has_vnet_hdr uint32_t field for ease of vmstate conversion
- use qemu_error()
]
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
tap_receive_raw() always prepends a vnet header if IFF_VNET_HDR is
enabled.
tap_receive() only prepends when the a header is required but the NIC
doesn't supply one.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Use qemu_send_packet_raw to send gratuitous arp. This will ensure that
vnet header is handled properly.
Also, avoid sending the gratuitous packet to the guest. There doesn't
appear to be any reason for doing that and the code will currently just
crash if the NIC is not associated with a vlan.
Signed-off-by: Gleb Natapov <[email protected]>
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Trivial patch to allow supplying a receive_raw function.
A future cleanup should combine this function pointer parameters into a
table.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
In the case where a NIC and backend agree on a packet header format,
this API allows injecting packets which lack the agreed upon header.
We need this for sending our gratuitous ARP.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This allows for the addition of a raw flag, and leaves the way open
for other flags too.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
These lamely named functions allow virtio-net to query whether
IFF_VNET_HDR is enabled on a tap interface and inform the tap code
that virtio-net will supply packets with a vnet header.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This is so as to allow APIs which operate on specific client types
without having to add a function table entry which is only implemented
by a single client type.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This allows people to disable the IFF_VNET_HDR flag, e.g. for debugging
purposes or if they know they may migrate the guest to a machine without
IFF_VNET_HDR support.
It also allows making the lack of IFF_VNET_HDR support an error
condition, e.g. in the case where a guest is being migrated from a host
which does support it.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Re-factor things so that there is only one call site for
net_tap_fd_init().
Two concerns about the QemuOpts usage here - firstly, we set the script
arguments to their default value and, secondly, we set the ifname value
to the name allocated by the kernel if none is supplied. Are we okay
with such things ending up in writeconfig output?
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
For now, we just add an empty header before writing and strip the header
after reading.
We really only want IFF_VNET_HDR when virtio_net is using it, but it
would significantly complicate matters to try and do that. There should
be little or no performance impact with always adding headers.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
In future we will want to prepend a virtio_net header if the NIC didn't
supply one but IFF_VNET_HDR is enabled on the interface. This is most
easily achived by using writev() in all cases.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Making features dependent on the availability of newer versions if_tun.h
is going to get seriously clumsy, so let's just import the definitions
we need. It's only a small handful.
If and when we're comfortable depending on 2.6.30 headers, we can remove
this again.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Looks like these are just artifacts of vl.c being split up.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
It was merely a workaround and the real fix is done now.
This reverts commit ef845c3bf4.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Also for Linux AIO, don't call callbacks that don't belong to the active
AsyncContext.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Don't call callbacks that don't belong to the active AsyncContext.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
bdrv_read/write emulation is used as the perfect example why we need something
like AsyncContexts. So maybe they better start using it.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add the possibility to use AIO and BHs without allowing foreign callbacks to be
run. Basically, you put your own AIOs and BHs in a separate context. For
details see the comments in the source.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Instead of putting more and more stuff into vl.c, let's have the generic
functions that deal with asynchronous callbacks in their own file.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We'll leave some AIO completions unhandled when we can't call the callback.
qemu_aio_process_queue() is used later to run any callbacks that are left and
can be run then.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We need to process the request queue and run callbacks separately from reading
out the queue in a later patch, so split it out.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Errors are still directly printed, as we are only converting
regular output.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Error is still directly printed, as we are only converting
regular output.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Just sent <anything> as a buffer. We put the pointer and the size
code does the rest.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
For a start bypp is not changed after vmsvga_reset() and it depends on depth
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
It don't compile. And the trivial fixes (change vga.foo field to foo field
don't work either. No output
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
VMSTATE_SUB_ARRAY(..., start, num, ...) saves the num elems starting at
position start of the array
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
It allows to have 'things' in savevm format not backed in the device state
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This allows to define VMSTATE_SINGLE with VMSTATE_SINGLE_TEST
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Change pointer to struct by embedded struct.
Adjust all callers
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
It is used everywhere as uint8_t except in one place. Cast to uint16_t
in that place
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
It was used for Acer Pica 61 emulation, removed in 2008
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
If I am using vga and serial which is stdio and hit C-c on
serial console, qemu terminates. That is annoying for me.
So make it configurable whether signal is generated when C-c is hit.
Signed-off-by: Kusanagi Kouichi <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Changes:
- create common scsi_hot_add function for adding a scsi disk to
a adapter.
- Add sanity checks. You can't drive_add disks to the VGA any more.
- Ignore the unit value calculated by drive_init, add a comment
explaining why. Review the patch to find the details ;)
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Explicitly add the drive to the bus of the newly created scsi adapter
instead of hoping that scsi_bus_legacy_handle_cmdline() picks it up
correctly.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch adds a 'index' property to the isa-parallel and isa-serial
devices. This can be used to create devices with the default isa irqs
and ioports by simply specifying the index, i.e.
-device isa-serial,index=1
instead of
-device isa-serial,iobase=0x2f8,irq=3
for ttyS1 aka com2. Likewise for parallel ports.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The other pxe roms are loaded by the drivers individual drivers now.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Initialization path will work with both converted and not-converted
drivers, so we can convert drivers one by one.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Function test whenever a driver has a specific property.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add a new type for properties common to all nics.
Add helper functions and macros to deal with it.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Make the mac property use the newly added type for the mac address.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add new type for mac addresses.
Add function which sets the qemu default mac address if it finds the mac
address uninitialized (i.e. all zeros).
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Currently, after a migration qemu sends a broadcast packet to update
switches' MAC->port mappings.
Unfortunately, it picks a random (constant) ethertype and crosses its
fingers that no one else is using it.
This patch causes it to send a RARP packet instead. RARP was chosen for
2 reasons. One, it is always harmless, and will continue to be so even
as new ethertypes are allocated. Two, it is what VMware ESX sends, so
people who write filtering rules for switches already know about it.
I also changed the code to send SELF_ANNOUNCE_ROUNDS packets, instead of
SELF_ANNOUNCE_ROUNDS + 1, and added a simple backoff scheme.
Signed-off-by: Nolan Leake <nolan <at> sigbus.net>
Signed-off-by: Anthony Liguori <[email protected]>
On Wed, Sep 23, 2009 at 10:55:02PM +0200, Juergen Lock wrote:
> On Wed, Sep 23, 2009 at 09:31:16PM +0100, Laurence Tratt wrote:
>[...]
> > then the above error doesn't occur, but
> > pc-bios/optionrom/multiboot.S dies as follows:
> >
> > $
> > AS optionrom/multiboot.o
> > multiboot.S: Assembler messages:
> > multiboot.S:116: Error: `%es:-4(%edi)' is not a valid 16 bit base/index
> > expression
> > $
> >
> > What little Intel assembler I ever knew has long since departed from my
> > brain, so I don't know why that error occurs, nor what a fix might be.
> >
> It occurs because of too old binutils (as(1) in this case), on FreeBSD
> we now have a port for newer ones,
> http://www.freshports.org/devel/binutils
> so I depend on that and have the optionrom Makefile use the new as
> like this: (the first change wrt CFLAGS is unrelated and has probably
> been fixed in the meantime; it caused gmake to complain about
> recursive use of CFLAGS.)
>
> Index: qemu/pc-bios/optionrom/Makefile
> @@ -9,10 +9,13 @@
>
> CFLAGS = -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin
> CFLAGS += -I$(SRC_PATH)
> -CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector,"")
> +CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-stack-protector,"")
>
> build-all: multiboot.bin
>
> +%.o: %.S
> + $(CC) -E $(CFLAGS) -o - -c $< |${LOCALBASE}/bin/as -V -Qy -o $@
> +
> %.img: %.o
> $(call quiet-command,$(LD) -Ttext 0 -e _start -s -o $@ $<," Building $(TARGET_DIR)$@")
>
That patch didn't seem to help on OpenBSD so I now finally got around
making another one that just emits the bytes of the offending insn
instead so people can keep using old assemblers:
Signed-off-by: Anthony Liguori <[email protected]>
When using Linux AIO raw still falls back to POSIX AIO sometimes, so we should
initialize it.
Not initializing it happens to work if POSIX AIO is used by another drive, or
if the format is not specified (probing the format uses POSIX AIO) or by pure
luck (e.g. it doesn't seem to happen any more with qcow2 since we have re-added
synchronous qcow2 functions).
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
In case of failure, we haven't increased the refcount for the newly allocated
cluster yet. Therefore we must not free the cluster or its refcount will become
negative (and endless recursion is possible).
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
0) This is an attempt to get an issue in usb-linux.c, for which a patch
was posted about a year ago, finally fixed.
1) Mark Burkley submitted a "EHCI emulation module" for review in in
October 2008 (see:
http://lists.gnu.org/archive/html/qemu-devel/2008-10/msg01326.html). No
EHCI emulation module was ever committed to qemu.
2) Part of that (large) patch was a fix for a separate issue in
usb-linux.c. Max Krasnyansky has ACK'ed that fix (see:
http://lists.gnu.org/archive/html/qemu-devel/2008-11/msg00032.html).
3) I already asked whether this fix was ready to be committed in last
April (see:
http://lists.gnu.org/archive/html/qemu-devel/2009-04/msg01763.html)
4) Maybe submitting this fix as a separate patch (with a really long
commit message but without a Signed-off-by) and cc-ing everbody involved
will help if actually getting this issue fixed.
Paul Bolle
Signed-off-by: Anthony Liguori <[email protected]>
This patch makes make quiet again.
There is already a similar patch from Juan Quintela,
but maybe this shorter form is preferred.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch only moves about 150 lines of code from
function eepro100_cu_command to a new function action_command.
A goto statement was replaced by a for loop.
There are no functional changes. Nor did I change comments
starting with // (they will be removed by future patches).
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Current code is broken at least on recent compilers, comparison
between signed and unsigned types yield incorrect code and render
the neon shift helper functions defunct. This is the third revision
of this patch, casting all comparisons with the sizeof operator to
signed ssize_t type to force comparisons to be between signed integral
types.
Signed-off-by: Juha Riihimäki <[email protected]>
Acked-by: Laurent Desnogues <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Shift by immediate value is incorrectly overwritten by a temporary
variable in the processing of NEON vsri, vshl and vsli instructions.
This patch has been revised to also include a fix for the special
case where the code would previously try to shift an integer value
over 31 bits left/right.
Signed-off-by: Juha Riihimäki <[email protected]>
Acked-by: Laurent Desnogues <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
All other bits except for the EN in the VFP FPEXC register are defined
as subarchitecture specific and real functionality for any of the
other bits has not been implemented in QEMU. However, current code
allows modifying all bits in the VFP FPEXC register leading to
problems when guest code is writing 1's to the subarchitecture
specific bits and checking whether the bits stay up to verify the
existence of functionality which in fact does not exist in QEMU.
This patch has been revised to include the same behavior change in
the gdb register write function.
Signed-off-by: Juha Riihimäki <[email protected]>
Acked-by: Laurent Desnogues <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Add support for NEON vld1.64 and vst1.64 instructions. This patch is
revised to follow more closely the specification and raises
undefined exception if 64bit element size is used for vld2/vst2 or
vld4/vst4 instructions.
Signed-off-by: Juha Riihimäki <[email protected]>
Acked-by: Laurent Desnogues <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
In the existing code shift value is clobbered during the pass loop.
This patch changes the code so that it stores the intermediate
result in the target neon register directly and eliminates the need
to use a temporary to hold the intermediate value thus leaving the
shift value in the temporary variable intact. This is a new patch
in this version of the patch series.
Signed-off-by: Juha Riihimäki <[email protected]>
Acked-by: Laurent Desnogues <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
tmp4 and tmp5 temporary variables are allocated using tcg_const_i32
but incorrectly released using dead_tmp which will cause resource
leak tracking to report false leaks.
Signed-off-by: Juha Riihimäki <[email protected]>
Acked-by: Laurent Desnogues <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Current implementation of thumb mul instruction is implemented as a
32x32->64 multiply which then uses only 32 least significant bits of
the result. Replace that with a simple 32x32->32 multiply.
Signed-off-by: Juha Riihimäki <[email protected]>
Acked-by: Laurent Desnogues <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Revised patch for getting rid of tcg temporary variable leaks in
target-arm/translate.c. This version also includes the leak patch for
gen_set_cpsr macro, now converted as a static inline function, which I
sent earlier as a separate patch on top of this patch.
Signed-off-by: Juha Riihimäki <[email protected]>
Acked-by: Laurent Desnogues <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
lzcnt is a AMD Phenom/Barcelona added instruction returning the
number of leading zero bits in a word.
As this is similar to the "bsr" instruction, reuse the existing
code. There need to be some more changes, though, as lzcnt always
returns a valid value (in opposite to bsr, which has a special
case when the operand is 0).
lzcnt is guarded by the ABM CPUID bit (Fn8000_0001:ECX_5).
Signed-off-by: Andre Przywara <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
(INT32_MIN / -1) triggers an overflow, and the result depends on the
host architecture (INT32_MIN on arm, -1 on ppc, SIGFPE on x86). Use a
test to output the correct value.
Signed-off-by: Aurelien Jarno <[email protected]>
Acked-by: Laurent Desnogues <[email protected]>
The OPENED event gets sent also when qemu resets its state initially.
The consumers of the event aren't interested in receiving this event
on reset.
Patchworks-ID: 35288
Signed-off-by: Amit Shah <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The char event RESET is emitted when a char device is opened.
Give it a better name.
Patchworks-ID: 35287
Signed-off-by: Amit Shah <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
At init, qemu_chr_reset is always called with initial_reset_issued set to 1.
So checking for it to be set is not necessary.
Patchworks-ID: 35286
Signed-off-by: Amit Shah <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
No need to alias e300 core for each CPU package.
Differences between microcontrollers have to be implemented in a higher layer
than translate_init.c
Signed-off-by: Thomas Monjalon <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Add CPU declarations of MPC8343, MPC8343E, MPC8347 and MPC8347E.
Signed-off-by: Thomas Monjalon <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Declare HID2 register.
Use high BATs for e300 (8 instead of 4).
Fix index of high BATs registers.
Before the fix, IBAT4-7 were overwriting IBAT0-3.
Signed-off-by: François Armand <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
The goal is eventually to get rid of all cpu_T register usage and to use
just short-lived tmp/tmp2 registers. This patch converts all the places where
cpu_T was used in the Thumb code and replaces it with explicit TCG register
allocation.
Signed-off-by: Filip Navara <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Uninitialized register was used instead of proper TCG variable.
Signed-off-by: Filip Navara <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
The neon_trn_u8, neon_trn_u16, neon_unzip_u8, neon_zip_u8 and neon_zip_u16
helpers used fixed registers to return values. This patch replaces that with
TCG code, so T0/T1 is no longer directly used by the helper functions.
Bugs in the gen_neon_unzip register load code were also fixed.
Signed-off-by: Filip Navara <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
The encoding of 'IA' and 'DB' conditions was swapped.
SRS instruction must store banked SPSR instead of CPSR at the specific address.
Missing 'return' statement at the end of RFE handling.
Fixed write-back code to reference correct registers.
From: Hyeonsung Jang <[email protected]>
Signed-off-by: Filip Navara <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
The temporary variable cache in no longer need since tcg_temp_free was introduced.
Signed-off-by: Filip Navara <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Currently each read/write of ARM register involves a LD/ST TCG operation. This
patch uses TCG memory-backed registers to represent the ARM register set. With
memory-backed registers the LD/ST operations are transparently generated by TCG
and host registers could be used to optimize the generated code.
Signed-off-by: Filip Navara <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
everything needed to run SDL on a framebuffer device in the userspace emulator
Signed-off-by: Ulrich Hecht <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
prepare_binprm() zeroes bprm->buf. That buffer is already zeroed in
main() and hasn't been touched since so that is not necessary.
Signed-off-by: Paul Bolle <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
Swap __pad1 and st_blocks fields location to maintain proper alignment.
This fixes incorrect 'du' and 'stat' report on ppc guest.
Signed-off-by: Max Filippov <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
updated fallocate check to new configure, added dup3 check as suggested
by Jan-Simon Möller.
Riku: updated to apply to current git.
Signed-off-by: Ulrich Hecht <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
As i8259 in mips_jazz.c is not correctly connected to the isa bus, the
mc146818rtc isa devices fails to be created.
Signed-off-by: Roy Tam <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Add size checks to avoid overwriting the multiboot structure
when too many modules are loaded.
Patchworks-ID: 35700
Signed-off-by: Adam Lackorzynski <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Fix address specified for cmdline value of module in multiboot structure.
Patchworks-ID: 35699
Signed-off-by: Adam Lackorzynski <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Call MADV_MERGEABLE on guest memory allocations. MADV_MERGABLE will be
available starting in Linux 2.6.32. This system call registers a region of
virtual address space with Linux as a candidate for transparent memory
sharing.
Patchworks-ID: 35447
Signed-off-by: Izik Eidus <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Update the IRQ state and stop the poll timer on reset. Moreover,
register the reset function with qemu.
Patchworks-ID: 35462
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
When the synchronous read and write functions were dropped, they were replaced
by generic emulation functions. Unfortunately, these emulation functions don't
provide the same semantics as the original functions did.
The original bdrv_read would mean that we read some data synchronously and that
we won't be interrupted during this read. The latter assumption is no longer
true with the emulation function which needs to use qemu_aio_poll and therefore
allows the callback of any other concurrent AIO request to be run during the
read. Which in turn means that (meta)data read earlier could have changed and
be invalid now. qcow2 is not prepared to work in this way and it's just scary
how many places there are where other requests could run.
I'm not sure yet where exactly it breaks, but you'll see breakage with virtio
on qcow2 with a backing file. Providing synchronous functions again fixes the
problem for me.
Patchworks-ID: 35437
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Putting it right in the middle of the explanation for "-serial udp" probably
wasn't the best idea.
Patchworks-ID: 35603
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Not all placeholders in options descriptions had the @var tag on them. Add the
tag so that it's clearly visible that they are placeholders.
Patchworks-ID: 35602
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Currently, suboptions (i.e. something like file=file for -drive) are rendered
as @code, so we're losing any @var highlighting in the man pages.
Replace them by @option, so that you actually can see what is a placeholder and
what is meant verbatim.
Patchworks-ID: 35601
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
For NICs, net_init_client() returns the index into the NICInfo table.
qemu_opts_foreach() interprets non-zero as an error return an stops
iterating over the options.
So, if you have more than one '-net nic' on the command line, subsequent
'-net' options do not get processed.
Fix this by making net_client_init() only return non-zero if
net_init_client() returns an error.
Reported-by: Peter Lieven <[email protected]>
Patchworks-ID: 35736
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Now that we have re-factored the packet queue code, we can re-use
it for peer-to-peer also.
Patchworks-ID: 35520
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The packet queue code is fairly standalone, has some complex details and
easily reusable. It makes sense to split it out on its own. This patch
doesn't contain any functional changes.
Patchworks-ID: 35511
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Introduce a 'peer' member to VLANClientState as an alternative
to a vlan. The idea being that packets are transfered directly
from peer clients rather than going through a vlan.
Patchworks-ID: 35516
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Allows them to be cleaned up at shutdown.
This is pretty lame, but will eventually go away as we make vlans
the special case.
Patchworks-ID: 35518
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Same as for -net except for:
- only tap, user, vde and socket types are supported
- the vlan parameter is not allowed
- the name parameter is not allowed but the id parameter is
required
Patchworks-ID: 35517
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Allow net clients to be created which are not connected to any vlan.
This is needed by Gerd in order to allow adding -device nic, where
the absence of a vlan parameter will not imply vlan=0. Also needed
to allow adding a -netdevice option which doesn't connect the backend
to a vlan.
Patchworks-ID: 35513
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Just use the name field instead since we now use the id paramater as
the name, if supplied. Only implication with this change is that if
id is not supplied, the value of the name paramater is used as an
id.
Patchworks-ID: 35512
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Use id= in the same was as the current name= parameter; if both are
specified, id= is used.
Patchworks-ID: 35514
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Needed for e.g. looking up a file descriptor name using
monitor_get_fd() in net_init_tap()
Patchworks-ID: 35509
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Without this, I'm seeing a segfault when unpluging a NIC.
Cc: Gerd Hoffmann <[email protected]>
Patchworks-ID: 35519
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Once upon the time when QEMU hacking was fun
there was a brave knight who wanted to have
a driver for a special intel nic.
So he started by cloning ne2000.c which also
meant that the new born eepro100.c was
immediately three years old.
Other knights who also wanted to have fun and
take their part in the battle thought that it
would be a good idea to remove stupid code
which says "missing nic load, missing nic save".
They saved everything they saw, man and women,
ne2000 code and runtime address offsets, and
put all saved elements in a prison called
vm data.
When the first knight came back and noticed
the unhappy prisoners, he wanted to set them
free. But the keepers of the keys told him
that they would have to stay there forever
for compatibility reasons.
So our brave knight now takes a new effort
to save the souls of the poor prisoners by
removing their names.
Their bodies will have to rot in the dungeons
of compatibility forever, watched by the
keepers of the keys.
Patchworks-ID: 35635
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The SCSI-2 documentation suggests, that although the block
descriptor is optional for an arbitrary SCSI-2 device (chapter 8.2.10,
http://ldkelley.com/SCSI2/SCSI2/SCSI2/SCSI2/SCSI2-08.html )
it is mandatory for a disk: chapters 9.1.2, 9.3.3
( http://ldkelley.com/SCSI2/SCSI2/SCSI2/SCSI2-09.html ) don't say
"optional" any more, just "The block descriptor in the MODE SENSE
data describes the block lengths that are used on the medium."
v2: limit the number of sectors reported in the block descriptor to 24 bits.
Signed-off-by: Artyom Tarasenko <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Fix done instruction to resume with pc=tnpc, npc=tnpc+4
Signed-off-by: Igor V. Kovalenko <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
- for absolute mode, scale coordinates to the real device maximum values,
since some drivers (on Haiku and Linux at least) need them as such,
and the HID descriptor is boggus on some models anyway,
- keep the coordinates even when no button is pressed, on real tablet
the pen is sensed on the surface even without direct contact,
and drivers expect this,
- map left button to pressure according to what the Haiku driver wants,
- map the right button to the pen button,
- map the middle button to the eraser,
- use asynchronous reporting as the hid code does, stops the Haiku driver
(and probably others) from spending 50% cpu polling for changes.
Signed-off-by: François Revol <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
In case qemu_find_file fails try to open the file as-is.
Patchworks-ID: 35263
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Changes:
(1) register pstrcpy_targphys() in rom list, it is used for kernel
command lines by a number of architectures.
(2) add rom_ptr() function to get a pointer for applying changes
to loaded images. Needed for example to tell the linux kernel
where it finds the initrd image by updating the header.
(3) make sparc use rom_ptr for initrd setup.
booting sparc-test works now, and 'info roms' shows this:
(qemu) info roms
addr=0000000000000000 size=0x2a3828 mem=ram name="phdr #0: vmlinux-2.6.11+tcx"
addr=00000000007ff000 size=0x00000e mem=ram name="cmdline"
addr=0000000000800000 size=0x400000 mem=ram name="/root/qemu-test/sparc-test/linux.img"
addr=0000000070000000 size=0x0e4000 mem=rom name="phdr #0: /home/kraxel/projects/qemu/build-zfull/pc-bios/openbios-sparc32"
reboot via 'system_reset' works too.
Patchworks-ID: 35262
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Without this, kvm will hold the mutex while it issues its run ioctl,
and never be able to step out of it, causing a deadlock.
Patchworks-ID: 35359
Signed-off-by: Glauber Costa <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This moves the code that depens on slirp under CONFIG_SLIRP again.
Patchworks-ID: 35372
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We have split the functions that needed it for cmd646
Patchworks-ID: 35302
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch splits cmd646 specific code from pci.c.
This patch splits piix4 specific code from pci.c.
And compile new piix.o and cmd646.o when they are needed.
The only change that is not code movemet is removal of cmd646 specific parts
in bmdma_readb/writeb for piix.
Patchworks-ID: 35301
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We already have a PCIDevice at that point
Patchworks-ID: 35296
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Segmented translation through the CRIS MMU is only done for
accesses in kernel mode. In user-mode, all accesses are treated
as paged regardless of the mode config in RW_MM_CFG.
Signed-off-by: Edgar E. Iglesias <[email protected]>
Just like we call into pcnet_poll_timer on stop, we need to call it on
start to trigger the setup of the poll timer.
Patchworks-ID: 35313
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This state field was never used, simply remained 0. Drop it from the
PCNetState and update the save/restore code accordingly, keeping
backward compatibility.
Patchworks-ID: 35314
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Each CPU information is stored in a QDict and the returned
QObject is a QList of all CPUs.
The QDict contains the following information:
- "CPU": cpu index
- "current": "yes" or "no"
- "pc": current PC
- "halted": "yes" or "no"
The user output in the Monitor should not change and the
future monitor protocol is expected to emit something like:
[ { "CPU": 0, "current": "yes", "pc": 0x..., "halted": "no" },
{ "CPU": 1, "current": "no", "pc": 0x..., "halted": "yes" } ]
which corresponds to the following user output:
* CPU #0: pc=0x00000000fffffff0
CPU #1: pc=0x00000000fffffff0 (halted)
Patchworks-ID: 35352
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
On success return a QInt with the balloon's value.
This also introduces monitor_print_balloon() to print the
balloon information in the user protocol.
Please, note that errors are not being converted yet.
Patchworks-ID: 35351
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The returned data is always a QString.
Also introduces monitor_print_qobject(), which can be used as
a standard way to print QObjects in the user protocol format.
Patchworks-ID: 35350
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
It is important to note that it never fails, as big refactoring
of the virtio code would be needed to get the proper error code.
Patchworks-ID: 35349
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Appropriate error handling support will be needed to have
encrypted images working under the future machine protocol,
but this initial conversion will work with the current
user protocol.
Patchworks-ID: 35348
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
do_info() is special, its job is to call 'info handlers'.
This is similar to what monitor_handle_command() does,
therefore do_info() also has to distinguish among new and
old style info handlers.
This commit converts do_info() to the new QObject style and
makes the appropriate changes so that it can handle both
info handlers styles.
In the future, when all handlers are converted to QObject's
style, it will be possible to share more code with
monitor_handle_command().
This commit also introduces a new function called
monitor_user_noop(), it should be used by handlers which do
not have data to print.
This is the case of do_info().
Patchworks-ID: 35341
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit changes monitor_handle_command() to support old style
_and_ new style handlers.
New style handlers are protocol independent, they return their
data to the Monitor, which in turn decides how to print them
(ie. user protocol vs. machine protocol).
Converted handlers will use the 'user_print' member of 'mon_cmd_t'
to define its user protocol function, which will be called to print
data in the user protocol format.
Handlers which don't have 'user_print' defined are not converted
and are handled as usual.
Patchworks-ID: 35340
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This new struct member will store a pointer to a function that
should be used to output data in the user protocol format.
It will also serve as a flag to say if a given handler has already
been converted to the new QObject style.
Patchworks-ID: 35339
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commits adds a new union member to mon_cmd_t for command
handlers and convert monitor_handle_command() and qemu-monitor.hx
to use it.
This improves type safety.
Patchworks-ID: 35337
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit adds a union to mon_cmd_t for info handlers and
converts do_info() and info_cmds[] array to use it.
This improves type safety.
Next commit will convert command handlers.
Patchworks-ID: 35336
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This suite contains tests to assure that QList API works as expected.
To execute it you should have check installed and build QEMU with
check support enabled (--enable-check-utests) and then run:
$ ./check-qlist
Patchworks-ID: 35333
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
QList is a high-level data type that can be used to store QObjects
in a singly-linked list.
The following functions are available:
- qlist_new() Create a new QList
- qlist_append() Append a QObject to the list
- qlist_iter() Iterate over stored QObjects
Patchworks-ID: 35334
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
It is convenient that QDECREF() and QINCREF() accept the QObject
parameter to be NULL, so that we don't duplicate 'if' tests in
the callers.
Patchworks-ID: 35332
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
First user of new config-devices.mak
Patchworks-ID: 35198
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Generate config-devices.h for each target and config-all-devices.h for
common library. We don't want to name both config-devices.h to avoid
path problems
Patchworks-ID: 35195
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We generate config-devices.h from there automatically.
We need to do it in main Makefile, because we are going to need a main
Makefile for them.
Patchworks-ID: 35196
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add config.h file that includes config-target.h and config-host.h
Patchworks-ID: 35193
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
If config-host.mak dont' exist, we have exited in the check at
the beginning of the file.
Once here, move the bits to the else part of the test at the beginning of
the file.
Patchworks-ID: 35191
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Use timestamp based appreach to avoid not needed recompilation.
Add it to rules.mak
Many thanks to Paolo Bonzini for helpding the design, and the debug.
Patchworks-ID: 35190
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Include it directly in Makefile.target
Patchworks-ID: 35189
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Some callers test for != 0, some for < 0. Normalize to < 0.
Patchworks-ID: 35171
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
After qdev_init() fails, the device is gone. Failure to check runs a
high risk of use-after-free.
Patchworks-ID: 35166
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Callers don't check the return value anyway.
Patchworks-ID: 35172
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Like qdev_init(), but terminate program via hw_error() instead of
returning an error value.
Use it instead of qdev_init() where terminating the program on failure
is okay, either because it's during machine construction, or because
we know that failure can't happen.
Because relying in the latter is somewhat unclean, and the former is
not always obvious, it would be nice to go back to qdev_init() in the
not-so-obvious cases, only with proper error handling. I'm leaving
that for another day, because it involves making sure that error
values are properly checked by all callers.
Patchworks-ID: 35168
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
But do so only where it may actually fail. Leave the rest for the
next commit.
Patchworks-ID: 35167
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Before, every caller had to do this. Only two actually did.
Patchworks-ID: 35170
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Commit 22f84e73 added a qdev_init() missing on the path through
usb_host_device_open(), but that broke the path through
usb_host_auto_scan(), which already had one. Remove that one.
Patchworks-ID: 35169
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The arpl implementation in target-i386/translate.c uses cpu_A0
temporary across a brcond op. This patch fixes that issue.
Signed-off-by: Laurent Desnogues <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
This remove implicit rules + implicit variables.
Explicit rules like the generation of %.h and %.c from %.hx still works
as expected.
As an added bonus, now the output of make -d is readable.
As another added bonus, time spend on Makefiles is way smaller.
We run make -j3 in a fully compiled tree, and results are:
Before:
$ time make -j3
real 0m1.225s
user 0m1.660s
sys 0m0.253s
After:
$ time make -j3
real 0m0.422s
user 0m0.393s
sys 0m0.248s
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Move comment back next to main_system_bus to avoid confusion.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Making pci device cleanup msix automatically makes pci.c depend on
msix.c, which is IMO messy. Since devices do msix_init it's easy and
natural for them to also do msix_uninit.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
PCI load routine has to be called with size equal to 256 (otherwise it
will crash in weird ways). So assert this, making code clearer.
Also avoid dynamically sized array on stack - good for portability.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Cc: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Now that net_client_init() has no users, kill it off and rename
net_client_init_from_opts().
There is no further need for the old code in net_client_parse() either.
We use qemu_opts_parse() 'firstname' facitity for that. Instead, move
the special handling of the 'vmchannel' type there.
Simplify the vl.c code into merely call net_client_parse() for each
-net command line option and then calling net_init_clients() later
to iterate over the options and create the clients.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We need net_client_init_from_opts() exported for this
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Here is where we rely on qemu_opts_parse() to handle an empty string.
We could alternatively explicitly handle this here by using
qemu_opts_create() when we're not supplied any parameters, but its
cleaner this way.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Now that we've ported everything over to QemuOpts, we can kill off
all the cruft in net_client_init().
Note, the 'channel' type requires special handling as it uses a
format that QemuOpts can't parse
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Note, not incrementing nb_host_devs in net_init_dump() is intentional.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The net_vde_init() change is needed because we now pass NULL pointers
instead of empty strings for group/sock if they're not set.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Some parameters are not valid with fd=. Rather than having a separate
parameter description table for validating fd=, it's easir to just
check for those invalid parameters later.
Note, the need to possible lookup a file descriptor name from the
monitor is the reason why all these init functions are passed a Monitor
pointer.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The handling of guestfwd and hostfwd requires the previous changes
to allow multiple values for each parameter. The only way to access
those multiple values is to use qemu_opt_foreach().
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We use a table of network types to look up the initialization function
and parameter descriptions in net_client_init().
For now, we use QemuOpts for the 'none' and 'nic' types. Subsequent
patches port the other types too and the special casing is removed.
We're not parsing the full -net option string here as the type has
been stripped from the string, so we do not use qemu_opts_parse()
'firstname' facility. This will also be rectified in subsequent
patches.
No functional changes are introduced by this patch.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The first step in porting -net to QemuOpts. We do not include parameter
descriptions in the QemuOptsList because we use the first parameter to
choose which descriptions validate against.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Rather than overwriting a QemuOpt, just add a new one to the tail and
always do a reverse search for parameters to preserve the same
behaviour. We use this order so that foreach() iterates over the opts
in their original order.
This will allow us handle options where multiple values for the same
parameter is allowed - e.g. -net user,hostfwd=
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Several qemu command line options have a parameter whose value affects
what other parameters are accepted for the option.
In these cases, we can have an empty description table in the
QemuOptsList and once the option has been parsed we can use a suitable
description table to validate the other parameters based on the value of
that parameter.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Rather than making callers explicitly handle empty strings by using
qemu_opts_create(), we can easily have qemu_opts_parse() handle
empty parameter strings.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
qemu_opts_parse() gives a suitable error message in all failure cases
so we can remove the error message from the caller.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
qemu_opt_set() prints an error message in all failure cases, so
qemu_set_option() doesn't need to print another error.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The only way qemu_opts_create() can fail is if a QemuOpts with that id
already exists and fail_if_exists=1. In that case, we already print
an error which makes more sense than the one in qemu_opts_set().
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Diagnostic output goes to stderr, except when we're in a monitor
command, when it goes to the monitor instead.
config_error() implements this with a monitor argument: if it's
non-null, report there, else to stderr. This obliges us to pass the
monitor down various call chains, to make it available to
config_error().
The recently created qemu_error() doesn't need a monitor argument to
route output. Use it.
There's one user-visible difference: config_error() prepended "qemu: "
to a message bound for stderr. qemu_error() doesn't, which means the
prefix goes away with this commit. If such a prefix is desired for
stderr, then I figure it should be slapped on all error messages, not
just the ones that used to go through config_error().
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Propagating errors up the call chain is tedious. In startup code, we
can take a shortcut: terminate the program. This is wrong elsewhere,
the monitor in particular.
config_error() tries to cater for both customers: it terminates the
program unless its mon parameter tells it it's working for the
monitor.
Its users need to return status anyway (unless passing a null mon
argument, which none do), which their users need to check. So this
automatic exit buys us exactly nothing useful. Only the dangerous
delusion that we can get away without returning status. Some of its
users fell for that. Their callers continue executing after failure
when working for the monitor.
This bites monitor command host_net_add in two places:
* net_slirp_init() continues after slirp_hostfwd(), slirp_guestfwd(),
or slirp_smb() failed, and may end up reporting success. This
happens for "host_net_add user guestfwd=foo": it complains about the
invalid guest forwarding rule, then happily creates the user network
without guest forwarding.
* net_client_init() can't detect slirp_guestfwd() failure, and gets
fooled by net_slirp_init() lying about success. Suppresses its
"Could not initialize device" message.
Add the missing error reporting, make sure errors are checked, and
drop the exit() from config_error().
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
net_slirp_init() walks slirp_configs, and stops when it encounters one
that doesn't work. Instead of consuming slirp_configs members there,
consume them in the sole caller. This makes sure all are consumed.
Before, the tail starting with the non-working one was left in place,
where it made the next net_slirp_init() fail again.
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
zeroing a structure before using it is more common than zeroing after
using it. Also makes the setting of nd->used more obvious.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We now only assign strdup()ed strings to these fields, never static
strings.
aliguori: fix build for ppc_prep and mips_jazz
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add support for -ctrl-grab to use the right-ctrl button to grab/release
the mouse in SDL.
The multi-button ctrl-alt and ctrl-alt-shift grab buttons present an
accessibility problem to users who cannot press more than one button
at a time.
https://bugs.edge.launchpad.net/ubuntu/+source/qemu-kvm/+bug/237635
Signed-off-by: Dustin Kirkland <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Converting files using "qemu-img convert" onto logical volumes (or any
block device) you need to use the currently undocumented "host_device"
format. This patch adds the required documentation to the manpage.
Reported-by: Adrian Bridgett <[email protected]>
Signed-off-by: Adrian Bridgett <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch adds infrastructure to maintain memory regions which must be
restored on reset. That includes roms (vga bios and option roms on pc),
but is also used when loading linux kernels directly. Features:
- loading files is supported.
- passing blobs is supported.
- target address range is supported (for optionrom area).
- fixed target memory address is supported (linux kernel).
New in v2:
- writes to ROM are done only at initial boot.
- also handle aout and uimage loaders.
- drop unused fread_targphys() function.
The final memory layout is created once all memory regions are
registered. The option roms get addresses assigned and the
registered regions are checked against overlaps. Finally all data
is copyed to the guest memory.
Advantages:
(1) Filling memory on initial boot and on reset takes the same
code path, making reset more robust.
(2) The need to keep track of the option rom load address is gone.
(3) Due to (2) option roms can be loaded outside pc_init(). This
allows to move the pxe rom loading into the nic drivers for
example.
Additional bonus: There is a 'info roms' monitor command now.
The patch also switches over pc.c and removes the
option_rom_setup_reset() and load_option_rom() functions.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This is necessary to support OpenBSD 4.2 install, without
this change it triggers an assert.
Signed-off-by: Reimar Döffinger <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This reduce the impact on hosts that have addressing modes with limited
offsets. Suggested by Laurent Desnogues.
Signed-off-by: Aurelien Jarno <[email protected]>
Today host_devices have a create function, so they also need a create_options
field to prevent qemu-img from complaining.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
By making the error reporting include strerror(errno), it gives the user
a bit more indication as to why qemu failed. This is particularly
important for people running qemu as a non root user.
Signed-off-by: Justin M. Forbes <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Without this patch, qemu on windows crashes as soon
as a vnc client connects.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
There was a missmerge, and then we got a tail recursive call to cpu_post_load
without case base :)
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
It's qdev_create() specialized for PCI, so name it accordingly.
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Monitor command "pci_add ADDR nic model=MODEL" uses pci_nic_init() to
create the NIC. When MODEL is unknown or "?", this prints to stderr
and terminates the program.
Change pci_nic_init() not to treat "?" specially, and to return NULL
on failure. Switch uses during startup to new convenience wrapper
pci_nic_init_nofail(), which behaves just like pci_nic_init() used to
do.
Bonus bug fix: we now check for qdev_init() failing there.
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Before this patch, pci_nic_init() returns NULL when it can't find the
model in pci_nic_models[]. Except this can't happen, because
qemu_check_nic_model_list() just searched for model in
pci_nic_models[], and terminated the program on failure.
Repeating the search here is pointless. Instead, change
qemu_check_nic_model_list() to return the model's array index.
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Monitor command "pci_add ADDR storage ..." does its work in
qemu_pci_hot_add_nic(). It called pci_create(..., ADDR) to create the
device. That's wrong, because pci_create() terminates the program
when ADDR is invalid.
Use pci_get_bus_devfn() and pci_create_noinit() instead.
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Commit a414c306 converted all VGA devices to qdev. It used
pci_create_simple() for all devices, except for this one it used
pci_create(). That's wrong, because it uses PCI bus#0 regardless of
the bus argument. Fix by switching to pci_create_noinit().
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This is necessary to make FreeBSD recognize the device as 82557 - otherwise its
driver will use unsupported features and fail to work.
Signed-off-by: Reimar Döffinger <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Currently only one virtio_console device is supported. Trying to add
multiple devices fails and such failure should be reported back to the
qdev init functions.
Signed-off-by: Amit Shah <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
When initialising a device fails, show the name of the failing device.
The current behaviour is to silently exit on such errors.
Signed-off-by: Amit Shah <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
After qemu_free, the pointers for input and output
buffers are no longer valid, so set them to NULL
(most other calls of qemu_free in vnc.c use this
pattern, too).
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The idea of using assert() for input validation is rather questionable.
Let's remove it from eepro100, so that guests need to find more interesting
ways if they want to crash qemu.
This patch replaces asserts that are directly dependent on guest-accessible
data by other means of error handling.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch increases the maximum qcow2 cluster size to 2 MB. Starting with 128k
clusters, L2 tables span 2 GB or more of virtual disk space, causing 32 bit
truncation and wraparound of signed integers. Therefore some variables need to
use a larger data type.
While being at reviewing data types, change some integers that are used for
array indices to unsigned. In some places they were checked against some upper
limit but not for negative values. This could avoid potential segfaults with
corrupted qcow2 images.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
it's safe to call msix_write_config if msix
is disabled, so call it unconditionally on
pci config write.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Since cpu_register_phys_memory does not require size to be a multiple of
target page size, simply make msix page size 0x1000. Do this in msix,
reverting part of 5e520a7d50, as we no
longer have to pass target page around.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We don't require full pages in cpu_register_physical_memory,
except for RAM.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Reset BARs and a couple of other registers on bus reset, as per PCI
spec.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
refactor code slightly, adding symbolic constants and functions, and
using macros where possible. This will also make following reset
patches easier.
No functional changes.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
virtio pci registers its own reset handler, but fails to unregister it,
which will lead to crashes after device removal. Solve this problem by
switching to qdev reset handler, which is automatically unregistered.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add type safety to qdev reset handlers, by declaring them as
DeviceState * rather than void *.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Everything using standard isa I/O ports and IRQ windup is considerd
being an actual isa device. That are all serial_init() users except
mips_mipssim() which seems to have a non-standard IRQ windup.
baud rate is fixed at 115200 now as no caller passed in something else.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
isa-fdc is completely qdev-ified with this patch applied, all
configuration uses properties.
sysbus-fdc needs dma_channel config fixed. There is only one user
(mips_jazz) which uses dma channel 0. Can anyone knowing this
platform suggest how to deal with it? Is hardcoding fine?
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Allow adding unconnected host drives by specifying if=none like it is
possible with -drive. They can be put in use with drive attributes,
like this:
drive_add dummy if=none,id=mydisk,file=/some/disk.img
device_add virtio-blk-pci,drive=mydisk
which is the monitor aequivalent to these command line switches:
-drive if=none,id=mydisk,file=/some/disk.img
-device virtio-blk-pci,drive=mydisk
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
move pci device lookup into the "case IF_SCSI" section, so we
can do something else for other interface types.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Changes:
* drive_uninit() wants a DriveInfo now.
* drive_uninit() also calls bdrv_delete(),
so callers don't need to do that.
* drive_uninit() calls are moved over to the ->exit()
callbacks, destroy_bdrvs() is zapped.
* setting bdrv->private is not needed any more as the
only user (destroy_bdrvs) is gone.
* usb-storage needs no drive_uninit, scsi-disk will
handle that.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Switch over acpi-based PCI hotplug for pc over to the new
qdev-based pci hotplugging.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Create qdev infrastructure for pci hotplug. PCI bus implementations
must register a handler for hotplug. Creating a new PCI device will
automagically hot-plug it in case the PCI bus in question supports this.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Adds device_add and device_del commands. device_add accepts accepts
the same syntax like the -device command line switch. device_del
expects a device id. So you should tag your devices with ids if you
want to remove them later on, like this:
device_add pci-ohci,id=ohci
device_del ohci
Unplugging via pci_del or usb_del works too.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Hook into DeviceInfo->exit().
handle_destroy() must not free the state struct, this is handled
by the new usb_qdev_exit() function now.
qdev_free(usb_device) works now.
Fix usb hub to qdev_free() all connected devices on unplug.
Unplugging a usb hub works now.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
pci_unregister_device is static now and hooked into Devicestate->exit.
qdev_free(pci_device) works now.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This adds a exit callback for device destruction to DeviceInfo, so
we can hook cleanups into qdev device destruction.
Followup patches will put that into use.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Two bug fixes:
* When freeing a device we unregister even stuff we didn't register in
the first place because the ->init() callback failed.
* When freeing a device with child busses attached, we fail to zap the
child bus (and the devices attached to it).
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Recent changes made on_vcpu hit the abort() path, even with the IO thread
disabled. This is because cpu_single_env is no longer set when we call this
function. Although the correct fix is a little bit more complicated that that,
the recent thread in which I proposed qemu_queue_work (which fixes that, btw),
is likely to go on a quite different direction.
So for the benefit of those using guest debugging, I'm proposing this simple
fix in the interim.
Signed-off-by: Glauber Costa <[email protected]>
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Hopefully the last regression of 4c0960c0: KVM_SET_GUEST_DEBUG requires
properly synchronized guest registers (on x86: eflags) on entry.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Commit 56aebc8916 changed gdbstub in way
that debugging 32 or 16-bit guest code is no longer possible with qemu
for x86_64 guest CPUs. Since that commit, qemu only provides registers
sets for 64-bit, forcing current and foreseeable gdb to also switch its
architecture to 64-bit. And this breaks if the inferior is 32 or 16 bit.
No question, this is a gdb issue. But, as it was confirmed in several
discusssions with gdb people, it is a non-trivial thing to fix. So until
qemu finds a gdb version attach with a rework x86 support, we have to
work around it by switching the register layout as the guest switches
its execution mode between 16/32 and 64 bit.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Switch RTC emulations to the new host_clock instead of vm_clock by
default. This has the advantage that the emulated RTC will follow
automatically the host time while it might be tuned via NTP. vm_clock
can still be selected by passing '-rtc clock=vm' on the command line.
Note that some RTC emulations (at least M48T59) already use the host
time unconditionally while others (namely MC146818) do not. This patch
introduces the required infrastructure for selecting the base clock but
only converts MC146818 for now.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Deprecate -localtime, -setdate and -rtc-td-hack in favor of a new
unified command line switch:
-rtc [base=utc|localtime|date][,driftfix=none|slew]
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Despite its name QEMU_CLOCK_REALTIME is (normally) not using
CLOCK_REALTIME / the host system time as base. In order to allow also
non-trivial RTC emulations (MC146818) to follow the host time instead of
the virtual guest time, introduce the new clock type QEMU_CLOCK_HOST. It
is unconditionally based on CLOCK_REALTIME, thus will follow system time
changes of the host.
The only limitation of its current implementation is that pending
host_clock timers may not fire early if the host time is pushed forward
beyond their expiry. So far no urgent need to overcome this limitation
was identified, so it's left as simple as it is (expiry on next alarm
timer tick).
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
These constants select clocks, not timers. And init_timers initializes
clocks.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
If the user issues one of the following commands to the Monitor:
pci_add pci_addr=auto nic model=None
pci_add pci_addr=auto nic model=?
QEMU will exit, because the function used to perform sanity
checks (qemu_check_nic_model_list()) exits on error.
This function is used by the startup code, where it makes
sense to exit on error, but in the Monitor it doesn't.
Changing qemu_check_nic_model_list() to not exit on error
is not possible though, as it's used by the board init
code (the PC one), where all board specific code must have
void return.
The way I've chosen to fix this was to introduce a new function
called pci_nic_supported(), which checks if the NIC is supported
and returns true or false accordingly.
The new function is used only by the Monitor, it performs the
necessary check and returns an error in case the NIC is not
supported, thus qemu_check_nic_model_list()'s exit is never trigged.
The following should be observed:
1. Only the specified NIC is checked, the default one is assumed
to be supported
2. The NIC query command (model=?) won't work with pci_add, the
right way to do this with the Monitor is to add a new command
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
When we "free" a NICInfo structure, we can leak pointers, since we don't do
much more than setting used = 0.
We free() the model parameter, but we don't set it to NULL. This means that
a new user of this structure will see garbage in there. It was not noticed
before because reusing a NICInfo is not that common, but it can be, for
users of device pci hotplug.
A user hit it, described at https://bugzilla.redhat.com/show_bug.cgi?id=524022
This patch memset's the whole structure, guaranteeing that anyone reusing it
will see a fresh NICinfo. Also, we free some other strings that are currently
leaking.
This codebase is quite old, so this patch should feed all stable trees.
Signed-off-by: Glauber Costa <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Currently, our check for qemu_cpu_self only checks if there is a cpu
currently in execution (represented by cpu_single_env being set). While
this might be okay for tcg, it is certainly not okay for kvm, since multiple
cpus might be executing.
Instead, I propose we use pthread primitives to test if the caller thread is
the same as env->thread.
For tcg, it will have the same semantics as before, since all CPUStates will
point to the same thread, and we'll only have one in execution at a time.
Signed-off-by: Glauber Costa <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This brings bfd_boolean to the wonderful world of <stdbool.h>, it is needed
because it defines bdf_boolean as an enum with values true and false,
and some architectures use TRUE, FALSE and give problems when you try to use
<stdbool.h>
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This time, I add them in configure only if target compiler supports it
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Register all relevant fields of Musicpal device states with the VMState
framework. This involves a few type changes of state variables.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Stop the periodic timers of the PIT on reset, disabling via the control
register and invalid parameters.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The qdev_gpio conversion of 343ec8e caused come polarity mismatch of key
event pins and left an overly complex solution behind. Take this chance
and refactor the GPIO input system of the Musicpal, moving it closer to
reality:
- Instantiate all 32 GPIO input pins and do the routing only via
qdev_connect_gpio_out.
- Implement IMR and IER registers. They manage the GPIO pin IRQ. IMR
seems to enable IRQs on rising edges, IER on falling ones. At least
this matches what the Musicpal fireware require.
- Move key pin logic inversion from the GPIO layer to musicpal_key.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
They likely represent invalid queues that should be skipped. We already
do this for RX queues. Wish I had a spec...
Credits go to malc for analyzing the issue and suggesting this fix.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Don't even ask, being able to load/save between 64<->80bit floats should be forbidden
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We save more that fpus on that 16 bits (fpstt), we need an additional field
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This makes the savevm code correct, and sign extensins gives us exactly
what we need (namely, sign extend to 64 bits when used with 64bit addresess.
Once there, change 0x100000 for 1 << 20, that maks all a20 use the same syntax.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
They were saved as uint8_t already. To make things simpler, I just
reg == -1 used to indicate an error, I create LM832x_GENERAL_ERROR
with vale 0xff to represet it
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Just don't look. struct tm members are ints' and they are sent as uint16_t.
VMState code complains as it should. Have to create hacky int32_as_uint16
type. Don't ever think about copying it
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
its value is always the level of an interrupt, 0 or 1
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
They were using only with very small integers, and they are sent/read as
bytes. They can't become negative as far as I can see
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This one is needed for changees happening on fdc. It allows you to send
arrays of structs whose size we want to send it is another field with type
uint8_t. (If you have been able to read the whole sentence without
stoping for breathing, you can use it.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Now that we have version_id on post_load() we don't need the old load
function
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
In a later patch, we introduce pre_save() and post_save() functions.
The whole point of that operation is to change things in the state.
Without this patch, we have to remove the const qualifier in each
use with a cast
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This is a regression/bug caused by previous vga_cleanup. This fixes
Ubuntu installer reported by:
Pierre Riteau
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch corrects the following aspects of exception generation in
fxsave/fxrstor:
* Generate #GP if the operand is not aligned to a 16 byte boundary
* Generate #UD if the LOCK prefix is used
* For CR0.EM = 1 #NM is generated, not #UD
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Make an "#if 0"'d printf() in load_elf_binary() reflect what the actual
code does (see commit 3bc0bdcaad).
Signed-off-by: Paul Bolle <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
The new devices added here are still not functional -
partially because some patches are still missing,
partially because I cannot test them. Nevertheless
they belong to the same family and will be supported
by this driver some day.
As soon as they work, they will also be added to hw/pci.c.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
A lot of entries are unused (they were added by copy + paste
from other drivers during development of eepro100.c).
Removing them from nic_save, nic_load makes any
old saved status incompatible, so a new version
for the virtual machine data was needed, too.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
RDTSCP reads the time stamp counter and atomically also the content
of a 32-bit MSR, which can be freely set by the OS. This allows CPU
local data to be queried by userspace.
Linux uses this to allow a fast implementation of the getcpu()
syscall, which uses the vsyscall page to avoid a context switch.
AMD CPUs since K8RevF and Intel CPUs since Nehalem support this
instruction.
RDTSCP is guarded by the RDTSCP CPUID bit (Fn8000_0001:EDX[27]).
Signed-off-by: Andre Przywara <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
This adds support for the AMD Phenom/Barcelona's SSE4a instructions.
Those include insertq and extrq, which are doing shift and mask on
XMM registers, in two versions (immediate shift/length values and
stored in another XMM register).
Additionally it implements movntss, movntsd, which are scalar
non-temporal stores (avoiding cache trashing). These are implemented
as normal stores, though.
SSE4a is guarded by the SSE4A CPUID bit (Fn8000_0001:ECX[6]).
Signed-off-by: Andre Przywara <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
AMD CPUs featuring a shortcut to access CR8 even from 32-bit mode.
If you use the LOCK prefix with "mov CR0", it accesses CR8 instead.
This behavior is guarded by the CR8_LEGACY CPUID bit
(Fn8000_0001:ECX[1]).
Signed-off-by: Andre Przywara <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Currently zero extensions ops are implemented by a and op with a
constant. This is then catched in some backend, and replaced by
a zero extension instruction. While this works well on RISC
machines, this adds a useless register move on non-RISC machines.
Example on x86:
ext16u_i32 r1, r2
is translated into
mov %eax,%ebx
movzwl %bx, %ebx
while the optimized version should be:
movzwl %ax, %ebx
This patch adds ext{8,16,32}u_i{32,64} TCG ops that can be
implemented in the backends to avoid emitting useless register
moves.
Signed-off-by: Aurelien Jarno <[email protected]>
Make an "#if 0"'d printf() in load_elf_binary(), probably left to aid in
debugging, reflect what the actual code does. The current printf() will
only confuse those who "#if 1" it (it certainly confused me enough to
write this trivial patch).
Signed-off-by: Paul Bolle <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
If available, the Universally Unique Identifier library
is used by the vdi block driver.
Other parts of QEMU (vl.c) could also use it.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
MULTI_REQ is never defined, so it doesn't matter much, but since
we have an if statement there, let's add {} to clarify what it
should do if it's uncommented, and indent the code properly.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
OpenSolaris headers can't export madvise() with a sane set of #defines.
For background, see MySQL bug #7156 (http://bugs.mysql.com/bug.php?id=7156)
for discussion about Solaris header problems.
Signed-off-by: Blue Swirl <[email protected]>
Looks like linux-user code was correct, just unreadable: what it wanted
to do with "-=" was really assign a negative number, not decrement. Fix
up accordingly.
Reported-by: Laurent Desnogues <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Additional argument (whether to try poll mode) is only passed with
VOICE_ENABLE command.
Thanks to Markus Armbruster for noticing the potential breakage.
In the very least, a change like this requires discussion on the list.
The naming convention is goofy and it causes a massive merge problem. Something
like this _must_ be presented on the list first so people can provide input
and cope with it.
This reverts commit 99a0949b72.
Signed-off-by: Anthony Liguori <[email protected]>
Fix another place with =- to be "= -".
to avoid confusion with old-style "-="
(which we also have, and needs to be fixed).
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Put space between = and - assigning a negative number
to avoid confusion with old-style "-="
(which we also have, and need to be fixed).
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Put space between = and & when taking a pointer,
to avoid confusion with old-style "&=".
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Modern compilers do not parse "=-" as decrement:
you must use "-=" for that.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Modern compilers do not parse "=-" as decrement:
you must use "-=" for that. Same for "=+"/"+=".
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Put space between = and - assigning a negative number
to avoid confusion with old-style "-="
(which we also have, and needs to be fixed).
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Put space between = and * when dereferencing a pointer,
to avoid confusion with old-style "*="
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Put space between = and * when dereferencing a pointer,
to avoid confusion with old-style "*="
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Put space between = and & when taking a pointer,
to avoid confusion with old-style "&=".
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Fix breakage in the following conditions:
- use in-tree building
- build user targets after system targets
Signed-off-by: Blue Swirl <[email protected]>
* Use TRACE macro to allow different logging flags.
* Add new debugging messages and clean existing ones.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
This patch uses sxtb for ext8s_i32 and sxth for ext16s_i32 in ARM back-end.
Signed-off-by: Laurent Desnogues <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Use a long long integer constant to fix a compilation error (integer
constant is too large for 'long' type).
Use a better value for testing, as -1 makes the test pass even if
qi->value is of type uint32_t, float or double. This was suggested by
Reimar Döffinger <[email protected]>.
Also, make the test fail when qi->value is of type double or float by
casting qi->value to int64_t, to avoid value being promoted to the type
of qi->value.
Signed-off-by: Pierre Riteau <[email protected]>
Acked-by: Luiz Capitulino <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Currently do_wav_capture() path's argument type is 's' (string),
but it should be 'F' (filename), this way 'wavcapture' gets
command completion.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Currently do_commit() argument type is 's' (string), but it
should be 'B' (block), this way 'commit' gets command completion.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Compiled (on linux) all the targets, and it compiled as expected.
What platform needs this redefinition?
Later, Juan.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Replace:
if (-1 == foo())
with:
if (foo() == -1)
While this coding style is not in direct contravention of our currently
ratified CODING_STYLE treaty, it could be argued that the Article 3 of
the European Convention on Human Rights (prohibiting torture and "inhuman
or degrading treatment") reads on the matter.
[This commit message was brought to you without humour, as is evidenced
by the absence of any emoticons]
Signed-off-by: Mark McLoughlin <[email protected]>
Cc: Avi Kivity <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Only two disassemblers (alpha and sh4) were still using it. Just remove its
use there, and its aparations in dis-asm.h
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
This reverts commit fe6549dfd7.
tcg-runtime and host-utils are needed on 32 bit host and they are not part
of libqemu.a.
Thanks to Stefan Weil for reporting.
Signed-off-by: Blue Swirl <[email protected]>
We are using the vs structure when it was just freed. Classic use after free,
fix it.
Signed-off-by: Glauber Costa <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Changes:
* Re-add the 'dev->fd = fd;' line which the qdev patches dropped
by mistake.
* call qdev_init() so the newly created usb device is plugged into
a usb port and thus actually visible to the guest.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
This patch fixes the linking of generated blocks on an ARM host.
No need to say this brings a very nice speedup :-)
Signed-off-by: Laurent Desnogues <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Sparc64 alternate space load/store helpers expect 8 bit ASI value,
while wrasi implementation sign-extends ASI operand causing
for example 0x80 to appear as 0xFFFFFF80. Resulting value falls
out of switch in helpers and causes obscure load/store faults.
- correct wrasi by masking lower 8 bits of xor result
- use lower 8 bits of ASI register in helpers
Signed-off-by: Igor V. Kovalenko <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Now that MAX_OP_PER_INSTR has been increased to a safer value, removed
the target-mips specific workaround.
Signed-off-by: Aurelien Jarno <[email protected]>
The x86_64 ror instruction on a 32-bit host can generate up to 77 TCG
ops. Some more space should be left for opc that are added at the end
of the translation.
Thanks to Laurent Desnogues for the debugging help.
Signed-off-by: Aurelien Jarno <[email protected]>
This fixes compilation of linux-user with today qemu, please apply.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
The CPU state parameter is not used, remove it and adjust callers. Now we
can compile ioport.c once for all targets.
Signed-off-by: Blue Swirl <[email protected]>
Callers must pass ELF machine, byte swapping and symbol LSB clearing
information to ELF loader. A.out loader needs page size information, pass
that too as a parameter.
Extract prototypes to a separate file. Move loader.[ch] and elf_ops.h under hw.
Adjust callers. Also use target_phys_addr_t instead of target_ulong for
addresses: loader addresses aren't virtual.
Signed-off-by: Blue Swirl <[email protected]>
The extlh instruction on Alpha currently doesn't work properly.
It's a combination of a cut/paste bug (16 where it should be 32) as well
as a "shift by 64" bug.
Signed-off-by: Vince Weaver <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
pcm_ops.run_out now takes number of live samples (which will be always
greater than zero) as a second argument, every driver was calling
audio_pcm_hw_get_live_out anyway with exception of fmod which used
audio_pcm_hw_get_live_out2 for no good reason.
Signed-off-by: malc <[email protected]>
Well one problem seems to be the rx condition,
... if ((s->ier & UART_IER_RDI) && (s->lsr & UART_LSR_DR))
is not enough to trigger an irq, yet still causes the following
conditions not to be checked anymore at all.
Signed-off-by: Juergen Lock <[email protected]>
Acked-by: Jan Kiszka <[email protected]>
Acked-by: Stefano Stabellini <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
With this patch applied ide drives (when attached to a pci adapter) can
be created via -device, like this:
-drive if=none,id=mydisk,file=/path/to/disk.img
-device ide-drive,drive=mydisk,bus=ide.0,unit=0
Note that creating a master on ide1 doesn't work that way. That is a
side effect of qemu creating a cdrom automagically even if you don't
ask for it.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
This allows the ide bus being initialized without drives attached
and the drives being attached and initialization later on as
separate step.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Like pci_create_simple() but doesn't call qdev_init(), so one can
set properties before initializing the device.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
The serial ports should be present even if associated with a null device
as some firmware wants to initialize them.
Signed-off-by: Aurelien Jarno <[email protected]>
When creating null devices, there is no way to ensure the unicity of
the labels. Bail out with an error message instead.
Signed-off-by: Aurelien Jarno <[email protected]>
Don't call curses_resize() at the end of curses_display_init() as height
and width are not yet defined. It will be called later by code from
vl.c.
This save 250MB of memory when using -curses.
Signed-off-by: Aurelien Jarno <[email protected]>
Now that labels must be unique, the chr devices can't be opened anymore
within the serial port code (in case they are not already opened in
vl.c), as they end up with the same label. Instead opened so
non-assigned one directly in vl.c, with a different label.
This make MIPS Malta board emulation working again.
Signed-off-by: Aurelien Jarno <[email protected]>
Single-stepping branches on MIPS didn't work right, because the
generation of EXCP_DEBUG happened after the generation of the code to
exit the current TB. That is, given the code:
bne v0,v1,target
nop
...
target:
addu v0,v0,v1
1:
when you single-stepped through the NOP, execution wouldn't actually
halt until you reached the label `1'.
This patch corrects that and also changes single-stepping so that a
branch and its delay slot are executed as one instruction for the
purposes of single-stepping. This behavior is comparable to what other
MIPS tools (e.g. MIPSsim with MDI) do. GDB avoids placing breakpoints
in branch delay slots, so this change doesn't break anything on the GDB
side.
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Changes:
* added isa bus, hooked up to the system bus. Not sure this is correct,
but 'info pci' lists lists no pci-isa bridge in the machine ...).
* switches the default cpu to one which actually works.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Recent versions of the Linux kernel will not preempt CPU-intensive
tasks unless the clock used by sched_clock() works. On -M versatilepb
that's the 24MHz timer in the system controller. It's a very simple
timer, so implement it.
Signed-off-by: Daniel Jacobowitz <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Change "ERROR: configure was not able to found it" to
"ERROR: configure was not able to find it".
Signed-off-by: Sebastian Herbszt <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
While i386, x86_64 and Sparc64/OpenBSD still worked after
df70204db5, Sparc32 and Sparc64 Linux hosts
broke.
Partially revert the commit: make the restored code conditional to
!CONFIG_USER_PIE.
Signed-off-by: Blue Swirl <[email protected]>
a. Use SNDCTL_DSP_POLICY instead of SNDCTL_DSP_SETFRAGMENT
b. Add ability to open device in exclusive mode, thus bypassing vmix
Signed-off-by: malc <[email protected]>
Build uset targers as true PIE if user want to keep qemu
self-virtualizable.
v5:
- Split into to patches: drop link hack and add PIE support
- do not build PIE by default and drop toolchain check
v4:
- Add test for toolchain if it has proper PIE support
v3:
- One more pice of the hack was removed
- Description updated
v2:
- Add configure options do enable/disable PIE for usermode targets.
Disabling can be useful if you build uswing toolchain which has
broken PIE support. PIE for usermode targets enabled by default.
Signed-off-by: Kirill A. Shutemov <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
There is a link hack in linux-user which produces an executable that
looks like PIE, but always has text relocations since all object files
isn't position-independent (compiled without -fpic/-fpie). Dynamic loader
has to do more work to load a binary with text relocations.
The best way to keep this functionality is to build a true PIE without
text relocations.
Signed-off-by: Kirill A. Shutemov <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
We need to define _XOPEN_SOURCE and __EXTENSIONS__ macros in order to get
CMSG_ and TIOCWIN macros defined. But then _POSIX_C_SOURCE gets defined, which
is (incorrectly) used as an indicator for existence of posix_memalign() in osdep.c.
Signed-off-by: Blue Swirl <[email protected]>
Problem: Our file sys-queue.h is a copy of the BSD file, but there are
some additions and it's not entirely compatible. Because of that, there have
been conflicts with system headers on BSD systems. Some hacks have been
introduced in the commits 15cc923584,
f40d753718,
96555a96d7 and
3990d09adf but the fixes were fragile.
Solution: Avoid the conflict entirely by renaming the functions and the
file. Revert the previous hacks.
Signed-off-by: Blue Swirl <[email protected]>
Direct call to kvm_arch_get_registers() bypass logic in
cpu_synchronize_state()
Signed-off-by: Gleb Natapov <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We can't move fifo back to an embeded array because it needs to be aligned
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This naming was used in kvm tree, and is easier to remember
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
vmsd alone is not enugh, because we can have several structs saved with the same description (vmsd).
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
ticks_per_sec is a constant. There's no need to store it as a variable as it
never changes since our time is based on units.
Convert get_ticks_per_sec() to a static inline and move the constant into
qemu-timer.h. Remove all references to QEMU_TIMER_BASE so that we consistently
use this interface.
Signed-off-by: Anthony Liguori <[email protected]>
loadvm_state is called from: vl.c during startup, vmstart() is called after finishing loading. The other caller do_loadvm() does the call after a vm_stop(). At both places where we can be saving state we are stoped a few lines before
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
In previosu series I remove v2 support for RAM (that was the version that was
supported when SaveVM v3 appeared). Now we can't load RAM for any image saved in SaveVM v2, we can as well remove SaveVM v2 entirely.
Note: That SaveVM RAM was at v2 when General SaveVM support went from v2 to v3 makes talking about versions confusing at least
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
It don't work. It fails in this check
if (qemu_get_be32(f) != last_ram_offset)
With 512MB of ram, values were for me:
v = 20c00000 last_ram_offset = 20840000
Last time that some code changed that was this one.
commit 94a6b54fd6
Implement dynamic guest ram allocation.
(I.e. it has been broken since at least April)
Going back to the previous commit, ram load correctly, but vga screen gets
corrupted and ide don't load correctly. At this point I decide that removing
support is the only viable thing.
The last user of the ram_compress_* were RAM_SAVE_FLAG_FULL flag, but
that flag was never ever been stored in an image. Mark the flag obsolete
and remove the functions.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Now that monitor stopped using focus we can make it internal
to the mux driver.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
make the mux driver send mux_in and mux_out events when switching
focus while hooking up more handlers.
stop using CharDriverState->focus in monitor.c, track state using
the mux events instead. This also removes the implicit assumtion
that a muxed monitor allways has mux channel 0.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Lets put -chardev into use now. With this patch applied chardev:name is
accepted as chardev specification everywhere, i.e. now you can:
-chardev stdio,id=ttyS0
-serial chardev:ttyS0
which does the same as '-serial stdio".
Muxing can be done this way:
-chardev stdio,id=mux,mux=on
-serial chardev:mux
-monitor chardev:mux
You can mux more than two streams.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
While being at it: create a new inet_dgram_opts() function for udp setup,
so udp can handle IPv6 now.
new cmd line syntax:
-chardev udp,id=name,host=remotehost,port=remoteport,\
localaddr=bindaddr,localport=bindport
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
new cmd line syntax: you can add mux=1 to any chardev to enable muxing,
then attach it multiple times, like this:
-chardev pty,name=mux,mux=on
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
new cmd line syntax:
unix socket:
-chardev socket,id=name,path=/path/to/socket
tcp socket:
-chardev socket,id=name,host=hostaddr|ipaddr,port=portnr
server and nowait options work as usual. Alternatively you can use
server=[on|off] + wait=[on|off] syntax.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add inet_listen_opts(). Does the same as inet_listen(), but uses
QemuOpts. inet_listen() is a compatibility wrapper for
inet_listen_opts() now and should go away some day.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add inet_connect_opts(). Does the same as inet_connect(), but uses
QemuOpts. inet_connect() is a compatibility wrapper for
inet_connect_opts() now and should go away some day.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add unix_listen_opts(). Does the same as unix_listen(), but uses
QemuOpts. unix_listen() is a compatibility wrapper for
unix_listen_opts() now and should go away some day.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add unix_connect_opts(). Does the same as unix_connect(), but uses
QemuOpts. unix_connect() is a compatibility wrapper for
unix_connect_opts() now and should go away some day.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
start switching chardevs to QemuOpts. This patch adds the
infrastructure and converts the null device.
The patch brings two new functions:
qemu_chr_open_opts()
same as qemu_chr_open(), but uses QemuOpts instead of a
option char string.
qemu_chr_parse_compat()
accepts a traditional chardev option string, returns the
corresponding QemuOpts instance, to handle backward
compatibility.
The patch also adds a new -chardev switch which can be used to create
named+unconnected chardevs, like this:
-chardev null,id=test
This uses the new qemu_chr_open_opts. Thus with this patch alone only
the null device works. The other devices will follow ...
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
qemu-option.h has no protection against including it twice.
This patch adds the usual "#ifndef header" bits.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
looking for id= and creating a new QemuOpts instance is splitted from
the actual option parser code now, so the parser can be called from
other contexts too.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Use DO_UPCAST() instead of container_of() to go from PCIDevice to
I6300State. This ensures that PCIDevice is the first member of struct
I6300State.
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Hello,
In some cases bus driver can deassert "bus master" bit in PCI command
register. The driver will no longer be able to update related registers in
the device. Eventually it will cause QEMU to exit in "virtqueue_num_heads"
function.
Attached path that fixes the described issue.
Best regards,
Yan Vugenfirer.
>From 3fdafbdfad676ec8479dc073cff70bf356868bfe Mon Sep 17 00:00:00 2001
From: Yan Vugenfirer <[email protected]>
Date: Tue, 8 Sep 2009 10:08:14 -0400
Subject: [PATCH] VirtIO: Fix QEMU crash during Windows PNP tests
Signed-off-by: Anthony Liguori <[email protected]>
Add a new VIRTIO_BLK_F_WCACHE feature to virtio-blk to indicate that we have
a volatile write cache that needs controlled flushing. Implement a
VIRTIO_BLK_T_FLUSH operation to flush it.
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Instead stalling the VCPU while serving a cache flush try to do it
asynchronously. Use our good old helper thread pool to issue an
asynchronous fdatasync for raw-posix. Note that while Linux AIO
implements a fdatasync operation it is not useful for us because
it isn't actually implement in asynchronous fashion.
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
If we are flushing the caches for our image files we only care about the
data (including the metadata required for accessing it) but not things
like timestamp updates. So try to use fdatasync instead of fsync to
implement the flush operations.
Unfortunately many operating systems still do not support fdatasync,
so we add a qemu_fdatasync wrapper that uses fdatasync if available
as per the _POSIX_SYNCHRONIZED_IO feature macro or fsync otherwise.
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add a enable_write_cache flag in the block driver state, and use it to
decide if we claim to have a volatile write cache that needs controlled
flushing from the guest. The flag is off if cache=writethrough is
defined because O_DSYNC guarantees that every write goes to stable
storage, and it is on for cache=none and cache=writeback.
Both scsi-disk and ide now use the new flage, changing from their
defaults of always off (ide) or always on (scsi-disk).
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
initialize vectors for all vqs to VIRTIO_NO_VECTOR rather than 0 which
is a valid vector. This fixes migration which happened before driver
was loaded.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Reported-by: Amit Shah <[email protected]>
Tested-by: Amit Shah <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
commit bf011293fa made virtio-blk-pci not
PCI-compliant, since it makes region 0 (which is an i/o region)
size > 256, and, since PCI 2.1, i/o regions are limited to 256 bytes size.
When the ATA serial number feature is off, which is the default,
make the device spec compliant again, by making region 0 smaller.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Reported-by: Vadim Rozenfeld <[email protected]>
Tested-by: Vadim Rozenfeld <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
In usb-linux.c:usb_host_handle_control, we pass a 1024-byte buffer and
length to the kernel. However, the length was provided by the caller
of dev->handle_packet, and is not checked, so the kernel might provide
too much data and overflow our buffer.
For example, hw/usb-uhci.c could set the length to 2047.
hw/usb-ohci.c looks like it might go up to 4096 or 8192.
This causes a qemu crash, as reported here:
http://www.mail-archive.com/[email protected]/msg18447.html
This patch increases the usb-linux.c buffer size to 2048 to fix the
specific device reported, and adds a check to avoid the overflow in
any case.
Signed-off-by: Jim Paris <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Compilation for MIPS host (not part of official QEMU)
checks __mips_isa_rev which is not always defined.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
It is quite common for virtio-blk to submit more than one write request in a
row to the qemu block layer. Use bdrv_aio_multiwrite to allow block drivers to
optimize its handling of the requests.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
One performance problem of qcow2 during the initial image growth are
sequential writes that are not cluster aligned. In this case, when a first
requests requires to allocate a new cluster but writes only to the first
couple of sectors in that cluster, the rest of the cluster is zeroed - just
to be overwritten by the following second request that fills up the cluster.
Let's try to merge sequential write requests to the same cluster, so we can
avoid to write the zero padding to the disk in the first place.
As a nice side effect, also other formats take advantage of dealing with less
and larger requests.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The microblaze gives MMU faults priority. For stores we still
have a flaw that the value leaks to memory in the case of an
unaligned exception.
Signed-off-by: Edgar E. Iglesias <[email protected]>
* Correct PVR checks for masking off individual exceptions.
* Correct FPU exception code.
* Set EAR on unaligned and unassigned exceptions.
Signed-off-by: Edgar E. Iglesias <[email protected]>
Also split the isa bits into a separate source file, so we don't drag in
a dependency for isa-bus.o for machines which want ne2k_pci only.
Signed-off-by: Gerd Hoffmann <[email protected]>
Like isa_create_simple, but doesn't call qdev_init, so one can set
properties after creating and before initializing the device.
Signed-off-by: Gerd Hoffmann <[email protected]>
isa-bus owns the isa irqs now, so it can hand them out directly.
There is no need for the separate isa_connect_irqs step, drop it.
Also hard-code isa interrupts which can't be configured anyway.
Signed-off-by: Gerd Hoffmann <[email protected]>
Lot of ISA devices work at fixed addresses, so having iobase
as bus property doesn't make much sense. Devices which can
have different iobases will get a device property.
Also simply hard-code stuff which can't be configured anyway.
Signed-off-by: Gerd Hoffmann <[email protected]>
PCI device entries have to have a default version, not 2, because they are
used in the midle of other structures that can have _any_ version number.
We can't use proper versioning here until we have SubSections support.
Why we didn't noticed before? Because in a PC, the only device ported with
a version less that 2 is piix_pm, and for that one, default pci values are
right. If you use a virtio-console, you will see that its state it is not
loaded back.
Thanks to Amit Shah for reporting the problem and help debug the fix.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Doing this will make the vcpu ioctl be issued from the I/O thread, instead
of cpu thread. The correct behaviour is to call it from within the cpu thread,
as soon as we are ready to go.
Signed-off-by: Glauber Costa <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The RTC emulation does not set the IRQ flags independent of the IRQ enable bits.
The original MC146818A datasheet from 1984 notes:
"flag bits in Register C [...] are set independent of the
state of the corresponding enable bits in Register B"
Similar sections can be found in newer documentation e.g. in rtc82885.
Qemu and Bochs set the IRQ flags only if they are enabled,
which breaks drivers polling on them.
The following patch corrects this for the update-ended-flag in Qemu only.
It does not fix the handling of the other flags.
Signed-off-by: Bernhard Kauer <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
qemu-kvm: fix segfault when running kvm without /dev/kvm, falling back
to non-accelerated mode
We're seeing segfaults on systems without access to /dev/kvm. It
looks like the global kvm_allowed is being set just a little too late
in vl.c. This patch moves the kvm initialization a bit higher in the
vl.c main, just after options processing, and solves the segfaults.
We're carrying this patch in Ubuntu 9.10 Alpha. Please apply
upstream, or advise if and why this might not be the optimal solution.
Signed-off-by: Dustin Kirkland <[email protected]>
Move the kvm_init() call a bit higher to fix a segfault when
/dev/kvm is not available. The kvm_allowed global needs
to be set correctly a little earlier.
Signed-off-by: Dustin Kirkland <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We should set $linux_aio to 'no' if detection failed, otherwise
its contents will be empty, which is a bug as we test for 'yes'
or 'no'.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
gcc 4.3.2 throws warnings when DEBUG_BUFFERED_FILE is defined, because
we are using the wrong format specifiers to print size_t/ssize_t values.
Signed-off-by: Anthony Liguori <[email protected]>
When two AIO requests write to the same cluster, and this cluster is
unallocated, currently both requests allocate a new cluster and the second one
merges the first one when it is completed. This means an cluster allocation, a
read and a cluster deallocation which cause some overhead. If we simply let the
second request wait until the first one is done, we improve overall performance
with AIO requests (specifially, qcow2/virtio combinations).
This patch maintains a list of in-flight requests that have allocated new
clusters. A second request touching the same cluster is limited so that it
either doesn't touch the allocation of the first request (so it can have a
non-overlapping allocation) or it waits for the first request to complete.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The wrong version of the preallocation patch has been applied, so this is the
remaining diff.
We can't use truncate to grow the image file to the right size because we don't
know if metadata has been written after the last data cluster. In this case
truncate would shrink the file and destroy its metadata. Write a zero sector at
the end of the virtual disk instead to ensure that the file is big enough.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
With cc-option we are testing if gcc just accept a particular option, we don't need CFLAGS at all. And this fixes the recursive problem with CFLAGS
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Here's a patch to fix the issue introduced by me, as Reimar Döffinger pointed out,
Reimar Döffinger wrote:
> On Thu, Aug 13, 2009 at 03:01:20PM +0300, Naphtali Sprei wrote:
>> Bug fix for segfault when run as i82551 HW:
>> Use Extended TBD only when HW supports it (i82558 and up).
>>
>> Added assertions to guard from such buffer overflow
>> Introduce the MAX_TCB_BYTE_COUNT macro
>> Allocate buf big enough as HW needs (MAX_ETH_FRAME_SIZE -> MAX_TCB_BYTE_COUNT)
>>
>>
>> I don't feel 100% OK with the "s->device >= i82558B" condition
>> since it relies on the numeric (hex) value of those defines, which currently
>> is correct, but changes (which I don't forsee now) might break it.
>
> It seems this was applied. Unfortunately this breaks things on FreeBSD.
> There seem to be multiple issues.
> First, the intel document says the 82551, 82550, 82559 models are all
> supersets of the 82558. Or in other words: they all support this
> feature.
> Only the 82557 does not.
> But then even for that the FreeBSD driver will fail.
> The reason for that is this line:
> eeprom_contents[0xa] = 0x4000;
> the value here must be 0x01000 for all 82557 models it seems.
Correct the logic of determining devices that supports
extended TxCB: only the 82557 do not support it.
Signed-off-by: Naphtali Sprei <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
one place is using strdup() instead of qemu_strdup
Fix it
Signed-off-by: Jean-Christophe Dubois <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
There are few places in vl.c not using the qemu version of
malloc/free/strdup.
Fix it.
Signed-off-by: Jean-Christophe Dubois <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
vl.c will not link if CONFIG_KVM is not defined.
This patch fixes the problem.
Signed-off-by: Jean-Christophe Dubois <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
PATH_MAX is used elsewhere in the qemu source tree without protection.
In addtion the actual code would not compile if PATH_MAX is not defined
Last the free() call is wrong as p is not malloc()ed.
Signed-off-by: Jean-Christophe Dubois <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
* Use function pci_config_set_device_id
* Use new macro PCI_DEVICE_ID_INTEL_82557
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
* Add missing include for struct timeval.
* Replace non-portable strsep by local qemu_strsep.
* Use POSIX basename by including libgen.h.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The company which made Virtual PC was Connectix.
They use the magic string "conectix" in their disk images.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Full coverage with properties and everything. You can add virtual usb
sticks this way now:
-drive if=none,id=pendrive,path=/some/where
-device usb-storage,drive=pendrive
-usbdevice disk:/path/to/image continues to work.
Other side effects:
usb storage is listed in 'info block' now.
kvm tree should be able to boot from usb via extboot (untested though).
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Drop num_ports argument for usb_ohci_init_pci(), everybody
calls it with num_ports == 3, so it is pointless.
Convert ohci pci device into qdev.
TODO: convert non-pci ohci adapters.
You can add a OHCI USB Controller to your virtual pc now using
'-device pci-ohci'. Specifying a id is a good idea, so you can
attach usb devices to it, like this:
-device pci-ohci,id=ohci
-device usb-mouse,bus=ohci.0
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Move usb code from vl.c to usb-bus.c and make it use the new data
structures added by qdev conversion. qemu usb core should be able
to handle multiple USB busses just fine now (untested though).
Kill some usb_*_init() legacy functions, use usb_create_simple()
instead.
Kill some FIXMEs added by the first qdev/usb patch.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
* Add USBBus.
* Add USBDeviceInfo, move device callbacks here.
* Add usb-qdev helper functions.
* Switch drivers to qdev.
TODO:
* make the rest of qemu aware of usb busses and kill the FIXMEs
added by this patch.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Simplify the logic to do everything inside the function.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Simplify the logic to do everything inside the function. Return 0xff if index is out of range independetly of DEBUG_CIRRUS
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Simplify the logic to do everything inside the function.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Simplify the logic to do everything inside the function.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Simplify the logic to do everything inside the function
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Simplify the logic to do everything inside the function
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
It is only used in mips softmmu, compile only there.
it_shift field was only used for vga_isa_mm, move it from VGACommonState
to ISAVGAMMstate.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Adjust all the VGAState in VGACommonState
Compile vga-isa.o in the targets that use it
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Adjust all the VGAState in VGACommonState
Compile vga-pci.o only for targets that use it.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Once there adjust VGAState <-> VGACommonState
Export vga_common_save/vga_common_load (nreeded by wmvare_vga
Remove vga.pci_dev field, it is not needed anymore
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Up to now "select without attention" was handled the same way as
"select with attention". According to
http://www.ibiblio.org/pub/historic-linux/early-ports/Sparc/NCR/NCR53C9X.txt
select without ATN sends the CDB (Command Descriptor Block) directly,
whereas select with ATN sends one message phase byte
followed by 6, 10, or 12 command phase bytes.
The attached patch implements the behaviour described above.
Signed-off-by: Artyom Tarasenko <[email protected]>
[[email protected]: cleaned up formatting]
Signed-off-by: Blue Swirl <[email protected]>
8baf73adf6 (qdev/isa: convert fdc)
breaks MIPS Malta:
Tried to create isa device isa-fdc with no isa bus present
Fix this by creating an isa bus for piix4.
This change also requires some more qdev related changes
(similar changes were applied to pc.c) and allows
cleaning of piix3/piix4 code.
Thanks to Gerd Hoffmann for his hints.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This suite contains tests to assure that QDict API works as expected.
To execute it you should have check installed and build QEMU with
check support enabled (--enable-check-utests) and then run:
$ ./check-qdict
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This file is used by the QDict stress test, it adds 5k nodes
on the dictionary and performs various operations.
My original file had 21k entries and almost 400k of size. After
some discussion with Eduardo Habkost, I decided to reduce the
size.
There are ways to generate this kind of data dynamically, but
it has its problems too.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This suite contains tests to assure that QString API works as expected.
To execute it you should have check installed and build QEMU with
check support enabled (--enable-check-utests) and then run:
$ ./check-qstring
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This suite contains tests to assure that QInt API works as expected.
To execute it you should have check installed and build QEMU with
check support enabled (--enable-check-utests) and then run:
$ ./check-qint
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Check is a unit testing framework for C.
All the QObjects have unit-tests and more will be written for the
future data types.
More info about check can be found at:
http://check.sourceforge.net/
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The 'i' argument type is for 32-bit only and most handlers
will use an 'int' to store its value.
It's better to fail gracefully when the user enters a value
greater than 32-bit than to get subtle casting bugs.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit drops all the code used to handle the 'args[]' array,
as now we use a dictionary to pass arguments.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
It's not used anymore, as QDict is now used to handle string
memory allocation/deallocation.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
GET_TLONG() and GET_TPHYSADDR() are not needed anymore, QInt can
handle such conversions.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
In order to help the integration with unit-tests and having a better
design, this commit splits monitor_handle_command() into two parts.
The parsing code is moved to a function called monitor_parse_command(),
while allocating memory and calling the handler is still done by
monitor_handle_command().
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit ports command handlers that receive ten arguments to use
the new monitor's dictionary.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Commit 79c4f6b080 added handler_8 and
handler_9 handling, but there isn't any command handler with those
number of arguments.
Just drop them.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit ports command handlers that receive seven arguments to
use the new monitor's dictionary.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit ports command handlers that receive six arguments to use
the new monitor's dictionary.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit ports command handlers that receive five arguments to use
the new monitor's dictionary.
Note that GET_TLONG() and GET_TPHYSADDR() macros are not used anymore.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit ports command handlers that receive four arguments to use
the new monitor's dictionary.
Note that GET_TLONG() and GET_TPHYSADDR() macros are not used anymore.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit ports command handlers that receive three arguments to use
the new monitor's dictionary.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit ports command handlers that receive two arguments to use
the new monitor's dictionary.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit ports command handlers that receive one argument to use
the new monitor's dictionary.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit ports command handlers that receive no arguments to use
the new monitor's dictionary.
It might seem no sense to do this, as the handlers have no arguments,
but at the end of this porting work all handlers will have the same
structure.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Command handlers will have to use QDict functions, so export
qdict.h through monitor.h.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
With this commit monitor_handle_command() will be able to setup a
QDict with arguments to command handlers.
However, the current 'args[]' method is still being used, next
changes will port commands to get their arguments from the dictionary.
Two changes are worth noting:
1. The '/' argument type always adds the following standard keys in the
dictionary: 'count', 'format' and 'size'. This way, the argument
name used in the 'args_type' string doesn't matter
2. The optional argument type '?' doesn't need to pass the additional
'has_arg' argument, hanlders can do the same check with qdict_haskey()
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Current handlers argument types, as defined in qemu-monitor.hx file,
are a sequence of chars where each one represents one argument type
of the command handler. The number of chars is also used to know how
many arguments a given handler accepts.
This commit defines a new format, which makes mandatory the use of
a name for each argument.
For example, do_eject() command handler is currently defined as:
{ "eject", "-fB", do_eject, ... }
With the new format it becomes:
{ "eject", "force:-f,filename:B", do_eject, ... }
This way the Monitor will be capable of setting up a dictionary, using
each argument's name as the key and the argument itself as the value.
This commit also adds two new functions: key_get_info() and
next_arg_type(), both are used to parse the new format.
Currently key_get_info() consumes the 'key' part of the new format and
discards it, this way the current parsing code is not affected by this
change.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Some functions exported to be used by the Monitor as command
handlers are also called in other places as regular functions.
When those functions got ported to use the Monitor dictionary
to pass argments, the callers will have to setup a dictionary
to be able to call them.
To avoid this problem, this commit add wrappers to those functions,
so that we change the wrapper to accept the dictionary, letting
the current functions as is.
The following wrappers are being added:
- do_help_cmd()
- do_pci_device_hot_remove()
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
QDict is a high-level dictionary data type that can be used to store a
collection of QObjects. A unique key is associated with only one
QObject.
The following functions are available:
- qdict_new() Create a new QDict
- qdict_put() Add a new 'key:object' pair
- qdict_get() Get the QObject of a given key
- qdict_del() Delete a 'key:object' pair
- qdict_size() Return the size of the dictionary
- qdict_haskey() Check if a given 'key' exists
Some high-level helpers to operate on QStrings and QInts objects
are also provided.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
QString is a high-level data type that can be used to represent
C strings.
The following functions are available:
- qstring_from_str() Create a new QString
- qstring_get_str() Get a pointer to the stored string
Note that qstring_get_str() is too low-level for a data type like
this, but it's interesting for quick read-only accesses.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
QInt is a high-level data type that can be used to represent integers,
internally it stores an int64_t value.
The following functions are available:
- qint_from_int() Create a new QInt
- qint_get_int() Get the stored integer
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This commit introduces the qobject.h header file, it contains
basic QObject definitions and helper macros.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
These variables are per bus, not per drive. Lets move them and
cleanup things a bit. And fix the cmd migration bug for real.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Rebased version of Anthony's patch: Allow to specify more than one
monitor terminal via the -monitor command line switch. This is
particularly useful when libvirt or some other management tool already
occupies the primary monitor but you need another one for debugging.
The current clumsy workaround is to multiplex such additional terminals
over a qemu character device (e.g. -serial mon:<device>).
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Ensure that packets enqueued for delayed delivery are dequeued in FIFO
order. At least one simplistic guest TCP/IP stack became unhappy due to
sporadically reordered packet streams.
At this chance, switch the send queue implementation to TAILQ.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
According to Documentation/kvm/api.txt, (and well, to common sense),
we should not be calling vcpu ioctls from within the iothread.
Since vcpu initialization issues a vcpu ioctl, move it a little bit
further in time to prevent it.
Signed-off-by: Glauber Costa <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
If we are using --serial telnet:0:5555,server or similar, ^C will not
kill qemu. We need to first connect using telnet, and the the ^C takes
effect.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
eepro100.c shouldn't have the need to do this in its local header file.
And I recently started getting this:
$ make -j3
...
CC x86_64-softmmu/eepro100.o
/home/amit/src/qemu/hw/eepro100.c:112: error: two or more data types
in declaration specifiers
/home/amit/src/qemu/hw/eepro100.c:112: warning: useless type name in
empty declaration
make[1]: *** [eepro100.o] Error 1
so just remove the typedef and include <stdbool.h> instead.
Signed-off-by: Amit Shah <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
extend QEMU's internal help and man page to cover the recently
added multi-core feature.
Signed-off-by: Andre Przywara <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We can't check the version in a substruct, it is not stored anywhere
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Now that we have all fields belonging to a PCIDevice, save each field
on the device that it belongs. This means moving pci_irq_levels
from PCII440FXState to PIIX3State.
Old formats are loaded, but we only save on the new saner format.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
With previous cleanups, now it is possible to put it where it belongs
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
i440fx_init will now work properly if we don't setup piix3
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Now mips_malta uses piix4 and pc's use piix_pci definitions
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The microblaze MMU can be synthesized in different configurations.
Have the MMU model show more respect to the chosen configuration.
Signed-off-by: Edgar E. Iglesias <[email protected]>
Raise illegal instruction exceptions when executing instructions that
require units not available on the particulare microblaze configuration.
Also trap priviliege violations made by userspace.
Signed-off-by: Edgar E. Iglesias <[email protected]>
audio/esdaudio.c: In function 'qesd_thread_out':
audio/esdaudio.c:136: error: format '%d' expects type 'int', but
argument 3 has type 'ssize_t'
audio/esdaudio.c: In function 'qesd_thread_in':
audio/esdaudio.c:366: error: format '%d' expects type 'int', but
argument 3 has type 'ssize_t'
Signed-off-by: Kirill A. Shutemov <[email protected]>
Signed-off-by: malc <[email protected]>
> ESP: Message Accepted (12)
> ESP: Transfer status (sense=0)
> ESP: read reg[5]: 0x20
> ESP: read reg[4]: 0x07
> ESP: read reg[7]: 0x02
> Extra scsi data. Fatal error.
It looks like "Message Accepted" shouldn't write a response. At least
ESP_RFLAGS must definetely be 0. With the following fix OBP goes one
step further:
Signed-off-by: Artyom Tarasenko <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
Starting with commit df7a86ed73,
mingw32 builds result in a compiler warning for dns_addr:
CC slirp/slirp.o
/home/stefan/src/qemu/savannah/qemu/slirp/slirp.c:50: warning: missing braces around initializer
/home/stefan/src/qemu/savannah/qemu/slirp/slirp.c:50: warning: (near initialization for ‘dns_addr.S_un’)
Removing the assignment fixes the warning without the need of special code
for mingw32 (and also saves some bytes in the resulting binary).
To fix another potential compiler warning, the missing 'static'
attribute was added.
The same changes were applied to dns_addr_time.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
This patch fixes linker errors when building QEMU without Linux AIO support.
It is based on suggestions from malc and Kevin Wolf.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Remove un needed casts from void *.
Use DO_UPCAST() instead of blind casts
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Once there, there is no way that we don't have a PCI Device at save/load time. Remove the check
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Currently the qemu user-mode networking stack reads the host DNS
configuration (/etc/resolv.conf or the Windows equivalent) only once
when qemu starts. This causes name lookups in the guest to fail if the
host is moved to a different network from which the original DNS servers
are unreachable, a common occurrence when the host is a laptop.
This patch changes the slirp code to read the host DNS configuration on
demand, caching the results for at most 1 second to avoid unnecessary
overhead if name lookups occur in rapid succession. On non-Windows
hosts, /etc/resolv.conf is re-read only if the file has been replaced or
if its size or mtime has changed.
Signed-off-by: Ed Swierk <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Three problems with our_addr:
- It's determined only once when qemu starts, but the address can change
(just like the DNS configuration can).
- It's supposed to be the IP address of a host network interface, but
there's no guarantee that gethostbyname(gethostname()) actually does
that: the host might be a laptop that has only a loopback interface up,
or the hostname might be localhost.localdomain, etc.
- It's useless at best: get_dns_addr() calls it, there's no reason to
send DNS requests to a different IP address if you're running a DNS
server on the host and resolv.conf points to 127.0.0.1.
These problems are easily solved by removing the code.
Signed-off-by: Ed Swierk <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
With that patch applied "-balloon virtio,args" becomes a shortcut for
"-device virtio-balloon-pci,args".
Side effects:
- ballon device gains support for id=<tag>.
- ballon device is off by default now.
- initialization order changes, which may in different pci slot
assignment depending on the VM configuration.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
create ide-microdrive.c and place microdrive support there.
only build ide-microdrive support for platforms using it.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
create ide-mmio.c and place mmio support there.
only build ide-mmio support for platforms using it.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
create ide-macio.c and place macio support there.
only build ide-macio support for platforms using it.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
create ide-pci.c and place pci bus support there.
only build ide-pci support for platforms using it.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Fix build (merge with isa mmio split)
create ide-isa.c and place isa bus support there.
only build ide-isa support for platforms using it.
also create ide.h header file.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
move lots of IDE defines to the new file.
also make a bunch of functions non-static
and add declaration for them. Needed by
the following patches of this series.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The current IDE code uses an array of two IDEState structs to maintain
the IDE bus. This patch adds a IDEBus to be used instead and does a
bunch of cleanups:
* move ide bus state from IDEState to IDEBus.
* drop a bunch of ugly pointer arithmetics to figure the active
interface, explicitly save the interface number instead.
* add helper functions to save/restore idebus state.
It also fixes a save/restore bug: loadvm allways stores the command in
the master's IDEState, even when it was saved from the slave.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Use the new qemu_error() function for virtio-blk-pci.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch adds some functions for error reporting to address the
problem that error messages should be routed to different destinations
depending on the context of the caller, i.e. monitor command errors
should go to the monitor, command line errors to stderr.
qemu_error() is a printf-like function to report errors.
qemu_errors_to_file() and qemu_errors_to_mon() switch the destination
for the error message to the specified file or monitor. When setting a
new destination the old one will be kept. One can switch back using
qemu_errors_to_previous(). i.e. it works like a stack.
main() calls qemu_errors_to_file(stderr), so errors go to stderr by
default. monitor callbacks are wrapped into qemu_errors_to_mon() +
qemu_errors_to_previous(), so any errors triggered by monitor commands
will go to the monitor.
Each thread has its own error message destination. qemu-kvm probably
should add a qemu_errors_to_file(stderr) call to the i/o-thread
initialization code.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Sorry folks, but it has to be. One more of these invasive qdev patches.
We have a serious design bug in the qdev interface: device init
callbacks can't signal failure because the init() callback has no
return value. This patch fixes it.
We have already one case in-tree where this is needed:
Try -device virtio-blk-pci (without drive= specified) and watch qemu
segfault. This patch fixes it.
With usb+scsi being converted to qdev we'll get more devices where the
init callback can fail for various reasons.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Hello,
the real world issue is that the hardware allows sends up to 2600 bytes,
and for some reason FreeBSD sometimes sends frames larger than the
ethernet frame size (102+1460 is the maximum I have seen so far),
overflowing the on-stack tx buffer of the driver.
Independent of that, the code should avoid allowing the guest to
overwrite the stack.
This is a minimal patch to fix the issue (you could leave out the size
change of the buf array as well, networking still seems to work either
way). Obviously there are better ways to handle it, but a proper fix IMO
would involve first getting rid of the code duplication and given the
number of patches pending for that code I see no point in working on that now.
Signed-off-by: Reimar Döffinger <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
If a flash file of size smaller than the flash size is specified in
the -pflash option, the block driver returns error. But the
pflash_cfi0x ignores the error. This results in a flash content of all
zeroes. And the simulation aborts while executing code.
This patch adds the checks for errors from bdrv_read and escalates it
to the calling code.
Signed-off-by: Vijay Kumar B. <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
cpu_synchronize_state() is a little unreadable since the 'modified'
argument isn't self-explanatory. Simplify it by making it always
synchronize the kernel state into qemu, and automatically flush the
registers back to the kernel if they've been synchronized on this
exit.
Signed-off-by: Avi Kivity <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
-watchdog NAME is now equivalent to -device NAME, except it treats
option argument '?' specially, and supports only one watchdog.
A side effect is that a device created with -watchdog may now receive
a different PCI address.
i6300esb is now available on any machine with a PCI bus, not just PCs.
ib700 is still PC only, but that could be changed easily.
The only remaining use of struct WatchdogTimerModel and
watchdog_add_model() is supporting '-watchdog ?'. Should be replaced
by searching device_info_list for watchdog devices when we can
identify them there.
Also fixes ib700 not to use vm_clock before it is initialized: in
wdt_ib700_init(), called from register_watchdogs(), which runs before
init_timers(). The bug made ib700_write_enable_reg() crash in
qemu_del_timer().
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The bdrv_aio_{read,write} routines can return a NULL pointer when the
I/O submission fails. Currently we ignore this and will wait forever
for an I/O completion and leading to a hang of the guest.
I can easily reproduce this using the native Linux AIO patch, but it's
also possible using normal pthreads-based AIO.
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Now that do have a nicer interface to work against we can add Linux native
AIO support. It's an extremly thing layer just setting up an iocb for
the io_submit system call in the submission path, and registering an
eventfd with the qemu poll handler to do complete the iocbs directly
from there.
This started out based on Anthony's earlier AIO patch, but after
estimated 42,000 rewrites and just as many build system changes
there's not much left of it.
To enable native kernel aio use the aio=native sub-command on the
drive command line. I have also added an option to qemu-io to
test the aio support without needing a guest.
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Currently the raw-posix.c code contains a lot of knowledge about the
asynchronous I/O scheme that is mostly implemented in posix-aio-compat.c.
All this code does not really belong here and is getting a bit in the
way of implementing native AIO on Linux.
So instead move all the guts of the AIO implementation into
posix-aio-compat.c (which might need a better name, btw).
There's now a very small interface between the AIO providers and raw-posix.c:
- an init routine is called from raw_open_common to return an AIO context
for this drive. An AIO implementation may either re-use one context
for all drives, or use a different one for each as the Linux native
AIO support will do.
- an submit routine is called from the aio_reav/writev methods to submit
an AIO request
There are no indirect calls involved in this interface as we need to
decide which one to call manually. We will only call the Linux AIO native
init function if we were requested to by vl.c, and we will only call
the native submit function if we are asked to and the request is properly
aligned. That's also the reason why the alignment check actually does
the inverse move and now goes into raw-posix.c.
The old posix-aio-compat.h headers is removed now that most of it's
content is private to posix-aio-compat.c, and instead we add a new
block/raw-posix-aio.h headers is created containing only the tiny interface
between raw-posix.c and the AIO implementation.
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
It isn't obvious what 'dvq' stands for. Since it's the output queue and
the corresponding input queue is called 'ivq', call this 'ovq'
Signed-off-by: Amit Shah <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Remove some redundant definitions for PCI classes:
PCI_CLASS_SERIAL_OTHER already exists as PCI_CLASS_COMMUNICATION_OTHER
and PCI_CLASS_PROCESSOR_CO is redefined.
PCI_CLASS_SERIAL_OTHER is not used anywhere.
Signed-off-by: Amit Shah <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This uses a run_after_load() function, and VMSTATE_PCI_DEVICE()
It could be made smaller changing the type of pm_io_space_update()
to return an int.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This uses a variant of buffer, with extra checks. Also uses the new
support for cheking that a read value is less or equal than a field.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We read the saved value and check that it is less or equal than the one
stored in the structure.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch adds support for static sized buffer and typecheks that the buffer is right.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch add supports for variable sized arrays whose size is
another field of the state.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We read the saved value and check that it is the same that the one
is stored in the structure.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch adds support for saving one VMStateDescription from other
VMStateDescription.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch adds support for saving arrays inside the struct
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch adds support for saving pointers to values
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch introduces VMState infrastructure, to convert the save/load
functions of devices to a table approach. This new approach has the
following advantages:
- it is type-safe
- you can't have load/save functions out of sync
- will allows us to have new interesting commands, like dump <device>, that
shows all its internal state.
- Just now, the only added type is arrays, but we can add structures.
- Uses old load_state() function for loading old state.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
do_loadvm() is now called from the monitor.
load_vmstate() is called by do_loadvm() and when -loadvm command line is used.
Command line don't have to play games with vmstop()/vmstart()
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This introduces a qemu-img create option for qcow2 which allows the metadata to
be preallocated, i.e. clusters are reserved in the refcount table and L1/L2
tables, but no data is written to them. Metadata is quite small, so this
happens in almost no time.
Especially with qcow2 on virtio this helps to gain a bit of performance during
the initial writes. However, as soon as create a snapshot, we're back to the
normal slow speed, obviously. So this isn't the real fix, but kind of a cheat
while we're still having trouble with qcow2 on virtio.
Note that the option is disabled by default and needs to be specified
explicitly using qemu-img create -f qcow2 -o preallocation=metadata.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Now with isa-bus maintaining the isa irqs we can move the
isa_connect_irq() calls into isa_create_simple().
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Introduce isa_reserve_irq() which marks an irq reserved and returns
the appropriate qemu_irq entry from the i8259 table.
isa_reserve_irq() is a temporary interface to be used to allocate ISA
IRQs for devices which have not yet been converted to qdev, and for
special cases which are not suited for qdev conversions, such as the
'ferr'.
This patch goes on top of Gerd Hoffmann's which makes isa-bus.c own
the ISA irq table.
[ added isa-bus.o to some targets to fix build failures -- kraxel ]
Signed-off-by: Jes Sorensen <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Changes:
(1) make isa-bus maintain isa irqs, complain when allocating
already taken irqs.
(2) note that (1) works only for isa devices converted to qdev
already (floppy and ps2/kbd/mouse right now), so more work
is needed to make this really useful.
(3) split floppy init into isa and sysbus versions.
(4) add sysbus->isa bridge & fix -M isapc breakage.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Bug fix for segfault when run as i82551 HW:
Use Extended TBD only when HW supports it (i82558 and up).
Added assertions to guard from such buffer overflow
Introduce the MAX_TCB_BYTE_COUNT macro
Allocate buf big enough as HW needs (MAX_ETH_FRAME_SIZE -> MAX_TCB_BYTE_COUNT)
I don't feel 100% OK with the "s->device >= i82558B" condition
since it relies on the numeric (hex) value of those defines, which currently
is correct, but changes (which I don't forsee now) might break it.
Signed-off-by: Naphtali Sprei <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Suppress the following compiler warning emitted by at least gcc version 4.2.1 (SUSE Linux)
and gcc version 3.4.5 (mingw32 special):
hw/pci-hotplug.c: In function 'pci_device_hot_add':
hw/pci-hotplug.c:102: warning: 'dinfo' may be used uninitialized in this function
hw/pci-hotplug.c:102: note: 'dinfo' was declared here
Signed-off-by: Sebastian Herbszt <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
* The code for option '-static' was wrong, so image creation
always created static images.
* Static images created with qemu-img did not set header entry
blocks_allocated.
* The size of the block map must be rounded to the next multiple
of SECTOR_SIZE, otherwise the block map is only read partially
for block map sizes which are not a multiple of SECTOR_SIZE.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
In addition to the TCG based qemu64 type let's introduce a kvm64 CPU type,
which is the least common denominator of all KVM-capable x86-CPUs
(based on Intel Pentium 4 Prescott). It can be used as a base type
for migration.
Signed-off-by: Andre Przywara <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The CPUID level determines how many CPUID leafs are exposed to the guest.
Some features (like multi-core) cannot be propagated without the proper
level, but guests maybe confused by bogus entries in some leafs.
So add level= and xlevel= to the list of -cpu options to allow the user to
override the default settings. While at it, merge unnecessary local
variables into one and allow hexadecimal arguments.
Signed-off-by: Andre Przywara <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Controlled by the enhanced -smp option set the CPUID bits to present the
guest the desired topology. This is vendor specific, but (with the exception
of the CMP_LEGACY bit) not conflicting, so we set all bits everytime.
There is no real multithreading support for AMD CPUs, so report cores
instead.
Signed-off-by: Andre Przywara <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Intel CPUs store the number of cores in CPUID leaf 4. So push
the maxleaf value to 4 to allow the guests access to this leaf.
Signed-off-by: Andre Przywara <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
For injecting multi-core and multi-threading CPU topology into guests
extend the -smp syntax to accommodate cores and threads specification.
Syntax: -smp smp_value[,cores=nr_cores][,threads=nr_threads]\
[,socket=nr_sockets][,maxcpus=max_cpus]
smp_value is the legacy value specifying the total number of vCPUs for
the guest. If you specify one of cores, threads or sockets this value
can be omitted. Missing values will be computed to fulfill:
smp_value = nr_cores * nr_threads * nr_sockets
where it will favour sockets over cores over threads (to mimic the
current behavior, which will only inject multiple sockets.)
So -smp 4,threads=2 will inject two sockets with 2 threads each,
-smp cores=4 is an abbreviation for -smp 4,cores=4,threads=1,sockets=1.
If max_cpus (the number of hotpluggable CPUs) is omitted, it will
be set to smp_value.
Signed-off-by: Andre Przywara <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Once there, move to a proper test to see if we are going to use it or not
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Extra error message is only given if --enable-kvm was given
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
All other features are named foo and enabled with --enable-foo.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Once there, remove extra check for package and output if bluez was found or not as the other features
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Dsound currently does not compile due to the typos in the code. This
patch makes it compile again.{PATCH}
Signed-off-by: Alex Ivanov <[email protected]>
Signed-off-by: malc <[email protected]>
Level 15 interrupts are broadcast to all CPUs, each CPU can clear the
interrupt using the local Clear Pending register.
Update intbit_to_level table.
Don't try to raise level 0 interrupts.
Calculate pending interrupts based on the separate inputs from master
register. Setting or resetting the pending level isn't correct because of
overlap of levels.
Level 14 is always used for CPU timer interrupts, remove the property.
Signed-off-by: Blue Swirl <[email protected]>
Conditional moves off fp condition codes were using the result of
get_fp_bit to isolate and test the relevant condition code. However,
get_fp_bit returns the bit number of the condition code, not a
bitmask. (Compare the use of get_fp_bit in gen_compute_branch1, for
instance.)
Fixed by shifting a bitmask into place using the result of get_fp_bit in
the relevant functions (gen_mov{ci,cf_s,cf_d,cf_ps}).
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
qemu's page table can be incomple if /proc/self/maps is unavailable or
host allocating a memory with mmap(), so we can't use it to find free
memory area.
New version mmap_find_vma() uses mmap() without MAP_FIXED to find free
memory.
Tested-by: Martin Mohring <[email protected]> :
quite some time ago this patch had been sent by Kirill to the QEMU ml.
At that time, the patch was rejected. Now we found out why the current
user mode memory allocator sometimes fails:
- Kernel Bug linux/fs/proc/task_mmu.c (fixed after 2.6.27)
http://bugzilla.kernel.org/attachment.cgi?id=17219
- use of proc file system to find memory mappings => bad idea
So I please apply the attached patch from Kirill to qemu to fix this
longstanding bug, because it causes all older linux distros (using
kernel 2.6.26 or older) to fail the QEMU memory allocator in user mode.
Signed-off-by: Kirill A. Shutemov <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
The fstat implementation does not initialize the nanosecond fields in the
stat buffer; this caused funny values to turn up there, preventing, for
instance, cp -p from preserving timestamps because utimensat rejected
the out-of-bounds nanosecond values. Resetting the entire structure
to zero fixes that.
Signed-off-by: Ulrich Hecht <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
works perfectly fine with the example from getdents(2) and passes the LTP
tests (tested with s390x on x86_64 emulation)
Signed-off-by: Ulrich Hecht <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
Fixes swaps on l_pid which were pretty much of random size. Implements
F_SETLEASE, F_GETLEASE. Now passes all LTP fcntl tests.
Signed-off-by: Ulrich Hecht <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
mqueue.h is only available if __NR_mq_open is defined. So don't include
it unconditionally. Similarly, the mq_* family of syscalls depend on
__NR_mq_open. Finally, the copy_{from,to}_user_mq_attr functions should
not be defined unconditionally, but only if we're going to use the mq_*
syscalls.
Signed-off-by: Nathan Froyd <[email protected]
Signed-off-by: Riku Voipio <[email protected]>
As setup_frame() and setup_rt_frame() are now implemented we can now
enable sigaltstack().
Signed-off-by: Laurent Vivier <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
This patch adds signals management for linux-user.
It implements setup_frame() which allows to call the user signal
handler.
setup_rt_frame() is always unimplemented.
Signed-off-by: Laurent Vivier <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
Straightforward implementation. This syscall is rare enough that we
don't need to support the odder cases, just disable it if host glibc
is too old.
Signed-off-by: Riku Voipio <[email protected]>
the encode_imm function in tcg/arm/tcg-target.c lacks shift declaration.
Laurent
Signed-off-by: Laurent Desnogues <[email protected]>
Signed-off-by: Andrzej Zaborowski <[email protected]>
The ne2k is an ancient card that performs pretty terribly under QEMU. In many
modern OSes, there is no longer drivers available for the ne2k.
Switch the default network adapter to e1000. This card is more widely
suppported and performs rather well under QEMU. There may be very old OSes
that had a ne2k driver but not an e1000 driver but I think this is likely the
exception.
I think the average user is better served with an e1000 vs ne2k.
Signed-off-by: Anthony Liguori <[email protected]>
These errors come up when compiling with gcc-4.3.3 and some older headers:
/scratch/froydnj/qemu.git/block/vpc.c: In function 'vpc_create':
/scratch/froydnj/qemu.git/block/vpc.c:514: error: value computed is not used
/scratch/froydnj/qemu.git/block/vpc.c:516: error: value computed is not used
/scratch/froydnj/qemu.git/block/vpc.c:517: error: value computed is not used
/scratch/froydnj/qemu.git/block/vpc.c:566: error: value computed is not used
Use memcpy to copy the strings instead of strncpy.
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
As requested by Anthony make pthreads mandatory. This means we will always
have AIO available on posix hosts, and it will also allow enabling the I/O
thread unconditionally once it's ready.
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
virtio-pci depends, and will always depend, on pci.c
so it makes sense to keep it in the same makefile,
(unlike the rest of virtio files which should eventually
be moved out to Makefile.hw).
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Notify users of the char interface whenever the file / connection is
closed.
Signed-off-by: Amit Shah <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
handle_cpu_signal is very nearly copy-paste code for each target, with a
few minor variations. This patch sets up appropriate defaults for a
generic handle_cpu_signal and provides overrides for particular targets
that did things differently. Fixing things like the persistent (XXX:
use sigsetjmp) should now become somewhat easier.
Previous comments on this patch suggest that the "activate soft MMU for
this block" comments refer to defunct functionality. I have removed
such blocks for the appropriate targets in this patch.
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
While reading Chris's code for fd migration I noticed the duplication
between QEMUFilePopen and QEMUFileStdio. This fixes it, and makes
qemu_fopen more similar qemu_popen.
Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
kqemu introduces a number of restrictions on the i386 target. The worst is that
it prevents large memory from working in the default build.
Furthermore, kqemu is fundamentally flawed in a number of ways. It relies on
the TSC as a time source which will not be reliable on a multiple processor
system in userspace. Since most modern processors are multicore, this severely
limits the utility of kqemu.
kvm is a viable alternative for people looking to accelerate qemu and has the
benefit of being supported by the upstream Linux kernel. If someone can
implement work arounds to remove the restrictions introduced by kqemu, I'm
happy to avoid and/or revert this patch.
N.B. kqemu will still function in the 0.11 series but this patch removes it from
the 0.12 series.
Paul, please Ack or Nack this patch.
Signed-off-by: Anthony Liguori <[email protected]>
Implement migration via unix sockets. While you can fake this using
exec and netcat, this involves forking another process and is
generally not very nice. By doing this directly in qemu, we can avoid
the copy through the external nc command. This is useful for
implementations (such as libvirt) that want to do "secure" migration;
we pipe the data on the sending side into the unix socket, libvirt
picks it up, encrypts it, and transports it, and then on the remote
side libvirt decrypts it, dumps it to another unix socket, and
feeds it into qemu.
The implementation is straightforward and looks very similar to
migration-exec.c and migration-tcp.c
Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Instead of calling the IOAPIC from the PIC, raise IOAPIC irqs via the ISA bus.
As a side effect, IOAPIC lines 16-23 are enabled.
Signed-off-by: Avi Kivity <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
A PC has its motherboard IRQ lines connected to both the PIC and IOAPIC.
Currently, qemu routes IRQs to the PIC which then calls the IOAPIC, an
incestuous arrangement. In order to clean this up, create a new ISA IRQ
abstraction, and have devices raise ISA IRQs (which in turn raise the i8259
IRQs as usual).
Signed-off-by: Avi Kivity <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
- still works if the build dir is not the src dir
- use find instead of *.c block/*.c etc...
Signed-off-by: Alexandre Bique <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Hi,
After discussing the issue with Avi, Gleb and a couple others on irq,
we came to the conclusion that it is preferred to have QEMU request
features from the BIOS, rather than notifying the BIOS that it is
running on QEMU or KVM. This way memory ranges can change etc. and
an older BIOS will continue to work on newer QEMU if it receives the
info as a fw_cfg value.
This one also matches what qemu-kvm does for irq0override, except I
haven't made it configurable. I leave that as an exercise for whoever
would be interested in switching off irq0override.
Thanks,
Jes
Set irq0 override in fw_cfg, informing the BIOS that QEMU expects
override on irq0. This matches qemu-kvm, and will help sharing a
single BIOS binary.
Signed-off-by: Jes Sorensen <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
For the lulz I implemented basic SMART functionality in ide.c. smartctl
on linux recognizes it just fine and starting self tests with it
complete successfully.
Signed-off-by: Brian Wheeler <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The error message for an unknown network device given to
monitor command set_link looks better with a terminating
linefeed.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
When trying to do detached migration with exec, I found that
the monitor wouldn't always return in a timely manner. I
tracked this down to exec_start_outgoing_migration. It
appeared we were setting the fd to NONBLOCK'ing, but in
point of fact we weren't.
This bugfix should also go onto the stable 0.10 branch
Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
If the user does not want autostart, they can specify -S.
Signed-off-by: Avi Kivity <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Hi all,
currently the vga screen_dump code doesn't use the DisplayState
interface properly and tries to replace it temporarily while taking the
screenshot.
A better approach is to register a DisplayChangeListener, call
vga_hw_update, and finally write the ppm in the next call from dpy_update.
Testing is appreciated.
Signed-off-by: Stefano Stabellini <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
qemu-system-arm (0.10.5) segfaults when invoked with a PXA machine target,
e.g. -M tosa. The reason is fairly obvious:
Signed-off-by: Torsten Duwe <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Andrzej Zaborowski <[email protected]>
Hello,
currently when a 32 bpp cursor gets defined the result is all-black in
the areas that are not transparent (you'll get a 32 bpp cursor if you
use my previous patch to allow vmware_vga to use a 32 bpp framebuffer).
This is because the switch in sdl.c lacks a 32 bpp case.
The thing I am unsure about though is which byte is the unused one and
should be skipped, the first or the last - for the black-and-white
cursors I tested it doesn't make a difference...
Signed-off-by: Reimar Döffinger <[email protected]>
Signed-off-by: Andrzej Zaborowski <[email protected]>
Hello,
for what I can tell, there is no way for vmware_vga to work correctly
right now. It assumes that the framebuffer bits-per-pixel and the one
from the DisplaySurface are identical (it uses directly the VRAM from
vga.c), but it always assumes 3 bytes per pixel, which is never possible
with the current version of DisplaySurface.
Attached patch fixes that by using ds_get_bits_per_pixel.
This change allows to define helpers returning pointers.
This looks like a typo in original commit.
Signed-off-by: [email protected]
Signed-off-by: Blue Swirl <[email protected]>
this patch handles all possible constants for immediate operand of ALU ops.
I'm not very satisfied by the implementation.
Laurent
Signed-off-by: Laurent Desnogues <[email protected]>
Signed-off-by: Andrzej Zaborowski <[email protected]>
Searching for "inspiration" to convert another device to qdev, I got
ac97. Once I understood a bit of qdev, found that ac97 used a not needed
indirection. To protect the unaware, just fixed it.
Later, Juan.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: malc <[email protected]>
Rely on the subpage system instead of the local version.
Make most functions "static".
Fix wrong parameter passed to ppc4xx_pob_reset.
Signed-off-by: Blue Swirl <[email protected]>
Based on 04a6dfebb6.
Adds support for qemu to modify target process environment
variables using -E and -U commandline switches. This replaces
eventually the -drop-ld-preload flag.
Signed-off-by: Blue Swirl <[email protected]>
commit 93c8cfd9e6
Author: Gleb Natapov <[email protected]>
Date: Sun Aug 2 11:36:47 2009 +0300
make windows notice media change
Broke save/restore by loading a new field but not saving it.
Signed-off-by: Anthony Liguori <[email protected]>
Second attempt failed due to $_ not being standard and as such it's
interpretation by certain shells when they were symlinked to /bin/sh
and invoked as such led to unpredictable results. So instead of trying
to be clever just use /bin/sh directly (That's what direct execution
would have led to anyway)
Hopefully this time nothing will break (Mingw?)
Thanks to Jordan Justen for report and analysis.
[Previous attempt (THISSHELL one) deserves a credit but reporter is
too humble]
Signed-off-by: malc <[email protected]>
http://www.opengroup.org/onlinepubs/7990989775/xbd/envvar.html
<quote>
SHELL
A pathname of the user's preferred command language
interpreter. If this interpreter does not conform to the XSI Shell
Command Language in the XCU specification, Shell Command Language,
utilities may behave differently from those described in this
specification set.
</quote>
So using shells for users who prefer csh variants is a no go.
Depending on what glibc/kernel headers you are compiling against,
PR_SET_NAME may or may not be defined. Do the right thing if
PR_SET_NAME isn't defined and skip setting the process name.
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
snprintf returns number of bytes needed for the output, not the number
of bytes actually written. Thus the math is wrong ...
Spotted by Markus Armbruster.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
There are DEFINE_PROP_$TYPE("name", struct, field, default) macros for
each property type. These macros link the qdev_prop_$name struct to the
type used by that property. typeof(struct->field) is verifyed to be the
correct one for the given property.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
Windows seems to be very stupid about cdrom media change. It polls
cdrom status and if status goes ready->media not present->ready
it assumes that media was changed. If "media not present" step doesn't
happen even if "medium may have changed" was seen it assumes media
haven't changed. Fake "media not present" step.
Filip Navara did a great job debugging this issue in Windows and this is
what he found out:
BINGO! ... The media present notifications were broken ever since
Windows 2000 it seems. The media change is detected properly and it's
passed to ClassSetMediaChangeState function which in turn calls
ClasspInternalSetMediaChangeState. This function is responsible for
changing some internal state of the device object and sending the PnP
events which later result in application notifications. It has this
tiny bit of code (not copied byte for byte):
if (oldMediaState == NewState) {
// Media is in the same state it was before.
return;
}
so the end result is that for the case of UNIT NEEDS ATTENTION /
MEDIUM MAY HAVE CHANGED without NOT READY in-between is really broken.
It results in the internal media change counter incremented, so the
media contents are re-read when necessary, instead of relying on the
cache, but the notifications to applications are never sent.
Signed-off-by: Gleb Natapov <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
Commit 751c6a1704 changed the monitor's
'commit' command to this behavior:
1. Any string you type as argument will cause do_commit() to
call bdrv_commit() to all devices
2. If you enter a device name, it will be the only one ignored
by do_commit() :)
The fix is to call bdrv_commit() to the specified device only and
ignore the others (when 'all' is not specified).
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
- One type 4 table is required per cpu. Add a check for this.
- Fix check for smbios file.
Changes from v1:
- static designation of smbios_validate_table, and remove whitespace
Signed-off-by: Beth Kon <[email protected]>
--
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
AUDIO_PT only changes LDFLAGS to include -pthread, but it change it in
Makefile, and audio files are linked only on Makefile.target
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
Use this to simplify Makefile.target and remove negative logic
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
Calculate its value in ./configure.
Put together all its uses
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
Now we have to variables: QEMU_CFLAGS: flags without which we can't compile
CFLAGS: "-g -O2"
We can now run:
make CFLAGS="-fbar" foo.o
make CFLAGS="" foo.o
make CFLAGS="-O3" foo.o
And it all should work.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
Instead of repeating the code through the file, create this two functions and
call them in all $cc invocations.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
Now, we compile all the tests with the values passed through the command
line.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
Fold its values into LDFLAGS and CFLAGS
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
Hi all,
currently vga always resizes the screen when vga_hw_invalidate is called
while this is not required and all the other graphic emulators don't.
This patch fixes it, making vga invalidate behaviour consistent with the
other emulated devices.
Signed-off-by: Stefano Stabellini <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
Hi all,
this patch fixes the sdl window resize event handler so that it doesn't
require the emulated graphic card (or console.c) to call
qemu_console_resize.
Signed-off-by: Stefano Stabellini <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
This patch introduces dynamic timer intervals: we slow down the refresh
rate when there in no much activity but we get back to a fast refresh
rate when the activity resume.
Please note that qemu_timer_expired is not an inline function any more
because I needed to call it from vnc.c however I don't think this change
should have any serious consequence.
Signed-off-by: Stefano Stabellini <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
This patch removes the server surface from VncState and adds a single
server surface to VncDisplay for all the possible clients connected.
Each client maintains a different dirty bitmap in VncState.
The guest surface is moved to VncDisplay as well because we don't need
to track guest updates in more than one place.
This patch has been updated to handle CopyRect correctly and efficiently.
Signed-off-by: Stefano Stabellini <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
This patch removes the timer per vnc client connected and adds a single
timer to update all the possible clients.
We call vga_hw_update only once in the timer handler.
Signed-off-by: Stefano Stabellini <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
The printf command takes an octal value after \, so we have to convert
our decimal representation to octal first and then write it.
This unbreaks extboot signing. Multiboot wasn't affected yet because
the checksum was < 8.
Spotted and first patch by Glauber Costa <[email protected]>.
Printf idea by Paolo Bonzini <[email protected]>.
Signed-off-by: Alexander Graf <[email protected]>
CC: Glauber Costa <[email protected]>
CC: Paolo Bonzini <[email protected]>
CC: Jan Ondrej <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
This is a new block driver written from scratch
to support the VDI format in QEMU.
VDI is the native format used by Innotek / SUN VirtualBox.
Latest changes:
* stripped down version
(code for synchronous operations and experimental code removed)
* don't open VDI snapshot images (with uuid_link or uuid_parent)
* modified vdi_aio_cancel
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
The old code resulted in wrong escape sequences:
#define CONFIG_QEMU_SHAREDIR "c:\Program Files\Qemu"
gcc warnings:
vl.c:5708:20: warning: unknown escape sequence '\P'
vl.c:5708:20: warning: unknown escape sequence '\Q'
Windows can handle slash (/) path separators,
and QEMU already adds directories using slash,
so there is no need to fight with the correct number
of backslashes.
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
First user of the new drive property. With this patch applied host
and guest config can be specified separately, like this:
-drive if=none,id=disk1,file=/path/to/disk.img
-device virtio-blk-pci,drive=disk1
You can set any property for virtio-blk-pci now. You can set the pci
address via addr=. You can switch the device into 0.10 compat mode
using class=0x0180. As this is per device you can have one 0.10 and one
0.11 virtio block device in a single virtual machine.
Old syntax continues to work. Internally it does the same as the two
lines above though. One side effect this has is a different
initialization order, which might result in a different pci address
being assigned by default.
Long term plan here is to have this working for all block devices, i.e.
once all scsi is properly qdev-ified you will be able to do something
like this:
-drive if=none,id=sda,file=/path/to/disk.img
-device lsi,id=lsi,addr=<pciaddr>
-device scsi-disk,drive=sda,bus=lsi.0,lun=<n>
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
Adds a (host) drive property, intended to be used by virtual disk
backend drivers.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
This adds a host drive, but doesn't implicitly add a guest drive for it.
First step in splitting host and guest configuration, check the
following patches to see how this can be used ...
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
Make -device switch use the QemuOpts framework.
Everything should continue to work like it did before.
New: "-set device.$id.$property=$value" works.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
One use case will be file for drives (no filename quoting issues), i.e.
-drive id=test,if=virtio
-set drive.test.file=/vmdisk/test-virtio.img
It will work for any other option (assuming handled by QemuOpts) though.
Except for id= for obvious reasons ;).
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
We can't use get_param_value(), it can't handle parameters without
'=' in there. Examples not working because of that:
-device foo,id=bar
-device file=/path/image,format=qcow2,snapshot,id=disk0
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
this patch fixes an issue in symfind.
Assume you have the following symbols:
Address Size
0045bca0 00000080 T s0
0045bd20 00000112 T s1
You'll notice that s1 is s0 + size.
So the current symfind will find that address 0045bd20 belongs to s0
instead of s1.
Laurent
Signed-off-by: Laurent Desnogues <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
Attached patch lets configure find xen headers and libs
with --extra-cflags and --extra-ldlfags option.
Signed-off-by: Christoph Egger <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
Use qemu_tolower() instead of tolower().
Fixes warning on NetBSD.
Signed-off-by: Christoph Egger <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Message-Id:
Use the FW_CFG interface to send user requested screen size and depth to
OpenBIOS like 7f1aec5f93 for ppc_oldworld.
Signed-off-by: Blue Swirl <[email protected]>
Use the FW_CFG interface to send user requested screen size and depth to
OpenBIOS like 7f1aec5f93 for ppc_oldworld.
Signed-off-by: Blue Swirl <[email protected]>
This patch uses the FW_CFG interface to send user requested screen size
and depth to openbios.
Signed-off-by: Laurent Vivier <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
tl and tsptr of members sparc64 cpu state must be changed
simultaneously to keep trap state window in sync with current
trap level. Currently translation of store to tl does not change
tsptr, which leads to corrupt trap state on corresponding
trap level.
This patch removes tsptr from sparc64 cpu state and replaces
all uses with call to helper routine.
Changes v0->v1:
- reimplemented helper routine with tcg generator
- on cpu reset trap type and pstate are populated with power-on reset
values, including tl=maxtl
Signed-off-by: [email protected]
Signed-off-by: Blue Swirl <[email protected]>
Enabling support for ppc64-linux-user should be easy enough to do later.
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: malc <[email protected]>
We handle conditional stores as an exception so we can ensure that no
other thread is changing memory out from underneath us.
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: malc <[email protected]>
We do this so we can check on the corresponding stc{w,d}x. whether the
value has changed. It's a poor man's form of implementing atomic
operations and is valid only for NPTL usermode Linux emulation.
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: malc <[email protected]>
We only need to make sure that the clone syscall looks like it
succeeded, not clobber 60% of the register set.
Signed-off-by: Nathan Froyd <[email protected]>
Signed-off-by: malc <[email protected]>
If translation block is interrupted by e.g. mmu exception
we need to compute conditional flags for inclusion into
saved cpu state. Otherwise after return from trap
conditional instructions would use stale psr/xcc data.
Signed-off-by: [email protected]
--
Kind regards,
Igor V. Kovalenko
Once again, the emulation of the EERD and ICS registers in e1000.c is
incorrect. Nobody has noticed this before because none of the Intel-written
e1000 drivers use these registers, and all of the independently written open
source drivers copy Intel's example, so they don't use them either.
Regardless, these registers are documented in the programmer's manuals, and
their emulated behavior doesn't match the verified behavior of real hardware,
so any software that does use them doesn't function correctly.
-Bill
Signed-off-by: Bill Paul <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
It works much better when parse_option_number actually
returns the number parsed ...
Common breakage resulting from this bug is that
'qemu -hda foo.img -cdrom bar.iso' stops working
(cdrom isn't there).
Cc: Avi Kivity <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
When a VM state change handler changes VM state, other VM state change
handlers can see the state transitions out of order.
bmdma_map(), scsi_disk_init() and virtio_blk_init() install VM state
change handlers to restart DMA. These handlers can vm_stop() by
running into a write error on a drive with werror=stop. This throws
the VM state change handler callback into disarray. Here's an example
case I observed:
0. The virtual IDE drive goes south. All future writes return errors.
1. Something encounters a write error, and duly stops the VM with
vm_stop().
2. vm_stop() calls vm_state_notify(0).
3. vm_state_notify() runs the callbacks in list vm_change_state_head.
It contains ide_dma_restart_cb() installed by bmdma_map(). It also
contains audio_vm_change_state_handler() installed by audio_init().
4. audio_vm_change_state_handler() stops audio stuff.
5. User continues VM with monitor command "c". This runs vm_start().
6. vm_start() calls vm_state_notify(1).
7. vm_state_notify() runs the callbacks in vm_change_state_head.
8. ide_dma_restart_cb() happens to come first. It does its work, runs
into a write error, and duly stops the VM with vm_stop().
9. vm_stop() runs vm_state_notify(0).
10. vm_state_notify() runs the callbacks in vm_change_state_head.
11. audio_vm_change_state_handler() stops audio stuff. Which isn't
running.
12. vm_stop() finishes, ide_dma_restart_cb() finishes, step 7's
vm_state_notify() resumes running handlers.
13. audio_vm_change_state_handler() starts audio stuff. Oopsie.
Fix this by moving the actual write from each VM state change handler
into a new bottom half (suggested by Gleb Natapov).
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
When sending a copyrect command to the vnc client, we must also update
the local server surface. Otherwise the server's and the client's idea
of the screen content run out of sync and screen updates don't work
correctly.
Signed-off-by: Anthony Liguori <[email protected]>
These are now unused.
However, perhaps the idea is that when we add -device, they will be
useful? In that case, we should add virtio-net-pci-0-10 too.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We have the pc-0.10 machine type now which does exactly the same
thing.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Since migration returns right away, starting the VM right
after calling qemu_start_incoming_migration is wrong even
if -S is not passed. We have to do this after migration
has completed.
Cc: Glauber Costa <[email protected]>
Cc: Anthony Liguori <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Both input and output streams may be in SND_PCM_STATE_SUSPENDED
after the host is suspended and resumed, meaning "Hardware is
suspended". snd_pcm_readi() and snd_pcm_writei() will return
-ESTRPIPE if called while the stream is in this state.
Call snd_pcm_resume() to enable audio output and capture after
host resume.
Signed-off-by: Bjørn Mork <[email protected]>
Signed-off-by: malc <[email protected]>
This reverts commit bd83677612.
PPC should just implement dirty logging so we can avoid all the fall-out from
this changeset.
Signed-off-by: Anthony Liguori <[email protected]>
Generate CONFIG_AUDIO_DRIVERS. Order is important here, because the
first driver in the list is the one used by default.
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
aliguori: ENOTSUP is not 4096 universally, only on OpenBSD
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We need a way to define posix-like (a.k.a. no win32)
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Use was not consistent, in Makefile was TARGET_GPROF and in *h HAVE_GPROF
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
SP_CFLAGS and SP_LDFLAGS are only used as initial values for ARCH_CFLAGS/ARCH_LDFLAGS. Call it directly ARCH_*. Once there, use the same indentantion that the rest of the file
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
On Win32 the setvbuf function requires the last parameter to be size between 2 and INT_MAX bytes, so the calls always failed. Since the whole point of the calls is to set line-buffered mode for the file handle and that's not supported on Win32 anyway, conditionally remove them.
Signed-off-by: Filip Navara <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Replace the usage of DDK headers with the SDK counterpart "winioctl.h".
Signed-off-by: Filip Navara <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
While fixing migration with -S, commit
89befdd1a6 broke the rest of us. Poor
glommer, with a poor family, spare him his life from this monstruosity.
Since the unconditional vm_start, not autostart was the villain, I'm putting
back autostart. Let me know if you prefer other solutions, it doesn't really matter,
doesn't really matter to me.
Any way the wind blows...
Signed-off-by: Glauber Costa <[email protected]>
CC: Paolo Bonzini <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The only caller of on_vcpu() is protected by ifdef
KVM_CAP_SET_GUEST_DEBUG, so protect on_vcpu() too otherwise QEMU
may not to build.
Signed-off-by: Luiz Capitulino <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Calling gettimeofday() to compute a time interval can cause problems if
the system clock jumps forwards or backwards; replace updtime() with
qemu_get_clock(rt_clock), which calls clock_gettime(CLOCK_MONOTONIC) if
it is available.
Also remove some useless macros.
Signed-off-by: Ed Swierk <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The UDP emulation code for talk has been commented out since the
beginning of time, and unless someone who runs CU-SeeMe on qemu with
user-mode networking can vouch that the special magic (a) is necessary
and (b) works, let's get rid of the code.
Signed-off-by: Ed Swierk <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
I don't think it's critical to do this, but it's
best to keep uninit and error recovery consistent.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Follow on patch will use it to determine the size of the MADT and
other BIOS tables.
Signed-off-by: Jes Sorensen <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We currently use host endian long types to store information
in the dirty bitmap.
This works reasonably well on Little Endian targets, because the
u32 after the first contains the next 32 bits. On Big Endian this
breaks completely though, forcing us to be inventive here.
So Ben suggested to always use Little Endian, which looks reasonable.
We only have dirty bitmap implemented in Little Endian targets so far
and since PowerPC would be the first Big Endian platform, we can just
as well switch to Little Endian always with little effort without
breaking existing targets.
This is the userspace part of the patch. It shouldn't change anything
for existing targets, but help PowerPC.
It replaces my older patch called "Use 64bit pointer for dirty log".
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Dirty logs currently get written with native "long" size. On little endian
it doesn't matter if we use uint64_t instead though, because we'd still end
up using the right bytes.
On big endian, this does become a bigger problem, so we need to ensure that
kernel and userspace talk the same language, which means getting rid of "long"
and using a defined size instead.
So I decided to use 64 bit types at all times. This doesn't break existing
targets but will in conjunction with a patch I'll send to the KVM ML make
dirty logs work with 32 bit userspace on 64 kernel with big endian.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch addresses the problems found by Andriy Gapon:
- The code was incorrectly overwriting the high order 32
bits of the timer and hpet config registers. This didn't show up
in testing because linux and windows use hpet in legacy mode,
where the high order 32 bits (advertising available interrupts)
of the timer config register are ignored, and the high order 32
bits of the hpet config register are reserved and unused.
- The mask for level-triggered interrupts was off by a bit. (hpet
doesn't currently support level-triggered interrupts).
In addition, I removed some unused #defines, and corrected the ioapic
interrupt values advertised. I'd set this up early in hpet development
and never went back to correct it, and no bugs resulted since linux and
windows use hpet in legacy mode where available interrupts are ignored.
Signed-off-by: Beth Kon <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Unless a virtual server address was explicitly defined (which is
impossible with the legacy -net channel format), guestfwd did not
properly forwarded host->guest packets. This patch fixes it.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Demo QemuOpts in action ;)
Implementing a alternative way to specify the filename should be
just a few lines of code now once we decided how the cmd line syntax
should look like.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This stores device parameters in a better way than unparsed strings.
New types:
QemuOpt - one key-value pair.
QemuOpts - group of key-value pairs, belonging to one
device, i.e. one drive.
QemuOptsList - list of some kind of devices, i.e. all drives.
Functions are provided to work with these types. The plan is that some
day we will pass around QemuOpts pointers instead of strings filled with
"key1=value1,key2=value2".
Check out the next patch to see all this in action ;)
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
cleanup pretty simliar to the drives_table removal patch:
- drop the table and make a linked list out of it.
- pass around struct pointers instead of table indices.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
-drive accepts the new id= now, allowing to explicitely name your
drives. They will show up with that name in "info block" if specified,
otherwise the existing namimg scheme is used to autogenerate one.
There is also a new function to lookup drives by name. Not used yet.
The plan is to link disk drivers and drives using the drive id instead
of passing around pointers to BlockDriveState.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
First step cleaning up the drives handling. This one does nothing but
removing drives_table[], still it became seriously big.
drive_get_index() is gone and is replaced by drives_get() which hands
out DriveInfo pointers instead of a table index. This needs adaption in
*tons* of places all over.
The drives are now maintained as linked list.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Hook i44fx pcihost into sysbus.
Convert Host bridge and ISA bridge pci devices to qdev.
Tag as no-user.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The -device switch is the users frontend to the qdev_device_add function
added by the previous patch.
Also adds a linked list where command line options can be saved.
Use it for the new -device and for the -usbdevice and -bt switches.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch implements a parser and qdev tree walker for bus paths and
adds qdev_device_add on top of this.
A bus path can be:
(1) full path, i.e. /i440FX-pcihost/pci.0/lsi/scsi.0
(2) bus name, i.e. "scsi.0". Best used together with id= to make
sure this is unique.
(3) relative path starting with a bus name, i.e. "pci.0/lsi/scsi.0"
For the (common) case of a single child bus being attached to a device
it is enougth to specify the device only, i.e. "pci.0/lsi" will be
accepted too.
qdev_device_add() adds devices and accepts bus= parameters to find the
bus the device should be attached to. Without bus= being specified it
takes the first bus it finds where the device can be attached to (i.e.
first pci bus for pci devices, ...).
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Create a default bus name if none is passed to qbus_create().
If the parent device has DeviceState->id set it will be used to create
the bus name,. i.e. -device lsi,id=foo will give you a scsi bus named
"foo.0".
If there is no id BusInfo->name (lowercased) will be used instead, i.e.
-device lsi will give you a scsi bus named "scsi.0".
A scsi adapter with two scsi busses would have "scsi.0" and "scsi.1" or
"$id.0" and "$id.1" busses. The numbers of the child busses are per
device, i.e. when adding two lsi adapters both will have a "*.0" child
bus.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
So we can parse "$slot.$fn" strings into devfn numbers.
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The pc-0.11 type allows users of qemu-0.11 to use a machine type which
they know will remain compatible when the upgrade to qemu-0.12.
Management tools may choose to canonicalize the 'pc' machine type to
'pc-0.11' so that if the 'pc' alias changes target in future versions
of qemu, the machine type used will remain compatible.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add an 'alias' field to QEMUMachine and display it in the output of
'qemu -M ?' with an '(aliased to foo)' suffix.
Aliases can change targets in newer versions of qemu, so management tools
may choose canonicalize machine types to ensure that if a user chooses an
alias, that the actual machine type used will remain compatible in
future.
This is intended to mimic a symlink to a machine description file.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This allows a program to initialize a host networking device using a
file descriptor passed over a unix monitor socket.
The program must first pass the file descriptor using SCM_RIGHTS
ancillary data with the getfd monitor command. It then may do
"host_net_add tap fd=name" to use the named file descriptor.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Add monitor commands to support passing file descriptors via
SCM_RIGHTS.
getfd assigns the passed file descriptor a name for use with other
monitor commands.
closefd allows passed file descriptors to be closed. If a monitor
command actually uses a named file descriptor, closefd will not be
required.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
If a file descriptor is passed via a message with SCM_RIGHTS ancillary
data on a unix socket, store the file descriptor for use in the
chr_read() handler. Close the file descriptor if it was not used.
The qemu_chr_get_msgfd() API provides access to the passed descriptor.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Split out tcp_chr_recv() out of tcp_chr_read() and implement it on
non-win32 using recvmsg(). This is needed for a subsequent patch
which implements SCM_RIGHTS support.
Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
- implement "used" bit in tlb translation entry
- mark tlb entry used if qemu code/data translation succeeds
- fold i/d mmu replacement writes code into replace_tlb_1bit_lru which
adds 1bit lru replacement algorithm; previously code tried to replace
first unlocked entry only
- extract more bitmasks to named macros
- add "immu" or "dmmu" type name to debugging output where appropriate
Signed-off-by: [email protected]
--
Kind regards,
Igor V. Kovalenko
- add names to mmu registers, this helps understanding the code which
uses/modifies them.
- fold i/d mmu tlb entries tag and tte arrays into arrays of tlb entries
- extract demap_tlb routine (code duplication)
- extract replace_tlb routine (code duplication)
- flush qemu tlb translations when replacing sparc64 mmu tlb entries
I have no test case which demands flushing qemu translations,
and this patch should have no other visible changes to runtime.
Signed-off-by: [email protected]
--
Kind regards,
Igor V. Kovalenko
My self-built PPC kernel doesn't fit in the region reserved for
the kernel, so I can't use -kernel with it.
Let's just extend the region.
Signed-off-by: Alexander Graf <[email protected]>
When giving KVM a slot of a size not on page boundary, it chokes. So let's
just round up the VGA BIOS size so nobody complains anymore and we don't need
to implement sub-page slots.
Required for booting a PPC guest in KVM.
Signed-off-by: Alexander Graf <[email protected]>
KVM can have an in-kernel pit or irqchip. While we don't implement it
yet, having a way for test for it (that always returns zero) will allow us
to reuse code in qemu-kvm that tests for it.
Signed-off-by: Glauber Costa <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Fixes
qemu-thread.c: In function `qemu_thread_equal':
qemu-thread.c:161: error: invalid operands to binary ==
Use of pthread_equal suggested by Filip Navara.
Signed-off-by: Sebastian Herbszt <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
When starting a qemu binary directly from the build directory and that
dir is located outside the source files, the search for bios files
fails. Fix this by linking them from the build to the source directory.
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Attached patch makes signrom.sh working on NetBSD.
The output of the 'od' command leads to a syntax error
which breaks the build.
Signed-off-by: Christoph Egger <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This is a backport from qemu-kvm. Just instead of using kvm's specific
notification mechanism, we use qemu_notify_event()
Signed-off-by: Glauber Costa <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
on_vcpu is a qemu-kvm function that will make sure that a specific
piece of code will run on a requested cpu. We don't need that because
we're restricted to -smp 1 right now, but those days are likely to end soon.
So for the benefit of having qemu-kvm share more code with us, I'm
introducing our own version of on_vcpu(). Right now, we either run
a function on the current cpu, or abort the execution, because it would
mean something is seriously wrong.
As an example code, I "ported" kvm_update_guest_debug to use it,
with some slight differences from qemu-kvm.
This is probably 0.12 material
Signed-off-by: Glauber Costa <[email protected]>
CC: Jan Kiszka <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Replace the use of atoi which is used for pattern parsing currently with
strtol. Atoi won't parse sedecimal pattern values (it always returns 0),
but qemu-iotests use such pattern values. Also reject every pattern
that is not a unsigned char as we pass the pattern to memset which
expect a bye value (despite having the pattern argument declared as int).
Based on an earlier patch by Stefan Weil which did not include the
error handling.
Signed-off-by: Christoph Hellwig <[email protected]>
Reported-by: Stefan Weil <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
The alloc command in qemu-io is mostly useless currently. Instead of doing a
single call to bdrv_is_allocated, we must call bdrv_is_allocated in a loop
until we have found out for each requested sector if it is allocated or not
(bdrv_is_allocated returns a number of sectors that are known to be in the same
state as the first one, but it is not required to include all of them)
This changes the output format of the alloc command so that a change to the
expected output of qemu-iotests 019 is necessary once this is included.
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Make 'qemu-img convert' copies unallocated parts of the source image
when -B option was not specified.
Signed-off-by: Akkarit Sangpetch <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
Instead of storing the backing file in its own BlockDriverState, VMDK uses the
BlockDriverState of the raw image file it opened. This is wrong and breaks
functions that access the backing file or protocols. This fix replaces all
occurrences of s->hd->backing_* with bs->backing_*.
This fixes qemu-iotests failure in 020 (Commit changes to backing file).
Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch requires "Handle BH's queued by AIO completions in
qemu_aio_flush()" to work reliably. The combination of those two
patches survived 300+ migrations with heavy IO load running in the
guest.
Signed-off-by: Nolan Leake <nolan <at> sigbus.net>
Signed-off-by: Anthony Liguori <[email protected]>
Without this, the call to qemu_aio_flush during migration doesn't
actually flush all in-flight SCSI IOs.
Signed-off-by: Nolan Leake <nolan <at> sigbus.net>
Signed-off-by: Anthony Liguori <[email protected]>
Some KVM platforms don't support dirty logging yet, like IA64 and PPC,
so in order to still have screen updates on those, we need to fake it.
This patch just tells the getter function for dirty bitmaps, that all
pages within a slot are dirty when the slot has dirty logging enabled.
That way we can implement dirty logging on those platforms sometime when
it drags down performance, but share the rest of the code with dirty
logging capable platforms.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
440 and desktop codes use different input constants for interrupt indication.
Let's use the respective ones for KVM.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This fixes a warning I stumbled across while compiling qemu on PPC64.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We need to tell the kernel about some initial CPU state we don't have yet,
so let's use the "sregs" IOCTL for that and simply put the Processor Version
Register in there.
Now the kernel knows which guest CPU to virtualize.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
We now have KVM on PPC64 too and might get it on PPC32 as well, as soon
as someone writes it.
So let's enable KVM for PPC32 and PPC64 targets.
Signed-off-by: Alexander Graf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
I used the following command to enable debugging:
perl -p -i -e 's/^\/\/#define DEBUG/#define DEBUG/g' * */* */*/*
Signed-off-by: Blue Swirl <[email protected]>
All elf64_note structure members are Elf64_Word (which is 32bit value)
hence using bswaptls to byteswap it on 64bit platforms is incorrect.
Signed-off-by: malc <[email protected]>
Hi!
Attached patch fixes an unlock bug in strace.
Catched by gcc due to an use of uninitialized variable.
Signed-off-by: Christoph Egger <[email protected]>
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
Hi!
Attached patch uses qemu_isxdigit() instead of isxdigit().
Fixes build warning on NetBSD.
Signed-off-by: Christoph Egger <[email protected]>
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
Hi!
Attached patch fixes build warnings due to use of different pointer
signedness.
Signed-off-by: Christoph Egger <[email protected]>
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
Re-implement GUEST_BASE support.
Offset guest ddress space by default if the guest binary contains
regions below the host mmap_min_addr.
Implement support for i386, x86-64 and arm hosts.
Signed-off-by: Riku Voipio <[email protected]>
Signed-off-by: Paul Brook <[email protected]>
On some Sparc32 machines, fdc is located above 4G limit, so uint32_t is not
appropriate type for io_base.
Signed-off-by: Blue Swirl <[email protected]>
The header sys-queue.h must be #included early, otherwise at some point OS
queue macros will be used. On OpenBSD, those don't define TAILQ_FOREACH_SAFE.
Signed-off-by: Blue Swirl <[email protected]>
/usr/include/alsa/pcm.h contains:
#define snd_pcm_sw_params_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_sw_params_t *) alloca(snd_pcm_sw_params_sizeof()); memset(*ptr, 0, snd_pcm_sw_params_sizeof()); } while (0)
The assert generates: "error: the address of 'sw_params' will always
evaluate as 'true'" which combined with -Werror prevents alsaaudio.o
from being built with certain versions of GCC.
Loaded 100 of 790 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.