Re: [PATCH 5/6] pcie: fast unplug when slot power is off

2021-10-11 Thread Michael S. Tsirkin
On Mon, Oct 11, 2021 at 02:05:03PM +0200, Gerd Hoffmann wrote: > In case the slot is powered off (and the power indicator turned off too) > we can unplug right away, without round-trip to the guest. > > Also clear pending attention button press, there is nothing to care > about any more. > >

Re: [PATCH v4 3/3] multifd: Implement zerocopy write in multifd migration (multifd-zerocopy)

2021-10-11 Thread Markus Armbruster
Leonardo Bras Soares Passos writes: > Hello Eric, > > On Mon, Oct 11, 2021 at 4:32 PM Eric Blake wrote: >> >> On Sat, Oct 09, 2021 at 04:56:13AM -0300, Leonardo Bras wrote: >> > Implement zerocopy on nocomp_send_write(), by making use of QIOChannel >> > zerocopy interface. >> > >> > Change

Re: [PATCH 6/6] pcie: expire pending delete

2021-10-11 Thread Michael S. Tsirkin
On Tue, Oct 12, 2021 at 07:30:34AM +0200, Gerd Hoffmann wrote: > > > index f3ac04399969..477c8776aa27 100644 > > > --- a/hw/pci/pcie.c > > > +++ b/hw/pci/pcie.c > > > @@ -549,6 +549,8 @@ void pcie_cap_slot_unplug_request_cb(HotplugHandler > > > *hotplug_dev, > > > } > > > > > >

Re: MMIO/PIO dispatch file descriptors (ioregionfd) design discussion

2021-10-11 Thread elena
On Wed, Nov 25, 2020 at 12:44:07PM -0800, Elena Afanasova wrote: > Hello, > Hi Sorry for top-posting, just wanted to provide a quik update. We are currently working on the support for ioregionfd in Qemu and will be posting the patches soon. Plus the KVM patches will be posted based of the RFC v3

Re: [PATCH 6/6] pcie: expire pending delete

2021-10-11 Thread Gerd Hoffmann
> > index f3ac04399969..477c8776aa27 100644 > > --- a/hw/pci/pcie.c > > +++ b/hw/pci/pcie.c > > @@ -549,6 +549,8 @@ void pcie_cap_slot_unplug_request_cb(HotplugHandler > > *hotplug_dev, > > } > > > > dev->pending_deleted_event = true; > > +dev->pending_deleted_expires_ms = > > +

Re: [RFC PATCH v4 15/20] vhost: Shadow virtqueue buffers forwarding

2021-10-11 Thread Markus Armbruster
Eugenio Pérez writes: > Initial version of shadow virtqueue that actually forward buffers. There > are no iommu support at the moment, and that will be addressed in future > patches of this series. Since all vhost-vdpa devices uses forced IOMMU, > this means that SVQ is not usable at this point

Re: [RFC PATCH v4 08/20] vhost: Route guest->host notification through shadow virtqueue

2021-10-11 Thread Markus Armbruster
Eugenio Pérez writes: > Shadow virtqueue notifications forwarding is disabled when vhost_dev > stops, so code flow follows usual cleanup. > > Also, host notifiers must be disabled at SVQ start, and they will not > start if SVQ has been enabled when device is stopped. This is trivial > to

Re: [RFC PATCH v4 05/20] vhost: Add x-vhost-enable-shadow-vq qmp

2021-10-11 Thread Markus Armbruster
Eugenio Pérez writes: > Command to enable shadow virtqueue. > > Signed-off-by: Eugenio Pérez > --- > qapi/net.json | 23 +++ > hw/virtio/vhost-vdpa.c | 8 > 2 files changed, 31 insertions(+) > > diff --git a/qapi/net.json b/qapi/net.json > index

Re: [PATCH] Trim some trailing space from human-readable output

2021-10-11 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 10/9/21 17:24, Markus Armbruster wrote: >> I noticed -cpu help printing enough trailing spaces to make the output >> at least 84 characters wide. Looks ugly unless the terminal is wider. >> Ugly or not, trailing spaces are stupid. >> >> The culprit is this

[PATCH] tests/tcg/xtensa: allow testing big-endian cores

2021-10-11 Thread Max Filippov
Don't disable all big-endian tests, instead check whether $(CORE) is supported by the configured $(QEMU) and enable tests if it is. Signed-off-by: Max Filippov --- MAINTAINERS| 1 + tests/tcg/xtensa/Makefile.softmmu-target | 4 ++--

Re: [RFC PATCH v4 00/20] vDPA shadow virtqueue

2021-10-11 Thread Jason Wang
On Tue, Oct 12, 2021 at 11:59 AM Jason Wang wrote: > > > 在 2021/10/1 下午3:05, Eugenio Pérez 写道: > > This series enable shadow virtqueue (SVQ) for vhost-vdpa devices. This > > is intended as a new method of tracking the memory the devices touch > > during a migration process: Instead of relay on

Re: [RFC PATCH v4 00/20] vDPA shadow virtqueue

2021-10-11 Thread Jason Wang
在 2021/10/1 下午3:05, Eugenio Pérez 写道: This series enable shadow virtqueue (SVQ) for vhost-vdpa devices. This is intended as a new method of tracking the memory the devices touch during a migration process: Instead of relay on vhost device's dirty logging capability, SVQ intercepts the VQ

Re: [PATCH v2 3/3] vdpa: Check for iova range at mappings changes

