qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 494cd1: kvm: support to get/set dirty log ini


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 494cd1: kvm: support to get/set dirty log initial-all-set ...
Date: Fri, 26 Jun 2020 10:30:29 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 494cd11d769ad1681c5914f8be7aa93ef497591f
      
https://github.com/qemu/qemu/commit/494cd11d769ad1681c5914f8be7aa93ef497591f
  Author: Jay Zhou <jianjay.zhou@huawei.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M accel/kvm/kvm-all.c

  Log Message:
  -----------
  kvm: support to get/set dirty log initial-all-set capability

Since the new capability KVM_DIRTY_LOG_INITIALLY_SET of
KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 has been introduced in the
kernel, tweak the userspace side to detect and enable this
capability.

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Message-Id: <20200304025554.2159-1-jianjay.zhou@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: ae2b72072bc401114ebb9f46abd67d07d4cabf10
      
https://github.com/qemu/qemu/commit/ae2b72072bc401114ebb9f46abd67d07d4cabf10
  Author: David CARLIER <devnexen@gmail.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M util/getauxval.c

  Log Message:
  -----------
  util/getauxval: Porting to FreeBSD getauxval feature

>From d7f9d40777d1ed7c9450b0be4f957da2993dfc72 Mon Sep 17 00:00:00 2001
From: David Carlier <devnexen@gmail.com>
Date: Fri, 12 Jun 2020 09:39:17 +0100
Subject: [PATCH] util/getauxval: Porting to FreeBSD getauxval feature

FreeBSD has a similar API for auxiliary vector.

Signed-off-by: David Carlier <devnexen@gmail.com>
Message-Id: <CA+XhMqxTU6PUSQBpbA9VrS1QZfqgrCAKUCtUF-x2aF=fCMTDOw@mail.gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 89ed83d8b23c11d250c290593cad3ca839d5b053
      
https://github.com/qemu/qemu/commit/89ed83d8b23c11d250c290593cad3ca839d5b053
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M tests/qtest/usb-hcd-ehci-test.c

  Log Message:
  -----------
  libqos: usb-hcd-ehci: use 32-bit write for config register

The memory region ops have min_access_size == 4 so obey it.

Tested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 4b7c06837ae0b1ff56473202a42e7e386f53d6db
      
https://github.com/qemu/qemu/commit/4b7c06837ae0b1ff56473202a42e7e386f53d6db
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M tests/qtest/libqos/pci-pc.c

  Log Message:
  -----------
  libqos: pci-pc: use 32-bit write for EJ register

The memory region ops have min_access_size == 4 so obey it.

Tested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 5d971f9e672507210e77d020d89e0e89165c8fc9
      
https://github.com/qemu/qemu/commit/5d971f9e672507210e77d020d89e0e89165c8fc9
  Author: Michael S. Tsirkin <mst@redhat.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M memory.c

  Log Message:
  -----------
  memory: Revert "memory: accept mismatching sizes in 
memory_region_access_valid"

Memory API documentation documents valid .min_access_size and .max_access_size
fields and explains that any access outside these boundaries is blocked.

This is what devices seem to assume.

However this is not what the implementation does: it simply
ignores the boundaries unless there's an "accepts" callback.

Naturally, this breaks a bunch of devices.

Revert to the documented behaviour.

Devices that want to allow any access can just drop the valid field,
or add the impl field to have accesses converted to appropriate
length.

