qemu-commits
[Top][All Lists]
Advanced

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

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


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] eb0bda: vnc: avoid deprecation warnings for SASL on OS X
Date: Tue, 15 Jun 2021 07:07:31 -0700

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: eb0bdaa114f44eb93827355a29f3a208b643a5c4
      
https://github.com/qemu/qemu/commit/eb0bdaa114f44eb93827355a29f3a208b643a5c4
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: c3a441dbe2a9335c94f1387a551700a24072eaa0
      
https://github.com/qemu/qemu/commit/c3a441dbe2a9335c94f1387a551700a24072eaa0
  Author: Zhenzhong Duan <zhenzhong.duan@intel.com>
  Date:   2021-06-14 (Mon, 14 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: f2adbc62b3491ba7fa7bbecc195061dbd8d27df5
      
https://github.com/qemu/qemu/commit/f2adbc62b3491ba7fa7bbecc195061dbd8d27df5
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: 443e47ae74eb6d65969611d71d4041d9e1ddfdac
      
https://github.com/qemu/qemu/commit/443e47ae74eb6d65969611d71d4041d9e1ddfdac
  Author: Maxim Levitsky <mlevitsk@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: 7bc5333d5f8b013a6c1b7401aa1ef1fd44db81b5
      
https://github.com/qemu/qemu/commit/7bc5333d5f8b013a6c1b7401aa1ef1fd44db81b5
  Author: Peng Liang <liangpeng10@huawei.com>
  Date:   2021-06-14 (Mon, 14 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: 6df4f0c3998b7d78f2cb0f921bb3df0b9943b647
      
https://github.com/qemu/qemu/commit/6df4f0c3998b7d78f2cb0f921bb3df0b9943b647
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-06-14 (Mon, 14 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: a00ddaaefd8ddfae2af92d3a8bdbcfcb8629cf28
      
https://github.com/qemu/qemu/commit/a00ddaaefd8ddfae2af92d3a8bdbcfcb8629cf28
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-06-14 (Mon, 14 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: e6e7abd6763262754acc1808537b18fd7723df7d
      
https://github.com/qemu/qemu/commit/e6e7abd6763262754acc1808537b18fd7723df7d
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-06-14 (Mon, 14 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: 4c8fa61e63dae36e5211b94c4e34d09c5879f6b5
      
https://github.com/qemu/qemu/commit/4c8fa61e63dae36e5211b94c4e34d09c5879f6b5
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-06-14 (Mon, 14 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: c5cd48b518bac7d8568764f6fd86249dd5b7d72e
      
https://github.com/qemu/qemu/commit/c5cd48b518bac7d8568764f6fd86249dd5b7d72e
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-06-14 (Mon, 14 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: 3fc0e166c154b4dccefdfa782ff9b697b8670e6c
      
https://github.com/qemu/qemu/commit/3fc0e166c154b4dccefdfa782ff9b697b8670e6c
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-06-14 (Mon, 14 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: 5668ab9d81b6932a1eada6050b8a634fb0cec13a
      
https://github.com/qemu/qemu/commit/5668ab9d81b6932a1eada6050b8a634fb0cec13a
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-06-14 (Mon, 14 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: 6b3e1a3a3964b97a2f76111b45205631567dff39
      
https://github.com/qemu/qemu/commit/6b3e1a3a3964b97a2f76111b45205631567dff39
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-06-14 (Mon, 14 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: 1a0515b8e1a42b9c45894457ac52c22e0c843b2d
      
https://github.com/qemu/qemu/commit/1a0515b8e1a42b9c45894457ac52c22e0c843b2d
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: 908ccbc43c75f2a6762c18e4ed13fdbdc28cf7ce
      
https://github.com/qemu/qemu/commit/908ccbc43c75f2a6762c18e4ed13fdbdc28cf7ce
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: 6772c79acbac5c6108ab6c0e8ddd025e60a79d92
      
https://github.com/qemu/qemu/commit/6772c79acbac5c6108ab6c0e8ddd025e60a79d92
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 Jun 2021)

  Changed paths:
    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: 8a5b9ce48d28ec2e1ed02401c031c2bd1c51d37e
      
https://github.com/qemu/qemu/commit/8a5b9ce48d28ec2e1ed02401c031c2bd1c51d37e
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: 282e9ee64d8dbf5374222ebfea6e796da207c34d
      
https://github.com/qemu/qemu/commit/282e9ee64d8dbf5374222ebfea6e796da207c34d
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: a24217c9a34cdb9e893e6c5eae1060e9ad0bf8d5
      
https://github.com/qemu/qemu/commit/a24217c9a34cdb9e893e6c5eae1060e9ad0bf8d5
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: b379ab5396517d04a0ab9a72b076815c7c7854da
      
https://github.com/qemu/qemu/commit/b379ab5396517d04a0ab9a72b076815c7c7854da
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: 9499c9cf77c06d035f006ec35052f9699188409f
      
https://github.com/qemu/qemu/commit/9499c9cf77c06d035f006ec35052f9699188409f
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: becbf63b403d92306cb03ebdc80610fb02685e3c
      
https://github.com/qemu/qemu/commit/becbf63b403d92306cb03ebdc80610fb02685e3c
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: bf1cedbe25f19cb0e38011c46d23cdf0e304f943
      
https://github.com/qemu/qemu/commit/bf1cedbe25f19cb0e38011c46d23cdf0e304f943
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: 89f221ed892b5e76374646ee5461842adbbd726d
      
https://github.com/qemu/qemu/commit/89f221ed892b5e76374646ee5461842adbbd726d
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: 582dee9863d9e32ad235fa50f0398500abe885c2
      
https://github.com/qemu/qemu/commit/582dee9863d9e32ad235fa50f0398500abe885c2
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: 3834f70492221d032aa6978b017bdaf09cf0dd45
      
https://github.com/qemu/qemu/commit/3834f70492221d032aa6978b017bdaf09cf0dd45
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: 379b7215c55579d11c3deb9dd506cd378aa5fc82
      
https://github.com/qemu/qemu/commit/379b7215c55579d11c3deb9dd506cd378aa5fc82
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: 6ac881867c3b5810da38fe54c0a77af7ed0149a1
      
https://github.com/qemu/qemu/commit/6ac881867c3b5810da38fe54c0a77af7ed0149a1
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: 1d203dfdb7176dee6bdb5943071e06ff394329a4
      
https://github.com/qemu/qemu/commit/1d203dfdb7176dee6bdb5943071e06ff394329a4
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: e2f34fd336b02f002171e67539727326bab4e674
      
https://github.com/qemu/qemu/commit/e2f34fd336b02f002171e67539727326bab4e674
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: dc25253242eef50f8f6c8c1e9128a5e67fb84bf4
      
https://github.com/qemu/qemu/commit/dc25253242eef50f8f6c8c1e9128a5e67fb84bf4
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: 4c13c4af15dc0f81bce638d141bb932383512715
      
https://github.com/qemu/qemu/commit/4c13c4af15dc0f81bce638d141bb932383512715
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-06-14 (Mon, 14 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: 429f60abe15cca9046e6aeaffd81e991e34c9bf6
      
https://github.com/qemu/qemu/commit/429f60abe15cca9046e6aeaffd81e991e34c9bf6
  Author: David Michael <fedora.dm0@gmail.com>
  Date:   2021-06-14 (Mon, 14 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: 210d7407716e2603a2e646603e4be3e7cba3b01b
      
https://github.com/qemu/qemu/commit/210d7407716e2603a2e646603e4be3e7cba3b01b
  Author: Peter Maydell <peter.maydell@linaro.org>
  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 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 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)

# gpg: Signature made Mon 14 Jun 2021 19:18:05 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: (33 commits)
  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
  memory: Introduce RAM_NORESERVE and wire it up in qemu_ram_mmap()
  util/mmap-alloc: Pass flags instead of separate bools to qemu_ram_mmap()
  softmmu/memory: Pass ram_flags to qemu_ram_alloc() and 
qemu_ram_alloc_internal()
  softmmu/memory: Pass ram_flags to memory_region_init_ram_shared_nomigrate()
  softmmu/memory: Pass ram_flags to qemu_ram_alloc_from_fd()
  util/mmap-alloc: Factor out activating of memory to mmap_activate()
  util/mmap-alloc: Factor out reserving of a memory region to mmap_reserve()
  util/mmap-alloc: Factor out calculation of the pagesize for the guard page
  softmmu/physmem: Fix qemu_ram_remap() to handle shared anonymous memory
  softmmu/physmem: Fix ram_block_discard_range() to handle shared anonymous 
memory
  softmmu/physmem: Mark shared anonymous memory RAM_SHARED
  esp: store lun coming from the MESSAGE OUT phase
  ...

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


Compare: https://github.com/qemu/qemu/compare/1ea06abceec6...210d7407716e



reply via email to

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