1. 15 5月, 2018 2 次提交
    • G
      ps2: Fix mouse stream corruption due to lost data · 7abe7eb2
      Geoffrey McRae 提交于
      This fixes an issue by adding bounds checking to multi-byte packets
      where the PS/2 mouse data stream may become corrupted due to data being
      discarded when the PS/2 ringbuffer is full.
      
      Interrupts for Multi-byte responses are postponed until the final byte
      has been queued.
      
      These changes fix a bug where windows guests drop the mouse device
      entirely requring the guest to be restarted.
      Signed-off-by: NGeoffrey McRae <geoff@hostfission.com>
      Message-Id: <20180507150310.2FEA0381924@moya.office.hostfission.com>
      
      [ kraxel: codestyle fixes ]
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      7abe7eb2
    • G
      ps2: Clear the PS/2 queue and obey disable · 143c04c7
      Geoffrey McRae 提交于
      This allows guest's to correctly reinitialize and identify the mouse
      should the guest decide to re-scan or reset during mouse input events.
      
      When the guest sends the "Identify" command, due to the PC's hardware
      architecutre it is impossible to reliably determine the response from
      the command amongst other streaming data, such as mouse or keyboard
      events. Standard practice is for the guest to disable the device and
      then issue the identify command, so this must be obeyed.
      Signed-off-by: NGeoffrey McRae <geoff@hostfission.com>
      Message-Id: <20180507150303.7486B381924@moya.office.hostfission.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      143c04c7
  2. 14 5月, 2018 5 次提交
  3. 11 5月, 2018 6 次提交
  4. 09 5月, 2018 3 次提交
    • D
      opts: don't silently truncate long option values · 950c4e6c
      Daniel P. Berrangé 提交于
      The existing QemuOpts parsing code uses a fixed size 1024 byte buffer
      for storing the option values. If a value exceeded this size it was
      silently truncated and no error reported to the user. Long option values
      is not a common scenario, but it is conceivable that they will happen.
      eg if the user has a very deeply nested filesystem it would be possible
      to come up with a disk path that was > 1024 bytes. Most of the time if
      such data was silently truncated, the user would get an error about
      opening a non-existant disk. If they're unlucky though, QEMU might use a
      completely different disk image from another VM, which could be
      considered a security issue. Another example program was in using the
      -smbios command line arg with very large data blobs. In this case the
      silent truncation will be providing semantically incorrect data to the
      guest OS for SMBIOS tables.
      
      If the operating system didn't limit the user's argv when spawning QEMU,
      the code should honour whatever length arguments were given without
      imposing its own length restrictions. This patch thus changes the code
      to use a heap allocated buffer for storing the values during parsing,
      lifting the arbitrary length restriction.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      Message-Id: <20180416111743.8473-4-berrange@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      950c4e6c
    • K
      riscv: htif: increase the priority of the htif subregion · 6fad7d18
      KONRAD Frederic 提交于
      The htif device is supposed to be mapped over an other subregion. So increase
      its priority to one to avoid any conflict.
      
      Here is the output of info mtree:
      
      Before:
      (qemu) info mtree
       address-space: memory
         0000000000000000-ffffffffffffffff (prio 0, i/o): system
           0000000000000000-000000000000000f (prio 0, i/o): riscv.htif.uart
           0000000000000000-0000000000011fff (prio 0, ram): riscv.spike.bootrom
           0000000002000000-000000000200ffff (prio 0, i/o): riscv.sifive.clint
           0000000080000000-0000000087ffffff (prio 0, ram): riscv.spike.ram
      
       address-space: I/O
         0000000000000000-000000000000ffff (prio 0, i/o): io
      
       address-space: cpu-memory-0
         0000000000000000-ffffffffffffffff (prio 0, i/o): system
           0000000000000000-000000000000000f (prio 0, i/o): riscv.htif.uart
           0000000000000000-0000000000011fff (prio 0, ram): riscv.spike.bootrom
           0000000002000000-000000000200ffff (prio 0, i/o): riscv.sifive.clint
           0000000080000000-0000000087ffffff (prio 0, ram): riscv.spike.ram
      
      After:
       (qemu) info mtree
       address-space: memory
         0000000000000000-ffffffffffffffff (prio 0, i/o): system
           0000000000000000-000000000000000f (prio 1, i/o): riscv.htif.uart
           0000000000000000-0000000000011fff (prio 0, ram): riscv.spike.bootrom
           0000000002000000-000000000200ffff (prio 0, i/o): riscv.sifive.clint
           0000000080000000-0000000087ffffff (prio 0, ram): riscv.spike.ram
      
       address-space: I/O
         0000000000000000-000000000000ffff (prio 0, i/o): io
      
       address-space: cpu-memory-0
         0000000000000000-ffffffffffffffff (prio 0, i/o): system
           0000000000000000-000000000000000f (prio 1, i/o): riscv.htif.uart
           0000000000000000-0000000000011fff (prio 0, ram): riscv.spike.bootrom
           0000000002000000-000000000200ffff (prio 0, i/o): riscv.sifive.clint
           0000000080000000-0000000087ffffff (prio 0, ram): riscv.spike.ram
      Reviewed-by: NMichael Clark <mjc@sifive.com>
      Signed-off-by: NKONRAD Frederic <frederic.konrad@adacore.com>
      Signed-off-by: NMichael Clark <mjc@sifive.com>
      
      Message-Id: <1525360636-18229-3-git-send-email-frederic.konrad@adacore.com>
      6fad7d18
    • K
      riscv: spike: allow base == 0 · 17b9751e
      KONRAD Frederic 提交于
      The sanity check on base doesn't allow htif to be mapped @0. Check if the
      symbol exists instead so we can map it where we want.
      Reviewed-by: NMichael Clark <mjc@sifive.com>
      Signed-off-by: NKONRAD Frederic <frederic.konrad@adacore.com>
      Signed-off-by: NMichael Clark <mjc@sifive.com>
      
      Message-Id: <1525360636-18229-2-git-send-email-frederic.konrad@adacore.com>
      17b9751e
  5. 08 5月, 2018 1 次提交
    • G
      ppc: e500: use g_strdup_printf() instead of snprintf() · 2fb513d3
      Greg Kurz 提交于
      qemu-system-ppc fails to build with GCC 8.0.1:
      
      /home/hsp/src/qemu-master/hw/ppc/e500.c: In function ‘ppce500_load_device_tree’:
      /home/hsp/src/qemu-master/hw/ppc/e500.c:442:37: error: ‘/pic@’
      directive output may be truncated writing 5 bytes into a region of
      size between 1 and 128 [-Werror=format-truncation=]
           snprintf(mpic, sizeof(mpic), "%s/pic@%llx", soc, MPC8544_MPIC_REGS_OFFSET);
                                           ^~~~~
      In file included from /usr/include/stdio.h:862,
                       from /home/hsp/src/qemu-master/include/qemu/osdep.h:68,
                       from /home/hsp/src/qemu-master/hw/ppc/e500.c:17:
      /usr/include/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’
      output between 11 and 138 bytes into a destination of size 128
         return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              __bos (__s), __fmt, __va_arg_pack ());
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /home/hsp/src/qemu-master/hw/ppc/e500.c:470:39: error:
      ‘/global-utilities@’ directive output may be truncated writing 18
      bytes into a region of size between 1 and 128
      [-Werror=format-truncation=]
           snprintf(gutil, sizeof(gutil), "%s/global-utilities@%llx", soc,
                                             ^~~~~~~~~~~~~~~~~~
      In file included from /usr/include/stdio.h:862,
                       from /home/hsp/src/qemu-master/include/qemu/osdep.h:68,
                       from /home/hsp/src/qemu-master/hw/ppc/e500.c:17:
      /usr/include/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’
      output between 24 and 151 bytes into a destination of size 128
         return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              __bos (__s), __fmt, __va_arg_pack ());
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /home/hsp/src/qemu-master/hw/ppc/e500.c:477:36: error: ‘/msi@’
      directive output may be truncated writing 5 bytes into a region of
      size between 0 and 127 [-Werror=format-truncation=]
           snprintf(msi, sizeof(msi), "/%s/msi@%llx", soc, MPC8544_MSI_REGS_OFFSET);
                                          ^~~~~
      In file included from /usr/include/stdio.h:862,
                       from /home/hsp/src/qemu-master/include/qemu/osdep.h:68,
                       from /home/hsp/src/qemu-master/hw/ppc/e500.c:17:
      /usr/include/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’
      output between 12 and 139 bytes into a destination of size 128
         return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              __bos (__s), __fmt, __va_arg_pack ());
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Fix this by converting e500 to use g_strdup_printf()+g_free() instead
      of snprintf(). This is done globally, even for call sites that don't
      break build, since this is the preferred practice in QEMU.
      Reported-by: NHoward Spoelstra <hsp.cat7@gmail.com>
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-id: 152568372989.443627.900708381919207053.stgit@bahia.lan
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      2fb513d3
  6. 07 5月, 2018 14 次提交
  7. 06 5月, 2018 7 次提交
  8. 05 5月, 2018 2 次提交