Git Product home page Git Product logo

Comments (8)

NattyNarwhal avatar NattyNarwhal commented on May 24, 2024 2

Filed this one upstream

from vmwmouse.

nsapa avatar nsapa commented on May 24, 2024

Qemu's implementation is in hw/i386/vmmouse.c
Passing -device vmmouse when calling qemu-system-i386 should be enough to enable this implementation.

from vmwmouse.

NattyNarwhal avatar NattyNarwhal commented on May 24, 2024

It looks like QEMU faults here:

(gdb) where
#0  i8042_isa_mouse_fake_event (isa=0x0) at ../hw/input/pckbd.c:680
#1  0x000055555584d036 in legacy_mouse_sync (dev=0x7fffdc077610) at ../ui/input-legacy.c:200
#2  0x000055555584eec9 in qemu_input_event_sync_impl () at ../ui/input.c:392
#3  0x0000555555a45984 in gd_motion_event (opaque=0x5555577fe0b0, motion=0x5555567ed340, widget=0x5555579040f0) at ../ui/gtk.c:880
#4  gd_event (widget=0x5555579040f0, event=0x5555567ed340, opaque=0x5555577fe0b0) at ../ui/gtk.c:1168
#5  0x00007ffff6e518c8 in _gtk_marshal_BOOLEAN__BOXEDv () at /lib64/libgtk-3.so.0
#6  0x00007ffff772583a in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
#7  0x00007ffff7725983 in g_signal_emit () at /lib64/libgobject-2.0.so.0
#8  0x00007ffff6e157ab in gtk_widget_event_internal.part.0.lto_priv () at /lib64/libgtk-3.so.0
#9  0x00007ffff6cb8cc0 in propagate_event.lto_priv () at /lib64/libgtk-3.so.0
#10 0x00007ffff6cb9b8a in gtk_main_do_event () at /lib64/libgtk-3.so.0
#11 0x00007ffff699b7d3 in _gdk_event_emit () at /lib64/libgdk-3.so.0
#12 0x00007ffff69d2c16 in gdk_event_source_dispatch.lto_priv.0.lto_priv () at /lib64/libgdk-3.so.0
#13 0x00007ffff760f4cf in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#14 0x0000555555d4c2b8 in glib_pollfds_poll () at ../util/main-loop.c:232
#15 os_host_main_loop_wait (timeout=0) at ../util/main-loop.c:255
#16 main_loop_wait (nonblocking=nonblocking@entry=0) at ../util/main-loop.c:531
#17 0x0000555555ae15f3 in qemu_main_loop () at ../softmmu/runstate.c:726
#18 0x000055555583a2be in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at ../softmmu/main.c:50

Crashing because isa is NULL.

from vmwmouse.

NattyNarwhal avatar NattyNarwhal commented on May 24, 2024

Without optimizations

(gdb) where
#0  0x00005555559a3b2f in i8042_isa_mouse_fake_event (isa=0x0) at ../hw/input/pckbd.c:680
#1  0x0000555555b562cc in vmmouse_mouse_event (opaque=0x555557971000, x=32028, y=21516, dz=0, buttons_state=0) at ../hw/i386/vmmouse.c:124
#2  0x000055555584d0b5 in legacy_mouse_sync (dev=0x7fffdc09c660) at ../ui/input-legacy.c:200
#3  0x0000555555850799 in qemu_input_event_sync_impl () at ../ui/input.c:392
#4  0x00005555558fd067 in replay_input_sync_event () at ../replay/replay-input.c:138
#5  0x00005555558507e4 in qemu_input_event_sync () at ../ui/input.c:404
#6  0x0000555555b135e9 in gd_motion_event (widget=0x555557b920f0, motion=0x555556a7b660, opaque=0x555557a7cca0) at ../ui/gtk.c:880
#7  0x0000555555b13e3a in gd_event (widget=0x555557b920f0, event=0x555556a7b660, opaque=0x555557a7cca0) at ../ui/gtk.c:1168
#8  0x00007ffff6e518c8 in _gtk_marshal_BOOLEAN__BOXEDv () at /lib64/libgtk-3.so.0
#9  0x00007ffff772583a in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
#10 0x00007ffff7725983 in g_signal_emit () at /lib64/libgobject-2.0.so.0
#11 0x00007ffff6e157ab in gtk_widget_event_internal.part.0.lto_priv () at /lib64/libgtk-3.so.0
#12 0x00007ffff6cb8cc0 in propagate_event.lto_priv () at /lib64/libgtk-3.so.0
#13 0x00007ffff6cb9b8a in gtk_main_do_event () at /lib64/libgtk-3.so.0
#14 0x00007ffff699b7d3 in _gdk_event_emit () at /lib64/libgdk-3.so.0
#15 0x00007ffff69d2c16 in gdk_event_source_dispatch.lto_priv.0.lto_priv () at /lib64/libgdk-3.so.0
#16 0x00007ffff760f4cf in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#17 0x0000555555f285e2 in glib_pollfds_poll () at ../util/main-loop.c:232
#18 0x0000555555f2865f in os_host_main_loop_wait (timeout=0) at ../util/main-loop.c:255
#19 0x0000555555f2876d in main_loop_wait (nonblocking=0) at ../util/main-loop.c:531
#20 0x0000555555befdc8 in qemu_main_loop () at ../softmmu/runstate.c:726
#21 0x0000555555839d76 in main (argc=13, argv=0x7fffffffd5c8, envp=0x7fffffffd638) at ../softmmu/main.c:50

