qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] b65310: vnc: avoid deprecation warnings for S


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] b65310: vnc: avoid deprecation warnings for SASL on OS X
Date: Fri, 18 Jun 2021 01:54:12 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: b65310ab34cbada47a5570c94d6f8f5efd39d171
      
https://github.com/qemu/qemu/commit/b65310ab34cbada47a5570c94d6f8f5efd39d171
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M ui/vnc-auth-sasl.c
    M ui/vnc-auth-sasl.h
    M ui/vnc.c

  Log Message:
  -----------
  vnc: avoid deprecation warnings for SASL on OS X

Apple has deprecated sasl.h functions in OS X 10.11.  Therefore,
all files that use SASL API need to disable -Wdeprecated-declarations.
Remove the only use that is outside vnc-auth-sasl.c and add the
relevant #pragma GCC diagnostic there.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210604120915.286195-1-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 38f71349c7c4969bc14da4da1c70b8cc4078d596
      
https://github.com/qemu/qemu/commit/38f71349c7c4969bc14da4da1c70b8cc4078d596
  Author: Zhenzhong Duan <zhenzhong.duan@intel.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M softmmu/vl.c

  Log Message:
  -----------
  vl: Fix an assert failure in error path

Based on the description of error_setg(), the local variable err in
qemu_maybe_daemonize() should be initialized to NULL.

Without fix, the uninitialized *errp triggers assert failure which
doesn't show much valuable information.

