qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 9a6e2d: mc146818rtc: update periodic timer on


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 9a6e2d: mc146818rtc: update periodic timer only if it is n...
Date: Mon, 12 Jun 2017 02:43:11 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 9a6e2dcfdda31275296c2a55ae10ec9ee5265459
      
https://github.com/qemu/qemu/commit/9a6e2dcfdda31275296c2a55ae10ec9ee5265459
  Author: Xiao Guangrong <address@hidden>
  Date:   2017-06-06 (Tue, 06 Jun 2017)

  Changed paths:
    M hw/timer/mc146818rtc.c

  Log Message:
  -----------
  mc146818rtc: update periodic timer only if it is needed

Currently, the timer is updated whenever RegA or RegB is written
even if the periodic timer related configuration is not changed

This patch optimizes it slightly to make the update happen only
if its period or enable-status is changed, also later patches are
depend on this optimization

Signed-off-by: Xiao Guangrong <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 369b41359af46bded5799c9ef8be2b641d92e043
      
https://github.com/qemu/qemu/commit/369b41359af46bded5799c9ef8be2b641d92e043
  Author: Tai Yunfang <address@hidden>
  Date:   2017-06-06 (Tue, 06 Jun 2017)

  Changed paths:
    M hw/timer/mc146818rtc.c

  Log Message:
  -----------
  mc146818rtc: precisely count the clock for periodic timer

There are two issues in current code:
1) If the period is changed by re-configuring RegA, the coalesced
   irq will be scaled to reflect the new period, however, it
   calculates the new interrupt number like this:
    s->irq_coalesced = (s->irq_coalesced * s->period) / period;

   There are some clocks will be lost if they are not enough to
   be squeezed to a single new period that will cause the VM clock
   slower

   In order to fix the issue, we calculate the interrupt window
   based on the precise clock rather than period, then the clocks
   lost during period is scaled can be compensated properly

2) If periodic_timer_update() is called due to RegA reconfiguration,
   i.e, the period is updated, current time is not the start point
   for the next periodic timer, instead, which should start from the
   last interrupt, otherwise, the clock in VM will become slow

   This patch takes the clocks from last interrupt to current clock
   into account and compensates the clocks for the next interrupt,
   especially if a complete interrupt was lost in this window, the
   time can be caught up by LOST_TICK_POLICY_SLEW

Signed-off-by: Tai Yunfang <address@hidden>
Signed-off-by: Xiao Guangrong <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 4aa70a0e9cd0c0332a8369df8c4f6d8e22fafe23
      
https://github.com/qemu/qemu/commit/4aa70a0e9cd0c0332a8369df8c4f6d8e22fafe23
  Author: Xiao Guangrong <address@hidden>
  Date:   2017-06-06 (Tue, 06 Jun 2017)

  Changed paths:
    M hw/timer/mc146818rtc.c

  Log Message:
  -----------
  mc146818rtc: ensure LOST_TICK_POLICY_SLEW is only enabled on TARGET_I386

Any tick policy specified on other platforms rather on TARGET_I386
will fall back to LOST_TICK_POLICY_DISCARD silently, this patch makes
sure only TARGET_I386 can enable LOST_TICK_POLICY_SLEW

After that, we can enable LOST_TICK_POLICY_SLEW in the common code
which need not use '#ifdef TARGET_I386' to make these code be x86
specific anymore

Signed-off-by: Xiao Guangrong <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 388ad5d2969b70242a385031caadef46328bf940
      
https://github.com/qemu/qemu/commit/388ad5d2969b70242a385031caadef46328bf940
  Author: Xiao Guangrong <address@hidden>
  Date:   2017-06-06 (Tue, 06 Jun 2017)

  Changed paths:
    M hw/timer/mc146818rtc.c

  Log Message:
  -----------
  mc146818rtc: drop unnecessary '#ifdef TARGET_I386'

If the code purely depends on LOST_TICK_POLICY_SLEW, we can simply
drop '#ifdef TARGET_I386' as only x86 can enable this tick policy

Signed-off-by: Xiao Guangrong <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: e0c8b950d17a57343926ed937af10e8903b0d6cc
      
https://github.com/qemu/qemu/commit/e0c8b950d17a57343926ed937af10e8903b0d6cc
  Author: Xiao Guangrong <address@hidden>
  Date:   2017-06-06 (Tue, 06 Jun 2017)

  Changed paths:
    M hw/timer/mc146818rtc.c

  Log Message:
  -----------
  mc146818rtc: embrace all x86 specific code

