Statistics
| Branch: | Revision:

root @ 57a46d05

# Date Author Comment
dd4b2659 11/17/2009 06:39 pm Alexander Graf

Move common option rom code to header file

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 <>...

57a46d05 11/17/2009 06:39 pm Alexander Graf

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...

77873196 11/17/2009 06:39 pm Alexander Graf

Convert multiboot to fw_cfg backed data storage

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...

235f86ef 11/17/2009 06:38 pm Alexander Graf

Introduce rom_copy

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 <>
Signed-off-by: Anthony Liguori <>

ff06108b 11/17/2009 06:38 pm Juan Quintela

fw_cfg: change cur_offset to 32 bits

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

1fd825f7 11/17/2009 04:49 pm Anthony Liguori

Provide marshalling mechanism for json

This introduces qobject_to_json which will convert a QObject to a JSON string
representation.

Signed-off-by: Anthony Liguori <>

6ee59202 11/17/2009 04:49 pm Anthony Liguori

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...

19451201 11/17/2009 04:49 pm Anthony Liguori

Update SeaBIOS to latest

Signed-off-by: Anthony Liguori <>

f7e6b192 11/17/2009 04:49 pm Anthony Liguori

Add a QBool type

Signed-off-by: Anthony Liguori <>

5ab8558d 11/17/2009 04:49 pm Anthony Liguori

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....

d7ff3acb 11/17/2009 04:49 pm Anthony Liguori

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...

4a5fcab7 11/17/2009 04:49 pm Anthony Liguori

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.

Signed-off-by: Anthony Liguori <>

b4748b9b 11/17/2009 04:49 pm Anthony Liguori

Add a QObject JSON wrapper

This provides a QObject interface for creating QObjects from a JSON expression.

Signed-off-by: Anthony Liguori <>

422c46a8 11/17/2009 04:49 pm Anthony Liguori

Add a unit test for JSON support

Signed-off-by: Anthony Liguori <>

21f800d3 11/17/2009 04:49 pm Luiz Capitulino

QDict: Introduce qdict_iter()

This adds iterator support to QDict, it will be used by the
(to be introduced) QError module.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

78f5d726 11/17/2009 04:49 pm Jan Kiszka

Cleanup configure checks for dup3 and fallocate

We have a function for this which does not issue annoying warnings.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

c99ca931 11/17/2009 04:49 pm Anthony Liguori

Properly escape QDECREF macro arguments

QDECREF does not properly escape the macro arguments which can lead to
unexpected syntax errors.

Signed-off-by: Anthony Liguori <>

033815fe 11/17/2009 04:49 pm Anthony Liguori

Add operations to qlist to allow it to be used as a stack

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 <>

d30ec846 11/17/2009 04:49 pm Anthony Liguori

Allow strings to grow in size

This lets us use QString for building larger strings

Signed-off-by: Anthony Liguori <>

ec072ced 11/17/2009 04:49 pm Anthony Liguori

Add a QFloat datatype

Signed-off-by: Anthony Liguori <>

9c9efb6b 11/17/2009 04:49 pm Anthony Liguori

Add unit test for QFloat

Signed-off-by: Anthony Liguori <>

fbc3d96c 11/17/2009 04:49 pm lirans@il.ibm.com

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...

caa5af0f 11/17/2009 04:49 pm Jan Kiszka

kvm: Add arch reset handler

Will be required by succeeding changes.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

0e607a80 11/17/2009 04:49 pm Jan Kiszka

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....

c163b5ca 11/17/2009 04:49 pm lirans@il.ibm.com

Block live migration

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....

127338e6 11/17/2009 04:03 pm Amit Shah

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.

Signed-off-by: Amit Shah <>...

7cd1e32a 11/17/2009 04:03 pm lirans@il.ibm.com

Expose a mechanism to trace block writes

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....

9bd7854e 11/17/2009 04:03 pm Amit Shah

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...

57e073a3 11/17/2009 04:03 pm Amit Shah

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...

2a424990 11/16/2009 07:06 pm Paul Brook