2021-10-11 Thread Jason Wang
On Tue, Oct 5, 2021 at 9:49 PM Eugenio Pérez wrote: > > Check vdpa device range before updating memory regions so we don't add > any outside of it, and report the invalid change if any. > > Signed-off-by: Eugenio Pérez > --- > include/hw/virtio/vhost-vdpa.h | 2 + > hw/virtio/vhost-vdpa.c

Re: [PATCH v2 2/3] vdpa: Add vhost_vdpa_section_end

2021-10-11 Thread Jason Wang
On Tue, Oct 5, 2021 at 9:49 PM Eugenio Pérez wrote: > > Abstract this operation, that will be reused when validating the region > against the iova range that the device supports. > > Signed-off-by: Eugenio Pérez Acked-by: Jason Wang > --- > hw/virtio/vhost-vdpa.c | 22 +++---

Re: [PATCH v2 1/3] vdpa: Skip protected ram IOMMU mappings

2021-10-11 Thread Jason Wang
On Tue, Oct 5, 2021 at 9:49 PM Eugenio Pérez wrote: > > Following the logic of commit 56918a126ae ("memory: Add RAM_PROTECTED > flag to skip IOMMU mappings") with VFIO, skip memory sections > inaccessible via normal mechanisms, including DMA. > > Signed-off-by: Eugenio Pérez Acked-by: Jason

[PATCH v2] hw/riscv: virt: bugfix the memory-backend-file command is invalid

2021-10-11 Thread MingWang Li
From: Mingwang Li When I start the VM with the following command: $ ./qemu-system-riscv64 -M virt,accel=kvm -m 4096M -cpu host -nographic \ -name guest=riscv-guset \ -smp 2 \ -bios none \ -kernel ./Image \ -drive file=./guest.img,format=raw,id=hd0 \ -device

Re: [PATCH 02/13] target/riscv: Create RISCVMXL enumeration

2021-10-11 Thread Alistair Francis
On Fri, Oct 8, 2021 at 3:47 AM Richard Henderson wrote: > > Move the MXL_RV* defines to enumerators. > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > target/riscv/cpu_bits.h | 8 +--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git

Re: [PATCH] hw/riscv: virt: bugfix the memory-backend-file command is invalid

2021-10-11 Thread Alistair Francis
On Thu, Sep 30, 2021 at 12:03 AM MingWang Li wrote: > > From: Mingwang Li > > If default main_mem is used to be registered as the system memory, > other memory cannot be initialized. Therefore, the system memory > should be initialized to the machine->ram, which consists of the > default

Re: [PATCH] target/riscv: line up all of the registers in the info register dump

2021-10-11 Thread Alistair Francis
On Sat, Oct 9, 2021 at 3:51 PM Travis Geiselbrecht wrote: > > Ensure the columns for all of the register names and values line up. > No functional change, just a minor tweak to the output. > > Signed-off-by: Travis Geiselbrecht Reviewed-by: Alistair Francis Alistair > --- >

Re: [PATCH 2/8] accel/tcg: Split out g2h_tlbe

2021-10-11 Thread Alistair Francis
On Mon, Oct 11, 2021 at 3:44 AM Richard Henderson wrote: > > Create a new function to combine a CPUTLBEntry addend > with the guest address to form a host address. > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > accel/tcg/cputlb.c | 24

Re: [PATCH 1/8] tcg: Add TCG_TARGET_SIGNED_ADDR32

2021-10-11 Thread Alistair Francis
On Mon, Oct 11, 2021 at 3:49 AM Richard Henderson wrote: > > Define as 0 for all tcg hosts. Put this in a separate header, > because we'll want this in places that do not ordinarily have > access to all of tcg/tcg.h. > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair

Re: [PATCH] Trim some trailing space from human-readable output

2021-10-11 Thread Max Filippov
On Sat, Oct 9, 2021 at 8:24 AM Markus Armbruster wrote: > > I noticed -cpu help printing enough trailing spaces to make the output > at least 84 characters wide. Looks ugly unless the terminal is wider. > Ugly or not, trailing spaces are stupid. > > The culprit is this line in

Re: [PATCH] Trim some trailing space from human-readable output

2021-10-11 Thread Philippe Mathieu-Daudé
On 10/9/21 17:24, Markus Armbruster wrote: > I noticed -cpu help printing enough trailing spaces to make the output > at least 84 characters wide. Looks ugly unless the terminal is wider. > Ugly or not, trailing spaces are stupid. > > The culprit is this line in x86_cpu_list_entry(): > >

Re: [PATCH v3 12/12] vfio-user: acceptance test

2021-10-11 Thread Philippe Mathieu-Daudé
On 10/11/21 07:31, Jagannathan Raman wrote: > Acceptance test for libvfio-user in QEMU > > Signed-off-by: Elena Ufimtseva > Signed-off-by: John G Johnson > Signed-off-by: Jagannathan Raman > --- > MAINTAINERS | 1 + > tests/acceptance/vfio-user.py | 96

Re: [PATCH 0/8] target/mips: Use tcg_constant_*

2021-10-11 Thread Philippe Mathieu-Daudé
On 10/3/21 19:57, Philippe Mathieu-Daudé wrote: > Replace temporary TCG registers by tcg_constant_*() when possible. > > Philippe Mathieu-Daudé (8): > target/mips: Remove unused register from MSA 2R/2RF instruction format > target/mips: Use tcg_constant_i32() in gen_msa_elm_df() >

Re: [PATCH 2/4] MAINTAINERS: Add entries to cover MIPS CPS / GIC hardware

