summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* target-i386: commonize checks for 2MB and 4KB pagesPaolo Bonzini2014-06-051-83/+44
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* target-i386: fix coding standards in x86_cpu_handle_mmu_faultPaolo Bonzini2014-06-051-5/+9
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* target-i386: simplify SMAP handling in MMU_KSMAP_IDXPaolo Bonzini2014-06-052-9/+5
| | | | | | | Do not use this MMU index at all if CR4.SMAP is false, and drop the SMAP check from x86_cpu_handle_mmu_fault. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* target-i386: fix kernel accesses with SMAP and CPL = 3Paolo Bonzini2014-06-053-8/+33
| | | | | | | | | With SMAP, implicit kernel accesses from user mode always behave as if AC=0. To do this, kernel mode is not anymore a separate MMU mode. Instead, KERNEL_IDX is renamed to KSMAP_IDX and the kernel mode accessors wrap KSMAP_IDX and KNOSMAP_IDX. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* target-i386: move check_io helpers to seg_helper.cPaolo Bonzini2014-06-052-42/+42
| | | | | | Prepare for adding _kernel accessors there in the next patch. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* target-i386: rename KSMAP to KNOSMAPPaolo Bonzini2014-06-052-7/+7
| | | | | | This is the mode where SMAP is overridden, put "NO" in its name. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* softmmu: move all load/store functions to cpu_ldst.hPaolo Bonzini2014-06-056-376/+368
| | | | | | | | Unify pieces of cpu-all.h, exec-all.h, softmmu_exec.h and tcg/tcg.h into a single new header file with all helpers. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* softmmu: introduce cpu_ldst.hPaolo Bonzini2014-06-0550-60/+84
| | | | | | | | | | This will collect all load and store helpers soon. For now it is just a replacement for softmmu_exec.h, which this patch stops including directly, but we also include it where this will be necessary in order to simplify the next patch. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* target-arm: move arm_*_code to a separate filePaolo Bonzini2014-06-055-22/+50
| | | | | | | These will soon require cpu_ldst.h, so move them out of cpu.h. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* softmmu: move softmmu_template.h out of include/Paolo Bonzini2014-06-052-8/+8
| | | | | | | It is only included in cputlb.c now. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* softmmu: commonize helper definitionsPaolo Bonzini2014-06-0518-220/+19
| | | | | | | | | They do not need to be in op_helper.c. Because cputlb.c now includes softmmu_template.h twice for each size, io_readX must be elided the second time through. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* softmmu: move ALIGNED_ONLY to cpu.hPaolo Bonzini2014-06-058-4/+5
| | | | | | | Prepare for moving softmmu_header.h inclusion out of .c files Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* softmmu: make do_unaligned_access a method of CPUPaolo Bonzini2014-06-0514-37/+63
| | | | | | | | | We will reference it from more files in the next patch. To avoid ruining the small steps we're making towards multi-target, make it a method of CPU rather than just a global. Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* softmmu: move definition of CPU_MMU_INDEX to inclusion site, drop ACCESS_TYPEPaolo Bonzini2014-06-053-27/+16
| | | | | Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* softmmu: move MMUSUFFIX under SOFTMMU_CODE_ACCESSPaolo Bonzini2014-06-051-9/+2
| | | | | Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* softmmu: start introducing SOFTMMU_CODE_ACCESS in softmmu_header.hPaolo Bonzini2014-06-052-5/+5
| | | | | | | | | This preprocessor symbol is already used in softmmu_template.h. We will use it to distinguish the two "fake" ACCESS_TYPEs NB_MMU_MODES and NB_MMU_MODES + 1. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* hw: use ld_p/st_p instead of ld_raw/st_rawPaolo Bonzini2014-06-0510-253/+253
| | | | | | | | | | The ld_raw and st_raw definitions are only needed in code that must compile for both user-mode and softmmu emulation. Device models can use the equivalent ld_p/st_p which are simple pointer accessors. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* nseries: clean up coding stylePaolo Bonzini2014-06-051-127/+145
| | | | | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* cputlb: Fix regression with TCG interpreter (bug 1310324)Stefan Weil2014-06-051-2/+4
| | | | | | | | | | | | | | | | | | | | | Commit 0f842f8a246f2b5b51a11c13f933bf7a90ae8e96 replaced GETPC_EXT() which was derived from GETPC() by GETRA_EXT() without fixing cputlb.c. A later patch replaced GETRA_EXT() by GETRA() in exec/softmmu_template.h which is included in cputlb.c. The TCG interpreter failed because the values returned by GETRA() were no longer explicitly set to 0. The redefinition of GETRA() introduced here fixes this. In addition, GETPC_ADJ which is also used in exec/softmmu_template.h is set to 0. Both changes reduce the compiled code size for cputlb.c by more than 100 bytes, so the normal TCG without interpreter also profits from the reduced code size and slightly faster code. Cc: qemu-stable@nongnu.org Reported-by: Giovanni Mascellani <gio@debian.org> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Merge remote-tracking branch ↵Peter Maydell2014-06-033-48/+392
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/awilliam/tags/vfio-pci-for-qemu-20140602.0' into staging VFIO patches: realtek NIC quirk + SPAPR IOMMU AddressSpace support # gpg: Signature made Mon 02 Jun 2014 22:44:42 BST using RSA key ID 3BB08B22 # gpg: Can't check signature: public key not found * remotes/awilliam/tags/vfio-pci-for-qemu-20140602.0: vfio: Add guest side IOMMU support vfio: Create VFIOAddressSpace objects as needed vfio: Introduce VFIO address spaces vfio: Rework to have error paths vfio: Fix 128 bit handling int128: Add int128_exts64() memory: Sanity check that no listeners remain on a destroyed AddressSpace vfio-pci: Quirk RTL8168 NIC Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * vfio: Add guest side IOMMU supportDavid Gibson2014-05-301-5/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch uses the new IOMMU notifiers to allow VFIO pass through devices to work with guest side IOMMUs, as long as the host-side VFIO iommu has sufficient capability and granularity to match the guest side. This works by tracking all map and unmap operations on the guest IOMMU using the notifiers, and mirroring them into VFIO. There are a number of FIXMEs, and the scheme involves rather more notifier structures than I'd like, but it should make for a reasonable proof of concept. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * vfio: Create VFIOAddressSpace objects as neededDavid Gibson2014-05-301-16/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, VFIO has a notion of different logical DMA address spaces, but only ever uses one (system memory). This patch extends this, creating new VFIOAddressSpace objects as necessary, according to the AddressSpace reported by the PCI subsystem for this device's DMAs. This isn't enough yet to support guest side IOMMUs with VFIO, but it does mean we could now support VFIO devices on, for example, a guest side PCI host bridge which maps system memory at somewhere other than 0 in PCI space. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * vfio: Introduce VFIO address spacesDavid Gibson2014-05-301-13/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only model so far supported for VFIO passthrough devices is the model usually used on x86, where all of the guest's RAM is mapped into the (host) IOMMU and there is no IOMMU visible in the guest. This patch begins to relax this model, introducing the notion of a VFIOAddressSpace. This represents a logical DMA address space which will be visible to one or more VFIO devices by appropriate mapping in the (host) IOMMU. Thus the currently global list of containers becomes local to a VFIOAddressSpace, and we verify that we don't attempt to add a VFIO group to multiple address spaces. For now, only one VFIOAddressSpace is created and used, corresponding to main system memory, that will change in future patches. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * vfio: Rework to have error pathsAlexey Kardashevskiy2014-05-301-26/+32
| | | | | | | | | | | | | | | | This reworks vfio_connect_container() and vfio_get_group() to have common exit path at the end of the function bodies. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * vfio: Fix 128 bit handlingAlexey Kardashevskiy2014-05-301-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Upcoming VFIO on SPAPR PPC64 support will initialize the IOMMU memory region with UINT64_MAX (2^64 bytes) size so int128_get64() will assert. The patch takes care of this check. The existing type1 IOMMU code is not expected to map all 64 bits of RAM so the patch does not touch that part. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * int128: Add int128_exts64()Alexey Kardashevskiy2014-05-301-0/+5
| | | | | | | | | | | | | | | | This adds macro to extend signed 64bit value to signed 128bit value. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * memory: Sanity check that no listeners remain on a destroyed AddressSpaceDavid Gibson2014-05-301-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment, most AddressSpace objects last as long as the guest system in practice, but that could well change in future. In addition, for VFIO we will be introducing some private per-AdressSpace information, which must be disposed of before the AddressSpace itself is destroyed. To reduce the chances of subtle bugs in this area, this patch adds asssertions to ensure that when an AddressSpace is destroyed, there are no remaining MemoryListeners using that AS as a filter. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * vfio-pci: Quirk RTL8168 NICAlex Williamson2014-05-301-0/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This device is ridiculous. It has two MMIO BARs, BAR4 and BAR2. BAR4 hosts the MSI-X table, so oviously it would be too easy to access it directly, instead it creates a window register in BAR2 that, among other things, provides access to the MSI-X table. This means MSI-X doesn't work in the guest because the driver actually manages to program the physical table. When interrupt remapping is present, the device MSI will be blocked. The Linux driver doesn't make use of this window, so apparently it's not required to make use of MSI-X. This quirk makes the device work with the Windows driver that does use this window for MSI-X, but I certainly cannot recommend this device for assignment (the Windows 7 driver also constantly pokes PCI config space). Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* | Merge remote-tracking branch 'remotes/kraxel/tags/pull-roms-3' into stagingPeter Maydell2014-06-038-0/+0
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | seabios: update to 1.7.5 final # gpg: Signature made Mon 02 Jun 2014 15:49:59 BST using RSA key ID D3E87138 # 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>" * remotes/kraxel/tags/pull-roms-3: seabios: update to 1.7.5 final Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | seabios: update to 1.7.5 finalGerd Hoffmann2014-06-028-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git shortlog since -rc1: Gerd Hoffmann (2): acpi: remove PORT_ACPI_PM_BASE constant Allow using full io region on q35. Kevin O'Connor (2): vgabios: Add debug message if x86emu leal check triggers. python3 fixes for vgabios and csm builds. Paolo Bonzini (1): smm: remove code to handle ACPI disable/enable Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | | Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-8' into stagingPeter Maydell2014-06-0214-154/+405
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtest: improve ehci/uhci test usb: misc fixes, mostly for usb3/xhci # gpg: Signature made Mon 02 Jun 2014 15:40:34 BST using RSA key ID D3E87138 # 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>" * remotes/kraxel/tags/pull-usb-8: xhci: order superspeed ports first xhci: make port reset trace point more verbose usb: add usb_pick_speed usb-host: add HAVE_STREAMS define usb-host: allow attaching usb3 devices to ehci usb: improve ehci/uhci test usb: move ehci register defines to header file usb: add uhci port status reserved bit usb: move uhci register defines to header file qtest: fix qpci_config_writel Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | | xhci: order superspeed ports firstGerd Hoffmann2014-06-022-8/+41
| | | | | | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | xhci: make port reset trace point more verboseGerd Hoffmann2014-06-022-2/+2
| | | | | | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb: add usb_pick_speedGerd Hoffmann2014-06-023-12/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can pick the usb port speed in generic code, by looking at the port and device speed masks and looking for the fastest match. So add a function to do exactly that, and drop the speed setting code from usb_desc_attach as it isn't needed any more. This way we can set the device speed before calling port->ops->attach, which fixes some xhci hotplug issues. https://bugzilla.redhat.com/show_bug.cgi?id=1046873 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb-host: add HAVE_STREAMS defineGerd Hoffmann2014-06-021-7/+11
| | | |
| * | | usb-host: allow attaching usb3 devices to ehciGerd Hoffmann2014-06-021-8/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend compatibility test function to also figure whenever usb3 devices can be supported on ehci. Tweak ep0 maxpacketsize field due to usb2 <-> usb3 difference. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb: improve ehci/uhci testGerd Hoffmann2014-06-022-5/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Attach usb devices to the bus. * Check initial port status register state. * Flip ehci initialization bit. * Check port status register state again to see whenever device handover to ehci worked. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb: move ehci register defines to header fileGerd Hoffmann2014-06-022-78/+83
| | | | | | | | | | | | | | | | | | | | | | | | So we can easily use them in tests. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb: add uhci port status reserved bitGerd Hoffmann2014-06-021-0/+1
| | | | | | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb: move uhci register defines to header fileGerd Hoffmann2014-06-022-35/+40
| | | | | | | | | | | | | | | | | | | | | | | | So we can easily use them in tests. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | qtest: fix qpci_config_writelGerd Hoffmann2014-06-021-1/+1
| |/ / | | | | | | | | | | | | | | | Found by Paolo. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | | Merge remote-tracking branch 'remotes/kraxel/tags/pull-sdl-3' into stagingPeter Maydell2014-06-023-2/+101
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sdl2: add support for text consoles # gpg: Signature made Mon 02 Jun 2014 15:35:20 BST using RSA key ID D3E87138 # 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>" * remotes/kraxel/tags/pull-sdl-3: sdl2: textinput + terminal sdl2: make Ctrl-Alt-<nr> hotkeys show and hide windows console: add kbd_put_string_console console: add kbd_put_qcode_console Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | | sdl2: textinput + terminalGerd Hoffmann2014-06-021-1/+40
| | | | | | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | sdl2: make Ctrl-Alt-<nr> hotkeys show and hide windowsGerd Hoffmann2014-06-021-1/+26
| | | | | | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | console: add kbd_put_string_consoleGerd Hoffmann2014-06-022-0/+10
| | | | | | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | console: add kbd_put_qcode_consoleGerd Hoffmann2014-06-022-0/+25
| |/ / | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | | Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-3' into stagingPeter Maydell2014-06-023-33/+44
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | misc minor vnc patches # gpg: Signature made Mon 02 Jun 2014 15:31:53 BST using RSA key ID D3E87138 # 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>" * remotes/kraxel/tags/pull-vnc-3: vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16,24,32} vnc: add trace events for key events vnc: refuse to set a password with VNC_AUTH_NONE Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | | vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16,24,32}Gonglei2014-06-021-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Spotted by Coverity: (1) Event assignment: Assigning: "pixels" = "0". (2) Event cond_true: Condition "y < h", taking true branch (3) Event cond_false: Condition "x < w", taking false branch (4) Event loop_end: Reached end of loop (5) Event divide_by_zero: In expression "(stats[0] + stats[1]) * 100U / pixels", division by expression "pixels" which may be zero has undefined behavior. 290 DEFINE_DETECT_FUNCTION(16) 291 DEFINE_DETECT_FUNCTION(32) Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | vnc: add trace events for key eventsGerd Hoffmann2014-06-022-4/+31
| | | | | | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | vnc: refuse to set a password with VNC_AUTH_NONEGerd Hoffmann2014-06-021-28/+6
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current code silently changes the authentication settings in case you try to set a password without password authentication turned on. This is bad. Return an error instead. If we want allow changing auth settings at runtime this should be done explicitly using a separate monitor command, not as side effect of set_passwd. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>