LAN9118 emulation

Add SMSC LAN9118 ethernet emulation.

Signed-off-by: Paul Brook <>

0ef849d7 11/16/2009 07:06 pm Paul Brook

ARM PB-A8 support

Add ARM Realview PB-A8 board support.

Signed-off-by: Paul Brook <>

e90e795e 11/16/2009 12:04 am Aurelien Jarno

mips_r4k: fix reset

(broken by 45a50b1668822c23afc2a89f724654e176518bc4)

Signed-off-by: Aurelien Jarno <>

d27d06f2 11/15/2009 07:42 pm Blue Swirl

PPC64: map Uni-North AGP bus aka fix Linux boot

Uni-North AGP device mapping was accidentally dropped in
2e29bd04786003561303dcad940b38afe790fb9b.

Map the device.

Signed-off-by: Blue Swirl <>

60398748 11/15/2009 04:30 pm Blue Swirl

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....

c364c974 11/15/2009 04:30 pm Blue Swirl

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...

3e65aaf5 11/14/2009 10:32 pm malc

Do not execute shell scripts directly

Signed-off-by: malc <>

593c0d10 11/14/2009 02:10 pm Aurelien Jarno

mips malta: fix indentation

Signed-off-by: Aurelien Jarno <>

31e3104f 11/14/2009 02:10 pm Aurelien Jarno

target-mips: fix indentation

Signed-off-by: Aurelien Jarno <>

c938ada2 11/14/2009 02:04 pm Aurelien Jarno

mips-malta: fix reset

(broken by 45a50b1668822c23afc2a89f724654e176518bc4)

Signed-off-by: Aurelien Jarno <>

51cc2e78 11/14/2009 03:25 am Blue Swirl

mips: fix cpu_reset memory leak

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 <>
Signed-off-by: Aurelien Jarno <>

fc8e320e 11/14/2009 02:23 am Magnus Damm

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

Signed-off-by: Magnus Damm <>...

b4e1f077 11/14/2009 02:19 am Magnus Damm

sh4 disasm fixes

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 <>
Signed-off-by: Aurelien Jarno <>

b785e476 11/14/2009 02:17 am Magnus Damm

tcg/i386: remove duplicate sar opcode

Signed-off-by: Magnus Damm <>
Signed-off-by: Aurelien Jarno <>

91011d4f 11/14/2009 02:14 am Stefan Weil

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...

e16ad5b0 11/14/2009 02:11 am Aurelien Jarno

mips: fix CPU reset

Don't load the kernel twice during reset.
See f2d74978764f62d832d61ac17bb5d934ade58816.

Signed-off-by: Blue Swirl <>
Signed-off-by: Stefan Weil <>
Signed-off-by: Aurelien Jarno <>

bc90ff77 11/13/2009 09:00 pm Blue Swirl

Fix PPC crash

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 c169998802505c244b8bcad562633f29de7d74a4.

Signed-off-by: Blue Swirl <>

c988bfad 11/13/2009 06:31 am Paul Brook

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.

Signed-off-by: Paul Brook <>

26e92f65 11/13/2009 06:04 am Paul Brook

Realview/EB procid hacks

Guess core tile ID based on CPU type.

Signed-off-by: Paul Brook <>

dbe73d7f 11/12/2009 07:23 pm Juan Quintela

pci: fix the conversion of config field from array to pointer

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

c34d2451 11/12/2009 07:23 pm David Woodhouse

Fix 32-bit overflow in parallels image support

Signed-off-by: David Woodhouse <>
Signed-off-by: Anthony Liguori <>

a00b2335 11/12/2009 07:23 pm Kay Ackermann

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)....

6b132502 11/12/2009 07:23 pm Gerd Hoffmann

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....

2966b390 11/12/2009 07:23 pm Juan Quintela

fdc: fix vmstate variable passed

When code was transformed to use qdev_reset/vmstate registration, vmstate
was passed a variable of the wrong type

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

504c2948 11/12/2009 07:23 pm Juan Quintela

