Re: [RFC PATCH v1 0/2] Improvements to SIGP handling [QEMU]

2021-10-11 Thread Thomas Huth
On 08/10/2021 22.38, Eric Farman wrote: I'm cleaning up some of the SIGP code in KVM and QEMU, and would like to propose the following changes. Patch 1 should be less concerning than its KVM counterpart, since the CZAM bit in question is already present in QEMU. Patch 2 provides some handshakin

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

2021-10-11 Thread Thomas Huth
On 11/10/2021 20.08, Philippe Mathieu-Daudé wrote: 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 Si

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

2021-10-11 Thread David Hildenbrand
On 12.10.21 00:17, Philippe Mathieu-Daudé wrote: 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 ret

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

2021-10-11 Thread Gerd Hoffmann
On Tue, Oct 12, 2021 at 01:46:35AM -0400, Michael S. Tsirkin wrote: > 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_

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

2021-10-11 Thread Gerd Hoffmann
On Tue, Oct 12, 2021 at 01:56:31AM -0400, Michael S. Tsirkin wrote: > 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 pendin

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

2021-10-11 Thread Jason Wang
On Tue, Oct 12, 2021 at 2:28 PM Eugenio Perez Martin wrote: > > On Tue, Oct 12, 2021 at 5:50 AM Jason Wang wrote: > > > > 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

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

2021-10-11 Thread Alex Bennée
Richard Henderson writes: > 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

Re: [PATCH v2 1/2] numa: Set default distance map if needed

2021-10-11 Thread Andrew Jones
On Tue, Oct 12, 2021 at 02:36:02PM +0800, Gavin Shan wrote: > The following option is used to specify the distance map. It's > possible the option isn't provided by user. In this case, the > distance map isn't populated and exposed to platform. On the > other hand, the empty NUMA node, where no mem

[PATCH v2 2/2] hw/arm/virt: Don't create device-tree node for empty NUMA node

2021-10-11 Thread Gavin Shan
The empty NUMA node, where no memory resides, are allowed. For example, the following command line specifies two empty NUMA nodes. With this, QEMU fails to boot because of the conflicting device-tree node names, as the following error message indicates. /home/gavin/sandbox/qemu.main/build/qemu-s

[PATCH v2 1/2] numa: Set default distance map if needed

2021-10-11 Thread Gavin Shan
The following option is used to specify the distance map. It's possible the option isn't provided by user. In this case, the distance map isn't populated and exposed to platform. On the other hand, the empty NUMA node, where no memory resides, is allowed on ARM64 virt platform. For these empty NUMA

[PATCH v2 0/2] hw/arm/virt: Fix qemu booting failure on device-tree

2021-10-11 Thread Gavin Shan
The empty NUMA nodes, where no memory resides, are allowed on ARM64 virt platform. However, QEMU fails to boot because the device-tree can't be populated due to the conflicting device-tree node names of these empty NUMA nodes. For example, QEMU fails to boot and the following error message reported

Re: [PATCH 8/9] linux-user/nios2: Use set_sigmask in do_rt_sigreturn

2021-10-11 Thread Laurent Vivier
Le 01/10/2021 à 17:33, Richard Henderson a écrit : > Using do_sigprocmask directly was incorrect, as it will > leave the signal blocked by the outer layers of linux-user. > > Signed-off-by: Richard Henderson > --- > linux-user/nios2/signal.c | 2 +- > linux-user/signal.c | 2 -- > 2 files

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

2021-10-11 Thread Eugenio Perez Martin
On Tue, Oct 12, 2021 at 5:50 AM Jason Wang wrote: > > 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 > > --- > >

Re: [PATCH 7/9] linux-user/nios2: Fix sigmask in setup_rt_frame

2021-10-11 Thread Laurent Vivier
Le 01/10/2021 à 17:33, Richard Henderson a écrit : > Do not cast the signal mask elements; trust __put_user. > > Signed-off-by: Richard Henderson > --- > linux-user/nios2/signal.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/linux-user/nios2/signal.c b/linux-user/n

Re: [PATCH v4 12/23] target/i386/sev: Use g_autofree in sev_launch_get_measure()

2021-10-11 Thread Dov Murik
On 07/10/2021 19:28, Dov Murik wrote: > > > On 07/10/2021 19:17, Philippe Mathieu-Daudé wrote: >> Use g_autofree to remove a pair of g_free/goto. >> >> Signed-off-by: Philippe Mathieu-Daudé >> --- >> target/i386/sev.c | 13 - >> 1 file changed, 4 insertions(+), 9 deletions(-) >>

Re: [PATCH 1/2] numa: Set default distance map if needed

2021-10-11 Thread Gavin Shan
Hi Drew, On 10/8/21 5:07 PM, Andrew Jones wrote: On Fri, Oct 08, 2021 at 10:51:24AM +1100, Gavin Shan wrote: On 10/6/21 10:56 PM, Andrew Jones wrote: On Wed, Oct 06, 2021 at 10:03:25PM +1100, Gavin Shan wrote: On 10/6/21 9:35 PM, Andrew Jones wrote: On Wed, Oct 06, 2021 at 06:22:08PM +0800,

Re: [PATCH 4/9] linux-user/elfload: Rename ARM_COMMPAGE to HI_COMMPAGE

2021-10-11 Thread Laurent Vivier
Le 01/10/2021 à 17:33, Richard Henderson a écrit : > Arm will no longer be the only target requiring a commpage, > but it will continue to be the only target placing the page > at the high end of the address space. > > Signed-off-by: Richard Henderson > --- > linux-user/elfload.c | 18 +-

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. > > Sign

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 multi

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, > > > } > > > > > > dev->pe

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 o

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 address,

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 7fab2e7cd8

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 li

[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 ++-- tests/tcg/xtensaeb/Makefile.s

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 vho

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 datapl

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 Wang

[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 virtio-blk-devi

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 a/ta

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 main_mem

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 > --- > target/riscv/cpu.

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 x86_cpu_list_entry(

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(): > > qem

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() > target/mip

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 n

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 + > tcg/arm/t

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, and

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 --- softmmu/memory

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 instruct

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 memory

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 @i

[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 Norwit

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 las

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 > > fe

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 think

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 b

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 > qio_channel_s

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 qio_channel

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 toolchain

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> > https://lists.g

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 Armbr

[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 boun

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 (vmnet.framework

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 objects

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 instrume

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: https://gitlab.com

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 flags

[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 ram_block_populate_pag

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 incorpora

[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 --- hw/virtio/virtio-me

[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 b/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 deletions(-

[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 migrat

[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 underlyin

[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 df91e454b2.

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 con

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 --- softmmu/memory.c

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? I

[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 ch

[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 devi

[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(), memory_

[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! UUI

[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 size

[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 deletion

[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] https://lore.kernel.org/qemu-devel/20211007161716.453984-1-p

[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(-) d

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, 1

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 from

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 Gues

  1   2   >