Introduce a function, rtc_policy_slew_deliver_irq(), which delivers
irq if LOST_TICK_POLICY_SLEW is used, as which is only supported on
x86, other platforms call it will trigger a assert

After that, we can move the x86 specific code to the common place

Signed-off-by: Xiao Guangrong <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: bd618eab7641693f0838da52c5af5c8050f831d3
      
https://github.com/qemu/qemu/commit/bd618eab7641693f0838da52c5af5c8050f831d3
  Author: Xiao Guangrong <address@hidden>
  Date:   2017-06-06 (Tue, 06 Jun 2017)

  Changed paths:
    M hw/timer/mc146818rtc.c
    M include/hw/timer/mc146818rtc_regs.h
    M tests/rtc-test.c

  Log Message:
  -----------
  qtest: add rtc periodic timer test

It tests the accuracy of rtc periodic timer which is recently
improved & fixed by commit 7ffcb539a3 ("mc146818rtc: precisely count
the clock for periodic timer", 2017-05-19).

Signed-off-by: Xiao Guangrong <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 9ba35d0b865361f9838f830672ab229a569024eb
      
https://github.com/qemu/qemu/commit/9ba35d0b865361f9838f830672ab229a569024eb
  Author: Peter Xu <address@hidden>
  Date:   2017-06-06 (Tue, 06 Jun 2017)

  Changed paths:
    M kvm-all.c
    M trace-events

  Log Message:
  -----------
  kvm: irqchip: trace changes on msi add/remove

It'll be nice to know which virq belongs to which device/vector when
adding msi routes, so adding two more parameters for the add trace.

Meanwhile, releasing virq has no tracing before. Add one for it.

Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 993b1f4b2ceb7b09a7153aa01d03bdf95972e61d
      
https://github.com/qemu/qemu/commit/993b1f4b2ceb7b09a7153aa01d03bdf95972e61d
  Author: Peter Xu <address@hidden>
  Date:   2017-06-06 (Tue, 06 Jun 2017)

  Changed paths:
    M hw/pci/msix.c
    M hw/pci/trace-events

  Log Message:
  -----------
  msix: trace control bit write op

Meanwhile, abstract a function to detect msix masked bit.

Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Acked-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: fd563564222f308e1d86847efdec8555fb472536
      
https://github.com/qemu/qemu/commit/fd563564222f308e1d86847efdec8555fb472536
  Author: Peter Xu <address@hidden>
  Date:   2017-06-06 (Tue, 06 Jun 2017)

  Changed paths:
    M target/i386/kvm.c

  Log Message:
  -----------
  kvm: irqchip: skip update msi when disabled

It's possible that one device kept its irqfd/virq there even when
MSI/MSIX was disabled globally for that device. One example is
virtio-net-pci (see commit f1d0f15a6 and virtio_pci_vq_vector_mask()).
It is used as a fast path to avoid allocate/release irqfd/virq
frequently when guest enables/disables MSIX.

However, this fast path brought a problem to msi_route_list, that the
device MSIRouteEntry is still dangling there even if MSIX disabled -
then we cannot know which message to fetch, even if we can, the messages
are meaningless. In this case, we can just simply ignore this entry.

It's safe, since when MSIX is enabled again, we'll rebuild them no
matter what.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1448813

Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 7e6478e7d4f2c4b607069bf488d57089a9d3244b
      
https://github.com/qemu/qemu/commit/7e6478e7d4f2c4b607069bf488d57089a9d3244b
  Author: Stefano Stabellini <address@hidden>
  Date:   2017-06-06 (Tue, 06 Jun 2017)

  Changed paths:
    M util/oslib-posix.c

  Log Message:
  -----------
  Check the return value of fcntl in qemu_set_cloexec

Assert that the return value is not an error. This issue was found by
Coverity.

CID: 1374831

Signed-off-by: Stefano Stabellini <address@hidden>
CC: address@hidden
CC: address@hidden
CC: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: f250a42ddaee042ad2eb02022a3ebd18fcf987de
      
https://github.com/qemu/qemu/commit/f250a42ddaee042ad2eb02022a3ebd18fcf987de
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-06-06 (Tue, 06 Jun 2017)

  Changed paths:
    M nbd/common.c

  Log Message:
  -----------
  nbd: strict nbd_wr_syncv

nbd_wr_syncv is called either from coroutine or from client negotiation
code, when socket is in blocking mode. So, -EAGAIN is impossible.

Furthermore, EAGAIN is confusing, as, what to read/write again? With
EAGAIN as a return code we don't know how much data is already
read or written by the function, so in case of EAGAIN the whole
communication is broken.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: f5d406fe86bb28da85824b6581e58980cc1a07f3
      
https://github.com/qemu/qemu/commit/f5d406fe86bb28da85824b6581e58980cc1a07f3
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-06-06 (Tue, 06 Jun 2017)

  Changed paths:
    M nbd/client.c
    M nbd/nbd-internal.h
    M nbd/server.c

  Log Message:
  -----------
  nbd: read_sync and friends: return 0 on success

functions read_sync, drop_sync, write_sync, and also
nbd_negotiate_write, nbd_negotiate_read, nbd_negotiate_drop_sync
returns number of processed bytes. But what this number can be,
except requested number of bytes?

Actually, underlying nbd_wr_syncv function returns a value >= 0 and
!= requested_bytes only on eof on read operation. So, firstly, it is
impossible on write (let's add an assert) and on read it actually
means, that communication is broken (except nbd_receive_reply, see
below).

Most of callers operate like this:
   if (func(..., size) != size) {
       /* error path */
   }
, i.e.:
  1. They are not interested in partial success
  2. Extra duplications in code (especially bad are duplications of
     magic numbers)
  3. User doesn't see actual error message, as return code is lost.
     (this patch doesn't fix this point, but it makes fixing easier)

Several callers handles ret >= 0 and != requested-size separately, by
just returning EINVAL in this case. This patch makes read_sync and
friends return EINVAL in this case, so final behavior is the same.

And only one caller - nbd_receive_reply() does something not so
obvious. It returns EINVAL for ret > 0 and != requested-size, like
previous group, but for ret == 0 it returns 0. The only caller of
nbd_receive_reply() - nbd_read_reply_entry() handles ret == 0 in the
same way as ret < 0, so for now it doesn't matter. However, in
following commits error path handling will be improved and we'll need
to distinguish success from fail in this case too. So, this patch adds
separate helper for this case - read_sync_eof.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: f2609565369429bc1619d106b200106dba29290e
      
https://github.com/qemu/qemu/commit/f2609565369429bc1619d106b200106dba29290e
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-06-06 (Tue, 06 Jun 2017)

  Changed paths:
    M block/nbd-client.c
    M include/block/nbd.h
    M nbd/common.c
    M nbd/nbd-internal.h

  Log Message:
  -----------
  nbd: add errp parameter to nbd_wr_syncv()

Will be used in following patch to provide actual error message in
some cases.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: e44ed99d1949315755bffb12a5a483ac66d4a976
      
https://github.com/qemu/qemu/commit/e44ed99d1949315755bffb12a5a483ac66d4a976
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-06-06 (Tue, 06 Jun 2017)

  Changed paths:
    M nbd/client.c
    M nbd/nbd-internal.h
    M nbd/server.c

  Log Message:
  -----------
  nbd: add errp to read_sync, write_sync and drop_sync

There a lot of calls of these functions, which already have errp, which
they are filling themselves. On the other hand, nbd_wr_syncv has errp
parameter too, so it would be great to connect them.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: be41c100c0d67f6072ddd4910c4b6f7d239f025f
      
https://github.com/qemu/qemu/commit/be41c100c0d67f6072ddd4910c4b6f7d239f025f
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-06-06 (Tue, 06 Jun 2017)

  Changed paths:
    M block/nbd-client.c
    M include/block/nbd.h
    M nbd/client.c
    M qemu-nbd.c
    M tests/qemu-iotests/083.out

  Log Message:
  -----------
  nbd/client.c: use errp instead of LOG

Move to modern errp scheme from just LOGging errors.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 003a0cf2cd1828a1141a874428571267b117f765
      
https://github.com/qemu/qemu/commit/003a0cf2cd1828a1141a874428571267b117f765
  Author: Peter Xu <address@hidden>
  Date:   2017-06-06 (Tue, 06 Jun 2017)

  Changed paths:
    M exec.c

  Log Message:
  -----------
  exec: simplify phys_page_find() params

It really only plays with the dispatchers, so the parameter list does
not need that complexity. This helps for readability at least.

Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 2cbe2de5454cf9af44b620b2b40d56361a12a45f
      
https://github.com/qemu/qemu/commit/2cbe2de5454cf9af44b620b2b40d56361a12a45f
  Author: Fam Zheng <address@hidden>
  Date:   2017-06-06 (Tue, 06 Jun 2017)

  Changed paths:
    M hw/scsi/virtio-scsi.c

  Log Message:
  -----------
  virtio-scsi: Unset hotplug handler when unrealize

This matches the qbus_set_hotplug_handler in realize, and it releases
the final reference to the embedded VirtIODevice so that it is
properly finalized.

A use-after-free is fixed with this patch, indirectly:
virtio_device_instance_finalize wasn't called at hot-unplug, and the
vdev->listener would be a dangling pointer in the global and the per
address space listener list. See also RHBZ 1449031.

Cc: address@hidden
Signed-off-by: Fam Zheng <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: c8bc83a4dd29a9a33f5be81686bfe6e2e628097b
      
https://github.com/qemu/qemu/commit/c8bc83a4dd29a9a33f5be81686bfe6e2e628097b
  Author: Paolo Bonzini <address@hidden>
  Date:   2017-06-07 (Wed, 07 Jun 2017)

  Changed paths:
    M target/i386/arch_memory_mapping.c
    M target/i386/cpu.h
    M target/i386/helper.c

  Log Message:
  -----------
  target/i386: enable A20 automatically in system management mode

Ignore env->a20_mask when running in system management mode.

Reported-by: Anthony Xu <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: f8c45c6550b9ff1e1f0b92709ff3213a79870879
      
https://github.com/qemu/qemu/commit/f8c45c6550b9ff1e1f0b92709ff3213a79870879
  Author: Paolo Bonzini <address@hidden>
  Date:   2017-06-07 (Wed, 07 Jun 2017)

  Changed paths:
    M target/i386/cpu.c
    M target/i386/cpu.h
    M target/i386/helper.c
    M target/i386/machine.c
    M target/i386/smm_helper.c

  Log Message:
  -----------
  target/i386: use multiple CPU AddressSpaces

This speeds up SMM switches.  Later on it may remove the need to take
the BQL, and it may also allow to reuse code between TCG and KVM.

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 5b003a40bb1ab14d0398e91f03393d3c6b9577cd
      
https://github.com/qemu/qemu/commit/5b003a40bb1ab14d0398e91f03393d3c6b9577cd
  Author: Mihail Abakumov <address@hidden>
  Date:   2017-06-07 (Wed, 07 Jun 2017)

  Changed paths:
    M target/i386/translate.c

  Log Message:
  -----------
  i386: fix read/write cr with icount option

Running Windows with icount causes a crash in instruction of write cr.
This patch fixes it.

Reading and writing cr cause an icount read because there are called
cpu_get_apic_tpr and cpu_set_apic_tpr functions. So, there is need
gen_io_start()/gen_io_end() calls.

Signed-off-by: Mihail Abakumov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: ad9579aaa16d5b385922d49edac2c96c79bcfb62
      
https://github.com/qemu/qemu/commit/ad9579aaa16d5b385922d49edac2c96c79bcfb62
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-06-07 (Wed, 07 Jun 2017)

  Changed paths:
    M util/qemu-sockets.c

  Log Message:
  -----------
  sockets: improve error reporting if UNIX socket path is too long

The 'struct sockaddr_un' only allows 108 bytes for the socket
path.

If the user supplies a path, QEMU uses snprintf() to silently
truncate it when too long. This is undesirable because the user
will then be unable to connect to the path they asked for.

If the user doesn't supply a path, QEMU builds one based on
TMPDIR, but if that leads to an overlong path, it mistakenly
uses error_setg_errno() with a stale errno value, because
snprintf() does not set errno on truncation.

In solving this the code needed some refactoring to ensure we
don't pass 'un.sun_path' directly to any APIs which expect
NUL-terminated strings, because the path is not required to
be terminated.

Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: df8ad9f128c15aa0a0ebc7b24e9a22c9775b67af
      
https://github.com/qemu/qemu/commit/df8ad9f128c15aa0a0ebc7b24e9a22c9775b67af
  Author: Eric Blake <address@hidden>
  Date:   2017-06-07 (Wed, 07 Jun 2017)

  Changed paths:
    M nbd/server.c
    M qemu-nbd.c

  Log Message:
  -----------
  nbd: Fully initialize client in case of failed negotiation

If a non-NBD client connects to qemu-nbd, we would end up with
a SIGSEGV in nbd_client_put() because we were trying to
unregister the client's association to the export, even though
we skipped inserting the client into that list.  Easy trigger
in two terminals:

$ qemu-nbd -p 30001 --format=raw file
$ nmap 127.0.0.1 -p 30001

nmap claims that it thinks it connected to a pago-services1
server (which probably means nmap could be updated to learn the
NBD protocol and give a more accurate diagnosis of the open
port - but that's not our problem), then terminates immediately,
so our call to nbd_negotiate() fails.  The fix is to reorder
nbd_co_client_start() to ensure that all initialization occurs
before we ever try talking to a client in nbd_negotiate(), so
that the teardown sequence on negotiation failure doesn't fault
while dereferencing a half-initialized object.

While debugging this, I also noticed that nbd_update_server_watch()
called by nbd_client_closed() was still adding a channel to accept
the next client, even when the state was no longer RUNNING.  That
is fixed by making nbd_can_accept() pay attention to the current
state.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1451614

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: e2b6c1712e08bc5feafb44fdc65ab81ef2630b4b
      
https://github.com/qemu/qemu/commit/e2b6c1712e08bc5feafb44fdc65ab81ef2630b4b
  Author: Denis Plotnikov <address@hidden>
  Date:   2017-06-07 (Wed, 07 Jun 2017)

  Changed paths:
    M hw/i386/kvm/clock.c

  Log Message:
  -----------
  kvmclock: update system_time_msr address forcibly

Do an update of system_time_msr address every time before reading
the value of tsc_timestamp from guest's kvmclock page.

There is no other code paths which ensure that qemu has an up-to-date
value of system_time_msr. So, force this update on guest's tsc_timestamp
reading.

This bug causes effect on those nested setups which turn off TPR access
interception for L2 guests and that access being intercepted by L0 doesn't
show up in L1.
Linux bootstrap initiate kvmclock before APIC initializing causing TPR access.
That's why on L1 guests, having TPR interception turned on for L2, the effect
of the bug is not revealed.

This patch fixes this problem by making sure it knows the correct
system_time_msr address every time it is needed.

Signed-off-by: Denis Plotnikov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 7e018385103cd7a571b9ea0d6f994af6b1129fe7
      
https://github.com/qemu/qemu/commit/7e018385103cd7a571b9ea0d6f994af6b1129fe7
  Author: Paolo Bonzini <address@hidden>
  Date:   2017-06-07 (Wed, 07 Jun 2017)

  Changed paths:
    M pc-bios/linuxboot_dma.bin
    M pc-bios/optionrom/Makefile

  Log Message:
  -----------
  linuxboot_dma: compile for i486

The ROM uses the cmovne instruction, which is new in Pentium Pro and does not
work when running QEMU with "-cpu 486".  Avoid producing that instruction.

Suggested-by: Richard W.M. Jones <address@hidden>
Suggested-by: Thomas Huth <address@hidden>
Reported-by: Rob Landley <address@hidden>
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: c25a67f0c3d0c86231f9653267a222c4effa706f
      
https://github.com/qemu/qemu/commit/c25a67f0c3d0c86231f9653267a222c4effa706f
  Author: Paolo Bonzini <address@hidden>
  Date:   2017-06-07 (Wed, 07 Jun 2017)

  Changed paths:
    M hw/misc/edu.c

  Log Message:
  -----------
  edu: fix memory leak on msi_broken platforms

If msi_init fails, the thread has already been created and the
mutex/condvar are not destroyed.  Initialize everything only
after the point where pci_edu_realize cannot fail.

Reported-by: Markus Armbruster <address@hidden>
Cc: Peter Xu <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: d45fc087c26674eedda9314b9aaefd8e061bf104
      
https://github.com/qemu/qemu/commit/d45fc087c26674eedda9314b9aaefd8e061bf104
  Author: Roman Pen <address@hidden>
  Date:   2017-06-07 (Wed, 07 Jun 2017)

  Changed paths:
    M target/i386/kvm.c

  Log Message:
  -----------
  i386/kvm: do not zero out segment flags if segment is unusable or not present

This is a fix for the problem [1], where VMCB.CPL was set to 0 and interrupt
was taken on userspace stack.  The root cause lies in the specific AMD CPU
behaviour which manifests itself as unusable segment attributes on SYSRET[2].

Here in this patch flags are not touched even segment is unusable or is not
present, therefore CPL (which is stored in DPL field) should not be lost and
will be successfully restored on kvm/svm kernel side.

Also current patch should not break desired behavior described in this commit:

4cae9c97967a ("target-i386: kvm: clear unusable segments' flags in migration")

since present bit will be dropped if segment is unusable or is not present.

This is the second part of the whole fix of the corresponding problem [1],
first part is related to kvm/svm kernel side and does exactly the same:
segment attributes are not zeroed out.

[1] Message id: address@hidden
[2] Message id: address@hidden

Signed-off-by: Roman Pen <address@hidden>
Signed-off-by: Mikhail Sennikovskii <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Cc: Radim Krčmář <address@hidden>
Cc: Michael Chapman <address@hidden>
Cc: address@hidden
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: b8158192fadb3e346372456c25cbbc4be584a85c
      
https://github.com/qemu/qemu/commit/b8158192fadb3e346372456c25cbbc4be584a85c
  Author: Abdallah Bouassida <address@hidden>
  Date:   2017-06-07 (Wed, 07 Jun 2017)

  Changed paths:
    M configure
    A gdb-xml/i386-32bit-sse.xml
    A gdb-xml/i386-32bit.xml
    A gdb-xml/i386-64bit-sse.xml
    A gdb-xml/i386-64bit.xml
    M target/i386/cpu.c

  Log Message:
  -----------
  target/i386: Add GDB XML description for SSE registers

Add an XML description for SSE registers (XMM+MXCSR) for both X86
and X86-64 architectures in the GDB stub:
- configure: Define gdb_xml_files for the X86 targets (32 and 64bit).
- gdb-xml/i386-32bit-sse.xml & gdb-xml/i386-64bit-sse.xml: The XML files
that contain a description of the XMM + MXCSR registers.
- gdb-xml/i386-32bit.xml & gdb-xml/i386-64bit.xml: wrappers that include
the XML file of the core registers and the other XML file of the SSE registers.
- target/i386/cpu.c: Modify the gdb_core_xml_file to the new XML wrapper,
  modify the gdb_num_core_regs to fit the registers number defined in each
  XML file.

Signed-off-by: Abdallah Bouassida <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 6bdcc018a6ed760b9dfe43539124e420aed83092
      
https://github.com/qemu/qemu/commit/6bdcc018a6ed760b9dfe43539124e420aed83092
  Author: Paolo Bonzini <address@hidden>
  Date:   2017-06-07 (Wed, 07 Jun 2017)

  Changed paths:
    M block/nbd-client.c

  Log Message:
  -----------
  nbd: make it thread-safe, fix qcow2 over nbd

NBD is not thread safe, because it accesses s->in_flight without
a CoMutex.  Fixing this will be required for multiqueue.
CoQueue doesn't have spurious wakeups but, when another coroutine can
run between qemu_co_queue_next's wakeup and qemu_co_queue_wait's
re-locking of the mutex, the wait condition can become false and
a loop is necessary.

In fact, it turns out that the loop is necessary even without this
multi-threaded scenario.  A particular sequence of coroutine wakeups
is happening ~80% of the time when starting a guest with qcow2 image
served over NBD (i.e. qemu-nbd --format=raw, and QEMU's -drive option
has -format=qcow2).  This patch fixes that issue too.

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: d870cfdea5b5fc7934cacc9786f185d741eab308
      
https://github.com/qemu/qemu/commit/d870cfdea5b5fc7934cacc9786f185d741eab308
  Author: Gonglei <address@hidden>
  Date:   2017-06-07 (Wed, 07 Jun 2017)

  Changed paths:
    M kvm-all.c
    M target/i386/kvm.c

  Log Message:
  -----------
  kvm: don't register smram_listener when smm is off

If the user set disable smm by '-machine smm=off', we
should not register smram_listener so that we can
avoid waster memory in kvm since the added sencond
address space.

Meanwhile we should assign value of the global kvm_state
before invoking the kvm_arch_init(), because
pc_machine_is_smm_enabled() may use it by kvm_has_mm().

Signed-off-by: Gonglei <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 90bb0c04214545beb75044a2742f711335103269
      
https://github.com/qemu/qemu/commit/90bb0c04214545beb75044a2742f711335103269
  Author: Felipe Franciosi <address@hidden>
  Date:   2017-06-07 (Wed, 07 Jun 2017)

  Changed paths:
    M cpus.c

  Log Message:
  -----------
  cpus: reset throttle_thread_scheduled after sleep

Currently, the throttle_thread_scheduled flag is reset back to 0 before
sleeping (as part of the throttling logic). Given that throttle_timer
(well, any timer) may tick with a slight delay, it so happens that under
heavy throttling (ie. close or on CPU_THROTTLE_PCT_MAX) the tick may
schedule a further cpu_throttle_thread() work item after the flag reset,
but before the previous sleep completed. This results on the vCPU thread
sleeping continuously for potentially several seconds in a row.

The chances of that happening can be drastically minimised by resetting
the flag after the sleep.

Signed-off-by: Felipe Franciosi <address@hidden>
Signed-off-by: Malcolm Crossley <address@hidden>
Message-Id: <address@hidden>
Acked-by: Jason J. Herne <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: ac06724a715864942e2b5e28f92d5d5421f0a0b0
      
https://github.com/qemu/qemu/commit/ac06724a715864942e2b5e28f92d5d5421f0a0b0
  Author: Paolo Bonzini <address@hidden>
  Date:   2017-06-07 (Wed, 07 Jun 2017)

  Changed paths:
    R docs/aio_notify.promela
    R docs/aio_notify_accept.promela
    R docs/aio_notify_bug.promela
    R docs/atomics.txt
    R docs/bitmaps.md
    R docs/blkdebug.txt
    R docs/blkverify.txt
    R docs/build-system.txt
    A docs/config/ich9-ehci-uhci.cfg
    A docs/config/mach-virt-graphical.cfg
    A docs/config/mach-virt-serial.cfg
    A docs/config/q35-emulated.cfg
    A docs/config/q35-virtio-graphical.cfg
    A docs/config/q35-virtio-serial.cfg
    A docs/devel/atomics.txt
    A docs/devel/bitmaps.md
    A docs/devel/blkdebug.txt
    A docs/devel/blkverify.txt
    A docs/devel/build-system.txt
    A docs/devel/lockcnt.txt
    A docs/devel/memory.txt
    A docs/devel/migration.txt
    A docs/devel/multi-thread-tcg.txt
    A docs/devel/multiple-iothreads.txt
    A docs/devel/qapi-code-gen.txt
    A docs/devel/rcu.txt
    A docs/devel/tracing.txt
    A docs/devel/virtio-migration.txt
    A docs/devel/writing-qmp-commands.txt
    R docs/ich9-ehci-uhci.cfg
    R docs/lockcnt.txt
    R docs/mach-virt-graphical.cfg
    R docs/mach-virt-serial.cfg
    R docs/memory.txt
    R docs/migration.txt
    R docs/multi-thread-tcg.txt
    R docs/multiple-iothreads.txt
    R docs/q35-emulated.cfg
    R docs/q35-virtio-graphical.cfg
    R docs/q35-virtio-serial.cfg
    R docs/qapi-code-gen.txt
    R docs/rcu.txt
    A docs/spin/aio_notify.promela
    A docs/spin/aio_notify_accept.promela
    A docs/spin/aio_notify_bug.promela
    A docs/spin/tcg-exclusive.promela
    A docs/spin/win32-qemu-event.promela
    R docs/tcg-exclusive.promela
    R docs/tracing.txt
    R docs/virtio-migration.txt
    R docs/win32-qemu-event.promela
    R docs/writing-qmp-commands.txt

  Log Message:
  -----------
  docs: create config/, devel/ and spin/ subdirectories

Developer documentation should be its own manual.  As a start, move all
developer-oriented files to a separate directory.

Also move non-text files to their own directories: docs/config/ for
QEMU -readconfig input, and docs/spin/ for formal models to be used
with the SPIN model checker.

Reviewed-by: Daniel P. Berrange <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: bbfa326fc8028e275eddf8c9965c2a1b59405b2e
      
https://github.com/qemu/qemu/commit/bbfa326fc8028e275eddf8c9965c2a1b59405b2e
  Author: Peter Maydell <address@hidden>
  Date:   2017-06-07 (Wed, 07 Jun 2017)

  Changed paths:
    M block/nbd-client.c
    M configure
    M cpus.c
    R docs/aio_notify.promela
    R docs/aio_notify_accept.promela
    R docs/aio_notify_bug.promela
    R docs/atomics.txt
    R docs/bitmaps.md
    R docs/blkdebug.txt
    R docs/blkverify.txt
    R docs/build-system.txt
    A docs/config/ich9-ehci-uhci.cfg
    A docs/config/mach-virt-graphical.cfg
    A docs/config/mach-virt-serial.cfg
    A docs/config/q35-emulated.cfg
    A docs/config/q35-virtio-graphical.cfg
    A docs/config/q35-virtio-serial.cfg
    A docs/devel/atomics.txt
    A docs/devel/bitmaps.md
    A docs/devel/blkdebug.txt
    A docs/devel/blkverify.txt
    A docs/devel/build-system.txt
    A docs/devel/lockcnt.txt
    A docs/devel/memory.txt
    A docs/devel/migration.txt
    A docs/devel/multi-thread-tcg.txt
    A docs/devel/multiple-iothreads.txt
    A docs/devel/qapi-code-gen.txt
    A docs/devel/rcu.txt
    A docs/devel/tracing.txt
    A docs/devel/virtio-migration.txt
    A docs/devel/writing-qmp-commands.txt
    R docs/ich9-ehci-uhci.cfg
    R docs/lockcnt.txt
    R docs/mach-virt-graphical.cfg
    R docs/mach-virt-serial.cfg
    R docs/memory.txt
    R docs/migration.txt
    R docs/multi-thread-tcg.txt
    R docs/multiple-iothreads.txt
    R docs/q35-emulated.cfg
    R docs/q35-virtio-graphical.cfg
    R docs/q35-virtio-serial.cfg
    R docs/qapi-code-gen.txt
    R docs/rcu.txt
    A docs/spin/aio_notify.promela
    A docs/spin/aio_notify_accept.promela
    A docs/spin/aio_notify_bug.promela
    A docs/spin/tcg-exclusive.promela
    A docs/spin/win32-qemu-event.promela
    R docs/tcg-exclusive.promela
    R docs/tracing.txt
    R docs/virtio-migration.txt
    R docs/win32-qemu-event.promela
    R docs/writing-qmp-commands.txt
    M exec.c
    A gdb-xml/i386-32bit-sse.xml
    A gdb-xml/i386-32bit.xml
    A gdb-xml/i386-64bit-sse.xml
    A gdb-xml/i386-64bit.xml
    M hw/i386/kvm/clock.c
    M hw/misc/edu.c
    M hw/pci/msix.c
    M hw/pci/trace-events
    M hw/scsi/virtio-scsi.c
    M hw/timer/mc146818rtc.c
    M include/block/nbd.h
    M include/hw/timer/mc146818rtc_regs.h
    M kvm-all.c
    M nbd/client.c
    M nbd/common.c
    M nbd/nbd-internal.h
    M nbd/server.c
    M pc-bios/linuxboot_dma.bin
    M pc-bios/optionrom/Makefile
    M qemu-nbd.c
    M target/i386/arch_memory_mapping.c
    M target/i386/cpu.c
    M target/i386/cpu.h
    M target/i386/helper.c
    M target/i386/kvm.c
    M target/i386/machine.c
    M target/i386/smm_helper.c
    M target/i386/translate.c
    M tests/qemu-iotests/083.out
    M tests/rtc-test.c
    M trace-events
    M util/oslib-posix.c
    M util/qemu-sockets.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

* virtio-scsi use-after-free fix (Fam)
* SMM fixes and improvements for TCG (myself, Mihail)
* irqchip and AddressSpaceDispatch cleanups and fixes (Peter)
* Coverity fix (Stefano)
* NBD cleanups and fixes (Vladimir, Eric, myself)
* RTC accuracy improvements and code cleanups (Guangrong+Yunfang)
* socket error reporting improvement (Daniel)
* GDB XML description for SSE registers (Abdallah)
* kvmclock update fix (Denis)
* SMM memory savings (Gonglei)
* -cpu 486 fix (myself)
* various bugfixes (Roman, Peter, myself, Thomas)
* rtc-test improvement (Guangrong)
* migration throttling fix (Felipe)
* create docs/ subdirectories (myself)

# gpg: Signature made Wed 07 Jun 2017 17:22:07 BST
# gpg:                using RSA key 0xBFFBD25F78C7AE83
# gpg: Good signature from "Paolo Bonzini <address@hidden>"
# gpg:                 aka "Paolo Bonzini <address@hidden>"
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream: (31 commits)
  docs: create config/, devel/ and spin/ subdirectories
  cpus: reset throttle_thread_scheduled after sleep
  kvm: don't register smram_listener when smm is off
  nbd: make it thread-safe, fix qcow2 over nbd
  target/i386: Add GDB XML description for SSE registers
  i386/kvm: do not zero out segment flags if segment is unusable or not present
  edu: fix memory leak on msi_broken platforms
  linuxboot_dma: compile for i486
  kvmclock: update system_time_msr address forcibly
  nbd: Fully initialize client in case of failed negotiation
  sockets: improve error reporting if UNIX socket path is too long
  i386: fix read/write cr with icount option
  target/i386: use multiple CPU AddressSpaces
  target/i386: enable A20 automatically in system management mode
  virtio-scsi: Unset hotplug handler when unrealize
  exec: simplify phys_page_find() params
  nbd/client.c: use errp instead of LOG
  nbd: add errp to read_sync, write_sync and drop_sync
  nbd: add errp parameter to nbd_wr_syncv()
  nbd: read_sync and friends: return 0 on success
  ...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/64175afc695c...bbfa326fc802

reply via email to

[Prev in Thread] Current Thread [Next in Thread]