summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* qom/cpu: move tlb_flush to cpu_common_resetAlex Bennée2017-01-1329-50/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | It is a common thing amongst the various cpu reset functions want to flush the SoftMMU's TLB entries. This is done either by calling tlb_flush directly or by way of a general memset of the CPU structure (sometimes both). This moves the tlb_flush call to the common reset function and additionally ensures it is only done for the CONFIG_SOFTMMU case and when tcg is enabled. In some target cases we add an empty end_of_reset_fields structure to the target vCPU structure so have a clear end point for any memset which is resetting value in the structure before CPU_COMMON (where the TLB structures are). While this is a nice clean-up in general it is also a precursor for changes coming to cputlb for MTTCG where the clearing of entries can't be done arbitrarily across vCPUs. Currently the cpu_reset function is usually called from the context of another vCPU as the architectural power up sequence is run. By using the cputlb API functions we can ensure the right behaviour in the future. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
* Merge remote-tracking branch ↵Peter Maydell2017-01-124-1/+188
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/bkoppelmann/tags/pull-tricore-2017-01-11-2' into staging TriCore FPU patches # gpg: Signature made Wed 11 Jan 2017 13:40:11 GMT # gpg: using RSA key 0x0AD2C6396B69CA14 # gpg: Good signature from "Bastian Koppelmann <kbastian@mail.uni-paderborn.de>" # Primary key fingerprint: 6E63 6A7E 83F2 DD0C FA6E 6E37 0AD2 C639 6B69 CA14 * remotes/bkoppelmann/tags/pull-tricore-2017-01-11-2: target-tricore: Add updfl instruction target-tricore: Added new JNE instruction variant target-tricore: Added new MOV instruction variant target-tricore: Added MADD.F and MSUB.F instructions target-tricore: Added FTOUZ instruction Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * target-tricore: Add updfl instructionBastian Koppelmann2017-01-113-0/+18
| | | | | | | | | | Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Reviewed-by: Richard Henderson <rth@twiddle.net>
| * target-tricore: Added new JNE instruction variantPeer Adelt2017-01-112-0/+20
| | | | | | | | | | | | | | | | | | | | If D[15] is != sign_ext(const4) then PC will be set to (PC + zero_ext(disp4 + 16)). [BK: fixed style errors] Signed-off-by: Peer Adelt <peer.adelt@c-lab.de> Message-Id: <1465314555-11501-5-git-send-email-peer.adelt@c-lab.de> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
| * target-tricore: Added new MOV instruction variantPeer Adelt2017-01-112-0/+17
| | | | | | | | | | | | | | | | | | | | | | Puts the content of data register D[a] into E[c][63:32] and the content of data register D[b] into E[c][31:0]. [BK: fix style error] [BK: Allocate temporaries only when needed] Signed-off-by: Peer Adelt <peer.adelt@c-lab.de> Message-Id: <1465314555-11501-4-git-send-email-peer.adelt@c-lab.de> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
| * target-tricore: Added MADD.F and MSUB.F instructionsBastian Koppelmann2017-01-113-1/+102
| | | | | | | | | | | | | | | | Multiplies D[a] and D[b] and adds/subtracts the result to/from D[d]. The result is put in D[c]. All operands are floating-point numbers. Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Reviewed-by: Richard Henderson <rth@twiddle.net>
| * target-tricore: Added FTOUZ instructionBastian Koppelmann2017-01-113-0/+31
| | | | | | | | | | | | | | | | Converts a 32-bit floating point number to an unsigned int. The result is rounded towards zero. Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Reviewed-by: Richard Henderson <rth@twiddle.net>
* | Merge remote-tracking branch 'remotes/kraxel/tags/pull-vga-20170111-1' into ↵Peter Maydell2017-01-123-5/+26
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging vga: fixes for virtio-gpu and cirrus. # gpg: Signature made Wed 11 Jan 2017 10:24:24 GMT # gpg: using RSA key 0x4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/pull-vga-20170111-1: virtio-gpu: tag as not hotpluggable virtio-gpu: Fix memory leak in virtio_gpu_load() virtio-gpu: Recalculate VirtIOGPU::hostmem on VM load display: cirrus: ignore source pitch value as needed in blit_is_unsafe virtio-gpu: fix information leak in capset get dispatch Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | virtio-gpu: tag as not hotpluggableGerd Hoffmann2017-01-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | qemu can't hotplug display devices. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1483970138-20360-1-git-send-email-kraxel@redhat.com
| * | virtio-gpu: Fix memory leak in virtio_gpu_load()Peter Maydell2017-01-111-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity points out that if we fail in the "creating resources" loop in virtio_gpu_load() we will leak various resources (CID 1356431). Failing a VM load is going to leave the simulation in a complete mess, but we can tidy up to the point that a full system reset should get us back to sanity. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1483969123-14839-3-git-send-email-peter.maydell@linaro.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | virtio-gpu: Recalculate VirtIOGPU::hostmem on VM loadPeter Maydell2017-01-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'hostmem' field in VirtIOGPU is used to track the total memory used in pixmaps so that we can impose a maximum limit on it. However this field is neither migrated nor recalculated on VM load, which means that after a migration it will be incorrectly too low, which can allow the guest to use more pixmap memory than it should. The per-resource hostmem fields are not filled in either as we reallocate them in the load function. Recalculate the memory used for each pixmap and the total memory used as we reallocate the pixmaps in virtio_gpu_load(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1483969123-14839-2-git-send-email-peter.maydell@linaro.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | display: cirrus: ignore source pitch value as needed in blit_is_unsafeBruce Rogers2017-01-111-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 4299b90 added a check which is too broad, given that the source pitch value is not required to be initialized for solid fill operations. This patch refines the blit_is_unsafe() check to ignore source pitch in that case. After applying the above commit as a security patch, we noticed the SLES 11 SP4 guest gui failed to initialize properly. Signed-off-by: Bruce Rogers <brogers@suse.com> Message-id: 20170109203520.5619-1-brogers@suse.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | virtio-gpu: fix information leak in capset get dispatchLi Qiang2017-01-111-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | In virgl_cmd_get_capset function, it uses g_malloc to allocate a response struct to the guest. As the 'resp'struct hasn't been full initialized it will lead the 'resp->padding' field to the guest. Use g_malloc0 to avoid this. Signed-off-by: Li Qiang <liqiang6-s@360.cn> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 58188cae.4a6ec20a.3d2d1.aff2@mx.google.com [ kraxel: resolved conflict ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | Merge remote-tracking branch 'remotes/kraxel/tags/pull-audio-20170111-1' ↵Peter Maydell2017-01-124-21/+53
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging audio: qomify drivers, hotplug fixes. # gpg: Signature made Wed 11 Jan 2017 09:32:09 GMT # gpg: using RSA key 0x4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/pull-audio-20170111-1: es1370: wire up reset via DeviceClass audio: ac97: add exit function audio: es1370: add exit function hw/audio: QOM'ify pl041.c hw/audio: QOM'ify marvell_88w8618.c Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | es1370: wire up reset via DeviceClassGerd Hoffmann2017-01-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Instead of using qemu_register_reset(). That way we get proper cleanup for free. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1484054281-26139-1-git-send-email-kraxel@redhat.com
| * | audio: ac97: add exit functionLi Qiang2017-01-111-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the ac97 device emulation doesn't have a exit function, hot unplug this device will leak some memory. Add a exit function to avoid this. Signed-off-by: Li Qiang <liqiang6-s@360.cn> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 58520052.4825ed0a.27a71.6cae@mx.google.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | audio: es1370: add exit functionLi Qiang2017-01-111-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the es1370 device emulation doesn't have a exit function, hot unplug this device will leak some memory. Add a exit function to avoid this. Signed-off-by: Li Qiang <liqiang6-s@360.cn> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 585200c9.a968ca0a.1ab80.4c98@mx.google.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | hw/audio: QOM'ify pl041.cxiaoqiang zhao2017-01-111-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | split the old SysBus init function into an instance_init and Device realize function Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com> Message-id: 20161231011720.3965-3-zxq_yx_007@163.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | hw/audio: QOM'ify marvell_88w8618.cxiaoqiang zhao2017-01-111-7/+11
| |/ | | | | | | | | | | | | | | | | split the old SysBus init function into an instance_init and Device realize function Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com> Message-id: 20161231011720.3965-2-zxq_yx_007@163.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20170110' into stagingPeter Maydell2017-01-1282-1111/+2603
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TCG opcodes for extract, clz, ctz, ctpop # gpg: Signature made Wed 11 Jan 2017 02:12:41 GMT # gpg: using RSA key 0xAD1270CC4DD0279B # gpg: Good signature from "Richard Henderson <rth7680@gmail.com>" # gpg: aka "Richard Henderson <rth@redhat.com>" # gpg: aka "Richard Henderson <rth@twiddle.net>" # Primary key fingerprint: 9CB1 8DDA F8E8 49AD 2AFC 16A4 AD12 70CC 4DD0 279B * remotes/rth/tags/pull-tcg-20170110: (65 commits) tcg/i386: Handle ctpop opcode tcg/ppc: Handle ctpop opcode tcg: Use ctpop to generate ctz if needed tests: New test-bitcnt qemu/host-utils.h: Reduce the operation count in the fallback ctpop target-i386: Use ctpop helper target-tilegx: Use ctpop helper target-sparc: Use ctpop helper target-s390x: Avoid a loop for popcnt target-ppc: Use ctpop helper target-alpha: Use ctpop helper tcg: Add opcode for ctpop target-xtensa: Use clrsb helper target-tricore: Use clrsb helper target-arm: Use clrsb helper tcg: Add helpers for clrsb tcg/i386: Rely on undefined/undocumented behaviour of BSF/BSR tcg/i386: Handle ctz and clz opcodes tcg/i386: Allow bmi2 shiftx to have non-matching operands tcg/i386: Hoist common arguments in tcg_out_op ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | tcg/i386: Handle ctpop opcodeRichard Henderson2017-01-102-3/+14
| | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | tcg/ppc: Handle ctpop opcodeRichard Henderson2017-01-102-3/+14
| | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | tcg: Use ctpop to generate ctz if neededRichard Henderson2017-01-101-40/+60
| | | | | | | | | | | | | | | | | | | | | Particularly when andc is also available, this is two insns shorter than using clz to compute ctz. Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | tests: New test-bitcntAlex Bennée2017-01-103-0/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add some unit tests for bit count functions (currently only ctpop). As the routines are based on the Hackers Delight optimisations I based the test patterns on their tests. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | qemu/host-utils.h: Reduce the operation count in the fallback ctpopRichard Henderson2017-01-101-14/+11Star
| | | | | | | | | | | | | | | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | target-i386: Use ctpop helperRichard Henderson2017-01-105-29/+15Star
| | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | target-tilegx: Use ctpop helperRichard Henderson2017-01-103-7/+1Star
| | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | target-sparc: Use ctpop helperRichard Henderson2017-01-103-7/+1Star
| | | | | | | | | | | | | | | Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | target-s390x: Avoid a loop for popcntRichard Henderson2017-01-101-9/+6Star
| | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | target-ppc: Use ctpop helperRichard Henderson2017-01-103-18/+9Star
| | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | target-alpha: Use ctpop helperRichard Henderson2017-01-103-8/+1Star
| | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | tcg: Add opcode for ctpopRichard Henderson2017-01-1016-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | The number of actual invocations of ctpop itself does not warrent an opcode, but it is very helpful for POWER7 to use in generating an expansion for ctz. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | target-xtensa: Use clrsb helperRichard Henderson2017-01-101-10/+1Star
| | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | target-tricore: Use clrsb helperRichard Henderson2017-01-103-7/+1Star
| | | | | | | | | | | | | | | | | | Tested-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | target-arm: Use clrsb helperRichard Henderson2017-01-103-16/+4Star
| | | | | | | | | | | | | | | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | tcg: Add helpers for clrsbRichard Henderson2017-01-104-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | The number of actual invocations does not warrent an opcode, and the backends generating it. But at least we can eliminate redundant helpers. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | tcg/i386: Rely on undefined/undocumented behaviour of BSF/BSRRichard Henderson2017-01-101-13/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ISA manual documents the output is undefined if the input was zero. However, we document in target-i386 that the behavior of real silicon is to preserve the contents of the output register. We also mention that there are real applications that depend on this. That this is baked into silicon is mentioned as a potential cause for some false sharing behaviour wrt lzcnt/tzcnt. Taking advantage of this allows us to save 2 insns in the normal case, and 4 insns for i686 emulating a 64-bit clz. Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | tcg/i386: Handle ctz and clz opcodesRichard Henderson2017-01-102-13/+120
| | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | tcg/i386: Allow bmi2 shiftx to have non-matching operandsRichard Henderson2017-01-101-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we could not have different constraints for different ISA levels, which prevented us from eliding the matching constraint for shifts. We do now have to make sure that the operands match for constant shifts. We can also handle some small left shifts via lea. Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | tcg/i386: Hoist common arguments in tcg_out_opRichard Henderson2017-01-101-102/+95Star
| | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | tcg/i386: Fuly convert tcg_target_op_defRichard Henderson2017-01-101-142/+198
| | | | | | | | | | | | | | | | | | | | | Use a switch instead of searching a table. Share constraints between 32-bit and 64-bit, when at all possible. Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | tcg/s390: Handle clz opcodeRichard Henderson2017-01-102-2/+36
| | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | tcg/mips: Handle clz opcodeRichard Henderson2017-01-102-2/+51
| | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | tcg/arm: Handle ctz and clz opcodesRichard Henderson2017-01-102-2/+29
| | | | | | | | | | | | | | | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | tcg/aarch64: Handle ctz and clz opcodesRichard Henderson2017-01-102-4/+52
| | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | tcg/ppc: Handle ctz and clz opcodesRichard Henderson2017-01-102-4/+73
| | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | target-i386: Use clz and ctz opcodesRichard Henderson2017-01-103-30/+14Star
| | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | target-arm: Use clz opcodeRichard Henderson2017-01-106-25/+7Star
| | | | | | | | | | | | | | | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | target-xtensa: Use clz opcodeRichard Henderson2017-01-103-17/+11Star
| | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * | target-unicore32: Use clz opcodeRichard Henderson2017-01-103-16/+3Star
| | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>