summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2016-05-20aspeed: include qemu/log.hPaolo Bonzini2-0/+2
This is not visible with the default "log" trace backend. With other backends however trace.h does not include qemu/log.h, resulting in build failures. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1463745452-25831-2-git-send-email-pbonzini@redhat.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-05-19hw: clean up hw/hw.h includesPaolo Bonzini1-0/+1
Include qom/object.h and exec/memory.h instead of exec/ioport.h; exec/ioport.h was almost everywhere required only for those two includes, not for the content of the header itself. Remove block/aio.h, everybody is already including it through another path. With this change, include/hw/hw.h is freed from qemu-common.h. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19hw: remove pio_addr_tPaolo Bonzini1-2/+2
pio_addr_t is almost unused, because these days I/O ports are simply accessed through the address space. cpu_{in,out}[bwl] themselves are almost unused; monitor.c and xen-hvm.c could use address_space_read/write directly, since they have an integer size at hand. This leaves qtest as the only user of those functions. On the other hand even portio_* functions use this type; the only interesting use of pio_addr_t thus is include/hw/sysbus.h. I guess I could move it there, but I don't see much benefit in that either. Using uint32_t is enough and avoids the need to include ioport.h everywhere. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19cpu: move exec-all.h inclusion out of cpu.hPaolo Bonzini4-0/+4
exec-all.h contains TCG-specific definitions. It is not needed outside TCG-specific files such as translate.c, exec.c or *helper.c. One generic function had snuck into include/exec/exec-all.h; move it to include/qom/cpu.h. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19hw: explicitly include qemu/log.hPaolo Bonzini84-1/+87
Move the inclusion out of hw/hw.h, most files do not need it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19qemu-common: push cpu.h inclusion out of qemu-common.hPaolo Bonzini19-0/+30
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19acpi: do not use TARGET_PAGE_SIZEPaolo Bonzini1-11/+11
This is a #define used by the CPU. NVDIMM can just use 4K unconditionally. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19s390x: reorganize CSS bits between cpu.h and other headersPaolo Bonzini6-133/+10
Move cpu_inject_* to the only C file where they are used. Move ioinst.h declarations that need S390CPU to cpu.h, to make ioinst.h independent of cpu.h. Move channel declarations that only need SubchDev from cpu.h to css.h, to make more channel users independent of cpu.h. Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19dma: do not depend on kvm_enabled()Paolo Bonzini7-1/+7
Memory barriers are needed also by Xen and, when the ioeventfd bugs are fixed, by TCG as well. sysemu/kvm.h is not anymore needed in sysemu/dma.h, move it to the actual users. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19qemu-common: stop including qemu/host-utils.h from qemu-common.hPaolo Bonzini3-0/+8
Move it to the actual users. There are some inclusions of qemu/host-utils.h in headers, but they are all necessary. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19qemu-common: stop including qemu/bswap.h from qemu-common.hPaolo Bonzini4-0/+4
Move it to the actual users. There are still a few includes of qemu/bswap.h in headers; removing them is left for future work. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19hw: do not use VMSTATE_*TLPaolo Bonzini2-5/+5
Reserve this to CPU state serialization. Luckily, they were only used by sPAPR devices and these are ppc64 only. So there is no change to migration format. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19include: poison symbols in osdep.hPaolo Bonzini1-1/+1
Ensure that all target-independent files ignore poisoned symbols, and fix the fallout. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19apic: move target-dependent definitions to cpu.hPaolo Bonzini1-0/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19explicitly include linux/kvm.hPaolo Bonzini4-0/+6
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19explicitly include qom/cpu.hPaolo Bonzini4-0/+4
exec/cpu-all.h includes qom/cpu.h. Explicit inclusion will keep things working when cpu.h will not be included indirectly almost everywhere (either directly or through qemu-common.h). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19ppc: use PowerPCCPU instead of CPUPPCStatePaolo Bonzini1-10/+10
This changes a cpu.h dependency for hw/ppc/ppc.h into a cpu-qom.h dependency. For it to compile we also need to clean up a few unused definitions. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19mips: use MIPSCPU instead of CPUMIPSStatePaolo Bonzini8-16/+19
This changes a cpu.h dependency into a cpu-qom.h dependency. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19alpha: include cpu-qom.h in files that require AlphaCPUPaolo Bonzini2-1/+1
This will keep things working when cpu.h will not be included indirectly almost everywhere (either directly or through qemu-common.h). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-19arm: include cpu-qom.h in files that require ARMCPUPaolo Bonzini2-1/+1
This will keep things working when cpu.h will not be included indirectly almost everywhere (either directly or through qemu-common.h). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-18Fix some typos found by codespellStefan Weil8-10/+10
Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-05-189p: drop unused declaration from coth.hGreg Kurz1-1/+0
Commit "ebac1202c95a virtio-9p: use QEMU thread pool" dropped function v9fs_init_worker_threads. Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-05-18ipack: Update e-mail addressAlberto Garcia3-3/+3
I'm not really using the old one anymore. Signed-off-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-05-18loader: fix potential memory leakCao jin1-0/+6
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-05-18s390: remove misleading commentMichael Tokarev1-1/+1
The comment talks about a non-ELF object while the example gives ELF object. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-05-17Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20160517' into stagingPeter Maydell10-81/+323
First batch of s390x patches for 2.7: - The new machine for 2.7 - Make use of the runtime instrumentation support introduced in the kernel - Enhance our ipl (boot) process: We can now start from devices in subchannel sets > 0 as well. As a bonus, the conversion to diag308 in the bios allows us to get rid of the gr7 hack. - Xiaoqiang Zhao's SCLP qomification patches - Several fixes in the s390x pci implementation # gpg: Signature made Tue 17 May 2016 15:35:32 BST using RSA key ID C6F02FAF # gpg: Good signature from "Cornelia Huck <huckc@linux.vnet.ibm.com>" # gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>" * remotes/cohuck/tags/s390x-20160517: s390x/pci: remove whitespace s390x/pci: add length checking for pci sclp handlers s390x/pci: enhance mpcifc_service_call s390x/pci: fix s390_pci_sclp_deconfigure s390x/pci: introduce S390PCIBusDevice.iommu_enabled s390x/pci: export pci_dereg_ioat and pci_dereg_irqs s390x/pci: separate s390_pcihost_iommu_configure function s390x/pci: separate s390_sclp_configure function s390x/pci: fix reg_irqs() hw/char: QOM'ify sclpconsole.c hw/char: QOM'ify sclpconsole-lm.c s390x/ipl: Remove redundant usage of gr7 s390-ccw.img: rebuild image pc-bios/s390-ccw: Get device address via diag 308/6 s390x/ipl: Add ssid field to IplParameterBlock s390x/ipl: Provide ipl parameter block s390x/ipl: Add type and length checks for IplParameterBlock values s390x/ipl: Extend the IplParameterBlock struct s390x: enable runtime instrumentation s390x: add compat machine for 2.7 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-05-17s390x/pci: remove whitespaceYi Min Zhao1-5/+5
Fix indentation of PciCfgSccb struct. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-17s390x/pci: add length checking for pci sclp handlersYi Min Zhao1-2/+12
The configure/deconfigure sclp commands need a SCCB with a length of at least 16. Indicate in the response code if this is not fulfilled. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-17s390x/pci: enhance mpcifc_service_callYi Min Zhao2-7/+54
Enhance error handling for mpcifc_service_call() to propagate errors to guest by setting status codes or triggering program interrupts. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-17s390x/pci: fix s390_pci_sclp_deconfigureYi Min Zhao1-0/+7
When deconfiguring a s390 pci device, we should deconfigure the corresponding IOMMU memory region and the IRQs for the device. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-17s390x/pci: introduce S390PCIBusDevice.iommu_enabledYi Min Zhao2-5/+5
We introduce iommu_enabled field for S390PCIBusDevice struct to track whether the iommu has been enabled for the device. This allows us to stop temporarily changing ->configured while en/disabling the iommu and to do conditional cleanup later. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-17s390x/pci: export pci_dereg_ioat and pci_dereg_irqsYi Min Zhao2-5/+8
dereg_irqs and dereg_ioat are needed by external functions. Let's rename and export both of them in s390-pci-inst.h. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-17s390x/pci: separate s390_pcihost_iommu_configure functionYi Min Zhao3-13/+16
Split s390_pcihost_iommu_configure() into separate functions for configuring and deconfiguring in order to make the code more readable. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-17s390x/pci: separate s390_sclp_configure functionYi Min Zhao3-8/+29
Split s390_sclp_configure() into separate functions for sclp configuring and deconfiguring in order to make the code more readable. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-17s390x/pci: fix reg_irqs()Yi Min Zhao1-2/+15
In reg_irqs(), present code assumes that map_indicator() always issues successfully. Let's check it and return the error to caller in order to inform guest. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com> Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-17hw/char: QOM'ify sclpconsole.cxiaoqiang zhao1-4/+8
Drop the DO_UPCAST macro Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com> Message-Id: <1459237645-17227-7-git-send-email-zxq_yx_007@163.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-17hw/char: QOM'ify sclpconsole-lm.cxiaoqiang zhao1-5/+9
Drop the DO_UPCAST macro Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com> Message-Id: <1459237645-17227-6-git-send-email-zxq_yx_007@163.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-17s390x/ipl: Remove redundant usage of gr7Alexander Yarygin1-27/+6
We don't need to pass device address for pc-bios using gr7 anymore as the pcbios completely relies on diag308 now, so we can remove it from qemu. devno, ssid and cssid are migrated but the value was never reused, so we can safely ignore these fields and migrate 0. Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-17s390x/ipl: Add ssid field to IplParameterBlockAlexander Yarygin2-1/+3
Add the ssid field to the ipl parameter block struct and fill it when necessary so the guest can use it. Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-17s390x/ipl: Provide ipl parameter blockAlexander Yarygin2-0/+8
Right now we return the ipl parameter block only if the guest specified one. Let's fill in the parameter block when bootindex parameter is available and not booting from an external kernel. Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-17s390x/ipl: Add type and length checks for IplParameterBlock valuesAlexander Yarygin1-0/+21
We can check for valid type and lengths of the IplParameterBlock fields when receiving the struct from the guest. Length of the IplParameterBlock can be less than 4K. To play safe we can read and write only required amount of data. Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com> Reviewed-by: David Hildenband <dahi@linux.vnet.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-17s390x/ipl: Extend the IplParameterBlock structAlexander Yarygin3-6/+87
The IplParameterBlock struct currently has only 200 bytes filled, but it can be up to 4K. This patch converts the struct to union with a fully populated struct inside it and second struct with old values. For compatibility reasons we disable migration of the extended iplb field for pre-2.7 machines. Also a guest still can read/write only the first 200 bytes of IPLB for now. Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-17s390x: enable runtime instrumentationFan Zhang1-0/+20
Introduce run-time-instrumentation support when running under kvm for virtio-ccw 2.7 machine and make sure older machines can not enable it. The new ri_allowed field in the s390MachineClass serves as an indicator whether the feature can be used by the machine and should therefore be activated if available. riccb_needed() is used to check whether riccb is needed or not in live migration. Signed-off-by: Fan Zhang <zhangfan@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-17s390x: add compat machine for 2.7Cornelia Huck1-1/+20
Also add some of the option cascading we were missing. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-05-16hw/intc/arm_gic: add tracepointsHollis Blanchard1-0/+12
These are obviously critical to understanding interrupt delivery: gic_enable_irq gic_disable_irq gic_set_irq (inbound irq from device models) gic_update_set_irq (outbound irq to CPU) gic_acknowledge_irq The only one that I think might raise eyebrows is gic_update_bestirq, but I've (sadly) debugged problems that ended up being caused by unexpected priorities. Knowing that the GIC has an irq ready, but doesn't deliver to the CPU due to priority, has also proven important. Signed-off-by: Hollis Blanchard <hollis_blanchard@mentor.com> Message-id: 1461252281-22399-1-git-send-email-hollis_blanchard@mentor.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2016-05-13Merge remote-tracking branch 'remotes/lalrae/tags/mips-20160513' into stagingPeter Maydell1-7/+11
MIPS patches 2016-05-13 Changes: * fix zeroing CP0.WatchLo registers in soft reset * QOMify Jazz led # gpg: Signature made Fri 13 May 2016 11:04:04 BST using RSA key ID 0B29DA6B # gpg: Good signature from "Leon Alrae <leon.alrae@imgtec.com>" * remotes/lalrae/tags/mips-20160513: hw/display: QOM'ify jazz_led.c target-mips: fix call to memset in soft reset code Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-05-13hw/display: QOM'ify jazz_led.cxiaoqiang.zhao1-7/+11
* Drop the old SysBus init function and use instance_init * Move graphic_console_init into realize stage Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
2016-05-12tcg: Remove needless CPUState::current_tbSergey Fedorov1-1/+0
This field was used for telling cpu_interrupt() to unlink a chain of TBs being executed when it worked that way. Now, cpu_interrupt() don't do this anymore. So we don't need this field anymore. Signed-off-by: Sergey Fedorov <serge.fdrv@gmail.com> Signed-off-by: Sergey Fedorov <sergey.fedorov@linaro.org> Message-Id: <1462273462-14036-1-git-send-email-sergey.fedorov@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
2016-05-12tb: consistently use uint32_t for tb->flagsEmilio G. Cota1-1/+1
We are inconsistent with the type of tb->flags: usage varies loosely between int and uint64_t. Settle to uint32_t everywhere, which is superior to both: at least one target (aarch64) uses the most significant bit in the u32, and uint64_t is wasteful. Compile-tested for all targets. Suggested-by: Laurent Desnogues <laurent.desnogues@gmail.com> Suggested-by: Richard Henderson <rth@twiddle.net> Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com> Signed-off-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Richard Henderson <rth@twiddle.net> Message-Id: <1460049562-23517-1-git-send-email-cota@braap.org>
2016-05-12Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell16-174/+149
Block layer patches # gpg: Signature made Thu 12 May 2016 14:37:05 BST using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: (69 commits) qemu-iotests: iotests: fail hard if not run via "check" block: enable testing of LUKS driver with block I/O tests block: add support for encryption secrets in block I/O tests block: add support for --image-opts in block I/O tests qemu-io: Add 'write -z -u' to test MAY_UNMAP flag qemu-io: Add 'write -f' to test FUA flag qemu-io: Allow unaligned access by default qemu-io: Use bool for command line flags qemu-io: Make 'open' subcommand more like command line qemu-io: Add missing option documentation qmp: add monitor command to add/remove a child quorum: implement bdrv_add_child() and bdrv_del_child() Add new block driver interface to add/delete a BDS's child qemu-img: check block status of backing file when converting. iotests: fix the redirection order in 083 block: Inactivate all children block: Drop superfluous invalidating bs->file from drivers block: Invalidate all children nbd: Simplify client FUA handling block: Honor BDRV_REQ_FUA during write_zeroes ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>