Before the fix:
qemu-system-x86_64: ../util/error.c:59: error_setv: Assertion `*errp == NULL' 
failed.

After fix:
qemu-system-x86_64: cannot create PID file: Cannot open pid file: Permission 
denied

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Message-Id: <20210610084741.456260-1-zhenzhong.duan@intel.com>
Cc: qemu-stable@nongnu.org
Fixes: 0546c0609c ("vl: split various early command line options to a separate 
function", 2020-12-10)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: e7d85d955a7a3405934a104f35228aae1d338a6d
      
https://github.com/qemu/qemu/commit/e7d85d955a7a3405934a104f35228aae1d338a6d
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M util/qemu-config.c

  Log Message:
  -----------
  qemu-config: use qemu_opts_from_qdict

Using qemu_opts_absorb_qdict, and then checking for any leftover options,
is redundant because there is already a function that does the same,
qemu_opts_from_qdict.  qemu_opts_from_qdict consumes the whole dictionary
and therefore can just return an error message if an option fails to validate.

This also fixes a bug, because the "id" entry was retrieved in
qemu_config_do_parse and then left there by qemu_opts_absorb_qdict.
As a result, it was reported as an unrecognized option.

Reported-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Fixes: 3770141139 ("qemu-config: parse configuration files to a QDict")
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 06b80795ee25d23e69747b2cb435003c6db2a6ab
      
https://github.com/qemu/qemu/commit/06b80795ee25d23e69747b2cb435003c6db2a6ab
  Author: Maxim Levitsky <mlevitsk@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

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

  Log Message:
  -----------
  block/scsi: correctly emulate the VPD block limits page

When the device doesn't support the VPD block limits page, we emulate it even
for SCSI passthrough.

As a part of the emulation we need to add it to the 'Supported VPD Pages'

The code that does this adds it to the page, but it doesn't increase the length
of the data to be copied to the guest, thus the guest never sees the VPD block
limits page as supported.

Bump the transfer size by 1 in this case.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20201217165612.942849-6-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 6e1da3d305499d3907f3c7f6638243e2e09b5085
      
https://github.com/qemu/qemu/commit/6e1da3d305499d3907f3c7f6638243e2e09b5085
  Author: Peng Liang <liangpeng10@huawei.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M softmmu/runstate.c

  Log Message:
  -----------
  runstate: Initialize Error * to NULL

Based on the description of error_setg(), the local variable err in
qemu_init_subsystems() should be initialized to NULL.

Fixes: efd7ab22fb ("vl: extract qemu_init_subsystems")
Cc: qemu-stable@nongnu.org
Signed-off-by: Peng Liang <liangpeng10@huawei.com>
Message-Id: <20210610131729.3906565-1-liangpeng10@huawei.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: cf1a7a9b3721544aaa3e43d111eb383c30d71a62
      
https://github.com/qemu/qemu/commit/cf1a7a9b3721544aaa3e43d111eb383c30d71a62
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: only assert INTR_DC interrupt flag if selection fails

The datasheet sequence tables confirm that when a target selection fails, only
the INTR_DC interrupt flag should be asserted.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Fixes: cf47a41e05 ("esp: latch individual bits in ESP_RINTR register")
Message-Id: <20210518212511.21688-2-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: af947a3d853a235943681a00f07f3081f5143cc3
      
https://github.com/qemu/qemu/commit/af947a3d853a235943681a00f07f3081f5143cc3
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: only set ESP_RSEQ at the start of the select sequence

When processing a command to select a target and send a CDB, the ESP device
maintains a sequence step register so that if an error occurs the host can
determine which part of the selection/CDB submission sequence failed.

The old Linux 2.6 driver is really pedantic here: it checks the sequence step
register even if a command succeeds and complains loudly on the console if the
sequence step register doesn't match the expected bus phase and interrupt flags.

This reason this mismatch occurs is because the ESP emulation currently doesn't
update the bus phase until the next TI (Transfer Information) command and so the
cleared sequence step register is considered invalid for the stale bus phase.

Normally this isn't an issue as the host only checks the sequence step register
if an error occurs but the old Linux 2.6 driver does this in several places
causing a large stream of "esp0: STEP_ASEL for tgt 0" messages to appear on the
console during the boot process.

Fix this by not clearing the sequence step register when reading the interrupt
register and clearing the DMA status, so the guest sees a valid sequence step
and bus phase combination at the end of the command phase. No other change is
required since the sequence step register is correctly updated throughout the
selection/CDB submission sequence once one of the select commands is issued.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Fixes: 1b9e48a5bd ("esp: implement non-DMA transfers in PDMA mode")
Message-Id: <20210518212511.21688-3-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 880d3089f1c667d7c84730ba9e9a2518220f7caf
      
https://github.com/qemu/qemu/commit/880d3089f1c667d7c84730ba9e9a2518220f7caf
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: allow non-DMA callback in esp_transfer_data() initial transfer

The current implementation only resumes DMA transfers when incoming data is
received from the target device, but this is also required for non-DMA transfers
with the next set of non-DMA changes.

Rather than duplicate the DMA/non-DMA dispatch logic in the initial transfer
section, update the code so that the initial transfer section can just
fallthrough to the main DMA/non-DMA dispatch logic.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20210519100803.10293-2-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 6ef2cabc7c4231207cfbac326853c0242d9c4617
      
https://github.com/qemu/qemu/commit/6ef2cabc7c4231207cfbac326853c0242d9c4617
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: handle non-DMA transfers from the target one byte at a time

The initial implementation of non-DMA transfers was based upon analysis of 
traces
from the MacOS toolbox ROM for handling unaligned reads but missed one key
aspect - during a non-DMA transfer from the target, the bus service interrupt
should be raised for every single byte received from the bus and not just at 
either
the end of the transfer or when the FIFO is full.

Adjust the non-DMA code accordingly so that esp_do_nodma() is called for every 
byte
received from the target. This also includes special handling for managing the 
change
from DATA IN to STATUS phase as this needs to occur when the final byte is read 
out
from the FIFO, and not at the end of the transfer of the last byte into the 
FIFO.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20210519100803.10293-3-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: e62a959afd2b1a13b27dda9d03f10c7feb36aa9b
      
https://github.com/qemu/qemu/commit/e62a959afd2b1a13b27dda9d03f10c7feb36aa9b
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: ensure PDMA write transfers are flushed from the FIFO to the target 
immediately

After each PDMA write transfer the MacOS CDROM driver waits until the FIFO is 
empty
(i.e. its contents have been written out to the SCSI bus) by polling the FIFO 
count
register until it reads 0. This doesn't work with the current PDMA write
implementation which waits until either the FIFO is full or the transfer is 
complete
before invoking the PDMA callback to process the FIFO contents.

Change the PDMA write transfer logic so that the PDMA callback is invoked after 
each
PDMA write to transfer the FIFO contents to the target buffer immediately, and 
hence
avoid getting stuck in the FIFO count register polling loop.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20210519100803.10293-4-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 35579b523cf8f441da12f968ce5dcf6ae0bfbfea
      
https://github.com/qemu/qemu/commit/35579b523cf8f441da12f968ce5dcf6ae0bfbfea
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: revert 75ef849696 "esp: correctly fill bus id with requested lun"

This commit from nearly 10 years ago is now broken due to the improvements
in esp emulation (or perhaps was never correct).  It shows up as a bug
in detecting the CDROM drive under MacOS. The error is caused by the
MacOS CDROM driver sending this CDB with an "S without ATN" command and
without DMA:

    0x12 0x00 0x00 0x00 0x05 0x00 (INQUIRY)

This is a valid INQUIRY command, however with this logic present the 3rd
byte (0x0) is copied over the 1st byte (0x12) which silently converts the
INQUIRY command to a TEST UNIT READY command before passing it to the
QEMU SCSI layer.  Since the TEST UNIT READY command has a zero length
response the MacOS CDROM driver never receives a response and assumes
the CDROM is not present.

The logic was to ignore the IDENTIFY byte and copy the LUN over from
the CDB, which did store the LUN in bits 5-7 of the second byte in
olden times.  This however is all obsolete, so just drop the code.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20210519100803.10293-5-mark.cave-ayland@ilande.co.uk>
[Tweaked commit message. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: c348458f357784629c36a6eb1493c0c0c33b74e7
      
https://github.com/qemu/qemu/commit/c348458f357784629c36a6eb1493c0c0c33b74e7
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: correctly accumulate extended messages for PDMA

Commit 799d90d818 "esp: transition to message out phase after SATN and stop
command" added logic to correctly handle extended messages for DMA requests
but not for PDMA requests.

Apply the same logic in esp_do_dma() to do_dma_pdma_cb() so that extended
messages terminated with a PDMA request are accumulated correctly. This allows
the ESP device to respond correctly to the SDTR negotiation initiated by the
NetBSD ESP driver without causing errors and timeouts on boot.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20210519100803.10293-6-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 0bcd5a18940e1c1e3350b93cfadcdc6b58ca1c0e
      
https://github.com/qemu/qemu/commit/0bcd5a18940e1c1e3350b93cfadcdc6b58ca1c0e
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: fix migration version check in esp_is_version_5()

Commit 4e78f3bf35 "esp: defer command completion interrupt on incoming data
transfers" added a version check for use with VMSTATE_*_TEST macros to allow
migration from older QEMU versions. Unfortunately the version check fails to
work in its current form since if the VMStateDescription version_id is
incremented, the test returns false and so the fields are not included in the
outgoing migration stream.

Change the version check to use >= rather == to ensure that migration works
correctly when the ESPState VMStateDescription has version_id > 5.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Fixes: 4e78f3bf35 ("esp: defer command completion interrupt on incoming data 
transfers")
Message-Id: <20210613102614.5438-1-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 4eb86065603400fe27c17a346985a97b489b55d4
      
https://github.com/qemu/qemu/commit/4eb86065603400fe27c17a346985a97b489b55d4
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M hw/scsi/esp.c
    M hw/scsi/trace-events
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: store lun coming from the MESSAGE OUT phase

The LUN is selected with an IDENTIFY message, and persists
until the next message out phase.  Instead of passing it to
do_busid_cmd, store it in ESPState.  Because do_cmd can simply
skip the message out phase if cmdfifo_cdb_offset is zero, it
can now be used for the S without ATN cases as well.

Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 7ce18ca0257dac6e3ac92c8bc3d610abbf14bcce
      
https://github.com/qemu/qemu/commit/7ce18ca0257dac6e3ac92c8bc3d610abbf14bcce
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M softmmu/physmem.c

  Log Message:
  -----------
  softmmu/physmem: Mark shared anonymous memory RAM_SHARED

Let's drop the "shared" parameter from ram_block_add() and properly
store it in the flags of the ram block instead, such that
qemu_ram_is_shared() properly succeeds on all ram blocks that were mapped
MAP_SHARED.

We'll use this information next to fix some cases with shared anonymous
memory.

Reviewed-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210406080126.24010-2-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: cdfa56c551bb48f286cfe1f2daa1083d333ee45d
      
https://github.com/qemu/qemu/commit/cdfa56c551bb48f286cfe1f2daa1083d333ee45d
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M include/qemu/osdep.h
    M softmmu/physmem.c

  Log Message:
  -----------
  softmmu/physmem: Fix ram_block_discard_range() to handle shared anonymous 
memory

We can create shared anonymous memory via
    "-object memory-backend-ram,share=on,..."
which is, for example, required by PVRDMA for mremap() to work.

Shared anonymous memory is weird, though. Instead of MADV_DONTNEED, we
have to use MADV_REMOVE: MADV_DONTNEED will only remove / zap all
relevant page table entries of the current process, the backend storage
will not get removed, resulting in no reduced memory consumption and
a repopulation of previous content on next access.

Shared anonymous memory is internally really just shmem, but without a
fd exposed. As we cannot use fallocate() without the fd to discard the
backing storage, MADV_REMOVE gets the same job done without a fd as
documented in "man 2 madvise". Removing backing storage implicitly
invalidates all page table entries with relevant mappings - an additional
MADV_DONTNEED is not required.

Fixes: 06329ccecfa0 ("mem: add share parameter to memory-backend-ram")
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210406080126.24010-3-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: dbb92eea3857ffeb770d006ad0306e408d33dd62
      
https://github.com/qemu/qemu/commit/dbb92eea3857ffeb770d006ad0306e408d33dd62
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M softmmu/physmem.c

  Log Message:
  -----------
  softmmu/physmem: Fix qemu_ram_remap() to handle shared anonymous memory

RAM_SHARED now also properly indicates shared anonymous memory. Let's check
that flag for anonymous memory as well, to restore the proper mapping.

Fixes: 06329ccecfa0 ("mem: add share parameter to memory-backend-ram")
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210406080126.24010-4-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: adad0b3ae8446acef0670efaa1e835ba37fca4bc
      
https://github.com/qemu/qemu/commit/adad0b3ae8446acef0670efaa1e835ba37fca4bc
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M util/mmap-alloc.c

  Log Message:
  -----------
  util/mmap-alloc: Factor out calculation of the pagesize for the guard page

Let's factor out calculating the size of the guard page and rename the
variable to make it clearer that this pagesize only applies to the
guard page.

Reviewed-by: Peter Xu <peterx@redhat.com>
Acked-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com> for memory backend and machine 
core
Cc: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210510114328.21835-2-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 01c26ad6affae8c00279f5cc8e1af4d6aac004ce
      
https://github.com/qemu/qemu/commit/01c26ad6affae8c00279f5cc8e1af4d6aac004ce
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M util/mmap-alloc.c

  Log Message:
  -----------
  util/mmap-alloc: Factor out reserving of a memory region to mmap_reserve()

We want to reserve a memory region without actually populating memory.
Let's factor that out.

Reviewed-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
Acked-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Xu <peterx@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com> for memory backend and machine 
core
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210510114328.21835-3-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: d01cbf82ce748955e622712356d8f56bc762ba9d
      
https://github.com/qemu/qemu/commit/d01cbf82ce748955e622712356d8f56bc762ba9d
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M util/mmap-alloc.c

  Log Message:
  -----------
  util/mmap-alloc: Factor out activating of memory to mmap_activate()

We want to activate memory within a reserved memory region, to make it
accessible. Let's factor that out.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com> for memory backend and machine 
core
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210510114328.21835-4-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: d5015b80134047013eeec10000df5ce2014ee114
      
https://github.com/qemu/qemu/commit/d5015b80134047013eeec10000df5ce2014ee114
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M backends/hostmem-memfd.c
    M hw/misc/ivshmem.c
    M include/exec/memory.h
    M include/exec/ram_addr.h
    M softmmu/memory.c

  Log Message:
  -----------
  softmmu/memory: Pass ram_flags to qemu_ram_alloc_from_fd()

Let's pass in ram flags just like we do with qemu_ram_alloc_from_file(),
to clean up and prepare for more flags.

Simplify the documentation of passed ram flags: Looking at our
documentation of RAM_SHARED and RAM_PMEM is sufficient, no need to be
repetitive.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com> for memory backend and machine 
core
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210510114328.21835-5-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 7f863cba4d8d35adacd513cba634dc0dd08d7904
      
https://github.com/qemu/qemu/commit/7f863cba4d8d35adacd513cba634dc0dd08d7904
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M backends/hostmem-ram.c
    M hw/m68k/next-cube.c
    M include/exec/memory.h
    M scripts/coccinelle/memory-region-housekeeping.cocci
    M softmmu/memory.c

  Log Message:
  -----------
  softmmu/memory: Pass ram_flags to memory_region_init_ram_shared_nomigrate()

Let's forward ram_flags instead, renaming
memory_region_init_ram_shared_nomigrate() into
memory_region_init_ram_flags_nomigrate().

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com> for memory backend and machine 
core
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210510114328.21835-6-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: ebef62d0e527d4a021f94a405fb38db263f3c4a5
      
https://github.com/qemu/qemu/commit/ebef62d0e527d4a021f94a405fb38db263f3c4a5
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M include/exec/ram_addr.h
    M softmmu/memory.c
    M softmmu/physmem.c

  Log Message:
  -----------
  softmmu/memory: Pass ram_flags to qemu_ram_alloc() and 
qemu_ram_alloc_internal()

Let's pass ram_flags to qemu_ram_alloc() and qemu_ram_alloc_internal(),
preparing for passing additional flags.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com> for memory backend and machine 
core
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210510114328.21835-7-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: b444f5c079fdb8019d2c59ffa6b67069e857f4e1
      
https://github.com/qemu/qemu/commit/b444f5c079fdb8019d2c59ffa6b67069e857f4e1
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M include/qemu/mmap-alloc.h
    M include/qemu/osdep.h
    M softmmu/physmem.c
    M util/mmap-alloc.c
    M util/oslib-posix.c

  Log Message:
  -----------
  util/mmap-alloc: Pass flags instead of separate bools to qemu_ram_mmap()

Let's pass flags instead of bools to prepare for passing other flags and
update the documentation of qemu_ram_mmap(). Introduce new QEMU_MAP_
flags that abstract the mmap() PROT_ and MAP_ flag handling and simplify
it.

We expose only flags that are currently supported by qemu_ram_mmap().
Maybe, we'll see qemu_mmap() in the future as well that can implement these
flags.

Note: We don't use MAP_ flags as some flags (e.g., MAP_SYNC) are only
defined for some systems and we want to always be able to identify
these flags reliably inside qemu_ram_mmap() -- for example, to properly
warn when some future flags are not available or effective on a system.
Also, this way we can simplify PROT_ handling as well.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com> for memory backend and machine 
core
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210510114328.21835-8-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 8dbe22c6868b8a5efd1df3d0c5150524fabe61ff
      
https://github.com/qemu/qemu/commit/8dbe22c6868b8a5efd1df3d0c5150524fabe61ff
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M include/exec/cpu-common.h
    M include/exec/memory.h
    M include/exec/ram_addr.h
    M include/qemu/osdep.h
    M migration/ram.c
    M softmmu/physmem.c
    M util/mmap-alloc.c
    M util/oslib-posix.c
    M util/oslib-win32.c

  Log Message:
  -----------
  memory: Introduce RAM_NORESERVE and wire it up in qemu_ram_mmap()

Let's introduce RAM_NORESERVE, allowing mmap'ing with MAP_NORESERVE. The
new flag has the following semantics:

"
RAM is mmap-ed with MAP_NORESERVE. When set, reserving swap space (or huge
pages if applicable) is skipped: will bail out if not supported. When not
set, the OS will do the reservation, if supported for the memory type.
"

Allow passing it into:
- memory_region_init_ram_nomigrate()
- memory_region_init_resizeable_ram()
- memory_region_init_ram_from_file()

... and teach qemu_ram_mmap() and qemu_anon_ram_alloc() about the flag.
Bail out if the flag is not supported, which is the case right now for
both, POSIX and win32. We will add Linux support next and allow specifying
RAM_NORESERVE via memory backends.

The target use case is virtio-mem, which dynamically exposes memory
inside a large, sparse memory area to the VM.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com> for memory backend and machine 
core
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210510114328.21835-9-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: d94e0bc9ef7848f69550a80e7be6d4de68856e46
      
https://github.com/qemu/qemu/commit/d94e0bc9ef7848f69550a80e7be6d4de68856e46
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M include/qemu/osdep.h
    M softmmu/physmem.c
    M util/mmap-alloc.c

  Log Message:
  -----------
  util/mmap-alloc: Support RAM_NORESERVE via MAP_NORESERVE under Linux

Let's support RAM_NORESERVE via MAP_NORESERVE on Linux. The flag has no
effect on most shared mappings - except for hugetlbfs and anonymous memory.

Linux man page:
  "MAP_NORESERVE: Do not reserve swap space for this mapping. When swap
  space is reserved, one has the guarantee that it is possible to modify
  the mapping. When swap space is not reserved one might get SIGSEGV
  upon a write if no physical memory is available. See also the discussion
  of the file /proc/sys/vm/overcommit_memory in proc(5). In kernels before
  2.6, this flag had effect only for private writable mappings."

Note that the "guarantee" part is wrong with memory overcommit in Linux.

Also, in Linux hugetlbfs is treated differently - we configure reservation
of huge pages from the pool, not reservation of swap space (huge pages
cannot be swapped).

The rough behavior is [1]:
a) !Hugetlbfs:

  1) Without MAP_NORESERVE *or* with memory overcommit under Linux
     disabled ("/proc/sys/vm/overcommit_memory == 2"), the following
     accounting/reservation happens:
      For a file backed map
       SHARED or READ-only - 0 cost (the file is the map not swap)
       PRIVATE WRITABLE - size of mapping per instance

      For an anonymous or /dev/zero map
       SHARED   - size of mapping
       PRIVATE READ-only - 0 cost (but of little use)
       PRIVATE WRITABLE - size of mapping per instance

  2) With MAP_NORESERVE, no accounting/reservation happens.

b) Hugetlbfs:

  1) Without MAP_NORESERVE, huge pages are reserved.

  2) With MAP_NORESERVE, no huge pages are reserved.

Note: With "/proc/sys/vm/overcommit_memory == 0", we were already able
to configure it for !hugetlbfs globally; this toggle now allows
configuring it more fine-grained, not for the whole system.

The target use case is virtio-mem, which dynamically exposes memory
inside a large, sparse memory area to the VM.

[1] https://www.kernel.org/doc/Documentation/vm/overcommit-accounting

Reviewed-by: Peter Xu <peterx@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com> for memory backend and machine 
core
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210510114328.21835-10-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 9181fb7043edcf096e0ae426cc3fb6f669c7fcb5
      
https://github.com/qemu/qemu/commit/9181fb7043edcf096e0ae426cc3fb6f669c7fcb5
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M backends/hostmem-file.c
    M backends/hostmem-memfd.c
    M backends/hostmem-ram.c
    M backends/hostmem.c
    M include/sysemu/hostmem.h
    M qapi/qom.json

  Log Message:
  -----------
  hostmem: Wire up RAM_NORESERVE via "reserve" property

Let's provide a way to control the use of RAM_NORESERVE via memory
backends using the "reserve" property which defaults to true (old
behavior).

Only Linux currently supports clearing the flag (and support is checked at
runtime, depending on the setting of "/proc/sys/vm/overcommit_memory").
Windows and other POSIX systems will bail out with "reserve=false".

The target use case is virtio-mem, which dynamically exposes memory
inside a large, sparse memory area to the VM. This essentially allows
avoiding to set "/proc/sys/vm/overcommit_memory == 0") when using
virtio-mem and also supporting hugetlbfs in the future.

As really only Linux implements RAM_NORESERVE right now, let's expose
the property only with CONFIG_LINUX. Setting the property to "false"
will then only fail in corner cases -- for example on very old kernels
or when memory overcommit was completely disabled by the admin.

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com> for memory backend and machine 
core
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210510114328.21835-11-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 157cfaf9b21c90a7c874ce80c4c1c9b1187ad244
      
https://github.com/qemu/qemu/commit/157cfaf9b21c90a7c874ce80c4c1c9b1187ad244
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M qapi/machine.json

  Log Message:
  -----------
  qmp: Clarify memory backend properties returned via query-memdev

We return information on the currently configured memory backends and
don't configure them, so decribe what the currently set properties
express.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Suggested-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com> for memory backend and machine 
core
Cc: Eric Blake <eblake@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210510114328.21835-12-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: d300fc54a48dcdbdd7c06873c3b9941f05c7c6ae
      
https://github.com/qemu/qemu/commit/d300fc54a48dcdbdd7c06873c3b9941f05c7c6ae
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M hw/core/machine-qmp-cmds.c
    M qapi/machine.json

  Log Message:
  -----------
  qmp: Include "share" property of memory backends

Let's include the property, which can be helpful when debugging,
for example, to spot misuse of MAP_PRIVATE which can result in some ugly
corner cases (e.g., double-memory consumption on shmem).

Use the same description we also use for describing the property.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com> for memory backend and machine 
core
Cc: Eric Blake <eblake@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210510114328.21835-13-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 7428e7ba15cbc2a1a801ea2697f5f47fe1153381
      
https://github.com/qemu/qemu/commit/7428e7ba15cbc2a1a801ea2697f5f47fe1153381
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M hw/core/machine-hmp-cmds.c

  Log Message:
  -----------
  hmp: Print "share" property of memory backends with "info memdev"

Let's print the property.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com> for memory backend and machine 
core
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210510114328.21835-14-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 69647f9d51795ebea09eef05b5b2d14ffb835baf
      
https://github.com/qemu/qemu/commit/69647f9d51795ebea09eef05b5b2d14ffb835baf
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M hw/core/machine-qmp-cmds.c
    M qapi/machine.json

  Log Message:
  -----------
  qmp: Include "reserve" property of memory backends

Let's include the new property. Instead of relying on CONFIG_LINUX,
let's try to unconditionally grab the property and treat errors as
"does not exist".

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com> for memory backend and machine 
core
Cc: Eric Blake <eblake@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210510114328.21835-15-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: baa014e3b92a12a6037c7525ee1a169ab7ec0302
      
https://github.com/qemu/qemu/commit/baa014e3b92a12a6037c7525ee1a169ab7ec0302
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M hw/core/machine-hmp-cmds.c

  Log Message:
  -----------
  hmp: Print "reserve" property of memory backends with "info memdev"

Let's print the new property.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com> for memory backend and machine 
core
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210510114328.21835-16-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: f8bb7e1c25b3d9c55975ca0f428f03d1049f2b06
      
https://github.com/qemu/qemu/commit/f8bb7e1c25b3d9c55975ca0f428f03d1049f2b06
  Author: David Michael <fedora.dm0@gmail.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M configure

  Log Message:
  -----------
  configure: map x32 to cpu_family x86_64 for meson

The meson.build file defines supported_cpus which does not contain
x32, and x32 is not one of meson's stable built-in values:
https://mesonbuild.com/Reference-tables.html#cpu-families

Signed-off-by: David Michael <fedora.dm0@gmail.com>
Message-Id: <878s3jrzm0.fsf@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 813c6459ee774ee48496653cd530658b733b79cd
      
https://github.com/qemu/qemu/commit/813c6459ee774ee48496653cd530658b733b79cd
  Author: Lara Lazier <laramglazier@gmail.com>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M target/i386/cpu.h
    M target/i386/tcg/sysemu/svm_helper.c

  Log Message:
  -----------
  target/i386: Refactored intercept checks into cpu_svm_has_intercept

Added cpu_svm_has_intercept to reduce duplication when checking the
corresponding intercept bit outside of cpu_svm_check_intercept_param

Signed-off-by: Lara Lazier <laramglazier@gmail.com>
Message-Id: <20210616123907.17765-2-laramglazier@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 7eb54ca95d369135f2570c10daf1a41a1f8a6b9c
      
https://github.com/qemu/qemu/commit/7eb54ca95d369135f2570c10daf1a41a1f8a6b9c
  Author: Lara Lazier <laramglazier@gmail.com>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M target/i386/tcg/sysemu/svm_helper.c

  Log Message:
  -----------
  target/i386: Added consistency checks for VMRUN intercept and ASID

Zero VMRUN intercept and ASID should cause an immediate VMEXIT
during the consistency checks performed by VMRUN.
(AMD64 Architecture Programmer's Manual, V2, 15.5)

Signed-off-by: Lara Lazier <laramglazier@gmail.com>
Message-Id: <20210616123907.17765-3-laramglazier@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 498df2a7470e09d6cb0204f45eeb30d7ae796465
      
https://github.com/qemu/qemu/commit/498df2a7470e09d6cb0204f45eeb30d7ae796465
  Author: Lara Lazier <laramglazier@gmail.com>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M target/i386/cpu.h
    M target/i386/svm.h
    M target/i386/tcg/sysemu/svm_helper.c

  Log Message:
  -----------
  target/i386: Added consistency checks for CR0

The combination of unset CD and set NW bit in CR0 is illegal.
CR0[63:32] are also reserved and need to be zero.
(AMD64 Architecture Programmer's Manual, V2, 15.5)

Signed-off-by: Lara Lazier <laramglazier@gmail.com>
Message-Id: <20210616123907.17765-4-laramglazier@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: e0375ec760d3c49163eb16f272349dc16f13e59c
      
https://github.com/qemu/qemu/commit/e0375ec760d3c49163eb16f272349dc16f13e59c
  Author: Lara Lazier <laramglazier@gmail.com>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M target/i386/tcg/sysemu/misc_helper.c

  Log Message:
  -----------
  target/i386: Added Intercept CR0 writes check

When the selective CR0 write intercept is set, all writes to bits in
CR0 other than CR0.TS or CR0.MP cause a VMEXIT.

Signed-off-by: Lara Lazier <laramglazier@gmail.com>
Message-Id: <20210616123907.17765-5-laramglazier@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 8a9d3d564093dbd5a7339085406e840893944d21
      
https://github.com/qemu/qemu/commit/8a9d3d564093dbd5a7339085406e840893944d21
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M configure
    M meson.build

  Log Message:
  -----------
  configure: Use -std=gnu11

Now that the minimum gcc version is 7.5, we can use C11.
This will allow lots of cleanups to the code, currently
hidden behind macros in include/qemu/compiler.h.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20210614233143.1221879-2-richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 52a80715799122c0a31e68c66a10ca901f6454ab
      
https://github.com/qemu/qemu/commit/52a80715799122c0a31e68c66a10ca901f6454ab
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M fpu/softfloat.c

  Log Message:
  -----------
  softfloat: Use _Generic instead of QEMU_GENERIC

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20210614233143.1221879-3-richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 5d63bd5aad0d80f9c3901c0948354ee3fb7da9bc
      
https://github.com/qemu/qemu/commit/5d63bd5aad0d80f9c3901c0948354ee3fb7da9bc
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M include/qemu/thread-posix.h
    M include/qemu/thread-win32.h
    M include/qemu/thread.h
    M util/qemu-thread-posix.c

  Log Message:
  -----------
  util: Use real functions for thread-posix QemuRecMutex

Move the declarations from thread-win32.h into thread.h
and remove the macro redirection from thread-posix.h.
This will be required by following cleanups.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20210614233143.1221879-4-richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: d3192460bffdf31e830a9ef1261b587259e7ebd7
      
https://github.com/qemu/qemu/commit/d3192460bffdf31e830a9ef1261b587259e7ebd7
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M include/qemu/thread.h
    M util/qemu-thread-posix.c
    M util/qemu-thread-win32.c

  Log Message:
  -----------
  util: Pass file+line to qemu_rec_mutex_unlock_impl

Create macros for file+line expansion in qemu_rec_mutex_unlock
like we have for qemu_mutex_unlock.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210614233143.1221879-5-richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: dc41737844dbec4736855e128dce0da20c082f65
      
https://github.com/qemu/qemu/commit/dc41737844dbec4736855e128dce0da20c082f65
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M include/qemu/thread-posix.h
    M util/qemu-thread-posix.c

  Log Message:
  -----------
  util: Use unique type for QemuRecMutex in thread-posix.h

We will shortly convert lockable.h to _Generic, and we cannot
have two compatible types in the same expansion.  Wrap QemuMutex
in a struct, and unwrap in qemu-thread-posix.c.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20210614233143.1221879-6-richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 23c9b7e0f3ddc727fc664b616a3d73a24adef9d0
      
https://github.com/qemu/qemu/commit/23c9b7e0f3ddc727fc664b616a3d73a24adef9d0
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M include/qemu/lockable.h

  Log Message:
  -----------
  include/qemu/lockable: Use _Generic instead of QEMU_GENERIC

This is both more and less complicated than our expansion
using __builtin_choose_expr and __builtin_types_compatible_p.

The expansion through QEMU_MAKE_LOCKABLE_ doesn't work because
we're not emumerating all of the types within the same _Generic,
which results in errors about unhandled cases.  We must also
handle void* explicitly, so that the NULL constant can be used.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210614233143.1221879-7-richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: de51d8cbf0f9a9745ac02fb07e02063b7dfe35b9
      
https://github.com/qemu/qemu/commit/de51d8cbf0f9a9745ac02fb07e02063b7dfe35b9
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M include/qemu/compiler.h

  Log Message:
  -----------
  qemu/compiler: Remove QEMU_GENERIC

All previous users now use C11 _Generic.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210614233143.1221879-8-richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: f51f8e3591393f7f274e1435ac22188e2dafdfe8
      
https://github.com/qemu/qemu/commit/f51f8e3591393f7f274e1435ac22188e2dafdfe8
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M configure
    M include/qemu/compiler.h

  Log Message:
  -----------
  configure: Remove probe for _Static_assert

_Static_assert is part of C11, which is now required.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20210614233143.1221879-9-richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: b6d73e9cb1c620960ca7d864ee0725f8a55fe778
      
https://github.com/qemu/qemu/commit/b6d73e9cb1c620960ca7d864ee0725f8a55fe778
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-06-17 (Thu, 17 Jun 2021)

  Changed paths:
    M backends/hostmem-file.c
    M backends/hostmem-memfd.c
    M backends/hostmem-ram.c
    M backends/hostmem.c
    M configure
    M hw/core/machine-hmp-cmds.c
    M hw/core/machine-qmp-cmds.c
    M hw/m68k/next-cube.c
    M hw/misc/ivshmem.c
    M hw/scsi/esp.c
    M hw/scsi/scsi-generic.c
    M hw/scsi/trace-events
    M include/exec/cpu-common.h
    M include/exec/memory.h
    M include/exec/ram_addr.h
    M include/hw/scsi/esp.h
    M include/qemu/mmap-alloc.h
    M include/qemu/osdep.h
    M include/sysemu/hostmem.h
    M migration/ram.c
    M qapi/machine.json
    M qapi/qom.json
    M scripts/coccinelle/memory-region-housekeeping.cocci
    M softmmu/memory.c
    M softmmu/physmem.c
    M softmmu/runstate.c
    M softmmu/vl.c
    M target/i386/cpu.h
    M target/i386/svm.h
    M target/i386/tcg/sysemu/misc_helper.c
    M target/i386/tcg/sysemu/svm_helper.c
    M ui/vnc-auth-sasl.c
    M ui/vnc-auth-sasl.h
    M ui/vnc.c
    M util/mmap-alloc.c
    M util/oslib-posix.c
    M util/oslib-win32.c
    M util/qemu-config.c

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

* avoid deprecation warnings for SASL on macOS 10.11 or newer
* fix -readconfig when config blocks have an id (like [chardev "qmp"])
* Error* initialization fixes
* Improvements to ESP emulation (Mark)
* Allow creating noreserve memory backends (David)
* Improvements to query-memdev (David)
* Bump compiler to C11 (Richard)
* First round of SVM fixes from GSoC project (Lara)

# gpg: Signature made Wed 16 Jun 2021 16:37:49 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-gitlab/tags/for-upstream: (45 commits)
  configure: Remove probe for _Static_assert
  qemu/compiler: Remove QEMU_GENERIC
  include/qemu/lockable: Use _Generic instead of QEMU_GENERIC
  util: Use unique type for QemuRecMutex in thread-posix.h
  util: Pass file+line to qemu_rec_mutex_unlock_impl
  util: Use real functions for thread-posix QemuRecMutex
  softfloat: Use _Generic instead of QEMU_GENERIC
  configure: Use -std=gnu11
  target/i386: Added Intercept CR0 writes check
  target/i386: Added consistency checks for CR0
  target/i386: Added consistency checks for VMRUN intercept and ASID
  target/i386: Refactored intercept checks into cpu_svm_has_intercept
  configure: map x32 to cpu_family x86_64 for meson
  hmp: Print "reserve" property of memory backends with "info memdev"
  qmp: Include "reserve" property of memory backends
  hmp: Print "share" property of memory backends with "info memdev"
  qmp: Include "share" property of memory backends
  qmp: Clarify memory backend properties returned via query-memdev
  hostmem: Wire up RAM_NORESERVE via "reserve" property
  util/mmap-alloc: Support RAM_NORESERVE via MAP_NORESERVE under Linux
  ...

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


Compare: https://github.com/qemu/qemu/compare/18e53dff9398...b6d73e9cb1c6



reply via email to

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