qemu_system_reset: we need to call it before loadvm/migration

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

ef2fad65 11/12/2009 07:23 pm Juan Quintela

fix type in CFLAGS name

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

14f26b00 11/12/2009 07:23 pm Juan Quintela

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.

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

cb499fb2 11/12/2009 07:23 pm Kevin Wolf

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...

49c3c8dc 11/12/2009 07:23 pm Kevin Wolf

virtio-blk: Pass read errors to the guest

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 <>
Signed-off-by: Anthony Liguori <>

9bdbe550 11/12/2009 07:23 pm Hollis Blanchard

kvm: Move KVM mp_state accessors to i386-specific code

Unbreaks PowerPC and S390 KVM builds.

Signed-off-by: Hollis Blanchard <>
Signed-off-by: Anthony Liguori <>

812151f2 11/12/2009 07:23 pm Hollis Blanchard

kvm ppc: Remove unused label

Signed-off-by: Hollis Blanchard <>
Signed-off-by: Anthony Liguori <>

4e9df06a 11/12/2009 07:23 pm Stefan Weil

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...
6a90e308 11/12/2009 07:23 pm Stefan Weil

eepro100: Add missing .exit initialisation

Some devices did not have an initialisation value
for entry ".exit". This is fixed here.

Signed-off-by: Stefan Weil <>
Signed-off-by: Anthony Liguori <>

88e2b0a5 11/12/2009 07:23 pm Stefan Weil

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...
593831de 11/12/2009 07:23 pm Amit Shah

qdev: Check if unplug handler exists before calling it

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....

f527c579 11/12/2009 07:23 pm Juan Quintela

fix parallel build

Based on a ideas of Daniel Jacobowitz + Stefan Weil

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

038eaf82 11/12/2009 07:23 pm Stefan Weil

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...

1bb62099 11/12/2009 07:23 pm Stefan Weil

Makefile: Prettify logging

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 <>
Signed-off-by: Anthony Liguori <>

ba6d048a 11/12/2009 03:15 am Edgar E. Iglesias

microblaze: Move the kcmdline out of the way.

Avoids rom overlap conflicts.

Signed-off-by: Edgar E. Iglesias <>

95b279de 11/12/2009 03:14 am Edgar E. Iglesias

microblaze: Restore env when raising unmapped bus access.

Signed-off-by: Edgar E. Iglesias <>

4898427e 11/12/2009 03:12 am Edgar E. Iglesias

microblaze: Unbreak reset.

Initialize synthesis config registers at reset to cope with the new
cpu_reset sequences.

Signed-off-by: Edgar E. Iglesias <>

be0f204a 11/11/2009 09:59 pm Paul Brook

Fix ARM MCore secondary cpu boot

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 <>

97fe84f5 11/11/2009 08:21 pm Paul Brook

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.

Signed-off-by: Paul Brook <>

f2d74978 11/11/2009 08:07 pm Paul Brook

Fix ARM system emulation

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 <>

9d993394 11/09/2009 04:43 pm Gerd Hoffmann

QemuOpts: dump config.

Add a function to write the QemuOpts configuration to a git-style
config file.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

42262ba8 11/09/2009 04:43 pm Gerd Hoffmann

QemuOpts: parse config from file.

Add functions to parse QemuOpts from a git-style config file.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

715a664a 11/09/2009 04:43 pm Gerd Hoffmann

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...
eeb4a3ba 11/09/2009 04:43 pm Naphtali Sprei

Added imlpementation for qemu_error for non-qemu executables

Now qemu_error can be called also from shared files, e.g. block.c.

Signed-off-by: Naphtali Sprei <>
Signed-off-by: Anthony Liguori <>

7273a2db 11/09/2009 04:43 pm Matthew Booth

Documentation: Add documentation for -chardev

Adds documentation for all -chardev backends.

Signed-off-by: Matthew Booth <>
Signed-off-by: Anthony Liguori <>

f932c040 11/09/2009 04:43 pm Kevin Wolf

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.

Signed-off-by: Kevin Wolf <>...