2021-10-11 Thread Philippe Mathieu-Daudé
Hi Paul, You are the maintainer of the Boston machine which is the only one using these peripherals; would you agree to be (co-)maintainer of these files? Regards, Phil. On 10/4/21 11:25, Philippe Mathieu-Daudé wrote: > MIPS CPS and GIC models are unrelated to the TCG frontend. > Move them as

Re: [PATCH v1 2/2] memory: Update description of memory_region_is_mapped()

2021-10-11 Thread Philippe Mathieu-Daudé
On 10/11/21 23:21, Richard Henderson wrote: > On 10/11/21 10:45 AM, David Hildenbrand wrote: >>   /** >>    * memory_region_is_mapped: returns true if #MemoryRegion is mapped >> - * into any address space. >> + * into another #MemoryRegion directly. Will return false if the >> + * #MemoryRegion is

Re: [PATCH 1/8] tcg: Add TCG_TARGET_SIGNED_ADDR32

2021-10-11 Thread Philippe Mathieu-Daudé
On 10/10/21 19:43, Richard Henderson wrote: > Define as 0 for all tcg hosts. Put this in a separate header, > because we'll want this in places that do not ordinarily have > access to all of tcg/tcg.h. > > Signed-off-by: Richard Henderson > --- > tcg/aarch64/tcg-target-sa32.h | 1 + >

Re: [PATCH 4/8] accel/tcg: Add guest_base_signed_addr32 for user-only

2021-10-11 Thread Philippe Mathieu-Daudé
On 10/10/21 19:43, Richard Henderson wrote: > While the host may prefer to treat 32-bit addresses as signed, > there are edge cases of guests that cannot be implemented with > addresses 0x7fff_ and 0x8000_ being non-consecutive. > > Therefore, default to guest_base_signed_addr32 false,

Re: [PATCH 8/8] target/riscv: Support TCG_TARGET_SIGNED_ADDR32

2021-10-11 Thread Philippe Mathieu-Daudé
On 10/10/21 19:44, Richard Henderson wrote: > All RV64 32-bit operations sign-extend the output, so we are easily > able to keep TCG_TYPE_I32 values sign-extended in host registers. > > Signed-off-by: Richard Henderson > --- > tcg/riscv/tcg-target-sa32.h | 6 +- > tcg/riscv/tcg-target.c.inc

Re: [PATCH] memory: Log access direction for invalid accesses

2021-10-11 Thread Richard Henderson
On 10/11/21 10:32 AM, BALATON Zoltan wrote: In memory_region_access_valid() invalid accesses are logged to help debugging but the log message does not say if it was a read or write. Log that too to better identify the access causing the problem. Signed-off-by: BALATON Zoltan ---

Re: [PATCH 2/8] accel/tcg: Split out g2h_tlbe

2021-10-11 Thread Philippe Mathieu-Daudé
On 10/10/21 19:43, Richard Henderson wrote: > Create a new function to combine a CPUTLBEntry addend > with the guest address to form a host address. > > Signed-off-by: Richard Henderson > --- > accel/tcg/cputlb.c | 24 ++-- > 1 file changed, 14 insertions(+), 10 deletions(-)

Re: [PATCH v3 6/9] bsd-user/mmap.c: Convert to qemu_log logging for mmap debugging

2021-10-11 Thread Philippe Mathieu-Daudé
On 10/8/21 23:23, Warner Losh wrote: > Convert DEBUG_MMAP to qemu_log CPU_LOG_PAGE. > > Signed-off-by: Warner Losh > --- > bsd-user/mmap.c | 53 + > 1 file changed, 23 insertions(+), 30 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH] s390x/ipl: check kernel command line size

2021-10-11 Thread Philippe Mathieu-Daudé
On 10/11/21 15:38, Thomas Huth wrote: > On 06/10/2021 11.26, Marc Hartmayer wrote: >> Check if the provided kernel command line exceeds the maximum size of >> the s390x >> Linux kernel command line size, which is 896 bytes. >> >> Reported-by: Sven Schnelle >> Signed-off-by: Marc Hartmayer >> ---

Re: [RFC PATCH] target/s390x: move tcg_gen_insn_start to s390x_tr_insn_start

2021-10-11 Thread Alex Bennée
Richard Henderson writes: > On 10/11/21 8:57 AM, Alex Bennée wrote: >> We use INDEX_op_insn_start to make the start of instruction >> boundaries. If we don't do it in the .insn_start hook things get >> confused especially now plugins want to use that marking to identify >> the start of

Re: [PATCH v1 2/2] memory: Update description of memory_region_is_mapped()

2021-10-11 Thread Richard Henderson
On 10/11/21 10:45 AM, David Hildenbrand wrote: /** * memory_region_is_mapped: returns true if #MemoryRegion is mapped - * into any address space. + * into another #MemoryRegion directly. Will return false if the + * #MemoryRegion is mapped indirectly via an alias. Hmm. I guess. It kinda

Re: [PATCH v1 1/2] machine: Use host_memory_backend_is_mapped() in machine_consume_memdev()

2021-10-11 Thread Richard Henderson
On 10/11/21 10:45 AM, David Hildenbrand wrote: memory_region_is_mapped() is the wrong check, we actually want to check whether the backend is already marked mapped. For example, memory regions mapped via an alias, such as NVDIMMs, currently don't make memory_region_is_mapped() return "true". As

Re: [PATCH v2 09/15] softmmu/qdev-monitor: add error handling in qdev_set_id

2021-10-11 Thread Eric Blake
On Fri, Oct 08, 2021 at 03:34:36PM +0200, Kevin Wolf wrote: > From: Damien Hedde > > qdev_set_id() is mostly used when the user adds a device (using > -device cli option or device_add qmp command). This commit adds > an error parameter to handle the case where the given id is > already taken. >

Re: [PATCH v4 1/3] QIOChannel: Add io_writev_zerocopy & io_flush_zerocopy callbacks

2021-10-11 Thread Leonardo Bras Soares Passos
On Mon, Oct 11, 2021 at 5:45 PM Eric Blake wrote: > > On Mon, Oct 11, 2021 at 04:38:23PM -0300, Leonardo Bras Soares Passos wrote: > > > > /** > > > > - * qio_channel_writev_full: > > > > + * qio_channel_writev_full_flags: > > > > * @ioc: the channel object > > > > * @iov: the array of

Re: [PATCH v4 1/3] QIOChannel: Add io_writev_zerocopy & io_flush_zerocopy callbacks

2021-10-11 Thread Eric Blake
On Mon, Oct 11, 2021 at 04:38:23PM -0300, Leonardo Bras Soares Passos wrote: > > > /** > > > - * qio_channel_writev_full: > > > + * qio_channel_writev_full_flags: > > > * @ioc: the channel object > > > * @iov: the array of memory regions to write data from > > > * @niov: the length of the

[PATCH v1] libvhost-user: fix VHOST_USER_REM_MEM_REG skipping mmap_addr

2021-10-11 Thread David Hildenbrand
We end up not copying the mmap_addr of all existing regions, resulting in a SEGFAULT once we actually try to map/access anything within our memory regions. Fixes: 875b9fd97b34 ("Support individual region unmap in libvhost-user") Cc: qemu-sta...@nongnu.org Cc: Michael S. Tsirkin Cc: Raphael

Re: [PATCH v4 3/3] multifd: Implement zerocopy write in multifd migration (multifd-zerocopy)

2021-10-11 Thread Leonardo Bras Soares Passos
Hello Eric, On Mon, Oct 11, 2021 at 4:32 PM Eric Blake wrote: > > On Sat, Oct 09, 2021 at 04:56:13AM -0300, Leonardo Bras wrote: > > Implement zerocopy on nocomp_send_write(), by making use of QIOChannel > > zerocopy interface. > > > > Change multifd_send_sync_main() so it can distinguish the

Re: [PATCH v4 2/3] QIOChannelSocket: Implement io_writev_zerocopy & io_flush_zerocopy for CONFIG_LINUX

2021-10-11 Thread Leonardo Bras Soares Passos
Hello Eric, On Mon, Oct 11, 2021 at 4:28 PM Eric Blake wrote: > > On Sat, Oct 09, 2021 at 04:56:12AM -0300, Leonardo Bras wrote: > > For CONFIG_LINUX, implement the new optional callbacks io_write_zerocopy and > > io_flush_zerocopy on QIOChannelSocket, but enables it only when MSG_ZEROCOPY > >

Re: [PATCH v4 1/3] QIOChannel: Add io_writev_zerocopy & io_flush_zerocopy callbacks

2021-10-11 Thread Leonardo Bras Soares Passos
Hello Eric, thank you for the feedback! On Mon, Oct 11, 2021 at 4:17 PM Eric Blake wrote: > > On Sat, Oct 09, 2021 at 04:56:11AM -0300, Leonardo Bras wrote: > > Adds io_async_writev and io_async_flush as optional callback to > > QIOChannelClass, > > Are these names accurate? I am sorry, I

Re: [PATCH v4 3/3] multifd: Implement zerocopy write in multifd migration (multifd-zerocopy)

2021-10-11 Thread Eric Blake
On Sat, Oct 09, 2021 at 04:56:13AM -0300, Leonardo Bras wrote: > Implement zerocopy on nocomp_send_write(), by making use of QIOChannel > zerocopy interface. > > Change multifd_send_sync_main() so it can distinguish the last sync from > the setup and per-iteration ones, so a flush_zerocopy() can

Re: [PATCH v4 2/3] QIOChannelSocket: Implement io_writev_zerocopy & io_flush_zerocopy for CONFIG_LINUX

2021-10-11 Thread Eric Blake
On Sat, Oct 09, 2021 at 04:56:12AM -0300, Leonardo Bras wrote: > For CONFIG_LINUX, implement the new optional callbacks io_write_zerocopy and > io_flush_zerocopy on QIOChannelSocket, but enables it only when MSG_ZEROCOPY > feature is available in the host kernel, which is checked on >

Re: [PATCH v4 1/3] QIOChannel: Add io_writev_zerocopy & io_flush_zerocopy callbacks

2021-10-11 Thread Eric Blake
On Sat, Oct 09, 2021 at 04:56:11AM -0300, Leonardo Bras wrote: > Adds io_async_writev and io_async_flush as optional callback to > QIOChannelClass, Are these names accurate? > allowing the implementation of asynchronous writes by subclasses. > > How to use them: > - Write data using

Re: [PATCH 0/9] nios2: Enable cross compile and fix signals

2021-10-11 Thread Richard Henderson
Ping. On 10/1/21 8:33 AM, Richard Henderson wrote: Patches 2, 3, and 5 have appeared before. The patch for the kuser page has been updated to use the commpage infrastructure, which needed expanding just a bit to handle the page being at the beginning of the address space. Getting the

Re: [PATCH RFC v2 5/5] block: Deprecate transaction type drive-backup

2021-10-11 Thread Eric Blake
On Sat, Oct 09, 2021 at 02:09:44PM +0200, Markus Armbruster wrote: > Several moons ago, Vladimir posted > > Subject: [PATCH v2 3/3] qapi: deprecate drive-backup > Date: Wed, 5 May 2021 16:58:03 +0300 > Message-Id: <20210505135803.67896-4-vsement...@virtuozzo.com> >

Re: [PATCH v2 4/5] qapi: Implement deprecated-input={reject,crash} for enum values

2021-10-11 Thread Eric Blake
On Sat, Oct 09, 2021 at 02:09:43PM +0200, Markus Armbruster wrote: > This copies the code implementing the policy from qapi/qmp-dispatch.c > to qapi/qobject-input-visitor.c. Tolerable, but if we acquire more > copes, we should look into factoring them out. copies > > Signed-off-by: Markus

[PATCH] target/s390x: move tcg_gen_insn_start to s390x_tr_insn_start

2021-10-11 Thread Richard Henderson
We use INDEX_op_insn_start to make the start of instruction boundaries. If we don't do it in the .insn_start hook things get confused especially now plugins want to use that marking to identify the start of instructions and will bomb out if it sees instrumented ops before the first instruction

Re: [PATCH v2 1/6] net/vmnet: dependencies setup, initial preparations

2021-10-11 Thread Eric Blake
On Tue, Aug 31, 2021 at 10:27:15PM +0300, Vladislav Yaroshchuk wrote: > Add 'vmnet' customizable option and 'vmnet.framework' probe into > configure; > > Create separate netdev per each vmnet operating mode > because they use quite different settings. Especially since > macOS 11.0

Re: [PATCH v2 1/5] qapi: Enable enum member introspection to show more than name

2021-10-11 Thread Eric Blake
On Sat, Oct 09, 2021 at 02:09:40PM +0200, Markus Armbruster wrote: > The next commit will add feature flags to enum members. There's a > problem, though: query-qmp-schema shows an enum type's members as an > array of member names (SchemaInfoEnum member @values). If it showed > an array of

Re: [RFC PATCH] target/s390x: move tcg_gen_insn_start to s390x_tr_insn_start

2021-10-11 Thread Richard Henderson
On 10/11/21 8:57 AM, Alex Bennée wrote: We use INDEX_op_insn_start to make the start of instruction boundaries. If we don't do it in the .insn_start hook things get confused especially now plugins want to use that marking to identify the start of instructions and will bomb out if it sees

Re: [PULL 0/2] Block patches

2021-10-11 Thread Richard Henderson
On 10/11/21 5:40 AM, Stefan Hajnoczi wrote: The following changes since commit ca61fa4b803e5d0abaf6f1ceb690f23bb78a4def: Merge remote-tracking branch 'remotes/quic/tags/pull-hex-20211006' into staging (2021-10-06 12:11:14 -0700) are available in the Git repository at:

Re: [RFC PATCH v1 2/2] s390x/kvm: Pass SIGP Stop flags

2021-10-11 Thread Eric Farman
On Mon, 2021-10-11 at 11:21 +0200, David Hildenbrand wrote: > On 11.10.21 10:40, Christian Borntraeger wrote: > > > > Am 11.10.21 um 09:09 schrieb David Hildenbrand: > > > On 08.10.21 22:38, Eric Farman wrote: > > > > When building a Stop IRQ to pass to KVM, we should incorporate > > > > the

[PATCH v1 8/9] migration/ram: Factor out populating pages readable in ram_block_populate_pages()

2021-10-11 Thread David Hildenbrand
Let's factor out prefaulting/populating to make further changes easier to review and add a comment what we are actually expecting to happen. While at it, use the actual page size of the ramblock, which defaults to qemu_real_host_page_size for anonymous memory. Further, rename

Re: [PATCH 2/2] target/i386/sev: Use local variable for kvm_sev_launch_measure

2021-10-11 Thread Dr. David Alan Gilbert
* Dov Murik (dovmu...@linux.ibm.com) wrote: > The struct kvm_sev_launch_measure has a constant and small size, and > therefore we can use a regular local variable for it instead of > allocating and freeing heap memory for it. > > Signed-off-by: Dov Murik Reviewed-by: Dr. David Alan Gilbert >

Re: [RFC PATCH v1 2/2] s390x/kvm: Pass SIGP Stop flags

2021-10-11 Thread David Hildenbrand
On 11.10.21 19:58, Eric Farman wrote: On Mon, 2021-10-11 at 11:21 +0200, David Hildenbrand wrote: On 11.10.21 10:40, Christian Borntraeger wrote: Am 11.10.21 um 09:09 schrieb David Hildenbrand: On 08.10.21 22:38, Eric Farman wrote: When building a Stop IRQ to pass to KVM, we should

[PATCH v1 5/9] virtio-mem: Drop precopy notifier

2021-10-11 Thread David Hildenbrand
Migration code now properly handles RAMBlocks which are indirectly managed by a RamDiscardManager. No need for manual handling via the free page optimization interface, let's get rid of it. Acked-by: Michael S. Tsirkin Acked-by: Peter Xu Signed-off-by: David Hildenbrand ---

[PATCH v1 3/9] migration/ram: Don't passs RAMState to migration_clear_memory_region_dirty_bitmap_*()

2021-10-11 Thread David Hildenbrand
The parameter is unused, let's drop it. Reviewed-by: Peter Xu Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela Signed-off-by: David Hildenbrand --- migration/ram.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/migration/ram.c

[PATCH v1 9/9] migration/ram: Handle RAMBlocks with a RamDiscardManager on background snapshots

2021-10-11 Thread David Hildenbrand
We already don't ever migrate memory that corresponds to discarded ranges as managed by a RamDiscardManager responsible for the mapped memory region of the RAMBlock. virtio-mem uses this mechanism to logically unplug parts of a RAMBlock. Right now, we still populate zeropages for the whole usable

[PATCH v1 7/9] migration: Simplify alignment and alignment checks

2021-10-11 Thread David Hildenbrand
Let's use QEMU_ALIGN_DOWN() and friends to make the code a bit easier to read. Reviewed-by: Peter Xu Signed-off-by: David Hildenbrand --- migration/migration.c| 6 +++--- migration/postcopy-ram.c | 9 - migration/ram.c | 2 +- 3 files changed, 8 insertions(+), 9

[PATCH v1 6/9] migration/postcopy: Handle RAMBlocks with a RamDiscardManager on the destination

2021-10-11 Thread David Hildenbrand
Currently, when someone (i.e., the VM) accesses discarded parts inside a RAMBlock with a RamDiscardManager managing the corresponding mapped memory region, postcopy will request migration of the corresponding page from the source. The source, however, will never answer, because it refuses to

[PATCH v1 1/9] memory: Introduce replay_discarded callback for RamDiscardManager

2021-10-11 Thread David Hildenbrand
Introduce replay_discarded callback similar to our existing replay_populated callback, to be used my migration code to never migrate discarded memory. Acked-by: Peter Xu Signed-off-by: David Hildenbrand --- include/exec/memory.h | 21 + softmmu/memory.c | 11

[PATCH v1 4/9] migration/ram: Handle RAMBlocks with a RamDiscardManager on the migration source

2021-10-11 Thread David Hildenbrand
We don't want to migrate memory that corresponds to discarded ranges as managed by a RamDiscardManager responsible for the mapped memory region of the RAMBlock. The content of these pages is essentially stale and without any guarantees for the VM ("logically unplugged"). Depending on the

[PATCH v1 2/9] virtio-mem: Implement replay_discarded RamDiscardManager callback

2021-10-11 Thread David Hildenbrand
Implement it similar to the replay_populated callback. Acked-by: Peter Xu Signed-off-by: David Hildenbrand --- hw/virtio/virtio-mem.c | 58 ++ 1 file changed, 58 insertions(+) diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index

Re: [PATCH 1/2] target/i386/sev: Use local variable for kvm_sev_launch_start

2021-10-11 Thread Dr. David Alan Gilbert
* Dov Murik (dovmu...@linux.ibm.com) wrote: > The struct kvm_sev_launch_start has a constant and small size, and > therefore we can use a regular local variable for it instead of > allocating and freeing heap memory for it. > > Signed-off-by: Dov Murik Reviewed-by: Dr. David Alan Gilbert >

[PATCH v1 0/9] migration/ram: Optimize for virtio-mem via RamDiscardManager

2021-10-11 Thread David Hildenbrand
This series is fully reviewed by Peter and I hope we can get either more review feedback or get it merged via the migration tree soonish. Thanks. --- virtio-mem exposes a dynamic amount of memory within RAMBlocks by coordinating with the VM. Memory within a RAMBlock can either get plugged and

Re: [PATCH] memory: Log access direction for invalid accesses

2021-10-11 Thread David Hildenbrand
On 11.10.21 19:32, BALATON Zoltan wrote: In memory_region_access_valid() invalid accesses are logged to help debugging but the log message does not say if it was a read or write. Log that too to better identify the access causing the problem. Signed-off-by: BALATON Zoltan ---

Re: ACPI endianness

2021-10-11 Thread BALATON Zoltan
On Mon, 11 Oct 2021, Michael S. Tsirkin wrote: On Mon, Oct 11, 2021 at 03:51:01PM +0200, BALATON Zoltan wrote: ... but given we did not previously do the read, maybe we should keep it that way at least for the time being. How do you know there was no read before this write? Did you check it?

[PATCH v1 2/2] memory: Update description of memory_region_is_mapped()

2021-10-11 Thread David Hildenbrand
memory_region_is_mapped() only indicates if the memory region is mapped into a different memory region, and only if it is mapped directly (->container), not via an alias. Update the documentation to make this clearer. Signed-off-by: David Hildenbrand --- include/exec/memory.h | 3 ++- 1 file

[PATCH v1 1/2] machine: Use host_memory_backend_is_mapped() in machine_consume_memdev()

2021-10-11 Thread David Hildenbrand
memory_region_is_mapped() is the wrong check, we actually want to check whether the backend is already marked mapped. For example, memory regions mapped via an alias, such as NVDIMMs, currently don't make memory_region_is_mapped() return "true". As the machine is initialized before any memory

[PATCH v1 0/2] memory: Update description of memory_region_is_mapped()

2021-10-11 Thread David Hildenbrand
Playing with memory_region_is_mapped(), I realized that memory regions mapped via an alias behave a little bit "differently", as they don't have their ->container set. * memory_region_is_mapped() will never succeed for memory regions mapped via an alias * memory_region_to_address_space(),

[PATCH] memory: Log access direction for invalid accesses

2021-10-11 Thread BALATON Zoltan
In memory_region_access_valid() invalid accesses are logged to help debugging but the log message does not say if it was a read or write. Log that too to better identify the access causing the problem. Signed-off-by: BALATON Zoltan --- softmmu/memory.c | 20 ++-- 1 file changed,

Re: [PATCH v4 00/11] virtio-iommu: Add ACPI support

2021-10-11 Thread Jean-Philippe Brucker
Hi Haiwei, On Mon, Oct 11, 2021 at 06:10:07PM +0800, Haiwei Li wrote: [...] > Gave up waiting for root file system device. Common problems: > - Boot args (cat /proc/cmdline) >- Check rootdelay= (did the system wait long enough?) > - Missing modules (cat /proc/modules; ls /dev) > ALERT!

[PATCH v1] virtio-mem: Don't skip alignment checks when warning about block size

2021-10-11 Thread David Hildenbrand
If we warn about the block size being smaller than the default, we skip some alignment checks. This can currently only fail on x86-64, when specifying a block size of 1 MiB, however, we detect the THP size of 2 MiB. Fixes: 228957fea3a9 ("virtio-mem: Probe THP size to determine default block

[PATCH 1/2] target/i386/sev: Use local variable for kvm_sev_launch_start

2021-10-11 Thread Dov Murik
The struct kvm_sev_launch_start has a constant and small size, and therefore we can use a regular local variable for it instead of allocating and freeing heap memory for it. Signed-off-by: Dov Murik --- target/i386/sev.c | 23 ++- 1 file changed, 10 insertions(+), 13

[PATCH 0/2] target/i386/sev: Replace malloc with local variables

2021-10-11 Thread Dov Murik
In two places in sev.c we use malloc+free to manage memory for small constant struct variables. Modify this to use local variables. This small series can be applied on top of master or on top of Phil's Housekeeping SEV series [1]. [1]

[PATCH 2/2] target/i386/sev: Use local variable for kvm_sev_launch_measure

2021-10-11 Thread Dov Murik
The struct kvm_sev_launch_measure has a constant and small size, and therefore we can use a regular local variable for it instead of allocating and freeing heap memory for it. Signed-off-by: Dov Murik --- target/i386/sev.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-)

Re: [PATCH 3/6] numa: Add SGXEPCSection list for multiple sections

2021-10-11 Thread Eric Blake
On Mon, Oct 11, 2021 at 07:15:51PM +0800, Yang Zhong wrote: > The SGXEPCSection list added into SGXInfo to show the multiple > SGX EPC sections detailed info, not the total size like before. > > Signed-off-by: Yang Zhong > --- > qapi/misc-target.json | 19 +-- > 1 file changed,

Re: [PATCH v4 0/7] util/oslib-posix: Support MADV_POPULATE_WRITE for os_mem_prealloc()

2021-10-11 Thread David Hildenbrand
On 04.10.21 14:02, David Hildenbrand wrote: #1 is a preparation for improved error reporting, #2 adds support for MADV_POPULATE_WRITE, #3 cleans up the code to avoid global variables and prepare for concurrency, #4 and #5 optimize thread handling, #6 makes os_mem_prealloc() safe to be called

Re: [PATCH 1/6] numa: Enable numa for SGX EPC sections

2021-10-11 Thread Eric Blake
On Mon, Oct 11, 2021 at 07:15:49PM +0800, Yang Zhong wrote: > The basic SGX did not enable numa for SGX EPC sections, which > result in all EPC sections located in numa node 0. This patch > enable SGX numa function in the guest and the EPC section can > work with RAM as one numa node. > > The

Re: Moving QEMU downloads to GitLab Releases?

2021-10-11 Thread Gerd Hoffmann
Hi, > > So while I'm all for making things a little more independent, > > let's not do it in a way that makes life difficult for downstreams. > > There are more there than just a couple of big distro builders. > > I think this is fine. Firmware blobs aren't needed to build QEMU, only > to run

Re: [PATCH] qcow2: Silence clang -m32 compiler warning

2021-10-11 Thread Eric Blake
On Mon, Oct 11, 2021 at 05:50:31PM +0200, Hanna Reitz wrote: > With -m32, size_t is generally only a uint32_t. That makes clang > complain that in the assertion > > assert(qiov->size <= INT64_MAX); > > the range of the type of qiov->size (size_t) is too small for any of its > values to ever

Re: [PATCH v4 2/2] monitor: refactor set/expire_password and allow VNC display id

2021-10-11 Thread Eric Blake
On Mon, Oct 11, 2021 at 04:03:01PM +0100, Dr. David Alan Gilbert wrote: > * Stefan Reiter (s.rei...@proxmox.com) wrote: > > It is possible to specify more than one VNC server on the command line, > > either with an explicit ID or the auto-generated ones à la "default", > > "vnc2", "vnc3", ... > >

[RFC PATCH] target/s390x: move tcg_gen_insn_start to s390x_tr_insn_start

2021-10-11 Thread Alex Bennée
We use INDEX_op_insn_start to make the start of instruction boundaries. If we don't do it in the .insn_start hook things get confused especially now plugins want to use that marking to identify the start of instructions and will bomb out if it sees instrumented ops before the first instruction

Re: [PATCH v4 08/11] tests/acpi: allow updates of VIOT expected data files

2021-10-11 Thread Igor Mammedov
On Fri, 8 Oct 2021 16:26:22 +0100 Jean-Philippe Brucker wrote: > On Wed, Oct 06, 2021 at 10:12:15AM +0200, Igor Mammedov wrote: > > On Fri, 1 Oct 2021 18:33:56 +0100 > > Jean-Philippe Brucker wrote: > > > > > Create empty data files and allow updates for the upcoming VIOT tests. > > > > >

Re: ACPI endianness

2021-10-11 Thread Michael S. Tsirkin
On Mon, Oct 11, 2021 at 03:51:01PM +0200, BALATON Zoltan wrote: > > ... but given we did not previously do the read, maybe we should keep > > it that way at least for the time being. > > How do you know there was no read before this write? Did you check it? I've > only added a printf in the write

[PATCH] qcow2: Silence clang -m32 compiler warning

2021-10-11 Thread Hanna Reitz
With -m32, size_t is generally only a uint32_t. That makes clang complain that in the assertion assert(qiov->size <= INT64_MAX); the range of the type of qiov->size (size_t) is too small for any of its values to ever exceed INT64_MAX. Cast qiov->size to uint64_t to silence clang. Fixes:

Re: Moving QEMU downloads to GitLab Releases?

2021-10-11 Thread Stefan Hajnoczi
On Mon, Oct 11, 2021 at 08:28:34AM -0600, Warner Losh wrote: > On Mon, Oct 11, 2021 at 4:59 AM Stefan Hajnoczi wrote: > > > On Mon, Oct 11, 2021 at 09:21:30AM +0200, Gerd Hoffmann wrote: > > > Hi, > > > > > > > > I guess the main question is who is using the ROM/BIOS sources in the > > > > >

Re: [PATCH 5/8] linux-user: Support TCG_TARGET_SIGNED_ADDR32

2021-10-11 Thread Richard Henderson
On 10/11/21 3:22 AM, Alex Bennée wrote: Richard Henderson writes: When using reserved_va, which is the default for a 64-bit host and a 32-bit guest, set guest_base_signed_addr32 if requested by TCG_TARGET_SIGNED_ADDR32, and the executable layout allows. Signed-off-by: Richard Henderson ---

Re: [PATCH 3/8] accel/tcg: Support TCG_TARGET_SIGNED_ADDR32 for softmmu

2021-10-11 Thread Richard Henderson
On 10/10/21 9:30 PM, WANG Xuerui wrote: @@ -92,6 +93,9 @@ static inline size_t sizeof_tlb(CPUTLBDescFast *fast) static inline uintptr_t g2h_tlbe(const CPUTLBEntry *tlb, target_ulong gaddr) { +if (TCG_TARGET_SIGNED_ADDR32 && TARGET_LONG_BITS == 32) { It seems this branch's direction

Re: [PATCH 6/8] tcg/aarch64: Support TCG_TARGET_SIGNED_ADDR32

2021-10-11 Thread Richard Henderson
On 10/11/21 3:28 AM, Alex Bennée wrote: Richard Henderson writes: AArch64 has both sign and zero-extending addressing modes, which means that either treatment of guest addresses is equally efficient. Enabling this for AArch64 gives us testing of the feature in CI. So which guests front

Re: [RFC v2 1/2] hw/pci-host/gpex: Allow to generate preserve boot config DSM #5

2021-10-11 Thread Igor Mammedov
On Tue, 5 Oct 2021 10:53:12 +0200 Eric Auger wrote: > Add a 'preserve_config' field in struct GPEXConfig and > if set generate the DSM #5 for preserving PCI boot configurations. > The DSM presence is needed to expose RMRs. here should be pointers to spec and location within it where it says

Re: [PATCH v2 04/15] qom: Reduce use of error_propagate()

2021-10-11 Thread Markus Armbruster
Kevin Wolf writes: > ERRP_GUARD() makes debugging easier by making sure that _abort > still fails at the real origin of the error instead of > error_propagate(). > > Signed-off-by: Kevin Wolf Yes, please! Reviewed-by: Markus Armbruster

Re: [PATCH v4 2/2] monitor: refactor set/expire_password and allow VNC display id

2021-10-11 Thread Dr. David Alan Gilbert
* Stefan Reiter (s.rei...@proxmox.com) wrote: > It is possible to specify more than one VNC server on the command line, > either with an explicit ID or the auto-generated ones à la "default", > "vnc2", "vnc3", ... > > It is not possible to change the password on one of these extra VNC > displays

Re: Moving QEMU downloads to GitLab Releases?

2021-10-11 Thread Anthony Liguori
On Fri, Oct 1, 2021 at 12:20 AM Stefan Hajnoczi wrote: > On Thu, Sep 30, 2021 at 03:57:49PM +, Eldon Stegall wrote: > > Hello! > > I'd be happy to help with this. I'm mostly a consumer of QEMU, but > > greatly appreciate all the work this community has done, and was able > > to contribute a

RE: [PATCH v2] vmdk: allow specification of tools version

2021-10-11 Thread Weissschuh, Thomas [ext]
Hi Hanna, > -Original Message- > From: Hanna Reitz > Sent: Monday, October 11, 2021 4:09 PM > Subject: Re: [PATCH v2] vmdk: allow specification of tools version > > On 13.09.21 15:04, Thomas Weißschuh wrote: > > VMDK files support an attribute that represents the version of the > >

Re: [PATCH] s390x/ipl: check kernel command line size

2021-10-11 Thread Marc Hartmayer
Thomas Huth writes: > On 06/10/2021 11.26, Marc Hartmayer wrote: >> Check if the provided kernel command line exceeds the maximum size of the >> s390x >> Linux kernel command line size, which is 896 bytes. >> >> Reported-by: Sven Schnelle >> Signed-off-by: Marc Hartmayer >> --- >>

  1   2   >