Alexander Graf [Thu, 12 Nov 2009 20:53:14 +0000 (21:53 +0100)]
Convert linux bootrom to external rom and fw_cfg
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!
Anthony Liguori [Wed, 11 Nov 2009 19:16:03 +0000 (13:16 -0600)]
Add test suite for json marshalling
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.
Anthony Liguori [Wed, 11 Nov 2009 16:39:23 +0000 (10:39 -0600)]
Add a JSON parser
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.
Anthony Liguori [Wed, 11 Nov 2009 16:38:59 +0000 (10:38 -0600)]
Add a JSON message boundary identifier
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.
Anthony Liguori [Wed, 11 Nov 2009 16:39:14 +0000 (10:39 -0600)]
Add a lexer for JSON
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.
Jan Kiszka [Fri, 6 Nov 2009 18:39:24 +0000 (19:39 +0100)]
kvm: x86: Refactor use of interrupt_bitmap
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.
Enable migration without shared storage from the monitor
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.
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.
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).
Amit Shah [Tue, 3 Nov 2009 14:29:56 +0000 (19:59 +0530)]
char: rename qemu_chr_reset to qemu_chr_generic_open
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.
Amit Shah [Tue, 3 Nov 2009 14:29:55 +0000 (19:59 +0530)]
char: Remove special init_reset handling
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.
Amit Shah [Tue, 3 Nov 2009 14:29:54 +0000 (19:59 +0530)]
char: don't limit data sent to backends to 1k per buffer
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.
Blue Swirl [Sun, 15 Nov 2009 14:30:56 +0000 (14:30 +0000)]
PPC64: Partial fix to Linux crash: revert to old devfn
Before 2e29bd04786003561303dcad940b38afe790fb9b, 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.
Blue Swirl [Sun, 15 Nov 2009 14:30:03 +0000 (14:30 +0000)]
PCI: make duplicate devfn allocation fatal
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.
Magnus Damm [Fri, 13 Nov 2009 09:51:05 +0000 (18:51 +0900)]
fix make clean targets
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
Stefan Weil [Fri, 13 Nov 2009 22:26:27 +0000 (23:26 +0100)]
pci: Fix function pci_default_write_config
Change 260c0cd3d985e51b15870ff47e17b7b930efbda1
(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().
Paul Brook [Fri, 13 Nov 2009 04:31:22 +0000 (04:31 +0000)]
ARM MPCore tweaks
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.
Gerd Hoffmann [Mon, 2 Nov 2009 11:47:06 +0000 (12:47 +0100)]
vnc: improve capslock handling.
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.
Kay Ackermann [Sat, 31 Oct 2009 17:29:43 +0000 (18:29 +0100)]
e1000 fix: read access to some registers is missing.
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).
Kevin Wolf [Tue, 3 Nov 2009 16:34:37 +0000 (17:34 +0100)]
savevm: Delete existing snapshots in all images
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.
Juan Quintela [Fri, 6 Nov 2009 14:58:06 +0000 (15:58 +0100)]
Fix incoming migration
commit b04c4134d6de28c249277de19e523bfbe4aebbd6
broke incoming migration. After talking with Gleb, code was intended
to be the way is in this fix. This fixes migration here.
Stefan Weil [Mon, 2 Nov 2009 18:59:06 +0000 (19:59 +0100)]
Makefile: Fix definition of pxe-*.bin blobs
* 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.
Stefan Weil [Sat, 31 Oct 2009 12:38:33 +0000 (13:38 +0100)]
eepro100: Fix boot ROM support
* 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).
Stefan Weil [Sat, 31 Oct 2009 10:28:11 +0000 (11:28 +0100)]
serial: Add interface to set reference oscillator frequency
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.
Paul Brook [Wed, 11 Nov 2009 18:17:24 +0000 (18:17 +0000)]
Reject late rom loading
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.
Gerd Hoffmann [Wed, 14 Oct 2009 08:39:28 +0000 (10:39 +0200)]
QemuOpts: command line switches for the config file.
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.
Kevin Wolf [Wed, 28 Oct 2009 11:49:16 +0000 (12:49 +0100)]
Documentation: Don't mention old qemu-img options
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.
Kevin Wolf [Wed, 28 Oct 2009 11:49:15 +0000 (12:49 +0100)]
Documentation: Move image format descriptions to own section
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.
Stefan Weil [Fri, 30 Oct 2009 12:36:21 +0000 (13:36 +0100)]
eepro100: Improve support for different devices
* 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.
Isaku Yamahata [Fri, 30 Oct 2009 12:21:25 +0000 (21:21 +0900)]
pci: implement pci bridge filtering.
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.
Isaku Yamahata [Fri, 30 Oct 2009 12:21:22 +0000 (21:21 +0900)]
pci: initialize pci config headers depending it pci header type.
- 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.
Isaku Yamahata [Fri, 30 Oct 2009 12:21:21 +0000 (21:21 +0900)]
pci: teach pci_default_config_write() ROM bar for normal/bridge device .
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.