pci: clean up of pci_set_default_subsystem_id().
Use pci accessor function.don't return value because it always return 0 andthe caller doesn't check the return value.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci: add const to pci_is_express(), pci_config_size().
add const to pci_is_express(), pci_config_size().
pci.h: remove unused constants.
So remove unused constants,PCI_STATUS_RESERVED_MASK_LO, PCI_STATUS_RESERVED_MASK_HI,PCI_COMMAND_RESERVED, PCI_COMMAND_RESERVED_MASK_HI.They were used once, but they aren't used anymore.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
msix: remove duplicated defines.
remove defines which are already defined in pci_regs.h
mc146818rtc: improve debugging
Add a separate flag for debugging coalesced interrupts.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
pc: improve debugging
Add a DPRINTF macro and use it for ISA and PIC interrupts.
apic: improve debugging
Add a DPRINTF macro. Use TARGET_FMT_plx for printing target_phys_addr_titems. Add a separate flag for debugging coalescing interrupts.
i8259: improve debugging
Add a DPRINTF macro.
Pad iommu with an empty slot (necessary for SunOS 4.1.4)
On the real hardware (SS-5, LX) the MMU is not padded, but aliased.Software shouldn't use aliased addresses, neither should it crashwhen it uses (on the real hardware it wouldn't). Using empty_slot...
Fix hw/gt64xxx.c compilation with DEBUG defined
Use TARGET_FMT_plx as format placeholder for target_phys_addr_t
Signed-off-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
musicpal: Drop redundant reset call
Reset is now triggered after init, no need for explicit calls anymore.
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix overflow in i440fx_init()
The ram_size parameter can be larger than an int, so it may be truncated.
Fix by using the correct type.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
vhost_net.c: v2 Fix build failure introduced by 0bfcd599e3f5c5679cc7d0165a0a1822e2f60de2
Fix build failure introduced by 0bfcd599e3f5c5679cc7d0165a0a1822e2f60de2
The format statement expects unsigned long on x86_64, but receivesunsigned long long, so gcc exits with an error....
sparc64: clean up pci bridge map
- remove unused host state and store pci bus pointer only- do not map host state access into unused 1fe.10000000 range- reorder pci region registration- assign pci i/o region to isa_mem_base
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>...
sparc64: rename sun4u cpu to Ultrasparc IIi
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
use new cursor struct + functions for vmware vga and sdl.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Virtio-net: Replace the hardcode 6 with defined ETN_ALEN
hw/virtio-net.h: #define ETH_ALEN 6ETH_ALEN was defined by commit 7967406801aa897fae83caad3278ac85a342adaa
Signed-off-by: Amos Kong <akong@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote branch 'kwolf/for-anthony' into staging
Merge remote branch 'qmp/for-anthony' into staging
microblaze: Handle new elf mach nr for sysemu.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
lsi: Fix value overflow in request tag processing
This fixes a mismerge of 64d564094cac5f72eeaeb950c442b773a00d3586 (wrongpatch version): We need to mask the tag value properly to obtain itsdevice ID.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
sparc32 protect read-only bits in DMA CSR registers
On a real hardware changing read-only bits has no effectUse a mask common for SCSI and Ethernet registers. The crucialbit is DMA_INTR, because setting or clearing it may producespurious interrupts.
This patch allows booting Solaris 2.3...
vmstate: fix breakage by 7e72abc382b700a72549e8147bdea413534eeedc
cirrus_post_load() will be executed twice when loading vm states and then thewrong physical memory will be registered. This issue may lead to crash qemu.
Signed-off-by: TeLeMan <geleman@gmail.com>...
Fix %lld or %llx printf format use
Compile dma only once
Use a qemu_irq to request CPU exit.
7 compilations less for the full build.
pckbd: improve debugging
Compile pckbd only once
Use a qemu_irq to indicate A20 line changes. Move I/O port 92to pckbd.c.
axisdev88: Fix passing of kernel cmdline.
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
arm_timer: reload timer when enabled
Reload the timer when TimerControl is written, if the timer is to beenabled. Otherwise, if an earlier write to TimerLoad was done whileperiodic mode was not set, s->delta may incorrectly still have the valueof the maximum limit instead of the value written to TimerLoad....
arm_timer: fix oneshot mode
In oneshot mode, the delta needs to come from the TimerLoad register,not the maximum limit.
Signed-off-by: Rabin Vincent <rabin@rab.in>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
pflash_cfi01: add device ID read command
Add support to read manufacturer and device ID. For everything else (eg.lock bits) 0 is returned.
Signed-off-by: Michael Walle <michael@walle.cc>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
virtio-blk: fix barrier support
Before issuing the barrier to the block driver we need to flush our oustandingqueue of write requests, as the flush is supposed to be issued after them.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
virtio-blk: Avoid zeroing every request structure
The VirtIOBlockRequest structure is about 40 KB in size. This patchavoids zeroing every request by only initializing fields that are read.The other fields are either written to or may not be used at all....
pc: fix segfault introduced by 3d53f5c36ff6
Commit 3d53f5c36ff6 introduced a segfault by erroneously making fw_cfg a'void **' and passing it around in different ways.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Revert "PCI: Convert pci_device_hot_add() to QObject"
Short story: We don't want pci_add in QMP. Long story follows.
pci_add can do two things:
Revert "monitor: Convert do_pci_device_hot_remove() to QObject"
We don't want pci_del in QMP. Use device_del instead.
This reverts commit 6848d827162fea039f2658414a4adb6164a4f9b0.
Conflicts:
hw/pci-hotplug.c sysemu.h
Signed-off-by: Markus Armbruster <armbru@redhat.com>
target-ppc: remove dead code
This function had been disabled from the beginning:see 9fddaa0c0cabb610947146a79b4a9a38b0a216e5
cpu_reset() function is in target-ppc/helper.c
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>Acked-by: Alexander Graf <agraf@suse.de>...
target-s390: add firmware code
This patch adds a firmware blob to the S390 target. The blob is a simpleimplementation of a virtio client that tries to read the second stagebootloader from sectors described as of offset 0x20 in the MBR.
In combination with an updated zipl this allows for booting from virtio...
Merge remote branch 'mst/for_anthony' into staging
ide: Fix ide_dma_cancel
When cancelling a request, bdrv_aio_cancel may decide that it waits forcompletion of a request rather than for cancellation. IDE therefore can'tabandon its DMA status before calling bdrv_aio_cancel; otherwise the callbackof a completed request would use invalid data....
Update to a hopefully more future proof FSF address
See also 70539e1850ddd3a7ee6f9a8db7bd8e81b85225a4,8167ee883931cb20c6264fc19d040ce2dc6ceaaa,530e7615ce3c01882e582c84dc6304ab98a3d5c5 andfad6cb1a565bb73f83fc0e2654489457b489e436.
Trim unnecessary includes
mc146818rtc: remove #ifdef DEBUG_CMOS.
remove #ifdef DEBUG_CMOS by using macro.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
apm: remove #ifdef DEBUG.
remove #ifdef DEBUG by using macro.
acpi_piix4: remove #ifdef DEBUG.
removed #ifdef DEBUG by using macro.
pm_smbus: remove #ifdef DEBUG.
pci hotadd, acpi_piix4: remove global variables
remove global variables, gpe and pci0_status by moving theminto PIIX4PMState.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>...
pci hotplug: add argument to pci hot plug callback.
Add argument, DeviceState*, to pci hot plug callback.The argument will be used later to remove global variable.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>...
acpi_piix4: qdevfy.
qdevfy acpi_piix4.
rtc: make rtc_xxx accept/return ISADevice instead of RTCState.
To match rtc_xxx with qdev, make rtc_xxx accept and return ISADeviceinstead of RTCState.
pc: move rtc declarations from pc.h into a dedicated header file.
Move rtc_xxx declarations from pc.h into mc146818rtc.h.
pc: split out piix specific part from pc.c into pc_piix.c
Finally, we can safely split out the piix specific part from pc.cinto pc_piix.c.
pc: split out pci device init from pc_init1() into pc_pci_device_init()
Split out pci device initialization from pc_init1() into pc_pci_device_init().and removed unnecessary braces.
pc: split out basic device init from pc_init1() into pc_basic_device_init()
Split out basic device, i.e. legacy devices like floppy, initializationfrom pc_init1() into pc_basic_device_init().Later it will be used.
pc: split out vga initialization from pc_init1() into pc_vga_init().
Split out vga initialization which is independent of piixfrom pc_init1() as pc_vga_init().Later it will be used.
pc: split out memory allocation from pc_init1() into pc_memory_init()
Split out memory allocation and rom/bios loading which doesn't dependon piix from pc_init1() into pc_memory_init().Later it will be used.
pc: split out cpu initialization from pc_init1() into pc_cpus_init().
split out cpu initialization which is piix independent from pc_init1()into pc_cpus_init(). Later it will be used.
pc: make pc_init1() not refer ferr_irq directly.
By introducing a registering function, make pc_init1() not refer toferr_irq directly in order to make ferr_irq piix independent.Later pc_init1() will be split out into another file keeping ferr_irqstatic....
pc: introduce a function to allocate cpu irq.
Introduce a function, pc_allocate_cpu_irq(), to allocate cpu irqin order to make pic_irq_request() piix independent.Later piix code will be split out to another file keeping pic_irq_request()static.
pc: remove global variable rtc_state by using qemu_irq.
Remove the reference to the global variable, rtc_state, by passingfunction argument to cmos_init_hd(), cmos_init().
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Cc: Paolo Bonzini <bonzini@gnu.org>...
pc: remove a global variable, floppy_controller.
Remove a global variable, floppy_controller.Since it is unnecessarily global, make it local and pass it asa function argument.
pc: make an unnecessary global variable, pit, local.
remove unnecessary global static variables, pit.Make it local.
pc, i440fx: Make smm enable/disable function i440fx independent.
make cpu_smm_update() generic to be independent on i440fx byregistering a callback.
pc: initialize ioapic before use.
The changeset of 2c8d9340203c7f19265fd4cb2341f568217a3af6prevents isa_irq_handler() from NULL refering of IsaIrqState::ioapic.However it would be better to initialize the member before reference.
acpi: split acpi.c into the common part and the piix4 part.
Split acpi.c into the common part and the piix4 specific part.The common part will be used later.
acpi: add acpi constants from linux header files and use them.
add acpi constants from linux header files andreplace the old constants with them.The acpi constants will be used by other file.
acpi: split out apm register emulation from acpi.c
Split out apm register emulation for acpi.c into apm.c.The apm emulation will be used later.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>Cc: Aurelien Jarno <aurelien@aurel32.net>...
acpi: split out piix4 smbus routines from acpi.c into pm_smbus.c
Split out piix4 smbus routines from acpi.c into pm_smbus.c anduse it.The split out smbus emulation will be used later.
mc146818rtc: Register vmstate via qdev
After defining the required alias ID, we can push vmstate registrationof mc146818rtc to qdev.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
fdc: Register vmstate via qdev
Establish vmstate containers for ISA and sysbus variant, define theiobase as instance ID alias, and let qdev do the vmstate registrationwork.
serial: Register vmstate via qdev
At least for isa-serial, we can already let qdev do the vmstateregistration for us. It just takes wrapping vmstate for theencapsulating ISASerialState and defining the proper instance IDaliases.
vmstate: Add support for alias ID
Some legacy users (mostly PC devices) of vmstate_register manageinstance IDs on their own, and that unfortunately in a way that isincompatible with automatically generated ones. This so far preventsswitching those users to vmstates that are registered by qdev....
vmstate: Drop unused post_save handler
No device makes use of it anymore.
sh: sm501: add 2D engine support
In linux kernel v2.6.33, sm501 frame buffer driver modified to support2D graphics engine on sm501 chip. One example is "fill rectangle" operation.But current qemu's sm501 emulation doesn't support it. This results ingraphics console disturbance....
tmp105: update the register in post_load where it needs updating.
This was the only user of .post_save as noticed by Jan Kiszka andseems to have been added there wrongly during conversion toVMStateDescription.
Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
e1000: make some tables 'const'
ide: make a table 'const'
vga: make some tables 'const'
apb: don't use any static state
pckbd: don't use any static state
virtio-net: return with value in void function
virtio-net has return with value in a void function.No idea why does it compile with gcc,but this isn't standard C.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
virtio: invoke set_features on load
After migration, vhost was not getting featuresacked because set_features callback was never invoked.The fix is just to invoke that callback.
Reported-by: David L Stevens <dlstevens@us.ibm.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
pci: irq_state vmstate breakage
Code for saving irq_state got vm_statemacros wrong, passing in the wrong parameter.As a result, we both saved a wrong valueand restored it to a wrong offset.
This leads to device and bus irq counts gettingout of sync, which in turn leads to interrupts getting lost or...
pci: cleanly backout of pci_qdev_init()
If the init function of a device fails, as might happen with deviceassignment, we never undo the work done by do_pci_register_device().This not only causes a bit of a memory leak, but also leaves a boguspointer in the bus devices array that can cause a segfault or...
lsi: Handle removal of selected devices
We must not store references to selected devices as they may behot-removed. Instead, look up the device based on its tag right beforeusing it. If the device disappeared, throw an interrupt and disconnect.
iov: Move from hw/ to topdir
The iov functions can be useful to other code as well.
Signed-off-by: Amit Shah <amit.shah@redhat.com>CC: Christoph Hellwig <hch@lst.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
SCSI: Add disk reset handler
Ensure that pending requests of an SCSI disk are purged on system resetand also restore max_lba. The latter is no only present in the resethandler as that one is called after init as well.
scsi-disk: Clear aiocb on read completion
Once the I/O completion callback returned, aiocb will be released by thecontroller. So we have to clear the reference not only inscsi_write_complete, but also in scsi_read_complete. Otherwise we riskinconsistencies when a reset hits us before the related request is...
lsi: Purge message queue on reset
Declare the input message queue empty and initialize the related statemachine properly on controller reset. This fixes unrecoverable errorswhen the controller was reset during ongoing requests.
lsi: Adjust some register reset values
According to the LSI spec, the reset value of dcmd, dstat, and ctest2were wrong, and sdid as well as ssid require zero initialization. Thereare surely more discrepancies, this is just another increment.
hw: better i440 emulation
updated version of an old patchhttp://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-piix-ram-size.patchthat together withhttp://www.mail-archive.com/linuxbios@linuxbios.org/msg02390.html(which is already in coreboot trunk) allows coreboot to autodetect the amount of RAM within qemu/kvm from a register in i440 northbridge....
virtio-9p: Add P9_TOPEN support.
Implement P9_TOPEN support.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-9p: Add P9_TREAD support
Implement P9_TREAD support.
virtio-9p: Add P9_TCLUNK support
Implement P9_TCLUNK support.This patch gets `ls -al` to work.
virtio-9p: Add P9_TWRITE support
Implement P9_TWRITE support.This gets write to file to work
virtio-9p: Add P9_TCREATE support
Implement P9_TCREATE support.[jvrao@linux.vnet.ibm.com: strdup to qemu_strdup conversion]
virtio-9p: Add P9_TWSTAT support
Implement P9_TWSTAT support.This gets file and directory creation to work.
[jvrao@linux.vnet.ibm.com: strdup to qemu_strdup conversion][aneesh.kumar@linux.vnet.ibm.com: v9fs_fix_path]
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
virtio-9p: Add P9_TREMOVE support.
Implement P9_TREMOVE support.This gets file deletion to work.
[mohan@in.ibm.com: Fix truncate to use the relative path]
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>...
virtio-9p: Add P9_TFLUSH support
Don't do anything special for flush.