summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-04-16xen: re-enable refresh interval reporting for xenfbGerd Hoffmann3-39/+24
xenfb informs the guest about the gui refresh interval so it can avoid pointless work. That logic was temporarely disabled for the DisplayState reorganization. Restore it now, with a proper interface for it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16qxl: add 4k + 8k resolutionsGerd Hoffmann1-0/+4
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: gui timer fixesGerd Hoffmann6-67/+60
Make gui update rate adaption code in gui_update() actually work. Sprinkle in a tracepoint so you can see the code at work. Remove the update rate adaption code in vnc and make vnc simply use the generic bits instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: add GraphicHwOpsGerd Hoffmann26-104/+155
Pass a single GraphicHwOps struct pointer to graphic_console_init, instead of a bunch of function pointers. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: make DisplayState private to console.cGerd Hoffmann2-8/+8
With gui_* being moved to console.c nobody outside console.c needs access to DisplayState fields any more. Make the struct private. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: move gui_update+gui_setup_refresh from vl.c into console.cGerd Hoffmann3-51/+50
Pure code motion, no functional changes. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: zap g_width + g_heightGerd Hoffmann1-23/+9
We have a surface per QemuConsole now, so there is no need to keep track of the QemuConsole size any more as we can query the surface size directly at any time. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: simplify screendumpGerd Hoffmann26-451/+73
Screendumps are alot simpler as we can update non-active QemuConsoles now. So we only need to update the QemuConsole we want write out, then dump the DisplaySurface content into a ppm file. Done. No console switching needed. No special support code in the gfx card emulation needed. Zap it all. Also move ppm_save out of the vga code and next to the qmp_screendump function. For now screen dumping is limited to console #0 (like it used to be), even though it is dead simple to extend it to other consoles. I wanna finish the console cleanup before setting new qapi interfaces into stone. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Igor Mitsyanko <i.mitsyanko@gmail.com>
2013-04-16console: give each QemuConsole its own DisplaySurfaceGerd Hoffmann2-28/+69
Go away from the global DisplaySurface, give one to each QemuConsole instead. With this patch applied it is possible to call graphics_hw_* functions with qemu consoles which are not the current foreground console. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: rename vga_hw_*, add QemuConsole paramGerd Hoffmann11-56/+67
Add QemuConsole parameter to vga_hw_*, so the interface allows to update non-active consoles (the actual code can't handle this yet, see next patch). Passing NULL is allowed and updates the active console, like the functions do today. While touching all vga_hw_* calls anyway rename that to the functions to hardware-neutral graphics_hw_* Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: displaystate init revampGerd Hoffmann3-48/+36
We have only one DisplayState, so there is no need for the "next" linking, rip it. Also consolidate all displaystate initialization into init_displaystate(). This function is called by vl.c after creating the devices (and thus all QemuConsoles) and before initializing DisplayChangeListensers (aka gtk/sdl/vnc/spice ui). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: add trace eventsGerd Hoffmann2-0/+7
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: switch color_table_rgb to pixman_color_tGerd Hoffmann1-16/+8
Now that all text console rendering uses pixman we can easily switch the color tables to use pixman_color_t directly. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: use pixman for font renderingGerd Hoffmann1-99/+11
Zap homegrown font rendering code, use pixman calls instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: use pixman for fill+blitGerd Hoffmann1-55/+10
Zap homegrown pixel shuffeling code, use pixman calls instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16pixman: render vgafont glyphs into pixman imagesGerd Hoffmann2-0/+50
Add helper functions to create pixman mask images for glyphs and to render these glyphs into a pixman image. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16pixman: add qemu_pixman_color()Gerd Hoffmann2-0/+13
Helper function to map qemu colors (32bit integer + matching PixelFormat) into pixman_color_t. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16hw/vmware_vga.c: various vmware vga fixes.Gerd Hoffmann2-27/+31
Hardcode depth to 32 bpp. It effectively was that way before because that is the default surface depth, this just makes it explicit in the code. Rename depth to new_depth to make it consistent with the new_width + new_height names. In theory we can make new_depth changeable (i.e. allow the guest to fill in -- say -- 16 there). In practice the guests don't try, the X-Server refuses to start if you ask it to use 16bpp depth (via DefaultDepth in the Screen section). Always return the correct rmask+gmask+bmask values for the given new_depth. Fix mode setting to also verify at new_depth to make sure we have a correct DisplaySurface, even if the current video mode happes to be 16bpp (set by vgabios via bochs vbe interface). While being at it switch over to use qemu_create_displaysurface_from, so the surface is backed by guest-visible video memory and we save a memcpy. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16hw/vmware_vga.c: add tracepoints for mmio reads+writesGerd Hoffmann2-32/+86
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16hw/vmware_vga.c: fix screen resize bug introduced after console revampIgor Mitsyanko1-1/+2
In vmsvga display update function, a pointer to DisplaySurface must be acquired after a call to vmsvga_check_size since this function might replace current DisplaySurface with a new one. Signed-off-by: Igor Mitsyanko <i.mitsyanko@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16exynos4210_fimd.c: fix display resize bug introduced after console revampIgor Mitsyanko1-3/+4
In exynos4210 display update function, we were acquiring DisplaySurface pointer before calling screen resize function, not paying attention that resize procedure can replace current DisplaySurface with newly allocated one. Right thing to do is to initialize DisplaySurface AFTER a call to resize function. Signed-off-by: Igor Mitsyanko <i.mitsyanko@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16target-cris: Override do_interrupt for pre-v32 CPU coresAndreas Färber3-6/+17
Instead of forwarding from cris_cpu_do_interrupt() to do_interruptv10(), override CPUClass::do_interrupt with crisv10_cpu_do_interrupt() in the newly introduced class_init functions. Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-04-16qdev: Set device's parent before calling realize() down inheritance chainIgor Mammedov1-4/+4
Currently device_set_realized() sets parent only after device was realized, but qdev_device_add() sets it before device is realized. Make behavior consistent and alter device_set_realized() to behave like qdev_device_add(). It will allow to set link<> properties in realize() method in classes inherited from DEVICE. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-04-16cpu: Pass CPUState to *cpu_synchronize_post*()Igor Mammedov4-16/+12
... so it could be called without requiring CPUArchState. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-04-16target-i386: Split out CPU creation and features parsingIgor Mammedov2-3/+16
Move CPU creation and features parsing into a separate cpu_x86_create() function, so that board would be able to set board-specific CPU properties before CPU is realized. Keep cpu_x86_init() for compatibility with the code that uses cpu_init() and doesn't need to modify CPU properties. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-04-16target-i386/cpu.c: Coding style fixesEduardo Habkost1-3/+4
* Add braces to 'if' statements; * Remove last TAB character from the source. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> [AF: Changed whitespace] Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-04-16ioapic: Replace FROM_SYSBUS() with QOM type castIgor Mammedov1-1/+1
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-04-16kvmvapic: Replace FROM_SYSBUS() with QOM type castIgor Mammedov1-2/+5
... and define type name and type cast macro for kvmvapic according to accepted convention. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-04-16target-i386: Split APIC creation from initialization in x86_cpu_realizefn()Igor Mammedov1-3/+21
When APIC is hotplugged during CPU hotplug, device_set_realized() calls device_reset() on it. And if QEMU runs in KVM mode, following call chain will fail: apic_reset_common() -> kvm_apic_vapic_base_update() -> kvm_vcpu_ioctl(cpu->kvm_fd,...) due to cpu->kvm_fd not being initialized yet. cpu->kvm_fd is initialized during qemu_init_vcpu() but x86_cpu_apic_init() can't be moved after it because kvm_init_vcpu() -> kvm_arch_reset_vcpu() relies on APIC to determine if CPU is BSP for setting initial env->mp_state. So split APIC device creation from its initialization and realize APIC after CPU is created, when it's safe to call APIC's reset method. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: liguang <lig.fnst@cn.fujitsu.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-04-16target-i386: Consolidate error propagation in x86_cpu_realizefn()Igor Mammedov1-7/+10
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-04-16qdev: Add qdev property for bool typeIgor Mammedov2-0/+43
Signed-off-by: Igor Mammedov <imammedo@redhat.com> [AF: Use new qdev_prop_set_after_realize()] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-04-16target-i386: Improve -cpu ? features outputJan Kiszka1-8/+6
We were missing a bunch of feature lists. Fix this by simply dumping the meta list feature_word_info. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-04-16target-i386: Fix including "host" in -cpu ? outputJan Kiszka1-3/+6
kvm_enabled() cannot be true at this point because accelerators are initialized much later during init. Also, hiding this makes it very hard to discover for users. Simply dump unconditionally if CONFIG_KVM is set. Add explanation for "host" CPU type. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-04-15virtio-balloon: fix dynamic properties.KONRAD Frederic2-0/+70
To keep compatibility with the old virtio-balloon-x, add the dynamic properties to virtio-balloon-pci and virtio-balloon-ccw. Cc: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Message-id: 1365941220-8114-1-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-15Merge remote-tracking branch 'bonzini/hw-dirs' into stagingAnthony Liguori153-319/+290
* bonzini/hw-dirs: exec: remove useless declarations from memory-internal.h memory: move core typedefs to qemu/typedefs.h include: avoid useless includes of exec/ headers sysemu: avoid proliferation of include/ subdirectories tpm: reorganize headers and split hardware part configure: fix TPM logic acpi.h: make it self contained acpi: move declarations from pc.h to acpi.h hw: Add lost ARM core again Fix failure to create q35 machine Add linux-headers to QEMU_INCLUDES arm: fix location of some include files Conflicts: configure aliguori: trivial conflict in configure output Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-15Allow qtest to be used together with a virtual CPUEdgar E. Iglesias1-0/+4
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Message-id: 1366054097-14132-1-git-send-email-edgar.iglesias@gmail.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-15qdev: Fix QOM unrealize behaviorAndreas Färber2-8/+19
Since commit 249d41720b7dfbb5951b430b9eefdbee7464f515 (qdev: Prepare "realized" property) setting realized = true would register the device's VMStateDescription, but realized = false would not unregister it. Fix that. Moving the code from unparenting also revealed that we were calling DeviceClass::init through DeviceClass::realize as interim solution but DeviceClass::exit still at unparenting time with a realized check. Make this symmetrical by implementing DeviceClass::unrealize to call it, while we're setting realized = false in the unparenting path. The only other unrealize user is mac_nvram, which can safely override it. Thus, mark DeviceClass::exit as obsolete, new devices should implement DeviceClass::unrealize instead. Cc: qemu-stable@nongnu.org Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Message-id: 1366043650-9719-1-git-send-email-afaerber@suse.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-15Merge branch 'tcg-ppc64' of git://github.com/rth7680/qemuAurelien Jarno4-457/+968
* 'tcg-ppc64' of git://github.com/rth7680/qemu: (33 commits) tcg-ppc64: Handle deposit of zero tcg-ppc64: Implement mulu2/muls2_i64 tcg-ppc64: Implement add2/sub2_i64 tcg-ppc64: Use getauxval for ISA detection tcg-ppc64: Implement movcond tcg-ppc64: Use ISEL for setcond tcg-ppc64: Use MFOCRF instead of MFCR tcg-ppc64: Cleanup i32 constants to tcg_out_cmp tcg-ppc64: Use TCGType throughout compares tcg-ppc64: Use I constraint for mul tcg-ppc64: Implement deposit tcg-ppc64: Handle constant inputs for some compound logicals tcg-ppc64: Implement compound logicals tcg-ppc64: Implement bswap64 tcg-ppc64: Implement bswap16 and bswap32 tcg-ppc64: Implement rotates tcg-ppc64: Streamline qemu_ld/st insn selection tcg-ppc64: Use automatic implementation of ext32u_i64 tcg-ppc64: Improve and_i64 with constant tcg-ppc64: Improve and_i32 with constant ...
2013-04-15Add -f FMT / --format FMT arg to qemu-nbdDaniel P. Berrange2-2/+20
Currently the qemu-nbd program will auto-detect the format of any disk it is given. This behaviour is known to be insecure. For example, if qemu-nbd initially exposes a 'raw' file to an unprivileged app, and that app runs 'qemu-img create -f qcow2 -o backing_file=/etc/shadow /dev/nbd0' then the next time the app is started, the qemu-nbd will now detect it as a 'qcow2' file and expose /etc/shadow to the unprivileged app. The only way to avoid this is to explicitly tell qemu-nbd what disk format to use on the command line, completely disabling auto-detection. This patch adds a '-f' / '--format' arg for this purpose, mirroring what is already available via qemu-img and qemu commands. qemu-nbd --format raw -p 9000 evil.img will now always use raw, regardless of what format 'evil.img' looks like it contains Signed-off-by: Daniel P. Berrange <berrange@redhat.com> [Use errx, not err. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-15tcg-ppc64: Handle deposit of zeroRichard Henderson1-6/+16
The TCG optimizer does great work when inserting constants, being able to fold the open-coded deposit expansion to just an AND or an OR. Avoid a bit the regression caused by having the deposit opcode by expanding deposit of zero as an AND. Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-04-15tcg-ppc64: Implement mulu2/muls2_i64Richard Henderson2-2/+29
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-04-15tcg-ppc64: Implement add2/sub2_i64Richard Henderson2-2/+58
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-04-15tcg-ppc64: Use getauxval for ISA detectionRichard Henderson2-0/+32
Glibc 2.16 includes an easy way to get feature bits previously buried in /proc or the program startup auxiliary vector. Use it. Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-04-15tcg-ppc64: Implement movcondRichard Henderson2-2/+61
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-04-15tcg-ppc64: Use ISEL for setcondRichard Henderson1-62/+119
There are a few simple special cases that should be handled first. Break these out to subroutines to avoid code duplication. Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-04-15tcg-ppc64: Use MFOCRF instead of MFCRRichard Henderson1-4/+8
It takes half the cycles to read one CR register instead of all 8. This is a backward compatible addition to the ISA, so chips prior to Power 2.00 spec will simply continue to read the entire CR register. Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-04-15tcg-ppc64: Cleanup i32 constants to tcg_out_cmpRichard Henderson1-0/+5
Nothing else in the call chain ensures that these constants don't have garbage in the high bits. Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-04-15tcg-ppc64: Use TCGType throughout comparesRichard Henderson1-19/+19
The optimization/bug being fixed is that tcg_out_cmp was not applying the right type to loading a constant, in the case it can't be implemented directly. Rather than recomputing the TCGType enum from the arch64 bool, pass around the original TCGType throughout. Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-04-15tcg-ppc64: Use I constraint for mulRichard Henderson1-12/+12
The mul_i32 pattern was loading non-16-bit constants into a register, when we can get the middle-end to do that for us. The mul_i64 pattern was not considering that MULLI takes 64-bit inputs. Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-04-15tcg-ppc64: Implement depositRichard Henderson2-2/+14
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>