Re: [PATCH v1 2/2] virtio-net: virtio_net_flush_tx() check for per-queue reset

2023-01-29 Thread Jason Wang
On Mon, Jan 30, 2023 at 1:32 PM Michael S. Tsirkin wrote: > > On Mon, Jan 30, 2023 at 10:15:12AM +0800, Xuan Zhuo wrote: > > On Sun, 29 Jan 2023 07:15:47 -0500, "Michael S. Tsirkin" > > wrote: > > > On Sun, Jan 29, 2023 at 08:03:42PM +0800, Xuan Zhuo wrote: > > > > On Sun, 29 Jan 2023 06:57:29

RE: [PATCH v10 1/9] mm: Introduce memfd_restricted system call to create restricted user memory

2023-01-29 Thread Wang, Wei W
On Monday, January 30, 2023 1:26 PM, Ackerley Tng wrote: > > > +static int restrictedmem_getattr(struct user_namespace *mnt_userns, > > +const struct path *path, struct kstat *stat, > > +u32 request_mask, unsigned int query_flags) > { > > +

Re: [PATCH v1 2/2] virtio-net: virtio_net_flush_tx() check for per-queue reset

2023-01-29 Thread Michael S. Tsirkin
On Mon, Jan 30, 2023 at 11:53:18AM +0800, Jason Wang wrote: > On Mon, Jan 30, 2023 at 11:42 AM Xuan Zhuo wrote: > > > > On Mon, 30 Jan 2023 11:01:40 +0800, Jason Wang wrote: > > > On Sun, Jan 29, 2023 at 3:44 PM Xuan Zhuo > > > wrote: > > > > > > > > On Sun, 29 Jan 2023 14:23:21 +0800, Jason

Re: [PATCH RFC 15/21] migration: Teach qemu about minor faults and doublemap

2023-01-29 Thread Juan Quintela
Peter Xu wrote: > When a ramblock is backed by hugetlbfs and the user specified using > double-map feature, we trap the faults on these regions using minor mode. > Teach QEMU about that. > > Add some sanity check on the fault flags when receiving a uffd message. > For minor fault trapped ranges,

Re: [PATCH v3 08/14] RISC-V: Adding T-Head MemPair extension

2023-01-29 Thread Richard Henderson
On 1/29/23 16:03, LIU Zhiwei wrote: Thanks. It's a bug. We should load all memory addresses to  local TCG temps first. Do you think we should probe all the memory addresses for the store pair instructions? If so, can we avoid the use of a helper function? Depends on what the hardware does.

Re: [PATCH v1 2/2] virtio-net: virtio_net_flush_tx() check for per-queue reset

2023-01-29 Thread Michael S. Tsirkin
On Mon, Jan 30, 2023 at 10:15:12AM +0800, Xuan Zhuo wrote: > On Sun, 29 Jan 2023 07:15:47 -0500, "Michael S. Tsirkin" > wrote: > > On Sun, Jan 29, 2023 at 08:03:42PM +0800, Xuan Zhuo wrote: > > > On Sun, 29 Jan 2023 06:57:29 -0500, "Michael S. Tsirkin" > > > wrote: > > > > On Sun, Jan 29, 2023

Re: [PATCH v10 1/9] mm: Introduce memfd_restricted system call to create restricted user memory

2023-01-29 Thread Ackerley Tng
+static int restrictedmem_getattr(struct user_namespace *mnt_userns, +const struct path *path, struct kstat *stat, +u32 request_mask, unsigned int query_flags) +{ + struct inode *inode = d_inode(path->dentry); + struct

Re: [PATCH RFC 14/21] migration: Map hugetlbfs ramblocks twice, and pre-allocate

2023-01-29 Thread Juan Quintela
Peter Xu wrote: > Add a RAMBlock.host_mirror for all the hugetlbfs backed guest memories. > It'll be used to remap the same region twice and it'll be used to service > page faults using UFFDIO_CONTINUE. > > To make sure all accesses to these ranges will generate minor page faults > not missing

Re: [PATCH RFC 13/21] migration: Add migration_ram_pagesize_largest()

2023-01-29 Thread Juan Quintela
Peter Xu wrote: > Let it replace the old qemu_ram_pagesize_largest() just to fetch the page > sizes using migration_ram_pagesize(), because it'll start to consider > double mapping effect in migrations. > > Also don't account the ignored ramblocks as they won't be migrated. > > Signed-off-by:

Re: [PATCH RFC 12/21] migration: Introduce page size for-migration-only

2023-01-29 Thread Juan Quintela
Peter Xu wrote: > Migration may not want to recognize memory chunks in page size of the host > only, but sometimes we may want to recognize the memory in smaller chunks > if e.g. they're doubly mapped as both huge and small. > > In those cases we'll prefer to assume the memory page size is always

Re: [PATCH RFC 11/21] migration: Add hugetlb-doublemap cap

2023-01-29 Thread Juan Quintela
Peter Xu wrote: > Add a new cap to allow mapping hugetlbfs backed RAMs in small page sizes. > > Signed-off-by: Peter Xu Reviewed-by: Juan Quintela > +bool migrate_hugetlb_doublemap(void) > +{ > +MigrationState *s = migrate_get_current(); > + > +return

Re: [PATCH RFC 10/21] ramblock: Add ramblock_file_map()

2023-01-29 Thread Juan Quintela
Peter Xu wrote: > Add a helper to do mmap() for a ramblock based on the cached informations. > > A trivial thing to mention is we need to move ramblock->fd setup to be > earlier, before the ramblock_file_map() call, because it'll need to > reference the fd being mapped. However that should not

Re: [PATCH RFC 09/21] ramblock: Add RAM_READONLY

2023-01-29 Thread Juan Quintela
Peter Xu wrote: > This allows us to have RAM_READONLY to be set in ram_flags to show that > this ramblock can only be read not write. > > We used to pass in readonly boolean along the way for allocating the > ramblock, now let it be together with the rest ramblock flags. > > The main purpose of

Re: [PATCH RFC 08/21] ramblock: Cache the length to do file mmap() on ramblocks

2023-01-29 Thread Juan Quintela
Peter Xu wrote: > We do proper page size alignment for file backed mmap()s for ramblocks. > Even if it's as simple as that, cache the value because it'll be used in > multiple places. > > Since at it, drop size for file_ram_alloc() and just use max_length because > that's always true for

Re: [PATCH RFC 07/21] ramblock: Cache file offset for file-backed ramblocks

2023-01-29 Thread Juan Quintela
Peter Xu wrote: > This value was only used for mmap() when we want to map at a specific > offset of the file for memory. To be prepared that we might do another map > upon the same range for whatever reason, cache the offset so we know how to > map again on the same range. > > Signed-off-by:

Re: [PATCH RFC 06/21] madvise: Add QEMU_MADV_COLLAPSE

2023-01-29 Thread Juan Quintela
Peter Xu wrote: > MADV_COLLAPSE is a new madvise() on Linux. Define it. > > Signed-off-by: Peter Xu Reviewed-by: Juan Quintela

Re: [PATCH RFC 05/21] madvise: Add QEMU_MADV_SPLIT

2023-01-29 Thread Juan Quintela
Peter Xu wrote: > MADV_SPLIT is a new madvise() on Linux. Define QEMU_MADV_SPLIT. > > Signed-off-by: Peter Xu Reviewed-by: Juan Quintela You can maintain the reviewed-by even if you collapsed with next one as David suggests.

Re: [PATCH RFC 04/21] madvise: Include linux/mman.h under linux-headers/

2023-01-29 Thread Juan Quintela
Peter Xu wrote: > This will allow qemu/madvise.h to always include linux/mman.h under the > linux-headers/. > > Signed-off-by: Peter Xu Reviewed-by: Juan Quintela

Re: [PATCH RFC 03/21] physmem: Add qemu_ram_is_hugetlb()

2023-01-29 Thread Juan Quintela
Peter Xu wrote: > Returns true for a hugetlbfs mapping, false otherwise. > > Signed-off-by: Peter Xu Reviewed-by: Juan Quintela

Re: [PATCH RFC 02/21] util: Include osdep.h first in util/mmap-alloc.c

2023-01-29 Thread Juan Quintela
Peter Xu wrote: > Without it, we never have CONFIG_LINUX defined even if on linux, so > linux/mman.h is never really included. > > Signed-off-by: Peter Xu Reviewed-by: Juan Quintela Markus is working on this right now, Markus?

Re: [PATCH 2/2] MAINTAINERS: Cover include/sysemu/accel-blocker.h

2023-01-29 Thread Juan Quintela
Markus Armbruster wrote: > Commit bd688fc931 "accel: introduce accelerator blocker API" aded > include/sysemu/accel-blocker.h and accel/accel-blocker.c. MAINTAINERS > covers the latter in section "Guest CPU Cores (other accelerators) / > Overall", but not the former. Fix that. > >

Re: [PATCH 1/2] MAINTAINERS: Cover userfaultfd

2023-01-29 Thread Juan Quintela
Markus Armbruster wrote: > Commit 0e9b5cd6b2 "migration: introduce UFFD-WP low-level interface > helpers" added util/userfaultfd.c without covering it in MAINTAINERS. > Add it to section "Migration". > > Signed-off-by: Markus Armbruster Reviewed-by: Juan Quintela

Re: [PATCH v3 11/11] tests/qtest/migration-test: Only use available accelerators

2023-01-29 Thread Juan Quintela
Philippe Mathieu-Daudé wrote: > For example, avoid when TCG is disabled: > > $ make check-qtest-aarch64 > ... > 20/20 qemu:qtest+qtest-aarch64 / qtest-aarch64/migration-test > qemu-system-aarch64: -accel tcg: invalid accelerator tcg > > Reviewed-by: Dr. David Alan Gilbert >

Re: [PATCH v3 10/11] tests/qtest/migration-test: Build command line using GString API (4/4)

2023-01-29 Thread Juan Quintela
Philippe Mathieu-Daudé wrote: > Part 4/4: Convert rest of options. > > Reviewed-by: Richard Henderson > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela

Re: [PATCH v3 09/11] tests/qtest/migration-test: Build command line using GString API (3/4)

2023-01-29 Thread Juan Quintela
Philippe Mathieu-Daudé wrote: > Part 3/4: Convert accelerator options. > > Reviewed-by: Richard Henderson > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela

Re: [PATCH v3 08/11] tests/qtest/migration-test: Build command line using GString API (2/4)

2023-01-29 Thread Juan Quintela
Philippe Mathieu-Daudé wrote: > Part 2/4: Convert shmem option. > > Reviewed-by: Richard Henderson > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela Again, much nicer that what was there.

Re: [PATCH v3 07/11] tests/qtest/migration-test: Build command line using GString API (1/4)

2023-01-29 Thread Juan Quintela
Philippe Mathieu-Daudé wrote: > Part 1/4: Convert memory & machine options. > > Signed-off-by: Philippe Mathieu-Daudé Much nicer. Reviewed-by: Juan Quintela

Re: [PATCH v3 06/11] tests/qtest/migration-test: Reduce 'cmd_source' string scope

2023-01-29 Thread Juan Quintela
Philippe Mathieu-Daudé wrote: > Reviewed-by: Richard Henderson > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela I am assuming that you will pull this patches through tests tree, not migration tree. Otherwise, let me know.

Re: [PATCH v3 05/11] tests/qtest/migration-test: Inverse #ifdef'ry ladders

2023-01-29 Thread Juan Quintela
Philippe Mathieu-Daudé wrote: > This slighly simplify the logic, and eases the following conversion. > > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Richard Henderson Reviewed-by: Juan Quintela

Re: [PATCH] migration: Fix migration crash when target psize larger than host

2023-01-29 Thread Juan Quintela
Peter Xu wrote: > Commit d9e474ea56 overlooked the case where the target psize is even larger > than the host psize. One example is Alpha has 8K page size and migration > will start to crash the source QEMU when running Alpha migration on x86. > > Fix it by detecting that case and set host

Re: [PATCH v8 5/5] riscv: Correctly set the device-tree entry 'mmu-type'

2023-01-29 Thread Bin Meng
On Thu, Jan 26, 2023 at 12:25 AM Alexandre Ghiti wrote: > > The 'mmu-type' should reflect what the hardware is capable of so use the > new satp_mode field in RISCVCPUConfig to do that. > > Signed-off-by: Alexandre Ghiti > Reviewed-by: Andrew Jones > Reviewed-by: Alistair Francis > --- >

Re: [PATCH v8 4/5] riscv: Introduce satp mode hw capabilities

2023-01-29 Thread Bin Meng
On Thu, Jan 26, 2023 at 12:24 AM Alexandre Ghiti wrote: > > Currently, the max satp mode is set with the only constraint that it must be > implemented in qemu, i.e. set in valid_vm_1_10_[32|64]. nits: s/qemu/QEMU/g > > But we actually need to add another level of constraint: what the hw is >

Re: [PATCH 3/3] migration: save/delete migration thread info

2023-01-29 Thread Juan Quintela
Jiang Jiacheng wrote: > To support query migration thread infomation, save and delete > thread information at thread creation and end. > > Signed-off-by: Jiang Jiacheng Don't disagree with this, but if we create this on the sending side, why this is not needed for the multifd_recv_threads?

Re: [PATCH 2/3] migration: implement query migration threadinfo by name

2023-01-29 Thread Juan Quintela
Jiang Jiacheng wrote: > Introduce interface query-migrationthreads. The interface is use > with the migration thread name reported by qemu and returns with > migration thread name and its pid. > Introduce threadinfo.c to manage threads with migration. > > Signed-off-by: Jiang Jiacheng I like

Re: [PATCH v8 3/5] riscv: Allow user to set the satp mode

2023-01-29 Thread Bin Meng
On Thu, Jan 26, 2023 at 12:23 AM Alexandre Ghiti wrote: > > RISC-V specifies multiple sizes for addressable memory and Linux probes for > the machine's support at startup via the satp CSR register (done in > csr.c:validate_vm). > > As per the specification, sv64 must support sv57, which in turn

Re: [PATCH 1/3] migration: report migration thread name to libvirt

2023-01-29 Thread Juan Quintela
Jiang Jiacheng wrote: > Report migration thread name to libvirt in order to > support query migration thread infomation by its name. > > Signed-off-by: Jiang Jiacheng > --- > migration/migration.c | 3 +++ > migration/multifd.c | 5 - > qapi/migration.json | 12 > 3 files

Re: [PATCH 1/2] MAINTAINERS: Cover userfaultfd

2023-01-29 Thread Juan Quintela
Markus Armbruster wrote: > Commit 0e9b5cd6b2 "migration: introduce UFFD-WP low-level interface > helpers" added util/userfaultfd.c without covering it in MAINTAINERS. > Add it to section "Migration". > > Signed-off-by: Markus Armbruster Reviewed-by: Juan Quintela

Re: [PATCH v4 19/19] Drop duplicate #include

2023-01-29 Thread Juan Quintela
Markus Armbruster wrote: > Tracked down with the help of scripts/clean-includes. > > Signed-off-by: Markus Armbruster > diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c > index b9a37ef255..8b7d1af75d 100644 > --- a/migration/postcopy-ram.c > +++ b/migration/postcopy-ram.c > @@

Re: [PATCH v4 16/19] Fix non-first inclusions of qemu/osdep.h

2023-01-29 Thread Juan Quintela
Markus Armbruster wrote: > This commit was created with scripts/clean-includes. > > Signed-off-by: Markus Armbruster Reviewed-by: Juan Quintela

Re: [PATCH v4 10/19] migration: Clean up includes

2023-01-29 Thread Juan Quintela
Markus Armbruster wrote: > "Dr. David Alan Gilbert" writes: > >> * Markus Armbruster (arm...@redhat.com) wrote: >>> "Dr. David Alan Gilbert" writes: >>> >>> > * Markus Armbruster (arm...@redhat.com) wrote: >>> >> Clean up includes so that osdep.h is included first and headers >>> >> which it

Re: [PATCH v1 2/2] virtio-net: virtio_net_flush_tx() check for per-queue reset

2023-01-29 Thread Jason Wang
On Mon, Jan 30, 2023 at 11:42 AM Xuan Zhuo wrote: > > On Mon, 30 Jan 2023 11:01:40 +0800, Jason Wang wrote: > > On Sun, Jan 29, 2023 at 3:44 PM Xuan Zhuo > > wrote: > > > > > > On Sun, 29 Jan 2023 14:23:21 +0800, Jason Wang > > > wrote: > > > > On Sun, Jan 29, 2023 at 10:52 AM Xuan Zhuo >

Re: [PATCH v1 2/2] virtio-net: virtio_net_flush_tx() check for per-queue reset

2023-01-29 Thread Xuan Zhuo
On Mon, 30 Jan 2023 11:01:40 +0800, Jason Wang wrote: > On Sun, Jan 29, 2023 at 3:44 PM Xuan Zhuo wrote: > > > > On Sun, 29 Jan 2023 14:23:21 +0800, Jason Wang wrote: > > > On Sun, Jan 29, 2023 at 10:52 AM Xuan Zhuo > > > wrote: > > > > > > > > Check whether it is per-queue reset state in

Re: [PATCH v1 2/2] virtio-net: virtio_net_flush_tx() check for per-queue reset

2023-01-29 Thread Jason Wang
On Sun, Jan 29, 2023 at 3:44 PM Xuan Zhuo wrote: > > On Sun, 29 Jan 2023 14:23:21 +0800, Jason Wang wrote: > > On Sun, Jan 29, 2023 at 10:52 AM Xuan Zhuo > > wrote: > > > > > > Check whether it is per-queue reset state in virtio_net_flush_tx(). > > > > > > Before per-queue reset, we need to

RE: [RFC v2 2/2] spice: Add an option to forward the dmabuf directly to the encoder (v2)

2023-01-29 Thread Kasireddy, Vivek
Hi Frediano, Gerd, > > Il giorno mar 24 gen 2023 alle ore 06:41 Kasireddy, Vivek > ha scritto: > > > > + Frediano > > > > Hi Gerd, > > > > > > > > Hi, > > > > > > > Here is the flow of things from the Qemu side: > > > > - Call gl_scanout (to update the fd) and gl_draw_async just like > > > >

Re: [PATCH v1 2/2] virtio-net: virtio_net_flush_tx() check for per-queue reset

2023-01-29 Thread Xuan Zhuo
On Sun, 29 Jan 2023 07:15:47 -0500, "Michael S. Tsirkin" wrote: > On Sun, Jan 29, 2023 at 08:03:42PM +0800, Xuan Zhuo wrote: > > On Sun, 29 Jan 2023 06:57:29 -0500, "Michael S. Tsirkin" > > wrote: > > > On Sun, Jan 29, 2023 at 04:23:08PM +0800, Xuan Zhuo wrote: > > > > On Sun, 29 Jan 2023

Re: [PATCH v3 08/14] RISC-V: Adding T-Head MemPair extension

2023-01-29 Thread LIU Zhiwei
On 2023/1/25 4:44, Richard Henderson wrote: On 1/24/23 09:59, Christoph Muellner wrote: +static bool gen_loadpair_tl(DisasContext *ctx, arg_th_pair *a, MemOp memop, +    int shamt) +{ +    TCGv rd1 = dest_gpr(ctx, a->rd1); +    TCGv rd2 = dest_gpr(ctx, a->rd2); +   

Re: [PATCH v4 0/3] hw/riscv: misc cleanups

2023-01-29 Thread Alistair Francis
On Wed, Jan 25, 2023 at 7:23 AM Daniel Henrique Barboza wrote: > > Hi, > > These are the last 3 patches from the series > > "[PATCH v3 0/7] riscv: fdt related cleanups" > > That can be sent in separate from the fdt work. Patches are all acked. > > Changes from v3: > - patches 1,2,3: > - former

Re: [XEN PATCH v2 0/3] Configure qemu upstream correctly by default for igd-passthru

2023-01-29 Thread Chuck Zmudzinski
On 1/25/23 6:19 PM, Chuck Zmudzinski wrote: > On 1/25/2023 6:37 AM, Anthony PERARD wrote: >> On Tue, Jan 10, 2023 at 02:32:01AM -0500, Chuck Zmudzinski wrote: >> > I call attention to the commit message of the first patch which points >> > out that using the "pc" machine and adding the xen

Re: [PATCH] hw/riscv: boot: Don't use CSRs if they are disabled

2023-01-29 Thread Alistair Francis
On Thu, Jan 26, 2023 at 10:03 PM Bin Meng wrote: > > On Tue, Jan 24, 2023 at 9:42 AM Alistair Francis wrote: > > > > On Tue, Jan 24, 2023 at 11:24 AM Bin Meng wrote: > > > > > > On Mon, Jan 23, 2023 at 11:58 AM Alistair Francis > > > wrote: > > > > > > > > From: Alistair Francis > > > > > > >

Re: [PATCH v7 3/3] hw/riscv: clear kernel_entry higher bits in load_elf_ram_sym()

2023-01-29 Thread Alistair Francis
On Thu, Jan 26, 2023 at 10:07 PM Bin Meng wrote: > > Hi Alistair, > > On Mon, Jan 16, 2023 at 12:28 PM Alistair Francis > wrote: > > > > On Sat, Jan 14, 2023 at 11:41 PM Bin Meng wrote: > > > > > > On Sat, Jan 14, 2023 at 1:18 AM Daniel Henrique Barboza > > > wrote: > > > > > > > > Recent

Re: [PATCH: fix for virt instr exception] target/riscv: fix for virtual instr exception

2023-01-29 Thread Alistair Francis
On Sat, Jan 28, 2023 at 6:37 AM Deepak Gupta wrote: > > Please dis-regard this. > I've sent the patch to qemu-ri...@nongnu.org That's not entirely correct either. You can run the `./scripts/get_maintainer.pl` script on your patch to get the email addresses to send this patch to. qemu-devel is

Re: [PATCH 1/2] util: import GTree as QTree

2023-01-29 Thread Emilio Cota
On Wed, Jan 11, 2023 at 12:08:26 +, Daniel P. Berrangé wrote: > First, I find the test to be a little unreliable the first few > times it is ran. I ran it in a loop 20 times and it got more > stable results. Looking at just the QTree lines I get something > typically like: Agreed, this is a

Re: [PATCH 2/2] tcg: use QTree instead of GTree

2023-01-29 Thread Emilio Cota
On Wed, Jan 25, 2023 at 15:58:25 +, Daniel P. Berrangé wrote: > On Wed, Jan 11, 2023 at 12:34:29PM +, Daniel P. Berrangé wrote: > > On Tue, Jan 10, 2023 at 10:55:36PM -0500, Emilio Cota wrote: > > > qemu-user can hang in a multi-threaded fork. One common > > > reason is that when creating

Re: [PATCH 2/2] tcg: use QTree instead of GTree

2023-01-29 Thread Emilio Cota
On Wed, Jan 11, 2023 at 12:10:53 +, Daniel P. Berrangé wrote: > On Tue, Jan 10, 2023 at 10:55:36PM -0500, Emilio Cota wrote: > > Performance impact on linux-user: > > - ~2% slowdown in spec06 > > - 1.05% slowdown in Nbench-int > > - 4.51% slowdown in Nbench-fp > > What do you get *before*

Re: [PATCH] linux-user,bsd-user: re-exec with G_SLICE=always-malloc

2023-01-29 Thread Emilio Cota
On Thu, Dec 01, 2022 at 10:49:27 +, Alex Bennée wrote: > Emilio Cota writes: > > On Tue, Oct 04, 2022 at 13:00:47 +0100, Daniel P. Berrangé wrote: > > (snip) > >> Can't say I especially like this but I'm out of other ideas for how > >> to guarantee a solution. Users can't set env vars prior

Re: [PATCH v2 01/15] RISC-V: Adding XTheadCmo ISA extension

2023-01-29 Thread Alistair Francis
On Wed, Jan 25, 2023 at 5:51 AM Christoph Müllner wrote: > > > > On Tue, Jan 24, 2023 at 6:31 PM Christoph Müllner > wrote: >> >> >> >> On Mon, Jan 23, 2023 at 11:50 PM Alistair Francis >> wrote: >>> >>> On Sat, Dec 24, 2022 at 4:09 AM Christoph Muellner >>> wrote: >>> > >>> > From:

virtio-sound Google Summer of Code project?

2023-01-29 Thread Stefan Hajnoczi
Hi Shreyansh, Gerd, and Laurent, The last virtio-sound RFC was sent in February last year. It was a spare time project. Understandably it's hard to complete the whole thing on weekends, evenings, etc. So I wanted to suggest relaunching the virtio-sound effort as a Google Summer of Code project.

[PATCH 0/3] VIA PM Improvements

2023-01-29 Thread Bernhard Beschow
This series is part of my work to bring the VIA south bridges to the PC machine [1]. First it resolves a fixme in the device model by using the dedicated ACPI interrupt register for SCI routing. It then enables the device model to switch to ACPI. Finally, ACPI shutdown is implemented which guests

[PATCH 3/3] hw/isa/vt82c686: Implement ACPI powerdown

2023-01-29 Thread Bernhard Beschow
Signed-off-by: Bernhard Beschow --- hw/isa/vt82c686.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index b0765d4ed8..2db54d1649 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -33,8 +33,10 @@ #include "qapi/error.h"

[PATCH 2/3] hw/isa/vt82c686: Allow PM controller to switch to ACPI mode

2023-01-29 Thread Bernhard Beschow
Adds missing functionality the real hardware supports. Signed-off-by: Bernhard Beschow --- hw/isa/vt82c686.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 2189be6f20..b0765d4ed8 100644 --- a/hw/isa/vt82c686.c

[PATCH 1/3] hw/isa/vt82c686: Fix SCI routing

2023-01-29 Thread Bernhard Beschow
According to the PCI specification, the hardware is not supposed to use PCI_INTERRUPT_PIN for interrupt routing. Use the dedicated ACPI Interrupt Select register for SCI routing instead. Signed-off-by: Bernhard Beschow --- hw/isa/vt82c686.c | 42 ++ 1

[PATCH v2 9/9] qtest: enable vnc-display test on win32

2023-01-29 Thread marcandre . lureau
From: Marc-André Lureau Now that qtest_qmp_add_client() works on win32, we can enable the VNC test. Signed-off-by: Marc-André Lureau Acked-by: Thomas Huth --- tests/qtest/vnc-display-test.c | 5 - 1 file changed, 5 deletions(-) diff --git a/tests/qtest/vnc-display-test.c

[PATCH v2 5/9] qmp: 'add_client' actually expects sockets

2023-01-29 Thread marcandre . lureau
From: Marc-André Lureau Whether it is SPICE, VNC, D-Bus, or the socket chardev, they all actually expect a socket kind or will fail in different ways at runtime. Throw an error early if the given 'add_client' fd is not a socket, and close it to avoid leaks. This allows to replace the close()

[PATCH v2 4/9] osdep: implement qemu_socketpair() for win32

2023-01-29 Thread marcandre . lureau
From: Marc-André Lureau Manually implement a socketpair() function, using UNIX sockets and simple peer credential checking. QEMU doesn't make much use of socketpair, beside vhost-user which is not available for win32 at this point. However, I intend to use it for writing some new portable

[PATCH v2 6/9] qapi: implement conditional command arguments

2023-01-29 Thread marcandre . lureau
From: Marc-André Lureau The generated code doesn't quite handle the conditional arguments. For example, 'bar' in 'test-if-cmd' is not correctly surrounded by #if conditions. See generated code in qmp_marshal_test_if_cmd(). Note that if there are multiple optional arguments at the last position,

[PATCH v2 1/9] tests: fix path separator, use g_build_filename()

2023-01-29 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- tests/unit/test-io-channel-command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test-io-channel-command.c

[PATCH v2 7/9] qmp: teach 'getfd' to import sockets on win32

2023-01-29 Thread marcandre . lureau
From: Marc-André Lureau A process with enough capabilities can duplicate a socket to QEMU. Modify 'getfd' to import it and add it to the monitor fd list, so it can be later used by other commands. Note that we actually store the SOCKET in the FD list, appropriate care must now be taken to use

[PATCH v2 8/9] libqtest: make qtest_qmp_add_client work on win32

2023-01-29 Thread marcandre . lureau
From: Marc-André Lureau Duplicate a socket to QEMU, and add it via 'getfd' on win32. Signed-off-by: Marc-André Lureau Acked-by: Thomas Huth --- tests/qtest/libqtest.h | 2 -- tests/qtest/libqtest.c | 16 ++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git

[PATCH v2 3/9] tests/docker: fix a win32 error due to portability

2023-01-29 Thread marcandre . lureau
From: Marc-André Lureau docker.py is run during configure, and produces an error: No module named 'pwd'. Use a more portable and recommended alternative to lookup the user "login name". Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- tests/docker/docker.py | 6

[PATCH v2 2/9] tests: fix test-io-channel-command on win32

2023-01-29 Thread marcandre . lureau
From: Marc-André Lureau socat "PIPE:"" on Windows are named pipes, not fifo path names. Fixes: commit 68406d10859 ("tests/unit: cleanups for test-io-channel-command") Signed-off-by: Marc-André Lureau --- tests/unit/test-io-channel-command.c | 6 ++ 1 file changed, 6 insertions(+) diff

[PATCH v2 0/9] Various win32 fixes & teach 'getfd' QMP command to import sockets

2023-01-29 Thread marcandre . lureau
From: Marc-André Lureau Hi, The following series first fixes a few tests on win32. The second part focuses on 'add_client' support, by limiting its scope to sockets and adding win32 support. Finally, it enables vnc-display test on win32, to exercise the new code paths and demonstrate the usage.

Re: [PATCH 3/7] hw/acpi/{ich9,piix4}: Resolve redundant io_base address attributes

2023-01-29 Thread Bernhard Beschow
Am 24. Januar 2023 16:05:40 UTC schrieb Igor Mammedov : >s/resolve/remove|drop/ > >On Mon, 23 Jan 2023 15:49:29 + >Bernhard Beschow wrote: > >> Am 23. Januar 2023 07:57:08 UTC schrieb "Philippe Mathieu-Daudé" >> : >> >Hi Bernhard, >> > >> >On 22/1/23 18:07, Bernhard Beschow wrote: >> >>

Re: Please review a important patch abort fix setting of CPUX86State::gdt::base

2023-01-29 Thread Peter Maydell
On Sun, 29 Jan 2023 at 12:10, wrote: > > The patch fix bug abort settting CPUX86State::gdt::base on linux-user, the > bug can write dirty data to emulated segment registers of x86 > Patch address: > https://lists.nongnu.org/archive/html/qemu-devel/2023-01/msg00142.html > Bug description:

Re: [PATCH 5/7] hw/acpi/piix4: Fix offset of GPE0 registers

2023-01-29 Thread Bernhard Beschow
Am 25. Januar 2023 15:55:01 UTC schrieb Igor Mammedov : >On Sun, 22 Jan 2023 18:07:22 +0100 >Bernhard Beschow wrote: > >> The PIIX4 datasheet defines the GPSTS register to be at offset 0x0c of the >> power management I/O register block. This register block is represented >> in the device model

Re: [PATCH 2/7] hw/acpi/ich9: Remove unneeded assignments

2023-01-29 Thread Bernhard Beschow
Am 24. Januar 2023 16:55:37 UTC schrieb Igor Mammedov : >On Sun, 22 Jan 2023 18:07:19 +0100 >Bernhard Beschow wrote: > >> The first thing ich9_pm_iospace_update() does is to set pm->pm_io_base to >> the pm_io_base parameter. >try to explain why 'pm->pm_io_base = 0' was there , what's changed

Re: [PATCH 4/7] hw/i386/pc_q35: Resolve redundant q35_host variable

2023-01-29 Thread BALATON Zoltan
On Sun, 29 Jan 2023, Bernhard Beschow wrote: Am 27. Januar 2023 19:22:49 UTC schrieb BALATON Zoltan : On Fri, 27 Jan 2023, Bernhard Beschow wrote: The variable is redundant to "phb" and is never used by its real type. Also replace qdev_get_machine() with reference already passed to init

[PATCH v6 0/3] block/rbd: Add support for layered encryption

2023-01-29 Thread o...@il.ibm.com
v6: nit fixes v5: nit fixes v4: split to multiple commits add support for more than just luks-any in layered encryption nit fixes v3: further nit fixes suggested by @idryomov v2: nit fixes suggested by @idryomov Or Ozeri (3): block/rbd: Remove redundant stack variable passphrase_len

Re: [PATCH 4/7] hw/i386/pc_q35: Resolve redundant q35_host variable

2023-01-29 Thread Bernhard Beschow
Am 27. Januar 2023 19:22:49 UTC schrieb BALATON Zoltan : >On Fri, 27 Jan 2023, Bernhard Beschow wrote: >> The variable is redundant to "phb" and is never used by its real type. > >Also replace qdev_get_machine() with reference already passed to init >function. (Maybe worth mentioning in commit

Please review a important patch abort fix setting of CPUX86State::gdt::base

2023-01-29 Thread fanwj
The patch fix bug abort settting CPUX86State::gdt::base on linux-user, the bug can write dirty data to emulated segment registers of x86 Patch address: https://lists.nongnu.org/archive/html/qemu-devel/2023-01/msg00142.html Bug description: https://gitlab.com/qemu-project/qemu/-/issues/1405

Re: [PATCH v1 2/2] virtio-net: virtio_net_flush_tx() check for per-queue reset

2023-01-29 Thread Xuan Zhuo
On Sun, 29 Jan 2023 06:57:29 -0500, "Michael S. Tsirkin" wrote: > On Sun, Jan 29, 2023 at 04:23:08PM +0800, Xuan Zhuo wrote: > > On Sun, 29 Jan 2023 03:12:12 -0500, "Michael S. Tsirkin" > > wrote: > > > On Sun, Jan 29, 2023 at 03:28:28PM +0800, Xuan Zhuo wrote: > > > > On Sun, 29 Jan 2023

Re: [PATCH v1 2/2] virtio-net: virtio_net_flush_tx() check for per-queue reset

2023-01-29 Thread Michael S. Tsirkin
On Sun, Jan 29, 2023 at 08:03:42PM +0800, Xuan Zhuo wrote: > On Sun, 29 Jan 2023 06:57:29 -0500, "Michael S. Tsirkin" > wrote: > > On Sun, Jan 29, 2023 at 04:23:08PM +0800, Xuan Zhuo wrote: > > > On Sun, 29 Jan 2023 03:12:12 -0500, "Michael S. Tsirkin" > > > wrote: > > > > On Sun, Jan 29, 2023

Re: [PATCH v1 2/2] virtio-net: virtio_net_flush_tx() check for per-queue reset

2023-01-29 Thread Xuan Zhuo
On Sun, 29 Jan 2023 07:15:47 -0500, "Michael S. Tsirkin" wrote: > On Sun, Jan 29, 2023 at 08:03:42PM +0800, Xuan Zhuo wrote: > > On Sun, 29 Jan 2023 06:57:29 -0500, "Michael S. Tsirkin" > > wrote: > > > On Sun, Jan 29, 2023 at 04:23:08PM +0800, Xuan Zhuo wrote: > > > > On Sun, 29 Jan 2023

Re: [PATCH v1 2/2] virtio-net: virtio_net_flush_tx() check for per-queue reset

2023-01-29 Thread Michael S. Tsirkin
On Sun, Jan 29, 2023 at 04:23:08PM +0800, Xuan Zhuo wrote: > On Sun, 29 Jan 2023 03:12:12 -0500, "Michael S. Tsirkin" > wrote: > > On Sun, Jan 29, 2023 at 03:28:28PM +0800, Xuan Zhuo wrote: > > > On Sun, 29 Jan 2023 02:25:43 -0500, "Michael S. Tsirkin" > > > wrote: > > > > On Sun, Jan 29, 2023

Re: [PATCH 6/7] hw/i386/pc_{q35, piix}: Minimize usage of get_system_memory()

2023-01-29 Thread Bernhard Beschow
Am 27. Januar 2023 19:30:21 UTC schrieb BALATON Zoltan : >On Fri, 27 Jan 2023, Bernhard Beschow wrote: >> Signed-off-by: Bernhard Beschow > >Why? I'd rather replace locals with direct call to function as it's not >expensive (just returns a global) and adding a local name to it is not much

[PATCH] hw/usb/core: fix inconsistent ep and pid (UBS_TOKEN_SETUP)

2023-01-29 Thread Qiang Liu
Sometimes, `ep` is not enforced to 0 when `pid` is `USB_TOKEN_SETUP`. I trigger this through dwc2 (https://lists.gnu.org/archive/html/qemu-devel/2021-06/msg07179.html). A similar bug was found [here](https://gitlab.com/qemu-project/qemu/-/issues/119) and

[RFC v6 4/4] virtio-blk: add some trace events for zoned emulation

2023-01-29 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- hw/block/trace-events | 7 +++ hw/block/virtio-blk.c | 12 2 files changed, 19 insertions(+) diff --git a/hw/block/trace-events b/hw/block/trace-events index 2c45a62bd5..34be8b9135 100644 --- a/hw/block/trace-events +++

[RFC v6 1/4] include: update virtio_blk headers

2023-01-29 Thread Sam Li
Use scripts/update-linux-headers.sh to update virtio-blk headers from Dmitry's "virtio-blk:add support for zoned block devices" Linux patches. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Dmitry Fomichev --- include/standard-headers/linux/virtio_blk.h | 158

[RFC v6 0/4] Add zoned storage emulation to virtio-blk driver

2023-01-29 Thread Sam Li
Note: the virtio-blk headers isn't upstream in the kernel yet therefore marked as an RFC. The VIRTIO spec changes have been merged. The Linux virtio_blk guest driver patches are in Michael Tsirkin's vhost tree:

[RFC v6 2/4] virtio-blk: add zoned storage emulation for zoned devices

2023-01-29 Thread Sam Li
This patch extends virtio-blk emulation to handle zoned device commands by calling the new block layer APIs to perform zoned device I/O on behalf of the guest. It supports Report Zone, four zone oparations (open, close, finish, reset), and Append Zone. The VIRTIO_BLK_F_ZONED feature bit will only

[RFC v6 3/4] block: add accounting for zone append operation

2023-01-29 Thread Sam Li
Taking account of the new zone append write operation for zoned devices, BLOCK_ACCT_APPEND enum is introduced as other I/O request type (read, write, flush). Signed-off-by: Sam Li --- block/qapi-sysemu.c| 11 block/qapi.c | 15 ++ hw/block/virtio-blk.c

[PATCH v15 8/8] docs/zoned-storage: add zoned device documentation

2023-01-29 Thread Sam Li
Add the documentation about the zoned device support to virtio-blk emulation. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Dmitry Fomichev --- docs/devel/zoned-storage.rst | 43 ++

[PATCH v15 5/8] config: add check to block layer

2023-01-29 Thread Sam Li
Putting zoned/non-zoned BlockDrivers on top of each other is not allowed. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev --- block.c | 19 +++ block/file-posix.c | 12

[PATCH v15 3/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2023-01-29 Thread Sam Li
Add zoned device option to host_device BlockDriver. It will be presented only for zoned host block devices. By adding zone management operations to the host_block_device BlockDriver, users can use the new block layer APIs including Report Zone and four zone management operations (open, close,

[PATCH v15 7/8] block: add some trace events for new block layer APIs

2023-01-29 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- block/file-posix.c | 3 +++ block/trace-events | 2 ++ 2 files changed, 5 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index f661f202a1..5cf92608db 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -3272,6

[PATCH v15 6/8] qemu-iotests: test new zone operations

2023-01-29 Thread Sam Li
We have added new block layer APIs of zoned block devices. Test it as follows: Run each zone operation on a newly created null_blk device and see whether the logs show the correct zone information. By: $ ./tests/qemu-iotests/tests/zoned.sh Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi ---

[PATCH v15 2/8] file-posix: introduce helper functions for sysfs attributes

2023-01-29 Thread Sam Li
Use get_sysfs_str_val() to get the string value of device zoned model. Then get_sysfs_zoned_model() can convert it to BlockZoneModel type of QEMU. Use get_sysfs_long_val() to get the long value of zoned device information. Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke Reviewed-by: Stefan

[PATCH v15 4/8] raw-format: add zone operations to pass through requests

2023-01-29 Thread Sam Li
raw-format driver usually sits on top of file-posix driver. It needs to pass through requests of zone commands. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev --- block/raw-format.c | 13 +

[PATCH v15 0/8] Add support for zoned device

2023-01-29 Thread Sam Li
Zoned Block Devices (ZBDs) devide the LBA space to block regions called zones that are larger than the LBA size. It can only allow sequential writes, which reduces write amplification in SSD, leading to higher throughput and increased capacity. More details about ZBDs can be found at:

[PATCH v15 1/8] include: add zoned device structs

2023-01-29 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke --- include/block/block-common.h | 43 1 file changed, 43 insertions(+) diff --git a/include/block/block-common.h b/include/block/block-common.h

Re: [PATCH 3/9] igb: implement VFRE and VFTE registers

2023-01-29 Thread Akihiko Odaki
On 2023/01/28 22:46, Sriram Yagnaraman wrote: Also add checks for RXDCTL/TXDCTL queue enable bits Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 42 +++--- hw/net/igb_regs.h | 3 ++- 2 files changed, 33 insertions(+), 12 deletions(-) diff

  1   2   >