History | View | Annotate | Download (33.1 kB)
Move x86 specific PC declarations to a separate file
x86 definitions (especially CPUState uses) prevent many files frombeing compiled within libhw.
Move x86 specific declarations (APIC stuff) to a separate file.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
error: Replace qemu_error() by error_report()
error_report() terminates the message with a newline. Strip it itfrom its arguments.
This fixes a few error messages lacking a newline:net_handle_fd_param()'s "No file descriptor named %s found", andtap_open()'s "vnet_hdr=1 requested, but no kernel support for...
pc: Fix error reporting for -boot once
Commit 0ecdffbb created pc_boot_set() for use from monitor command"boot_set", via qemu_boot_set(). pc_boot_set() reports errors tocur_mon, which works fine for monitor code.
Commit e0f084bf reused the function int reset handler...
pc: Factor common code out of pc_boot_set() and cmos_init()
Code duplicated in commit 0ecdffbb. The two versions are similar, butnot identical:
x86: Extend validity of bsp_to_cpu
As we hard-wire the BSP to CPU 0 anyway and cpuid_apic_id equalscpu_index, bsp_to_cpu can also be based on the latter directly. Thiswill help an early user of it: KVM while initializing mp_state.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
Allocate memory below 4GB as one chunk
Instead of allocating a separate chunk for the first 640KB and anotherfor 1MB+, allocate one large chunk. This plays well in terms of alignmentand size with large pages.
Signed-off-by: Avi Kivity <avi@redhat.com>...
QEMU e820 reservation patch
Hi,
Kevin and I have agreed on the approach for this one now. So here isthe latest version of the patch for QEMU, submitting e820 reservationentries via fw_cfg.
Cheers,Jes
Use qemu-cfg to provide the BIOS with an optional table of e820 entries....
pc: Bump up pc version to 0.13 and add a 0.12 compat version
The version 0.13 will be the new default and compatibility options willbe added to the 0.12 version.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc: Add backward compatibility options for virtio-serial
virtio-serial-pci can support multiple ports in the current developmentversion that will become 0.13. Add compatibility options for the 0.12and 0.11 pc machine types.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
Remove conditional rom loading support
Commit c2039bd0ffce8807e0eaac55254fde790825fa92 made rom loadingautomatic for non-PC architectures. Remove now mostly unusedconditional rom loading support.
fdc: don't use reserved _t suffix
virtio-console: qdev conversion, new virtio-serial-bus
This commit converts the virtio-console device to create a newvirtio-serial bus that can host console and generic serial ports. Thefile hosting this code is now called virtio-serial-bus.c.
The virtio console is now a very simple qdev device that sits on the...
pc: add driver version compat properties
This patch adds compat property entries for ide-disk.ver andscsi-disk.ver to pc-0.10 and pc-0.11. With this patch appliedthe scsi and ide disks report "0.10" and "0.11" as version whenyou start qemu with "-M pc-0.10" or "-M pc-0.11"....
pc: add machine type for 0.12
Add a new machine type for qemu 0.12.
Also fixup the 0.11 machine type: msi for virtio-blk-pci was enabledafter the 0.11 release, so turn it off in the 0.11 machine type.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
roms: rework rom loading via fw
This patch changes the way rom loading via fw_cfg is handled.Instead of having pc_init1() call a function which passed allroms to the firmware config we simply pass a pointer to fw_cfgto the rom loader.
Advantage: loading roms via firmware works also for devices which...
pc: add rombar to compat properties for pc-0.10 and pc-0.11
So '-M pc-0.10' and '-M pc-0.11' will use the fw_cfg rom load methodby default.
multiboot: Support arbitrary number of modules.
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
multiboot: Separate multiboot loading into separate file
Move multiboot loading code into separate files as suggested by Alex Graf.
hw/pc.c: fix warnings with _FORTIFY_SOURCE
CC i386-softmmu/pc.occ1: 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...
roms: use new fw_cfg file xfer support.
roms: use fw_cfg for vgabios and option rom loading, additionally todeploying them the traditional way (copy to 0xc0000 -> 0xe0000 range).
Fix loading of ELF multiboot kernels
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 ofthe code. This doesn't hold true generally and caused too little data to be...
qdev: make compat stuff more generic
This patch renames the compat properties into global properties andmakes them more generic. The compatibility stuff is only one ofmultiple possible users now.
multiboot: Use signed type for negative error numbers
In mb_mod_length a return value is stored that is negative in error case. Withan unsigned type the check goes wrong.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
multiboot: Fix module loading and setting of mmap.
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: pci.h cleanup: move out stuff not in pci.c
pci.h declares some functions which aren'tdefined in pci.h. Clean up moving thingsto appropriate headers, and update all users.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Convert linux bootrom to external rom and fw_cfg
We already have a working multiboot implementation that uses fw_cfg to getits kernel module etc. data in int19 runtime now.
So what's missing is a working linux boot option rom. While at it I figured itwould be a good idea to take the opcode generator out of pc.c and instead use...
Convert multiboot to fw_cfg backed data storage
Right now we load the guest kernel to RAM, fire off the BIOS, hope itdoesn'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...
Remove e1000 rom loading hack
The gPXE rom supports BEV properly.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
rom loader: make vga+rom loading configurable.
The rom_add_vga() and rom_add_option() macros are transformed intofunctions. They look at the new rom_enable_driver_roms variableand only do something if it is set to non-zero, making vga+option romloading runtime option. pc_init() sets rom_enable_driver_roms to 1....
vga roms: move loading from pc.c to vga drivers.
use rom loader for pc bios.
The pc bios shows up in 'info roms' now.
Note that the BIOS is mapped to two places: The complete rom at the topof the memory, and the first 128k at 0xe0000. Only the first place islisted in 'info roms'.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
pc.c: only load e1000 rom.
The other pxe roms are loaded by the drivers individual drivers now.
multiboot: Fix cmdline of modules
Fix address specified for cmdline value of module in multiboot structure.
Patchworks-ID: 35699Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
multiboot: Limit number of multiboot modules
Add size checks to avoid overwriting the multiboot structurewhen too many modules are loaded.
Patchworks-ID: 35700Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
rom loader: fix sparc -kernel boot.
Changes:(1) register pstrcpy_targphys() in rom list, it is used for kernelcommand lines by a number of architectures.(2) add rom_ptr() function to get a pointer for applying changesto loaded images. Needed for example to tell the linux kernel...
New qdev_init_nofail()
Like qdev_init(), but terminate program via hw_error() instead ofreturning an error value.
Use it instead of qdev_init() where terminating the program on failureis okay, either because it's during machine construction, or because...
Reorganize option rom (+linux kernel) loading.
This patch adds infrastructure to maintain memory regions which must berestored on reset. That includes roms (vga bios and option roms on pc),but is also used when loading linux kernels directly. Features:...
Improve error reporting on file access
By making the error reporting include strerror(errno), it gives the usera bit more indication as to why qemu failed. This is particularlyimportant for people running qemu as a non root user.
Signed-off-by: Justin M. Forbes <jforbes@redhat.com>...
Fix pci_add nic not to exit on bad model
Monitor command "pci_add ADDR nic model=MODEL" uses pci_nic_init() tocreate the NIC. When MODEL is unknown or "?", this prints to stderrand terminates the program.
Change pci_nic_init() not to treat "?" specially, and to return NULL...
serial: convert isa to qdev
Everything using standard isa I/O ports and IRQ windup is considerdbeing an actual isa device. That are all serial_init() users exceptmips_mipssim() which seems to have a non-standard IRQ windup.
baud rate is fixed at 115200 now as no caller passed in something else....
pci: windup acpi-based hotplug
Switch over acpi-based PCI hotplug for pc over to the newqdev-based pci hotplugging.
floppy: add drive properties.
parallel: convert isa to qdev
i2c: addresses are load/save as uint8_t values, change types to reflect this
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Revert "Get rid of _t suffix"
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. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
Compile loader only once
Callers must pass ELF machine, byte swapping and symbol LSB clearinginformation to ELF loader. A.out loader needs page size information, passthat too as a parameter.
Extract prototypes to a separate file. Move loader.[ch] and elf_ops.h under hw....
ide/isa: convert to qdev.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
x86: move a declaration to header
x86: add 'const'
qdev/isa: convert ne2000
Also split the isa bits into a separate source file, so we don't drag ina dependency for isa-bus.o for machines which want ne2k_pci only.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
qdev/isa: convert real time clock
qdev: simplify isa irq assignments
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.
isapc: pick a more sane default cpu for such old hardware.
qdev: drop iobase properties from isa bus
Lot of ISA devices work at fixed addresses, so having iobaseas bus property doesn't make much sense. Devices which canhave different iobases will get a device property.
Also simply hard-code stuff which can't be configured anyway....
isapc: Fix irq routing
Only send irqs to ioapic in case we have one.Fixes qemu segfault.
Fix indentation
mips malta: Fix fdc regression and use qdev for i8042 setup
8baf73adf664e79eae201c3f618078a220a661d9 (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...
ide: pass down DriveInfo instead of BlockDriverState
Fold piix3_init() intto i440fx_init
i440fx_init will now work properly if we don't setup piix3
Use PCII440FXState instead of generic PCIDevice
switch balloon initialization to -device.
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...
ide: split away ide-isa.c
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.
qdev: convert watchdogs
-watchdog NAME is now equivalent to -device NAME, except it treatsoption argument '?' specially, and supports only one watchdog.
A side effect is that a device created with -watchdog may now receivea different PCI address.
i6300esb is now available on any machine with a PCI bus, not just PCs....
Add isa_reserve_irq().
Introduce isa_reserve_irq() which marks an irq reserved and returnsthe appropriate qemu_irq entry from the i8259 table.
isa_reserve_irq() is a temporary interface to be used to allocate ISAIRQs for devices which have not yet been converted to qdev, and for...
Move isa_connect_irq calls into isa_create_simple
Now with isa-bus maintaining the isa irqs we can move theisa_connect_irq() calls into isa_create_simple().
isa bus irq changes and fixes.
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...
virtio-blk: add msi support.
Make the e1000 the default network adapter for the pc target.
The ne2k is an ancient card that performs pretty terribly under QEMU. In manymodern OSes, there is no longer drivers available for the ne2k.
Switch the default network adapter to e1000. This card is more widely...
Unbreak large mem support by removing kqemu
kqemu introduces a number of restrictions on the i386 target. The worst is thatit prevents large memory from working in the default build.
Furthermore, kqemu is fundamentally flawed in a number of ways. It relies on...
Route IOAPIC interrupts via ISA bus
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 <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
QEMU set irq0override in fw_cfg
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 requestfeatures from the BIOS, rather than notifying the BIOS that it isrunning on QEMU or KVM. This way memory ranges can change etc. and...
Route PC irqs to ISA bus instead of i8259 directly
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, anincestuous arrangement. In order to clean this up, create a new ISA IRQ...
qdev/isa: make pc use qdev for i8042 setup.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-Id:
qdev-ify virtio-blk.
First user of the new drive property. With this patch applied hostand 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...
Remove the pc-0-10 machine type
We have the pc-0.10 machine type now which does exactly the samething.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
kill drives_table
First step cleaning up the drives handling. This one does nothing butremoving drives_table[], still it became seriously big.
drive_get_index() is gone and is replaced by drives_get() which handsout DriveInfo pointers instead of a table index. This needs adaption in...
Add a pc-0.11 machine type and make the pc type an alias
The pc-0.11 type allows users of qemu-0.11 to use a machine type whichthey know will remain compatible when the upgrade to qemu-0.12.
Management tools may choose to canonicalize the 'pc' machine type to...
qdev/compat: virtio-blk-pci 0.10 compatibility.
Add class property to virtio-blk-pci allowing to specify the PCI class.Add compat property to pc-0.10 to set the old PCI class.
qdev/compat: virtio-console-pci 0.10 compatibility.
Add class property to virtio-console-pci allowing to specify the PCI class.Add compat property to pc-0.10 to set the old PCI class.
qdev/compat: virtio-net-pci 0.10 compatibility.
Add vectors property, allowing to turn off msi by setting vectors=0.Add compat property to pc-0.10 disabling msi.
qdev/compat: add pc-0.10 machine type.
qdev: rework device properties.
This patch is a major overhaul of the device properties. The propertiesare saved directly in the device state struct now, the linked list ofproperty values is gone.
Advantages: * We don't have to maintain the list with the property values....
Handle vga= in -append
Here is a patch I had sent twice to the list 2 years ago.Hopefuly this time someone will be interested
It adds support for passing vga mode to linux kernel throughvga= option in -append
Signed-off-by: Pascal Terjan <pterjan@gmail.com>...
Add a pc-0-10 machine type for compatibility with 0.10.x
Add a pc-0-10 machine type to allow a pc machine to be created withvirtio block and console devices compatibility with qemu-0.10.x.
Revert "Introduce reset notifier order"
This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (andupdates later added users of qemu_register_reset), we solved theproblem it originally addressed less invasively.
x86: Factor out pc_new_cpu
At this point, this refactoring looks like overkill. But we will need itfor CPU hotplugging, and qemu-kvm already carries it. Merging it earlywould help qemu-kvm when rebasing against upstream.
Replace -no-virtio-balloon by -balloon
We want to do (at least) two things to the virtio-balloon device:suppress it, and control its PCI address. Option -no-virtio-balloonlets us do only the former. To get the latter, replace-no-virtio-balloon with...
Change bochs bios init order
For multiboot support, we need bochs_bios_init to happen beforeload_linux, so we get the fw_cfg device.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Expose fw_cfg v2
Multiboot passes options to the option rom using the fw_cfg device.Right now, that device is local to the bochs_bios_init function.
Let's change that and expose it, so everyone may put data in there.
Signed-off-by: Alexander Graf <agraf@suse.de>...
Multiboot support v5
This patch implements support for Multiboot on x86 for -kernel.Multiboot is a "new" approach to get rid of different bootloaders, providinga unified interface for the kernel. It supports command line options andkernel modules.
The two probably best known projects using multiboot are Xen and GNU Hurd....
Support addr=... in option argument of -net nic
Make net_client_init() accept addr=, put the value into structNICinfo. Use it in pci_nic_init(), and remove arguments bus anddevfn.
Don't support addr= in third argument of monitor command pci_add,because that clashes with its first argument. Admittedly unelegant....
Support addr=... in option argument of -drive if=virtio
Make drive_init() accept addr=, put the value into struct DriveInfo.Use it in all the places that create virtio-blk-pci devices:pc_init1(), bamboo_init(), mpc8544ds_init().
Don't support addr= in third argument of monitor command pci_add and...
Don't register cpu reset handler for cpu with APIC.
APIC reset handler already resets cpu, no need to reset it twice.Also register cpu_reset handler directly to make it impossible toadd additional code to main_cpu_reset() by mistake.
Signed-off-by: Gleb Natapov <gleb@redhat.com>...
acpi.c: make qemu_system_device_hot_add piix independent.
introruce piix4_device_hot_add() for piix4 specific codeand make qemu_system_device_hot_add() generic.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Make nic option rom loading less painful.
The code how it is today, is totally painful to read and keep.To begin with, the code is duplicated with the option rom loadingcode that linux_boot and vga are already using.
This patch introduces a "bootable" state in NICInfo structure,...
Don't use cpu_index as apic_id.
(patch is on top of "Apic creation should not depend on pci" series)
Currently cpu_index is used as cpu apic id on x86. This is incorrectsince apic ids not have to be continuous (they can also encode cpuhierarchy information). This patch uses cpuid_apic_id for initial apic id...
Apic creation should not depend on pci
It should depend on whether cpu has APIC.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add -no-virtio-balloon command-line option
This new option may be used to disable the virtio-balloon device.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Use relative path for bios
Look for bios and other support files relative to qemu binary, rather thana hardcoded prefix.
Signed-off-by: Paul Brook <paul@codesourcery.com>