Skip to content
Snippets Groups Projects
  1. Jan 13, 2022
    • Dmitry Petrov's avatar
      ps2: Initial horizontal scroll support · 64ebbb7d
      Dmitry Petrov authored
      
      This change adds support for horizontal scroll to ps/2 mouse device
      code. The code is implemented to match the logic of linux kernel
      which is used as a reference.
      
      Signed-off-by: default avatarDmitry Petrov <dpetroff@gmail.com>
      Message-Id: <20220108153947.171861-2-dpetroff@gmail.com>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      64ebbb7d
    • Satyeshwar Singh's avatar
      edid: Added support for 4k@60 Hz monitor · f0602b70
      Satyeshwar Singh authored
      
      Previously, the large modes (>1080p) that were generated by Qemu in its EDID
      were all 50 Hz. If we provide them to a Guest OS and the user selects
      one of these modes, then the OS by default only gets 50 FPS. This is
      especially true for Windows OS. With this patch, we are now exposing a
      3840x2160@60 Hz which will allow the guest OS to get 60 FPS.
      
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: default avatarSatyeshwar Singh <satyeshwar.singh@intel.com>
      Message-Id: <20211116221103.27128-1-dongwon.kim@intel.com>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      f0602b70
    • Daniel P. Berrangé's avatar
      edid: set default resolution to 1280x800 (WXGA) · de72c4b7
      Daniel P. Berrangé authored
      
      Currently QEMU defaults to a resolution of 1024x768 when exposing EDID
      info to the guest OS. The EDID default info is important as this will
      influence what resolution many guest OS will configure the screen with
      on boot. It can also potentially influence what resolution the firmware
      will configure the screen with, though until very recently EDK2 would
      not handle EDID info.
      
      One important thing to bear in mind is that the default graphics card
      driver provided by Windows will leave the display set to whatever
      resolution was enabled by the firmware on boot. Even if sufficient
      VRAM is available, the resolution can't be changed without installing
      new drivers. IOW, the default resolution choice is quite important
      for usability of Windows.
      
      Modern real world monitor hardware for desktop/laptop has supported
      resolutions higher than 1024x768 for a long time now, perhaps as long
      as 15+ years. There are quite a wide variety of native resolutions in
      use today, however, and in wide screen form factors the height may not
      be all that tall.
      
      None the less, it is considered that there is scope for making the
      QEMU default resolution slightly larger.
      
      In considering what possible new default could be suitable, choices
      considered were 1280x720 (720p), 1280x800 (WXGA) and 1280x1024 (SXGA).
      
      In many ways, vertical space is the most important, and so 720p was
      discarded due to loosing vertical space, despite being 25% wider.
      
      The SXGA resolution would be good, but when taking into account
      window titlebars/toolbars and window manager desktop UI, this might
      be a little too tall for some users to fit the guest on their physical
      montior.
      
      This patch thus suggests a modest change to 1280x800 (WXGA). This
      only consumes 1 MB per colour channel, allowing double buffered
      framebuffer in 8 MB of VRAM. Width wise this is 25% larger than
      QEMU's current default, but height wise this only adds 5%, so the
      difference isn't massive on the QEMU side.
      
      Overall there doesn't appear to be a compelling reason to stick
      with 1024x768 resolution.
      
      Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Reviewed-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Message-Id: <20211129140508.1745130-1-berrange@redhat.com>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      de72c4b7
    • Philippe Mathieu-Daudé's avatar
      hw/mips/jazz: Inline vga_mmio_init() and remove it · 7336c944
      Philippe Mathieu-Daudé authored
      
      vga_mmio_init() is used only one time and not very helpful,
      inline and remove it.
      
      Reviewed-by: default avatarBALATON Zoltan <balaton@eik.bme.hu>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Message-Id: <20211206224528.563588-5-f4bug@amsat.org>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      7336c944
    • Philippe Mathieu-Daudé's avatar
      hw/display/vga-mmio: QOM'ify vga_mmio_init() as TYPE_VGA_MMIO · 23f6e3b1
      Philippe Mathieu-Daudé authored
      
      Introduce TYPE_VGA_MMIO, a sysbus device.
      
      While there is no change in the vga_mmio_init()
      interface, this is a migration compatibility break
      of the MIPS Acer Pica 61 Jazz machine (pica61).
      
      Suggested-by: default avatarThomas Huth <thuth@redhat.com>
      Reviewed-by: default avatarBALATON Zoltan <balaton@eik.bme.hu>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Message-Id: <20211206224528.563588-4-f4bug@amsat.org>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      23f6e3b1
    • Philippe Mathieu-Daudé's avatar
      hw/display/vga-mmio: Inline vga_mm_init() · 6bd06f77
      Philippe Mathieu-Daudé authored
      
      Inline vga_mm_init() in vga_mmio_init() to simplify the
      next patch review. Kind of.
      
      Reviewed-by: default avatarBALATON Zoltan <balaton@eik.bme.hu>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20211206224528.563588-3-f4bug@amsat.org>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      6bd06f77
    • Philippe Mathieu-Daudé's avatar
      hw/display: Rename VGA_ISA_MM -> VGA_MMIO · 3ac25236
      Philippe Mathieu-Daudé authored
      
      There is no ISA bus part in the MMIO VGA device, so rename:
      
       *  hw/display/vga-isa-mm.c -> hw/display/vga-mmio.c
       *  CONFIG_VGA_ISA_MM -> CONFIG_VGA_MMIO
       *  ISAVGAMMState -> VGAMmioState
       *  isa_vga_mm_init() -> vga_mmio_init()
      
      Reviewed-by: default avatarBALATON Zoltan <balaton@eik.bme.hu>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20211206224528.563588-2-f4bug@amsat.org>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      3ac25236
    • Gerd Hoffmann's avatar
      uas: add missing return · 1c6c0b9e
      Gerd Hoffmann authored
      
      Otherwise we run the error handling code even for successful requests.
      
      Fixes: 13b250b1 ("uas: add stream number sanity checks.")
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20211210080659.2537084-1-kraxel@redhat.com>
      1c6c0b9e
    • Marc-André Lureau's avatar
      ui: fix gtk clipboard clear assertion · 87800d94
      Marc-André Lureau authored
      
      When closing the QEMU Gtk display window, it can occasionaly warn:
      qemu-system-x86_64: Gtk: gtk_clipboard_set_with_data: assertion 'targets != NULL' failed
      
      #3  0x00007ffff4f02f22 in gtk_clipboard_set_with_data (clipboard=<optimized out>, targets=<optimized out>, n_targets=<optimized out>, get_func=<optimized out>, clear_func=<optimized out>, user_data=<optimized out>) at /usr/src/debug/gtk3-3.24.30-4.fc35.x86_64/gtk/gtkclipboard.c:672
      #4  0x00007ffff552cd75 in gd_clipboard_update_info (gd=0x5555579a9e00, info=0x555557ba4b50) at ../ui/gtk-clipboard.c:98
      #5  0x00007ffff552ce00 in gd_clipboard_notify (notifier=0x5555579aaba8, data=0x7fffffffd720) at ../ui/gtk-clipboard.c:128
      #6  0x000055555603e0ff in notifier_list_notify (list=0x555556657470 <clipboard_notifiers>, data=0x7fffffffd720) at ../util/notify.c:39
      #7  0x000055555594e8e0 in qemu_clipboard_update (info=0x555557ba4b50) at ../ui/clipboard.c:54
      #8  0x000055555594e840 in qemu_clipboard_peer_release (peer=0x55555684a5b0, selection=QEMU_CLIPBOARD_SELECTION_PRIMARY) at ../ui/clipboard.c:40
      #9  0x000055555594e786 in qemu_clipboard_peer_unregister (peer=0x55555684a5b0) at ../ui/clipboard.c:19
      #10 0x000055555595f044 in vdagent_disconnect (vd=0x55555684a400) at ../ui/vdagent.c:852
      #11 0x000055555595f262 in vdagent_chr_fini (obj=0x55555684a400) at ../ui/vdagent.c:908
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20211216083233.1166504-1-marcandre.lureau@redhat.com>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      87800d94
    • Marc-André Lureau's avatar
      ui/dbus: fix buffer-overflow detected by ASAN · fc94d115
      Marc-André Lureau authored
      
      On the last added dbus patch, I left a tiny BO:
      
      ==441487==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x611000025a70 at pc 0x7f0817bb764c bp 0x7ffde672ae60 sp 0x7ffde672ae58
      WRITE of size 8 at 0x611000025a70 thread T0
          #0 0x7f0817bb764b in dbus_vc_class_init ../ui/dbus.c:401
      
      A cookie for ASAN! not you C :)
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Fixes: 7f767ca3 ("ui/dbus: register D-Bus VC handler")
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20211222144032.443424-1-marcandre.lureau@redhat.com>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      fc94d115
    • Volker Rümelin's avatar
      hw/audio/intel-hda: fix stream reset · ecd5f288
      Volker Rümelin authored
      Quote from:
      High Definition Audio Specification 1.0a, section 3.3.35
      
      Offset 80: {IOB}SDnCTL Stream Reset (SRST): Writing a 1 causes
      the corresponding stream to be reset. The Stream Descriptor
      registers (except the SRST bit itself) ... are reset.
      
      Change the code to reset the Stream Descriptor Control and Status
      registers except the SRST bit.
      
      Resolves: https://gitlab.com/qemu-project/qemu/-/issues/757
      
      
      Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
      Message-Id: <20211226154017.6067-3-vr_qemu@t-online.de>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      ecd5f288
    • Volker Rümelin's avatar
      dsoundaudio: fix crackling audio recordings · 9d90ceb2
      Volker Rümelin authored
      
      Audio recordings with the DirectSound backend don't sound right.
      A look a the Microsoft online documentation tells us why.
      
      From the DirectSound Programming Guide, Capture Buffer Information:
      'You can safely copy data from the buffer only up to the read
      cursor.'
      
      Change the code to read up to the read cursor instead of the
      capture cursor.
      
      Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
      Message-Id: <20211226154017.6067-2-vr_qemu@t-online.de>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      9d90ceb2
    • Volker Rümelin's avatar
      jackaudio: use ifdefs to hide unavailable functions · ead789eb
      Volker Rümelin authored
      On Windows the jack_set_thread_creator() function and on MacOS the
      pthread_setname_np() function with a thread pointer paramater is
      not available. Use #ifdefs to remove the jack_set_thread_creator()
      function call and the qjack_thread_creator() function in both
      cases.
      
      The qjack_thread_creator() function just sets the name of the
      created thread for debugging purposes and isn't really necessary.
      
      From the jack_set_thread_creator() documentation:
      (...)
      
      No normal application/client should consider calling this. (...)
      
      Resolves: https://gitlab.com/qemu-project/qemu/-/issues/785
      
      
      Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
      Reviewed-by: default avatarChristian Schoenebeck <qemu_oss@crudebyte.com>
      Message-Id: <20211226154017.6067-1-vr_qemu@t-online.de>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      ead789eb
    • Rao Lei's avatar
      ui/vnc.c: Fixed a deadlock bug. · 1dbbe6f1
      Rao Lei authored
      
      The GDB statck is as follows:
      (gdb) bt
      0  __lll_lock_wait (futex=futex@entry=0x56211df20360, private=0) at lowlevellock.c:52
      1  0x00007f263caf20a3 in __GI___pthread_mutex_lock (mutex=0x56211df20360) at ../nptl/pthread_mutex_lock.c:80
      2  0x000056211a757364 in qemu_mutex_lock_impl (mutex=0x56211df20360, file=0x56211a804857 "../ui/vnc-jobs.h", line=60)
          at ../util/qemu-thread-posix.c:80
      3  0x000056211a0ef8c7 in vnc_lock_output (vs=0x56211df14200) at ../ui/vnc-jobs.h:60
      4  0x000056211a0efcb7 in vnc_clipboard_send (vs=0x56211df14200, count=1, dwords=0x7ffdf1701338) at ../ui/vnc-clipboard.c:138
      5  0x000056211a0f0129 in vnc_clipboard_notify (notifier=0x56211df244c8, data=0x56211dd1bbf0) at ../ui/vnc-clipboard.c:209
      6  0x000056211a75dde8 in notifier_list_notify (list=0x56211afa17d0 <clipboard_notifiers>, data=0x56211dd1bbf0) at ../util/notify.c:39
      7  0x000056211a0bf0e6 in qemu_clipboard_update (info=0x56211dd1bbf0) at ../ui/clipboard.c:50
      8  0x000056211a0bf05d in qemu_clipboard_peer_release (peer=0x56211df244c0, selection=QEMU_CLIPBOARD_SELECTION_CLIPBOARD)
          at ../ui/clipboard.c:41
      9  0x000056211a0bef9b in qemu_clipboard_peer_unregister (peer=0x56211df244c0) at ../ui/clipboard.c:19
      10 0x000056211a0d45f3 in vnc_disconnect_finish (vs=0x56211df14200) at ../ui/vnc.c:1358
      11 0x000056211a0d4c9d in vnc_client_read (vs=0x56211df14200) at ../ui/vnc.c:1611
      12 0x000056211a0d4df8 in vnc_client_io (ioc=0x56211ce70690, condition=G_IO_IN, opaque=0x56211df14200) at ../ui/vnc.c:1649
      13 0x000056211a5b976c in qio_channel_fd_source_dispatch
          (source=0x56211ce50a00, callback=0x56211a0d4d71 <vnc_client_io>, user_data=0x56211df14200) at ../io/channel-watch.c:84
      14 0x00007f263ccede8e in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
      15 0x000056211a77d4a1 in glib_pollfds_poll () at ../util/main-loop.c:232
      16 0x000056211a77d51f in os_host_main_loop_wait (timeout=958545) at ../util/main-loop.c:255
      17 0x000056211a77d630 in main_loop_wait (nonblocking=0) at ../util/main-loop.c:531
      18 0x000056211a45bc8e in qemu_main_loop () at ../softmmu/runstate.c:726
      19 0x000056211a0b45fa in main (argc=69, argv=0x7ffdf1701778, envp=0x7ffdf17019a8) at ../softmmu/main.c:50
      
      From the call trace, we can see it is a deadlock bug.
      vnc_disconnect_finish will acquire the output_mutex.
      But, the output_mutex will be acquired again in vnc_clipboard_send.
      Repeated locking will cause deadlock. So, I move
      qemu_clipboard_peer_unregister() behind vnc_unlock_output();
      
      Fixes: 0bf41cab ("ui/vnc: clipboard support")
      Signed-off-by: default avatarLei Rao <lei.rao@intel.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20220105020808.597325-1-lei.rao@intel.com>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      1dbbe6f1
    • Zhenwei Pi's avatar
      usb: allow max 8192 bytes for desc · 7cd2cfa2
      Zhenwei Pi authored
      
      A device of USB video class usually uses larger desc structure, so
      use larger buffer to avoid failure. (dev-video.c is ready)
      
      This is an unlikely code path:
      1, during guest startup, guest tries to probe device.
      2, run 'lsusb' command in guest(or other similar commands).
      
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: default avatarzhenwei pi <pizhenwei@bytedance.com>
      Message-Id: <20220112015835.900619-1-pizhenwei@bytedance.com>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      7cd2cfa2
    • Dario Binacchi's avatar
      hw/usb/dev-wacom: add missing HID descriptor · 5280117b
      Dario Binacchi authored
      Linux need to fill up the HID descriptor in order to let the driver be
      emulated. The descriptor was downloaded from [1]. The patch was tested
      with evtest tool on top of qemu 5.2.0 with linux kernel 4.19.208.
      
      [1] https://github.com/linuxwacom/wacom-hid-descriptors/tree/master/Wacom%20PenPartner
      
      
      
      Signed-off-by: default avatarMichael Trimarchi <michael@amarulasolutions.com>
      Co-developed-by: default avatarMichael Trimarchi <michael@amarulasolutions.com>
      Signed-off-by: default avatarDario Binacchi <dario.binacchi@amarulasolutions.com>
      Message-Id: <20220112090125.381364-1-dario.binacchi@amarulasolutions.com>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      5280117b
  2. Jan 12, 2022
    • Peter Maydell's avatar
      Merge remote-tracking branch... · 91f5f7a5
      Peter Maydell authored
      Merge remote-tracking branch 'remotes/lvivier-gitlab/tags/linux-user-for-7.0-pull-request' into staging
      
      linux-user pull request 20220111
      siginfo_t cleanup
      more prtctl() update
      target_struct.h cleanup
      
      # gpg: Signature made Tue 11 Jan 2022 19:52:20 GMT
      # gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
      # gpg:                issuer "laurent@vivier.eu"
      # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
      # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
      # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
      # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
      
      * remotes/lvivier-gitlab/tags/linux-user-for-7.0-pull-request: (30 commits)
        linux-user: Implement capability prctls
        linux-user: Implement PR_SET_PDEATHSIG
        linux-user: Map signal number in PR_GET_PDEATHSIG
        linux-user: Do not special-case NULL for PR_GET_PDEATHSIG
        linux-user: Move target_struct.h generic definitions to generic/
        linux-user/arm: Move target_oabi_flock64 out of target_structs.h
        linux-user/xtensa: Use force_sig_fault
        linux-user/sparc: Use force_sig_fault
        linux-user/sh4: Use force_sig_fault
        linux-user/s390x: Use force_sig_fault
        linux-user/riscv: Use force_sig_fault
        linux-user/ppc: Use force_sig_fault
        linux-user/openrisc: Use force_sig_fault
        target/mips: Extract trap code into env->error_code
        target/mips: Extract break code into env->error_code
        linux-user/mips: Use force_sig_fault
        linux-user/mips: Improve do_break
        linux-user/microblaze: Fix SIGFPE si_codes
        linux-user/microblaze: Use force_sig_fault
        linux-user/m68k: Use force_sig_fault
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      91f5f7a5
    • Peter Maydell's avatar
      linux-user: Fix clang warning for nios2-linux-user code · b37778b8
      Peter Maydell authored
      
      The clang in Ubuntu 18.04 (10.0.0-4ubuntu1) produces a warning
      on the code added in commit f5ef0e51 where we use a
      shifted expression in a boolean context:
      
      ../../linux-user/elfload.c:2423:16: error: converting the result of '<<' to a boolean always evaluates to true [-Werror,-Wtautological-constant-compare]
          } else if (LO_COMMPAGE) {
                     ^
      ../../linux-user/elfload.c:1102:22: note: expanded from macro 'LO_COMMPAGE'
      #define LO_COMMPAGE  TARGET_PAGE_SIZE
                           ^
      /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/include/exec/cpu-all.h:231:31: note: expanded from macro 'TARGET_PAGE_SIZE'
      #define TARGET_PAGE_SIZE   (1 << TARGET_PAGE_BITS)
                                    ^
      1 error generated.
      
      The warning is bogus because whether LO_COMMPAGE is zero or not
      depends on compile-time ifdefs; shut the compiler up by adding
      an explicit comparison to zero.
      
      Fixes: f5ef0e51 ("linux-user/nios2: Map a real kuser page")
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Message-id: 20220111082900.3341274-1-peter.maydell@linaro.org
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      b37778b8
  3. Jan 11, 2022
Loading