8063d0fe 11/09/2009 04:43 pm Kevin Wolf

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...

3e032364 11/09/2009 04:43 pm Kevin Wolf

Documentation: Add options to image format descriptions

Explain the existing format specific options that can be used with qemu-img
create/convert -o ...

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

ddc97855 11/09/2009 04:43 pm Gerd Hoffmann

QemuOpts: add find_list()

Factor out the QemuOptsList search code for upcoming users.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

ba42b646 11/09/2009 04:43 pm Stefan Weil

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....
260c0cd3 11/09/2009 04:43 pm Isaku Yamahata

pci: use range helper functions.

clean up pci_default_write_config() by the range helper functions.

Suggested by Michael S. Tsirkin <>
Cc: Michael S. Tsirkin <>
Signed-off-by: Isaku Yamahata <>
Signed-off-by: Anthony Liguori <>

edb00035 11/09/2009 04:43 pm Isaku Yamahata

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....

fb231628 11/09/2009 04:43 pm Isaku Yamahata

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....

a9688570 11/09/2009 04:43 pm Isaku Yamahata

pci: cosmetic on pci_upadte_mappings()

Remove one indentation of pci_update_mappings.
Just for cosmetics, no logic change.

Signed-off-by: Isaku Yamahata <>
Signed-off-by: Anthony Liguori <>

1074df4f 11/09/2009 04:43 pm Isaku Yamahata

pci: factor out pci_for_each_device().

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 <>
Signed-off-by: Anthony Liguori <>

a0c7a97e 11/09/2009 04:43 pm Isaku Yamahata

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...

b4dccd8d 11/09/2009 04:43 pm Isaku Yamahata

pci/monitor: print out bridge's filtering values and so on.

make pci_info_device() print out bridge's filtering value like
io base/limit, subbus and subordinate bus.

Signed-off-by: Isaku Yamahata <>
Acked-by: Michael S. Tsirkin <>...

14421258 11/09/2009 04:43 pm Isaku Yamahata

pci: 64bit bar support.

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 <>...

e94ff650 11/09/2009 04:43 pm Isaku Yamahata

pci: remove bus_num member from struct PCIBus.

Since It can be retrieved from pci configuration space,
the member is unnecessary.

Signed-off-by: Isaku Yamahata <>
Signed-off-by: Anthony Liguori <>

e822a52a 11/09/2009 04:43 pm Isaku Yamahata

pci: make pci configuration transaction more accurate.

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....

74e32ac1 11/09/2009 04:43 pm Isaku Yamahata

pci: factor out the conversion logic from io port address into pci device.

factor out the logic which converts io port address into pci device
and offset in PCI configuration space.

Signed-off-by: Isaku Yamahata <>
Signed-off-by: Anthony Liguori <>

766347cc 11/09/2009 04:43 pm Isaku Yamahata

pci: move pci host stuff from pci.c to pci_host.c

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 <>...

ce195fb5 11/09/2009 04:43 pm Isaku Yamahata

pci_host: change the signature of pci_data_{read, write}.

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....

9cae69bd 11/09/2009 04:43 pm Isaku Yamahata

vmstate: introduce VMSTATE_BUFFER_UNSAFE_INFO.

VMSTATE_BUFFER_UNSAFE_INFO for as a buffer with specified VMStateInfo.
It will be used later.

Signed-off-by: Isaku Yamahata <>
Signed-off-by: Anthony Liguori <>

a9f49946 11/09/2009 04:43 pm Isaku Yamahata

pci: pcie host and mmcfg support.

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 <>
Signed-off-by: Anthony Liguori <>

f49db805 11/09/2009 04:43 pm Isaku Yamahata

pci: add helper functions to check ranges overlap.

add helper function to check ranges overlap suggested by
Michael S. Tsirkin <>.
His original suggestion was to use [first, last], however I chosen
to use offset, length pair, i.e. [offset, offset + length)...

4f8589e1 11/09/2009 04:43 pm Isaku Yamahata

pci: typedef pcibus_t as uint64_t instead of uint32_t.

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....