Cc: qemu-stable@nongnu.org
Reviewed-by: Richard Henderson <rth@twiddle.net>
Fixes: CVE-2020-13754
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1842363
Fixes: a014ed07bd5a ("memory: accept mismatching sizes in 
memory_region_access_valid")
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20200610134731.1514409-1-mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 255ae6e2158c743717bed76c9a2365ee4bcd326e
      
https://github.com/qemu/qemu/commit/255ae6e2158c743717bed76c9a2365ee4bcd326e
  Author: Pavel Dovgalyuk <Pavel.Dovgaluk@gmail.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M cpus.c

  Log Message:
  -----------
  replay: notify the main loop when there are no instructions

When QEMU is executed in console mode without any external event sources,
main loop may sleep for a very long time. But in case of replay
there is another event source - event log.
This patch adds main loop notification when the vCPU loop has nothing
to do and main loop should process the inputs from the event log.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Message-Id: <159013007895.28110.2020104406699709721.stgit@pasha-ThinkPad-X280>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 677a3baba4356b91c7acfb5828dd9a598decda6a
      
https://github.com/qemu/qemu/commit/677a3baba4356b91c7acfb5828dd9a598decda6a
  Author: Pavel Dovgalyuk <Pavel.Dovgaluk@gmail.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M replay/replay.c
    M util/qemu-timer.c

  Log Message:
  -----------
  replay: synchronize on every virtual timer callback

Sometimes virtual timer callbacks depend on order
of virtual timer processing and warping of virtual clock.
Therefore every callback should be logged to make replay deterministic.
This patch creates a checkpoint before every virtual timer callback.
With these checkpoints virtual timers processing and clock warping
events order is completely deterministic.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Acked-by: Alex Bennée <alex.bennee@linaro.org>

--

v2:
  - remove mutex lock/unlock for virtual clock checkpoint since it is
    not process any asynchronous events (commit 
ca9759c2a92f528f256fef0e3922416f7bb47bf9)
  - bump record/replay log file version
Message-Id: <159012932716.27256.8854065545365559921.stgit@pasha-ThinkPad-X280>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 21b2eca6fc48c6485f5c3b4ed813246839f0a4df
      
https://github.com/qemu/qemu/commit/21b2eca6fc48c6485f5c3b4ed813246839f0a4df
  Author: Jingqi Liu <jingqi.liu@intel.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M configure

  Log Message:
  -----------
  configure: add libdaxctl support

Add a pair of configure options --{enable,disable}-libdaxctl to control
whether QEMU is compiled with libdaxctl [1]. Libdaxctl is a utility
library for managing the device dax subsystem.

QEMU uses mmap(2) to maps vNVDIMM backends and aligns the mapping
address to the page size (getpagesize(2)) by default. However, some
types of backends may require an alignment different than the page
size. The 'align' option is provided to memory-backend-file to allow
users to specify the proper alignment.

For device dax (e.g., /dev/dax0.0), the 'align' option needs to match
the alignment requirement of the device dax, which can be fetched
through the APIs of libdaxctl version 57 or up.

[1] Libdaxctl is a part of ndctl project.
The project's repository is: https://github.com/pmem/ndctl

For more information about libdaxctl APIs, you can refer to the
comments in source code of: pmem/ndctl/daxctl/lib/libdaxctl.c.

Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Jingqi Liu <jingqi.liu@intel.com>
Message-Id: <20200429085011.63752-4-jingqi.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: ce317be98db0dfdfae1d77b77e6b2575d7c59eeb
      
https://github.com/qemu/qemu/commit/ce317be98db0dfdfae1d77b77e6b2575d7c59eeb
  Author: Jingqi Liu <jingqi.liu@intel.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M exec.c

  Log Message:
  -----------
  exec: fetch the alignment of Linux devdax pmem character device nodes

If the backend file is devdax pmem character device, the alignment
specified by the option 'align=NUM' in the '-object memory-backend-file'
needs to match the alignment requirement of the devdax pmem character device.

This patch uses the interfaces of libdaxctl to fetch the devdax pmem file
'align', so that we can compare it with the NUM of 'align=NUM'.
The NUM needs to be larger than or equal to the devdax pmem file 'align'.

It also fixes the problem that mmap() returns failure in qemu_ram_mmap()
when the NUM of 'align=NUM' is less than the devdax pmem file 'align'.

Suggested-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Jingqi Liu <jingqi.liu@intel.com>
Message-Id: <20200429085011.63752-2-jingqi.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 5f509751f711b54717c1be03d55d096015b1712b
      
https://github.com/qemu/qemu/commit/5f509751f711b54717c1be03d55d096015b1712b
  Author: Jingqi Liu <jingqi.liu@intel.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M docs/nvdimm.txt
    M exec.c

  Log Message:
  -----------
  docs/nvdimm: add description of alignment requirement of device dax

For device dax (e.g., /dev/dax0.0), the NUM of 'align=NUM' option
needs to match the alignment requirement of the device dax.
It must be larger than or equal to the 'align' of device dax.

Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Jingqi Liu <jingqi.liu@intel.com>
Message-Id: <20200429085011.63752-3-jingqi.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: ee760ac80ac1f130138e8eb4eba263a4d48ace51
      
https://github.com/qemu/qemu/commit/ee760ac80ac1f130138e8eb4eba263a4d48ace51
  Author: Thomas Huth <thuth@redhat.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M hw/scsi/megasas.c

  Log Message:
  -----------
  hw/scsi/megasas: Fix possible out-of-bounds array access in tracepoints

Some tracepoints in megasas.c use a guest-controlled value as an index
into the mfi_frame_desc[] array. Thus a malicious guest could cause an
out-of-bounds error here. Fortunately, the impact is very low since this
can only happen when the corresponding tracepoints have been enabled
before, but the problem should be fixed anyway with a proper check.

Buglink: https://bugs.launchpad.net/qemu/+bug/1882065
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20200615072629.32321-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: c13dba2c77b2f2066eeb04edd9ba72a09a668ea9
      
https://github.com/qemu/qemu/commit/c13dba2c77b2f2066eeb04edd9ba72a09a668ea9
  Author: Liao Pingfang <liao.pingfang@zte.com.cn>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M Makefile
    M docs/index.html.in

  Log Message:
  -----------
  Makefile: Install qemu-[qmp/ga]-ref.* into the directory "interop"

We need install qemu-[qmp/ga]-ref.* files into the subdirectory of qemu docs: 
interop.

If we visit the following address and click the link to qemu-qmp-ref.html:
https://www.qemu.org/docs/master/interop/bitmaps.html#basic-qmp-usage

It will report following error:
"
Not Found
The requested URL /docs/master/interop/qemu-qmp-ref.html was not found on this 
server.
"

Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <1591663670-47712-1-git-send-email-wang.yi59@zte.com.cn>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: b00de3a51fc8e86d1678c57e65d57aa9ed052422
      
https://github.com/qemu/qemu/commit/b00de3a51fc8e86d1678c57e65d57aa9ed052422
  Author: Anthony PERARD <anthony.perard@citrix.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M hw/xen/Makefile.objs

  Log Message:
  -----------
  xen: Actually fix build without passthrough

Fix typo.

Fixes: acd0c9416d48 ("xen: fix build without pci passthrough")
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20200619103115.254127-1-anthony.perard@citrix.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: eca30647fc078f4d9ed1b455bd67960f99dbeb7a
      
https://github.com/qemu/qemu/commit/eca30647fc078f4d9ed1b455bd67960f99dbeb7a
  Author: Joseph Myers <joseph@codesourcery.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M target/i386/fpu_helper.c
    A tests/tcg/i386/test-i386-f2xm1.c

  Log Message:
  -----------
  target/i386: reimplement f2xm1 using floatx80 operations

The x87 f2xm1 emulation is currently based around conversion to
double.  This is inherently unsuitable for a good emulation of any
floatx80 operation, even before considering that it is a particularly
naive implementation using double (computing with pow and then
subtracting 1 rather than attempting a better emulation using expm1).

Reimplement using the soft-float operations, including additions and
multiplications with higher precision where appropriate to limit
accumulation of errors.  I considered reusing some of the m68k code
for transcendental operations, but the instructions don't generally
correspond exactly to x87 operations (for example, m68k has 2^x and
e^x - 1, but not 2^x - 1); to avoid possible accumulation of errors
from applying multiple such operations each rounding to floatx80
precision, I wrote a direct implementation of 2^x - 1 instead.  It
would be possible in principle to make the implementation more
efficient by doing the intermediate operations directly with
significands, signs and exponents and not packing / unpacking floatx80
format for each operation, but that would make it significantly more
complicated and it's not clear that's worthwhile; the m68k emulation
doesn't try to do that.

A test is included with many randomly generated inputs.  The
assumption of the test is that the result in round-to-nearest mode
should always be one of the two closest floating-point numbers to the
mathematical value of 2^x - 1; the implementation aims to do somewhat
better than that (about 70 correct bits before rounding).  I haven't
investigated how accurate hardware is.

Signed-off-by: Joseph Myers <joseph@codesourcery.com>

Message-Id: <alpine.DEB.2.21.2006112341010.18393@digraph.polyomino.org.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 6b8b0136ab3018e4b552b485f808bf66bcf19ead
      
https://github.com/qemu/qemu/commit/6b8b0136ab3018e4b552b485f808bf66bcf19ead
  Author: Joseph Myers <joseph@codesourcery.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M fpu/softfloat.c
    M include/fpu/softfloat.h
    M target/m68k/softfloat.c
    M target/m68k/softfloat.h

  Log Message:
  -----------
  softfloat: merge floatx80_mod and floatx80_rem

The m68k-specific softfloat code includes a function floatx80_mod that
is extremely similar to floatx80_rem, but computing the remainder
based on truncating the quotient toward zero rather than rounding it
to nearest integer.  This is also useful for emulating the x87 fprem
and fprem1 instructions.  Change the floatx80_rem implementation into
floatx80_modrem that can perform either operation, with both
floatx80_rem and floatx80_mod as thin wrappers available for all
targets.

There does not appear to be any use for the _mod operation for other
floating-point formats in QEMU (the only other architectures using
_rem at all are linux-user/arm/nwfpe, for FPA emulation, and openrisc,
for instructions that have been removed in the latest version of the
architecture), so no change is made to the code for other formats.

Signed-off-by: Joseph Myers <joseph@codesourcery.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <alpine.DEB.2.21.2006081654280.23637@digraph.polyomino.org.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 499a2f7b554a295cfc10f8cd026d9b20a38fe664
      
https://github.com/qemu/qemu/commit/499a2f7b554a295cfc10f8cd026d9b20a38fe664
  Author: Joseph Myers <joseph@codesourcery.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M fpu/softfloat.c

  Log Message:
  -----------
  softfloat: fix floatx80 remainder pseudo-denormal check for zero

The floatx80 remainder implementation ignores the high bit of the
significand when checking whether an operand (numerator) with zero
exponent is zero.  This means it mishandles a pseudo-denormal
representation of 0x1p-16382L by treating it as zero.  Fix this by
checking the whole significand instead.

Signed-off-by: Joseph Myers <joseph@codesourcery.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <alpine.DEB.2.21.2006081655180.23637@digraph.polyomino.org.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: b662495dca0a2a36008cf8def91e2566519ed3f2
      
https://github.com/qemu/qemu/commit/b662495dca0a2a36008cf8def91e2566519ed3f2
  Author: Joseph Myers <joseph@codesourcery.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M fpu/softfloat.c

  Log Message:
  -----------
  softfloat: do not return pseudo-denormal from floatx80 remainder

The floatx80 remainder implementation sometimes returns the numerator
unchanged when the denominator is sufficiently larger than the
numerator.  But if the value to be returned unchanged is a
pseudo-denormal, that is incorrect.  Fix it to normalize the numerator
in that case.

Signed-off-by: Joseph Myers <joseph@codesourcery.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <alpine.DEB.2.21.2006081655520.23637@digraph.polyomino.org.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 566601f1f9d972e44214696d3cb320e6c18880aa
      
https://github.com/qemu/qemu/commit/566601f1f9d972e44214696d3cb320e6c18880aa
  Author: Joseph Myers <joseph@codesourcery.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M fpu/softfloat.c

  Log Message:
  -----------
  softfloat: do not set denominator high bit for floatx80 remainder

The floatx80 remainder implementation unnecessarily sets the high bit
of bSig explicitly.  By that point in the function, arguments that are
invalid, zero, infinity or NaN have already been handled and
subnormals have been through normalizeFloatx80Subnormal, so the high
bit will already be set.  Remove the unnecessary code.

Signed-off-by: Joseph Myers <joseph@codesourcery.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <alpine.DEB.2.21.2006081656220.23637@digraph.polyomino.org.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 445810ec915687d37b8ae0ef8d7340ab4a153efa
      
https://github.com/qemu/qemu/commit/445810ec915687d37b8ae0ef8d7340ab4a153efa
  Author: Joseph Myers <joseph@codesourcery.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M fpu/softfloat.c
    M include/fpu/softfloat.h

  Log Message:
  -----------
  softfloat: return low bits of quotient from floatx80_modrem

Both x87 and m68k need the low parts of the quotient for their
remainder operations.  Arrange for floatx80_modrem to track those bits
and return them via a pointer.

The architectures using float32_rem and float64_rem do not appear to
need this information, so the *_rem interface is left unchanged and
the information returned only from floatx80_modrem.  The logic used to
determine the low 7 bits of the quotient for m68k
(target/m68k/fpu_helper.c:make_quotient) appears completely bogus (it
looks at the result of converting the remainder to integer, the
quotient having been discarded by that point); this patch does not
change that, but the m68k maintainers may wish to do so.

Signed-off-by: Joseph Myers <joseph@codesourcery.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <alpine.DEB.2.21.2006081656500.23637@digraph.polyomino.org.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 5ef396e2ba865f34a4766dbd60c739fb4bcb4fcc
      
https://github.com/qemu/qemu/commit/5ef396e2ba865f34a4766dbd60c739fb4bcb4fcc
  Author: Joseph Myers <joseph@codesourcery.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M target/i386/fpu_helper.c

  Log Message:
  -----------
  target/i386: reimplement fprem, fprem1 using floatx80 operations

The x87 fprem and fprem1 emulation is currently based around
conversion to double, which is inherently unsuitable for a good
emulation of any floatx80 operation.  Reimplement using the soft-float
floatx80 remainder operations.

Signed-off-by: Joseph Myers <joseph@codesourcery.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <alpine.DEB.2.21.2006081657200.23637@digraph.polyomino.org.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 5eebc49d2d0aa5fc7e90eeac97533051bb7b72fa
      
https://github.com/qemu/qemu/commit/5eebc49d2d0aa5fc7e90eeac97533051bb7b72fa
  Author: Joseph Myers <joseph@codesourcery.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M target/i386/fpu_helper.c
    A tests/tcg/i386/test-i386-fyl2xp1.c

  Log Message:
  -----------
  target/i386: reimplement fyl2xp1 using floatx80 operations

The x87 fyl2xp1 emulation is currently based around conversion to
double.  This is inherently unsuitable for a good emulation of any
floatx80 operation, even before considering that it is a particularly
naive implementation using double (adding 1 then using log rather than
attempting a better emulation using log1p).

Reimplement using the soft-float operations, as was done for f2xm1; as
in that case, m68k has related operations but not exactly this one and
it seemed safest to implement directly rather than reusing the m68k
code to avoid accumulation of errors.

A test is included with many randomly generated inputs.  The
assumption of the test is that the result in round-to-nearest mode
should always be one of the two closest floating-point numbers to the
mathematical value of y * log2(x + 1); the implementation aims to do
somewhat better than that (about 70 correct bits before rounding).  I
haven't investigated how accurate hardware is.

Intel manuals describe a narrower range of valid arguments to this
instruction than AMD manuals.  The implementation accepts the wider
range (it's needed anyway for the core code to be reusable in a
subsequent patch reimplementing fyl2x), but the test only has inputs
in the narrower range so that it's valid on hardware that may reject
or produce poor results for inputs outside that range.

Code in the previous implementation that sets C2 for some out-of-range
arguments is not carried forward to the new implementation; C2 is
undefined for this instruction and I suspect that code was just
cut-and-pasted from the trigonometric instructions (fcos, fptan, fsin,
fsincos) where C2 *is* defined to be set for out-of-range arguments.

Signed-off-by: Joseph Myers <joseph@codesourcery.com>

Message-Id: <alpine.DEB.2.21.2006172320190.20587@digraph.polyomino.org.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 1f18a1e6ab8368a4eab2d22894d3b2ae75250cd3
      
https://github.com/qemu/qemu/commit/1f18a1e6ab8368a4eab2d22894d3b2ae75250cd3
  Author: Joseph Myers <joseph@codesourcery.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M target/i386/fpu_helper.c
    A tests/tcg/i386/test-i386-fyl2x.c

  Log Message:
  -----------
  target/i386: reimplement fyl2x using floatx80 operations

The x87 fyl2x emulation is currently based around conversion to
double.  This is inherently unsuitable for a good emulation of any
floatx80 operation.  Reimplement using the soft-float operations,
building on top of the reimplementation of fyl2xp1 and factoring out
code to be shared between the two instructions.

The included test assumes that the result in round-to-nearest mode
should always be one of the two closest floating-point numbers to the
mathematically exact result (including that it should be exact, in the
exact cases which cover more cases than for fyl2xp1).

Signed-off-by: Joseph Myers <joseph@codesourcery.com>
Message-Id: <alpine.DEB.2.21.2006172321530.20587@digraph.polyomino.org.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: ff57bb7b63267dabd60f88354c8c29ea5e1eb3ec
      
https://github.com/qemu/qemu/commit/ff57bb7b63267dabd60f88354c8c29ea5e1eb3ec
  Author: Joseph Myers <joseph@codesourcery.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M target/i386/fpu_helper.c
    A tests/tcg/i386/test-i386-fpatan.c

  Log Message:
  -----------
  target/i386: reimplement fpatan using floatx80 operations

The x87 fpatan emulation is currently based around conversion to
double.  This is inherently unsuitable for a good emulation of any
floatx80 operation.  Reimplement using the soft-float operations, as
for other such instructions.

Signed-off-by: Joseph Myers <joseph@codesourcery.com>

Message-Id: <alpine.DEB.2.21.2006230000340.24721@digraph.polyomino.org.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 47f0d11d215695bd3434099a7c823f26c910d3ec
      
https://github.com/qemu/qemu/commit/47f0d11d215695bd3434099a7c823f26c910d3ec
  Author: Tao Xu <tao3.xu@intel.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M target/i386/cpu.c

  Log Message:
  -----------
  target/i386: Add notes for versioned CPU models

Add which features are added or removed in this version.

Signed-off-by: Tao Xu <tao3.xu@intel.com>
Message-Id: <20200324051034.30541-1-tao3.xu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: f9919116b8c226428df28bc69ab33480eaa1ee6d
      
https://github.com/qemu/qemu/commit/f9919116b8c226428df28bc69ab33480eaa1ee6d
  Author: Eric Blake <eblake@redhat.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M accel/tcg/translate-all.c
    M hw/usb/hcd-xhci.h
    M include/block/block.h
    M include/exec/cpu-all.h
    M include/exec/cpu-defs.h
    M include/qemu/osdep.h
    M migration/qemu-file.c

  Log Message:
  -----------
  osdep: Make MIN/MAX evaluate arguments only once

I'm not aware of any immediate bugs in qemu where a second runtime
evaluation of the arguments to MIN() or MAX() causes a problem, but
proactively preventing such abuse is easier than falling prey to an
unintended case down the road.  At any rate, here's the conversation
that sparked the current patch:
https://lists.gnu.org/archive/html/qemu-devel/2018-12/msg05718.html

Update the MIN/MAX macros to only evaluate their argument once at
runtime; this uses typeof(1 ? (a) : (b)) to ensure that we are
promoting the temporaries to the same type as the final comparison (we
have to trigger type promotion, as typeof(bitfield) won't compile; and
we can't use typeof((a) + (b)) or even typeof((a) + 0), as some of our
uses of MAX are on void* pointers where such addition is undefined).

However, we are unable to work around gcc refusing to compile ({}) in
a constant context (such as the array length of a static variable),
even when only used in the dead branch of a __builtin_choose_expr(),
so we have to provide a second macro pair MIN_CONST and MAX_CONST for
use when both arguments are known to be compile-time constants and
where the result must also be usable as a constant; this second form
evaluates arguments multiple times but that doesn't matter for
constants.  By using a void expression as the expansion if a
non-constant is presented to this second form, we can enlist the
compiler to ensure the double evaluation is not attempted on
non-constants.

Alas, as both macros now rely on compiler intrinsics, they are no
longer usable in preprocessor #if conditions; those will just have to
be open-coded or the logic rewritten into #define or runtime 'if'
conditions (but where the compiler dead-code-elimination will probably
still apply).

I tested that both gcc 10.1.1 and clang 10.0.0 produce errors for all
forms of macro mis-use.  As the errors can sometimes be cryptic, I'm
demonstrating the gcc output:

Use of MIN when MIN_CONST is needed:

In file included from /home/eblake/qemu/qemu-img.c:25:
/home/eblake/qemu/include/qemu/osdep.h:249:5: error: braced-group within 
expression allowed only inside a function
  249 |     ({                                                  \
      |     ^
/home/eblake/qemu/qemu-img.c:92:12: note: in expansion of macro ‘MIN’
   92 | char array[MIN(1, 2)] = "";
      |            ^~~

Use of MIN_CONST when MIN is needed:

/home/eblake/qemu/qemu-img.c: In function ‘is_allocated_sectors’:
/home/eblake/qemu/qemu-img.c:1225:15: error: void value not ignored as it ought 
to be
 1225 |             i = MIN_CONST(i, n);
      |               ^

Use of MIN in the preprocessor:

In file included from /home/eblake/qemu/accel/tcg/translate-all.c:20:
/home/eblake/qemu/accel/tcg/translate-all.c: In function ‘page_check_range’:
/home/eblake/qemu/include/qemu/osdep.h:249:6: error: token "{" is not valid in 
preprocessor expressions
  249 |     ({                                                  \
      |      ^

Fix the resulting callsites that used #if or computed a compile-time
constant min or max to use the new macros.  cpu-defs.h is interesting,
as CPU_TLB_DYN_MAX_BITS is sometimes used as a constant and sometimes
dynamic.

It may be worth improving glib's MIN/MAX definitions to be saner, but
that is a task for another day.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200625162602.700741-1-eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 32a354dc6c07d766e70b51f42a62d8cd479e3f82
      
https://github.com/qemu/qemu/commit/32a354dc6c07d766e70b51f42a62d8cd479e3f82
  Author: Igor Mammedov <imammedo@redhat.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M docs/system/deprecated.rst
    M hw/arm/virt.c
    M hw/core/numa.c
    M hw/i386/pc.c
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M hw/ppc/spapr.c
    M qemu-options.hx

  Log Message:
  -----------
  numa: forbid '-numa node, mem' for 5.1 and newer machine types

Deprecation period is run out and it's a time to flip the switch
introduced by cd5ff8333a.  Disable legacy option for new machine
types (since 5.1) and amend documentation.

'-numa node,memdev' shall be used instead of disabled option
with new machine types.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <20200609135635.761587-1-imammedo@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 74aaddc6283ff789923127f3b95f781796fe3f39
      
https://github.com/qemu/qemu/commit/74aaddc6283ff789923127f3b95f781796fe3f39
  Author: Marcelo Tosatti <mtosatti@redhat.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M target/i386/kvm.c

  Log Message:
  -----------
  kvm: i386: allow TSC to differ by NTP correction bounds without TSC scaling

The Linux TSC calibration procedure is subject to small variations
(its common to see +-1 kHz difference between reboots on a given CPU, for 
example).

So migrating a guest between two hosts with identical processor can fail, in 
case
of a small variation in calibrated TSC between them.

Allow a conservative 250ppm error between host TSC and VM TSC frequencies,
rather than requiring an exact match. NTP daemon in the guest can
correct this difference.

Also change migration to accept this bound.

KVM_SET_TSC_KHZ depends on a kernel interface change. Without this change,
the behaviour remains the same: in case of a different frequency
between host and VM, KVM_SET_TSC_KHZ will fail and QEMU will exit.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

Message-Id: <20200616165805.GA324612@fuller.cnet>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 8f06f22f38246ea7a6b0b20013fd9a7a87e23569
      
https://github.com/qemu/qemu/commit/8f06f22f38246ea7a6b0b20013fd9a7a87e23569
  Author: Jon Doron <arilou@gmail.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M hw/hyperv/vmbus.c
    M hw/i386/acpi-build.c
    M include/hw/hyperv/vmbus-bridge.h

  Log Message:
  -----------
  hyperv: vmbus: Remove the 2nd IRQ

It seems like Windows does not really require 2 IRQs to have a
functioning VMBus.

Signed-off-by: Jon Doron <arilou@gmail.com>
Message-Id: <20200617160904.681845-2-arilou@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: f983ff95f4c9886eaa4c59beff609d59fa2a90ff
      
https://github.com/qemu/qemu/commit/f983ff95f4c9886eaa4c59beff609d59fa2a90ff
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M hw/core/machine.c

  Log Message:
  -----------
  vmport: move compat properties to hw_compat_5_0

The patches that introduced the properties were submitted when QEMU 5.0
had not been released yet, so they got merged under the wrong heading.
Move them to hw_compat_5_0 so that 5.0 machine types get the pre-patch
behavior.

Fixes: b889212973da ("hw/i386/vmport: Propagate IOPort read to vCPU EAX 
register")
Fixes: 0342ee761ef2 ("hw/i386/vmport: Set EAX to -1 on failed and unsupported 
commands")
Fixes: f8bdc550370f ("hw/i386/vmport: Report vmware-vmx-type in CMD_GETVERSION")
Fixes: aaacf1c15a22 ("hw/i386/vmport: Add support for CMD_GETBIOSUUID")
Reported-by: Laurent Vivier <lvivier@redhat.com>
Cc: Liran Alon <liran.alon@oracle.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: c8d7fd059d73a7d3035e379c319034c30ba3dbbf
      
https://github.com/qemu/qemu/commit/c8d7fd059d73a7d3035e379c319034c30ba3dbbf
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M hw/char/ibex_uart.c

  Log Message:
  -----------
  ibex_uart: fix XOR-as-pow

The xor-as-pow warning in clang actually detected a genuine bug.
Fix it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 730319aef0fcb94f11a4a2d32656437fdde7efdd
      
https://github.com/qemu/qemu/commit/730319aef0fcb94f11a4a2d32656437fdde7efdd
  Author: Eduardo Habkost <ehabkost@redhat.com>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M target/i386/cpu.c
    M tests/qtest/test-x86-cpuid-compat.c

  Log Message:
  -----------
  i386: Mask SVM features if nested SVM is disabled

QEMU incorrectly validates FEAT_SVM feature flags against
GET_SUPPORTED_CPUID even if SVM features are being masked out by
cpu_x86_cpuid().  This can make QEMU print warnings on most AMD
CPU models, even when SVM nesting is disabled (which is the
default).

This bug was never detected before because of a Linux KVM bug:
until Linux v5.6, KVM was not filtering out SVM features in
GET_SUPPORTED_CPUID when nested was disabled.  This KVM bug was
fixed in Linux v5.7-rc1, on Linux commit a50718cc3f43 ("KVM:
nSVM: Expose SVM features to L1 iff nested is enabled").

Fix the problem by adding a CPUID_EXT3_SVM dependency to all
FEAT_SVM feature flags in the feature_dependencies table.

Reported-by: Yanan Fu <yfu@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20200623230116.277409-1-ehabkost@redhat.com>
[Fix testcase. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 3591ddd39987cbdaa0cfa344a262f315abd97582
      
https://github.com/qemu/qemu/commit/3591ddd39987cbdaa0cfa344a262f315abd97582
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-06-26 (Fri, 26 Jun 2020)

  Changed paths:
    M Makefile
    M accel/kvm/kvm-all.c
    M accel/tcg/translate-all.c
    M configure
    M cpus.c
    M docs/index.html.in
    M docs/nvdimm.txt
    M docs/system/deprecated.rst
    M exec.c
    M fpu/softfloat.c
    M hw/arm/virt.c
    M hw/char/ibex_uart.c
    M hw/core/machine.c
    M hw/core/numa.c
    M hw/hyperv/vmbus.c
    M hw/i386/acpi-build.c
    M hw/i386/pc.c
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M hw/ppc/spapr.c
    M hw/scsi/megasas.c
    M hw/usb/hcd-xhci.h
    M hw/xen/Makefile.objs
    M include/block/block.h
    M include/exec/cpu-all.h
    M include/exec/cpu-defs.h
    M include/fpu/softfloat.h
    M include/hw/hyperv/vmbus-bridge.h
    M include/qemu/osdep.h
    M memory.c
    M migration/qemu-file.c
    M qemu-options.hx
    M replay/replay.c
    M target/i386/cpu.c
    M target/i386/fpu_helper.c
    M target/i386/kvm.c
    M target/m68k/softfloat.c
    M target/m68k/softfloat.h
    M tests/qtest/libqos/pci-pc.c
    M tests/qtest/test-x86-cpuid-compat.c
    M tests/qtest/usb-hcd-ehci-test.c
    A tests/tcg/i386/test-i386-f2xm1.c
    A tests/tcg/i386/test-i386-fpatan.c
    A tests/tcg/i386/test-i386-fyl2x.c
    A tests/tcg/i386/test-i386-fyl2xp1.c
    M util/getauxval.c
    M util/qemu-timer.c

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

* Various fixes
* libdaxctl support to correctly align devdax character devices (Jingqi)
* initial-all-set support for live migration (Jay)
* forbid '-numa node, mem' for 5.1 and newer machine types (Igor)
* x87 fixes (Joseph)
* Tighten memory_region_access_valid (Michael) and fix fallout (myself)
* Replay fixes (Pavel)

# gpg: Signature made Fri 26 Jun 2020 14:42:17 BST
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# 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)
  i386: Mask SVM features if nested SVM is disabled
  ibex_uart: fix XOR-as-pow
  vmport: move compat properties to hw_compat_5_0
  hyperv: vmbus: Remove the 2nd IRQ
  kvm: i386: allow TSC to differ by NTP correction bounds without TSC scaling
  numa: forbid '-numa node, mem' for 5.1 and newer machine types
  osdep: Make MIN/MAX evaluate arguments only once
  target/i386: Add notes for versioned CPU models
  target/i386: reimplement fpatan using floatx80 operations
  target/i386: reimplement fyl2x using floatx80 operations
  target/i386: reimplement fyl2xp1 using floatx80 operations
  target/i386: reimplement fprem, fprem1 using floatx80 operations
  softfloat: return low bits of quotient from floatx80_modrem
  softfloat: do not set denominator high bit for floatx80 remainder
  softfloat: do not return pseudo-denormal from floatx80 remainder
  softfloat: fix floatx80 remainder pseudo-denormal check for zero
  softfloat: merge floatx80_mod and floatx80_rem
  target/i386: reimplement f2xm1 using floatx80 operations
  xen: Actually fix build without passthrough
  Makefile: Install qemu-[qmp/ga]-ref.* into the directory "interop"
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/87fb952da83b...3591ddd39987



reply via email to

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