from vmwmouse.

NattyNarwhal avatar NattyNarwhal commented on May 24, 2024

It seems we have two of them:

Thread 1 "qemu-system-i38" hit Breakpoint 2, vmmouse_realizefn (dev=0x555557660a60, errp=0x7fffffffcdb0) at ../hw/i386/vmmouse.c:285
285	    VMMouseState *s = VMMOUSE(dev);
(gdb) next
289	    if (!object_resolve_path_type("", TYPE_VMPORT, NULL)) {
(gdb) p s
$9 = (VMMouseState *) 0x555557660a60
(gdb) p *s
$10 = {parent_obj = {parent_obj = {parent_obj = {class = 0x5555569d4940, free = 0x5555558356c0 <g_free@plt>, Python Exception <class 'gdb.error'> There is no member named keys.: 
properties = 0x5555575d19e0, ref = 3, parent = 0x555556a45220}, id = 0x0, canonical_path = 0x0, realized = false, 
      pending_deleted_event = false, pending_deleted_expires_ms = 0, opts = 0x0, hotplugged = 0, allow_unplug_during_migration = false, parent_bus = 0x555556b13960, gpios = {lh_first = 0x0}, clocks = {lh_first = 0x0}, child_bus = {
        lh_first = 0x0}, num_child_bus = 0, instance_id_alias = -1, alias_required_for_version = 0, reset = {count = 0, hold_phase_pending = false, exit_phase_in_progress = false}}, isairq = "\377\377", nirqs = 0, ioport_id = 0}, 
  queue = {0 <repeats 1024 times>}, queue_size = 0, nb_queue = 0, status = 0, absolute = 0 '\000', entry = 0x0, i8042 = 0x555556b88cf0}
(gdb) cont
Continuing.

Thread 1 "qemu-system-i38" hit Breakpoint 2, vmmouse_realizefn (dev=0x5555579712a0, errp=0x7fffffffcf50) at ../hw/i386/vmmouse.c:285
285	    VMMouseState *s = VMMOUSE(dev);
(gdb) next
289	    if (!object_resolve_path_type("", TYPE_VMPORT, NULL)) {
(gdb) p s
$11 = (VMMouseState *) 0x5555579712a0
(gdb) p *s
$12 = {parent_obj = {parent_obj = {parent_obj = {class = 0x5555569d4940, free = 0x5555558356c0 <g_free@plt>, Python Exception <class 'gdb.error'> There is no member named keys.: 
properties = 0x5555578d3f00, ref = 3, parent = 0x555556a3cf90}, id = 0x0, canonical_path = 0x0, realized = false, 
      pending_deleted_event = false, pending_deleted_expires_ms = 0, opts = 0x555557972370, hotplugged = 0, allow_unplug_during_migration = false, parent_bus = 0x555556b13960, gpios = {lh_first = 0x0}, clocks = {lh_first = 0x0}, 
      child_bus = {lh_first = 0x0}, num_child_bus = 0, instance_id_alias = -1, alias_required_for_version = 0, reset = {count = 0, hold_phase_pending = false, exit_phase_in_progress = false}}, isairq = "\377\377", nirqs = 0, 
    ioport_id = 0}, queue = {0 <repeats 1024 times>}, queue_size = 0, nb_queue = 0, status = 0, absolute = 0 '\000', entry = 0x0, i8042 = 0x0}
(gdb) 

And from an info qtree:

        bus: isa.0
          type ISA
          dev: vmmouse, id ""
          dev: port92, id ""
            gpio-out "a20" 1
          dev: vmmouse, id ""
          dev: vmport, id ""
            x-read-set-eax = true
            x-signal-unsupported-cmd = true
            x-report-vmx-type = true
            x-cmds-v2 = true
            vmware-vmx-version = 6 (0x6)
            vmware-vmx-type = 2 (0x2)
          dev: i8042, id ""
            gpio-out "a20" 1
            extended-state = true
            kbd-throttle = false
            isa irqs 1,12

My command line is basically, gdb --args ~/src/qemu/build/qemu-system-i386 -boot c -hda win31.qcow2 -fda install/dos/Disk01.img -vga cirrus -m 16 -device vmmouse; not sure what I'd be doing to confuse it.

from vmwmouse.

supercomputer7 avatar supercomputer7 commented on May 24, 2024

I never had to specify -device vmmouse for QEMU, but I do remember that by doing so it crashed the VM.
The SerenityOS kernel uses VMMouse out of the box with the VMWare backdoor, so if you implemented it correctly for VMWare, it should probably work just fine for QEMU too.

from vmwmouse.

NattyNarwhal avatar NattyNarwhal commented on May 24, 2024

Huh, you're right, it does it out of the box. The fact you can attach it twice is probably what breaks it.

from vmwmouse.

NattyNarwhal avatar NattyNarwhal commented on May 24, 2024

Closing because we actually do support this, and it should be updated in the README. Neat!

from vmwmouse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.