summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2013-07-11pseries: move interrupt controllers to hw/intc/Alexey Kardashevskiy3-1/+2
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-11spapr: Respect -bios command line option for SLOFAndreas Färber1-1/+4
Allow the user to override the firmware file name rather than always using "slof.bin". Reported-by: Dinar Valeev <k0da@opensuse.org> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-11spapr: Use named enum for function remove_hpteStefan Weil1-4/+4
The function returned a target_ulong which was made from unnamed enum values. The target_ulong was then assigned to an int variable which was used in a switch statement. Using a named enum in both cases makes reviews easier. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-11spapr: Fix compiler warnings for some versions of gccStefan Weil2-3/+3
i686-w64-mingw32-gcc (GCC) 4.6.3 from Debian wheezy reports these warnings: hw/ppc/spapr_hcall.c:188:1: warning: control reaches end of non-void function [-Wreturn-type] hw/ppc/spapr_pci.c:454:1: warning: control reaches end of non-void function [-Wreturn-type] Both warnings are fixed by using g_assert_not_reached instead of assert. A second line with assert(0) in spapr_pci.c which did not raise a compiler warning was modified, too, because g_assert_not_reached documents the purpose of that statement and is not removed in release builds. Signed-off-by: Stefan Weil <sw@weilnetz.de> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-10Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into stagingAnthony Liguori30-127/+133
QOM CPUState refactorings * Fix for OpenRISCCPU subclasses * Fix for gdbstub CPU selection * Move linux-user CPU functions into new header * CPUState part 10 refactoring: first_cpu, next_cpu, cpu_single_env et al. * Fix some targets to consistently inline TCG code generation * Centrally log CPU reset # gpg: Signature made Wed 10 Jul 2013 07:52:39 AM CDT using RSA key ID 3E7E013F # gpg: Can't check signature: public key not found # By Andreas Färber (41) and others # Via Andreas Färber * afaerber/tags/qom-cpu-for-anthony: (43 commits) cpu: Move reset logging to CPUState target-ppc: Change LOG_MMU_STATE() argument to CPUState target-i386: Change LOG_PCALL_STATE() argument to CPUState log: Change log_cpu_state[_mask]() argument to CPUState target-i386: Change do_smm_enter() argument to X86CPU target-i386: Change do_interrupt_all() argument to X86CPU target-xtensa: Change gen_intermediate_code_internal() arg to XtensaCPU target-unicore32: Change gen_intermediate_code_internal() signature target-sparc: Change gen_intermediate_code_internal() argument to SPARCCPU target-sh4: Change gen_intermediate_code_internal() argument to SuperHCPU target-s390x: Change gen_intermediate_code_internal() argument to S390CPU target-ppc: Change gen_intermediate_code_internal() argument to PowerPCCPU target-mips: Change gen_intermediate_code_internal() argument to MIPSCPU target-microblaze: Change gen_intermediate_code_internal() argument types target-m68k: Change gen_intermediate_code_internal() argument to M68kCPU target-lm32: Change gen_intermediate_code_internal() argument to LM32CPU target-i386: Change gen_intermediate_code_internal() argument to X86CPU target-cris: Change gen_intermediate_code_internal() argument to CRISCPU target-arm: Change gen_intermediate_code_internal() argument to ARMCPU target-alpha: Change gen_intermediate_code_internal() argument to AlphaCPU ...
2013-07-09timer/arm_mptimer: Build arm_mptimer only onceAndreas Färber2-1/+2
Since current_cpu is CPUState it no longer depends on CPUARMState. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09intc/openpic: Build openpic only onceAndreas Färber3-2/+3
Since current_cpu is CPUState it no longer depends on CPUPPCState. Move ppce500_set_mpic_proxy() to a new hw/ppc/ppc_e500.h because hw/ppc/ppc.h is too heavily using CPUPPCState and PowerPCCPU. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09intc/arm_gic: Build arm_gic only onceAndreas Färber2-1/+2
Since current_cpu is CPUState it no longer needs CPUArchState. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09cpu: Make first_cpu and next_cpu CPUStateAndreas Färber17-61/+65
Move next_cpu from CPU_COMMON to CPUState. Move first_cpu variable to qom/cpu.h. gdbstub needs to use CPUState::env_ptr for now. cpu_copy() no longer needs to save and restore cpu_next. Acked-by: Paolo Bonzini <pbonzini@redhat.com> [AF: Rebased, simplified cpu_copy()] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09cpu: Replace cpu_single_env with CPUState current_cpuAndreas Färber15-62/+61
Move it to qom/cpu.h. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09Simplify -machine option queries with qemu_get_machine_opts()Markus Armbruster3-34/+14
The previous two commits fixed bugs in -machine option queries. I can't find fault with the remaining queries, but let's use qemu_get_machine_opts() everywhere, for consistency, simplicity and robustness. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1372943363-24081-7-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09microblaze: Fix latent bug with default DTB lookupMarkus Armbruster1-14/+13
microblaze_load_kernel() fails to call qemu_find_file(QEMU_FILE_TYPE_BIOS, dtb_filename) when no -machine options are given. This can't normally happen, because -machine option kernel is mandatory for this target. Fix it anyway, by using qemu_get_machine_opts(). Cc: Peter Crosthwaite <peter.crosthwaite@petalogix.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1372943363-24081-6-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09Fix -machine options accel, kernel_irqchip, kvm_shadow_memMarkus Armbruster1-9/+4
Multiple -machine options with the same ID are merged. All but the one without an ID are to be silently ignored. In most places, we query these options with a null ID. This is correct. In some places, we instead query whatever options come first in the list. This is wrong. When the -machine processed first happens to have an ID, options are taken from that ID, and the ones specified without ID are silently ignored. Example: $ upstream-qemu -nodefaults -S -display none -monitor stdio -machine id=foo -machine accel=kvm,usb=on $ upstream-qemu -nodefaults -S -display none -monitor stdio -machine id=foo,accel=kvm,usb=on -machine accel=xen $ upstream-qemu -nodefaults -S -display none -monitor stdio -machine accel=xen -machine id=foo,accel=kvm,usb=on $ qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -machine accel=kvm,usb=on QEMU 1.5.50 monitor - type 'help' for more information (qemu) info kvm kvm support: enabled (qemu) info usb (qemu) q $ qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -machine id=foo -machine accel=kvm,usb=on QEMU 1.5.50 monitor - type 'help' for more information (qemu) info kvm kvm support: disabled (qemu) info usb (qemu) q $ qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -machine id=foo,accel=kvm,usb=on -machine accel=xen QEMU 1.5.50 monitor - type 'help' for more information (qemu) info kvm kvm support: enabled (qemu) info usb USB support not enabled (qemu) q $ qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -machine accel=xen -machine id=foo,accel=kvm,usb=on xc: error: Could not obtain handle on privileged command interface (2 = No such file or directory): Internal error xen be core: can't open xen interface failed to initialize Xen: Operation not permitted Option usb is queried correctly, and the one without an ID wins, regardless of option order. Option accel is queried incorrectly, and which one wins depends on option order and ID. Affected options are accel (and its sugared forms -enable-kvm and -no-kvm), kernel_irqchip, kvm_shadow_mem. Additionally, option kernel_irqchip is normally on by default, except it's off when no -machine options are given. Bug can't bite, because kernel_irqchip is used only when KVM is enabled, KVM is off by default, and enabling always creates -machine options. Downstreams that enable KVM by default do get bitten, though. Use qemu_get_machine_opts() to fix these bugs. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1372943363-24081-5-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09hw/9pfs: Fix memory leak in error pathM. Mohan Kumar1-9/+17
Fix few more memory leaks in virtio-9p-device.c detected using valgrind. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Message-id: 1372929678-14341-1-git-send-email-mohan@in.ibm.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09Extend support of SMBUS(module pm_smbus.c) HST_STS register.MRatnikov1-2/+23
Previous realization doesn't consider flags in the status register. Add DS and INTR bits of HST_STS register set after transaction execution. Update bits resetting in HST_STS register. Update error processing: if DEV_ERR bit set transaction isn't execution. Signed-off-by: MRatnikov <m.o.ratnikov@gmail.com> Message-id: 1373230982-9190-1-git-send-email-m.o.ratnikov@gmail.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-08Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori26-145/+339
pci,misc enhancements This includes some pci enhancements: Better support for systems with multiple PCI root buses FW cfg interface for more robust pci programming in BIOS Minor fixes/cleanups for fw cfg and cross-version migration - because of dependencies with other patches Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Sun 07 Jul 2013 03:11:18 PM CDT using RSA key ID D28D5469 # gpg: Can't check signature: public key not found # By David Gibson (10) and others # Via Michael S. Tsirkin * mst/tags/for_anthony: pci: Fold host_buses list into PCIHostState functionality pci: Remove domain from PCIHostBus pci: Simpler implementation of primary PCI bus pci: Add root bus parameter to pci_nic_init() pci: Add root bus argument to pci_get_bus_devfn() pci: Replace pci_find_domain() with more general pci_root_bus_path() pci: Use helper to find device's root bus in pci_find_domain() pci: Abolish pci_find_root_bus() pci: Move pci_read_devaddr to pci-hotplug-old.c pci: Cleanup configuration for pci-hotplug.c pvpanic: fix fwcfg for big endian hosts pvpanic: initialization cleanup MAINTAINERS: s/Marcelo/Paolo/ e1000: cleanup process_tx_desc pc_piix: cleanup init compat handling pc: pass PCI hole ranges to Guests pci: store PCI hole ranges in guestinfo structure range: add Range structure Message-id: 1373228271-31223-1-git-send-email-mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-07pci: Fold host_buses list into PCIHostState functionalityDavid Gibson1-19/+14
The host_buses list is an odd structure - a list of pointers to PCI root buses existing in parallel to the normal qdev tree structure. This patch removes it, instead putting the link pointers into the PCIHostState structure, which have a 1:1 relationship to PCIHostBus structures anyway. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-07-07pci: Remove domain from PCIHostBusDavid Gibson1-4/+3
There are now no users of the domain field of PCIHostBus, so remove it from the structure, and as a parameter from the pci_host_bus_register() function which sets it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-07-07pci: Simpler implementation of primary PCI busDavid Gibson2-9/+26
Currently pci_find_primary_bus() searches the list of root buses for one with domain 0. But since host buses are always registered with domain 0, this just amounts to finding the only PCI host bus. The only remaining users of pci_find_primary_bus() are in pci-hotplug-old.c, which implements the old style pci_add/pci_del commands. Therefore, this patch redefines pci_find_primary_bus() to find the only PCI root bus, returning an error if there are multiple roots. The callers in pci-hotplug-old.c are updated correspondingly, to produce sensible error messages. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-07-07pci: Add root bus parameter to pci_nic_init()David Gibson16-24/+32
At present, pci_nic_init() and pci_nic_init_nofail() assume that they will only create a NIC under the primary PCI root. As we add support for multiple PCI roots, that may no longer be the case. This patch adds a root bus parameter to pci_nic_init() (and updates callers accordingly) to allow the machine init code using it to specify the right PCI root for NICs created by old-style -net nic parameters. NICs created new-style, with -device can of course be put anywhere. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-07-07pci: Add root bus argument to pci_get_bus_devfn()David Gibson2-5/+6
pci_get_bus_devfn() interprets a full PCI address string to give a PCIBus * and device/function number within that bus. Currently it assumes it is working on an address under the primary PCI root bus. This patch extends it to allow the caller to specify a root bus. This might seem a little odd since the supplied address can (theoretically) include a PCI domain number. However, attempting to use a non-zero domain number there is currently an error, so that shouldn't really cause problems. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-07-07pci: Replace pci_find_domain() with more general pci_root_bus_path()David Gibson7-24/+55
pci_find_domain() is used in a number of places where we want an id for a whole PCI domain (i.e. the subtree under a PCI root bus). The trouble is that many platforms may support multiple independent host bridges with no hardware supplied notion of domain number. This patch, therefore, replaces calls to pci_find_domain() with calls to a new pci_root_bus_path() returning a string. The new call is implemented in terms of a new callback in the host bridge class, so it can be defined in some way that's well defined for the platform. When no callback is available we fall back on the qbus name. Most current uses of pci_find_domain() are for error or informational messages, so the change in identifiers should be harmless. The exception is pci_get_dev_path(), whose results form part of migration streams. To maintain compatibility with old migration streams, the PIIX PCI host is altered to always supply "0000" for this path, which matches the old domain number (since the code didn't actually support domains other than 0). For the pseries (spapr) PCI bridge we use a different platform-unique identifier (pseries machines can routinely have dozens of PCI host bridges). Theoretically that breaks migration streams, but given that we don't yet have migration support for pseries, it doesn't matter. Any other machines that have working migration support including PCI devices will need to be updated to maintain migration stream compatibility. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-07-07pci: Use helper to find device's root bus in pci_find_domain()David Gibson3-10/+15
Currently pci_find_domain() performs two functions - it locates the PCI root bus above the given bus, then looks up that root bus's domain number. This patch adds a helper function to perform the first task, finding the root bus for a given PCI device. This is then used in pci_find_domain(). This changes pci_find_domain()'s signature slightly, taking a PCIDevice instead of a PCIBus - since all callers passed something of the form dev->bus, this simplifies things slightly. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-07-07pci: Abolish pci_find_root_bus()David Gibson3-14/+41
pci_find_root_bus() takes a domain parameter. Currently PCI root buses with domain other than 0 can't be created, so this is more or less a long winded way of retrieving the main PCI root bus. Numbered domains don't actually properly cover the (non x86) possibilities for multiple PCI root buses, so this patch for now enforces the domain == 0 restriction in other places to replace pci_find_root_bus() with an explicit pci_find_primary_bus(). Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-07-07Merge remote-tracking branch 'bonzini/iommu-for-anthony' into stagingAnthony Liguori329-928/+1159
# By Paolo Bonzini (50) and others # Via Paolo Bonzini * bonzini/iommu-for-anthony: (66 commits) exec: change some APIs to take AddressSpaceDispatch exec: remove cur_map exec: put memory map in AddressSpaceDispatch exec: separate current radix tree from the one being built exec: move listener from AddressSpaceDispatch to AddressSpace memory: move MemoryListener declaration earlier exec: separate current memory map from the one being built exec: change well-known physical sections to macros qom: Use atomics for object refcounting memory: add reference counting to FlatView memory: use a new FlatView pointer on every topology update memory: access FlatView from a local variable add a header file for atomic operations hw/[u-x]*: pass owner to memory_region_init* functions hw/t*: pass owner to memory_region_init* functions hw/s*: pass owner to memory_region_init* functions hw/p*: pass owner to memory_region_init* functions hw/n*: pass owner to memory_region_init* functions hw/m*: pass owner to memory_region_init* functions hw/i*: pass owner to memory_region_init* functions ... Message-id: 1372950842-32422-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-04add a header file for atomic operationsPaolo Bonzini2-6/+6
We're already using them in several places, but __sync builtins are just too ugly to type, and do not provide seqcst load/store operations. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04hw/[u-x]*: pass owner to memory_region_init* functionsPaolo Bonzini12-25/+31
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04hw/t*: pass owner to memory_region_init* functionsPaolo Bonzini23-31/+41
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04hw/s*: pass owner to memory_region_init* functionsPaolo Bonzini14-26/+33
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04hw/p*: pass owner to memory_region_init* functionsPaolo Bonzini21-86/+91
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04hw/n*: pass owner to memory_region_init* functionsPaolo Bonzini20-39/+48
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04hw/m*: pass owner to memory_region_init* functionsPaolo Bonzini22-53/+58
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04hw/i*: pass owner to memory_region_init* functionsPaolo Bonzini41-87/+111
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04hw/gpio: pass owner to memory_region_init* functionsPaolo Bonzini4-6/+6
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04hw/d*: pass owner to memory_region_init* functionsPaolo Bonzini15-27/+34
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04hw/c*: pass owner to memory_region_init* functionsPaolo Bonzini19-29/+36
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04hw/block: pass owner to memory_region_init* functionsPaolo Bonzini5-13/+17
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04hw/a*: pass owner to memory_region_init* functionsPaolo Bonzini24-68/+88
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04piolist: add owner argument to initialization functions and pass devicesPaolo Bonzini8-9/+10
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04pam: pass device to init_pam and use it to set ownerPaolo Bonzini3-11/+13
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04spapr_iommu: pass device to spapr_tce_new_table and use it to set ownerPaolo Bonzini3-4/+5
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04vfio: pass device to vfio_mmap_bar and use it to set ownerPaolo Bonzini1-5/+6
Cc: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04ne2000: pass device to ne2000_setup_io, use it as ownerPaolo Bonzini3-5/+5
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04vga: set owner in vga_update_memory_accessPaolo Bonzini1-1/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04vga: pass owner to vga_init_ioPaolo Bonzini3-5/+5
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04vga: pass owner to vga_init_vbePaolo Bonzini6-7/+7
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04vga: pass owner to cirrus_init_commonPaolo Bonzini1-10/+12
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04vga: pass owner to vga_common_initPaolo Bonzini8-10/+10
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04vga: pass owner to vga_initPaolo Bonzini5-5/+7
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04escc: rename struct to ESCCStatePaolo Bonzini1-17/+17
We are using the same struct name for two devices. 8250 is widespread enough that this causes some confusion, rename the other instance. Reviewed-by: Andreas Faerber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>