Re: [PATCH] hw/ppc: ppc440_uc: avoid multiply overflow in dcr_write_dma()

2022-08-05 Thread BALATON Zoltan
On Fri, 5 Aug 2022, Daniel Henrique Barboza wrote: Coverity reports a OVERFLOW_BEFORE_WIDEN issue in dcr_write_dma(). When handling the DMA0_CR switch we're doing a multiplication between two integers (count and width), and the product is assigned to an uint64_t (xferlen). The int32 product can b

Re: [PULL 0/7] loongarch patch queue

2022-08-05 Thread Richard Henderson
ository at: https://gitlab.com/rth7680/qemu.git tags/pull-la-20220805 for you to fetch changes up to 2f149c759ff352399e7a0eca25a62388822d7d13: target/loongarch: Update gdb_set_fpu() and gdb_get_fpu() (2022-08-05 10:0

Re: [PULL 0/6] Misc next patches

2022-08-05 Thread Richard Henderson
On 8/5/22 08:20, Daniel P. Berrangé wrote: The following changes since commit 09ed077d7fae5f825e18ff9a2004dcdd1b165edb: Merge tag 'trivial-branch-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging (2022-08-04 17:21:13 -0700) are available in the Git repository at:

[PATCH] hw/ppc: ppc440_uc: avoid multiply overflow in dcr_write_dma()

2022-08-05 Thread Daniel Henrique Barboza
Coverity reports a OVERFLOW_BEFORE_WIDEN issue in dcr_write_dma(). When handling the DMA0_CR switch we're doing a multiplication between two integers (count and width), and the product is assigned to an uint64_t (xferlen). The int32 product can be overflow before widened. Fix it by casting the fir

Re: [PATCH v2 3/4] target/i386: Make translator stop before the end of a page

2022-08-05 Thread Richard Henderson
On 8/5/22 09:09, Ilya Leoshkevich wrote: @@ -4568,9 +4598,19 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) s->rip_offset = 0; /* for relative ip address */ s->vex_l = 0; s->vex_v = 0; -if (sigsetjmp(s->jmpbuf, 0) != 0) { +disas_save(&snapshot, s); +

[PULL 7/7] target/loongarch: Update gdb_set_fpu() and gdb_get_fpu()

2022-08-05 Thread Richard Henderson
From: Song Gao GDB LoongArch fpu use fcc register, update gdb_set_fpu() and gdb_get_fpu() to match it. Signed-off-by: Song Gao Reviewed-by: Richard Henderson Acked-by: Alex Bennée Message-Id: <20220805033523.1416837-6-gaos...@loongson.cn> --- target/loongarch/internals.h| 3 +++ linux-u

[PULL 4/7] target/loongarch: add gdb_arch_name()

2022-08-05 Thread Richard Henderson
From: Song Gao Matches bfd/cpu-loongarch.c, bfd_loongarch_arch. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Acked-by: Alex Bennée Message-Id: <20220805033523.1416837-3-gaos...@loongson.cn> --- target/loongarch/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/

[PULL 3/7] target/loongarch: Fix GDB get the wrong pc

2022-08-05 Thread Richard Henderson
From: Song Gao GDB LoongArch add a register orig_a0, see the base64.xml [1]. We should add the orig_a0 to match the upstream GDB. [1]: https://github.com/bminor/binutils-gdb/blob/master/gdb/features/loongarch/base64.xml Signed-off-by: Song Gao Reviewed-by: Richard Henderson Acked-by: Alex Be

[PULL 6/7] target/loongarch: Update loongarch-fpu.xml

2022-08-05 Thread Richard Henderson
From: Song Gao Rename loongarch-fpu64.xml to loongarch-fpu.xml and update loongarch-fpu.xml to match upstream GDB [1] [1]:https://github.com/bminor/binutils-gdb/blob/master/gdb/features/loongarch/fpu.xml Signed-off-by: Song Gao Reviewed-by: Richard Henderson Acked-by: Alex Bennée Message-Id:

[PULL 1/7] target/loongarch: Fix macros SET_FPU_* in cpu.h

2022-08-05 Thread Richard Henderson
From: Qi Hu The macros SET_FPU_* are used to set corresponding bits of fcsr. Unfortunately it forgets to set the result and it causes fcsr's "CAUSE" never being updated. This patch is to fix this bug. Signed-off-by: Qi Hu Reviewed-by: Song Gao Message-Id: <20220804132450.314329-1-h...@loongson

[PULL 5/7] target/loongarch: update loongarch-base64.xml

2022-08-05 Thread Richard Henderson
From: Song Gao Update loongarch-base64.xml to match the upstream GDB [1]. [1]:https://github.com/bminor/binutils-gdb/blob/master/gdb/features/loongarch/base64.xml Reviewed-by: Richard Henderson Signed-off-by: Song Gao Acked-by: Alex Bennée Message-Id: <20220805033523.1416837-4-gaos...@loongs

[PULL 2/7] hw/loongarch: remove acpi-build.c unused variable 'aml_len'

2022-08-05 Thread Richard Henderson
From: Song Gao Fix a compiler warning on openbsd: ../src/hw/loongarch/acpi-build.c:416:12: warning: variable 'aml_len' set but not used [-Wunused-but-set-variable] size_t aml_len = 0; ^ Reported-by: Peter Maydell Signed-off-by: Song Gao Reviewed-by: Richard Henderson Message-Id

[PULL 0/7] loongarch patch queue

2022-08-05 Thread Richard Henderson
u.git tags/pull-la-20220805 for you to fetch changes up to 2f149c759ff352399e7a0eca25a62388822d7d13: target/loongarch: Update gdb_set_fpu() and gdb_get_fpu() (2022-08-05 10:02:40 -0700) LoongArch updates: Store value in SET_FP

Re: [PATCH v7 08/14] KVM: Rename mmu_notifier_*

2022-08-05 Thread Paolo Bonzini
On 7/29/22 21:02, Sean Christopherson wrote: If we really want a different name, I'd vote for nomenclature that captures the invalidation aspect, which is really what the variables are all trackng, e.g. mmu_invalidate_seq mmu_invalidate_in_progress mmu_invalidate_range_start mmu_inva

Re: [PATCH v2 12/20] ppc/ppc405: QOM'ify EBC

2022-08-05 Thread BALATON Zoltan
On Fri, 5 Aug 2022, BALATON Zoltan wrote: On Fri, 5 Aug 2022, Peter Maydell wrote: On Fri, 5 Aug 2022 at 17:50, BALATON Zoltan wrote: This also allows to get the cpu without a link with something like: PPC4XX_MACHINE(current_machine /* or qdev_get_machine() */)->soc.cpu ...and now you have

Re: [PATCH v2 2/4] target/s390x: Make translator stop before the end of a page

2022-08-05 Thread Richard Henderson
On 8/5/22 09:09, Ilya Leoshkevich wrote: Right now translator stops right *after* the end of a page, which breaks reporting of fault locations when the last instruction of a multi-insn translation block crosses a page boundary. Signed-off-by: Ilya Leoshkevich --- include/exec/translator.h

[PATCH v2 2/4] target/s390x: Make translator stop before the end of a page

2022-08-05 Thread Ilya Leoshkevich
Right now translator stops right *after* the end of a page, which breaks reporting of fault locations when the last instruction of a multi-insn translation block crosses a page boundary. Signed-off-by: Ilya Leoshkevich --- include/exec/translator.h| 10 ++ target/s390x/tcg/translate.

[PATCH v2 0/4] linux-user: Fix siginfo_t contents when jumping to non-readable pages

2022-08-05 Thread Ilya Leoshkevich
Hi, I noticed that when we get a SEGV due to jumping to non-readable memory, sometimes si_addr and program counter in siginfo_t are slightly off. I tracked this down to the assumption that translators stop before the end of a page, while in reality they may stop right after it. Patch 1 fixes a mi

[PATCH v2 3/4] target/i386: Make translator stop before the end of a page

2022-08-05 Thread Ilya Leoshkevich
Right now translator stops right *after* the end of a page, which breaks reporting of fault locations when the last instruction of a multi-insn translation block crosses a page boundary. We may find out that we crossed page boundary after some ops were emitted and cc_op was updated. In theory it m

Re: [PATCH v7 01/14] mm: Add F_SEAL_AUTO_ALLOCATE seal to memfd

2022-08-05 Thread David Hildenbrand
On 05.08.22 19:55, Paolo Bonzini wrote: > On 7/21/22 11:44, David Hildenbrand wrote: >> >> Also, I*think* you can place pages via userfaultfd into shmem. Not >> sure if that would count "auto alloc", but it would certainly bypass >> fallocate(). > > Yeah, userfaultfd_register would probably have

Re: [PATCH v3] hw/i386: place setup_data at fixed place in memory

2022-08-05 Thread Ard Biesheuvel
On Fri, 5 Aug 2022 at 19:29, Paolo Bonzini wrote: > > On 8/5/22 13:08, Ard Biesheuvel wrote: > >> > >> Does it work to place setup_data at the end of the cmdline file instead > >> of having it at the end of the kernel file? This way the first item > >> will be at 0x2 + cmdline_size. > >> > >

Re: [PATCH v7 01/14] mm: Add F_SEAL_AUTO_ALLOCATE seal to memfd

2022-08-05 Thread Paolo Bonzini
On 7/21/22 11:44, David Hildenbrand wrote: Also, I*think* you can place pages via userfaultfd into shmem. Not sure if that would count "auto alloc", but it would certainly bypass fallocate(). Yeah, userfaultfd_register would probably have to forbid this for F_SEAL_AUTO_ALLOCATE vmas. Maybe

Re: [PATCH v2 1/4] accel/tcg: Invalidate translations when clearing PAGE_READ

2022-08-05 Thread Richard Henderson
On 8/5/22 09:09, Ilya Leoshkevich wrote: After mprotect(addr, PROT_NONE), addr can still be executed if there are cached translations. Drop them. Signed-off-by: Ilya Leoshkevich --- accel/tcg/translate-all.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git

Re: [PATCH v2 1/4] accel/tcg: Invalidate translations when clearing PAGE_READ

2022-08-05 Thread Peter Maydell
On Fri, 5 Aug 2022 at 18:33, Ilya Leoshkevich wrote: > > After mprotect(addr, PROT_NONE), addr can still be executed if there > are cached translations. Drop them. > > Signed-off-by: Ilya Leoshkevich > --- > accel/tcg/translate-all.c | 17 - > 1 file changed, 12 insertions(+), 5

Re: [PATCH v7 00/14] qapi: net: add unix socket type support to netdev backend

2022-08-05 Thread Stefano Brivio
On Fri, 22 Jul 2022 21:04:28 +0200 Laurent Vivier wrote: > "-netdev socket" only supports inet sockets. > > It's not a complex task to add support for unix sockets, but > the socket netdev parameters are not defined to manage well unix > socket parameters. > > As discussed in: > > "socket.c

[PATCH v2 1/4] accel/tcg: Invalidate translations when clearing PAGE_READ

2022-08-05 Thread Ilya Leoshkevich
After mprotect(addr, PROT_NONE), addr can still be executed if there are cached translations. Drop them. Signed-off-by: Ilya Leoshkevich --- accel/tcg/translate-all.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/tran

Re: libslirp and static linking

2022-08-05 Thread Paolo Bonzini
On 8/5/22 18:13, Peter Maydell wrote: Hi; I noticed today that Debian's libslirp-dev package doesn't ship a static library version of libslirp. I was going to file a Debian bug about that, but then looking at upstream 'libslirp' I found that its README.md https://gitlab.freedesktop.org/slirp/libs

Re: [PATCH v3] hw/i386: place setup_data at fixed place in memory

2022-08-05 Thread Paolo Bonzini
On 8/5/22 13:08, Ard Biesheuvel wrote: Does it work to place setup_data at the end of the cmdline file instead of having it at the end of the kernel file? This way the first item will be at 0x2 + cmdline_size. Does QEMU always allocate the command line statically like that? AFAIK, OVMF ne

Re: [PATCH 0/2] Floating-point OE/UE exception bug

2022-08-05 Thread Daniel Henrique Barboza
Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks, Daniel On 8/5/22 11:15, Lucas Mateus Castro(alqotel) wrote: From: "Lucas Mateus Castro (alqotel)" Changes in v2: - Completely reworked the solution: * Created re_bias in FloatFmt, it is 3/4 of the total exponent

Re: [PATCH 2/2] target/ppc: Bugfix FP when OE/UE are set

2022-08-05 Thread Daniel Henrique Barboza
On 8/5/22 14:17, Richard Henderson wrote: On 8/5/22 07:15, Lucas Mateus Castro(alqotel) wrote: From: "Lucas Mateus Castro (alqotel)" When an overflow exception occurs and OE is set the intermediate result should be adjusted (by subtracting from the exponent) to avoid rounding to inf. The sa

[PATCH] vl: remove dead code in parse_memory_options()

2022-08-05 Thread Paolo Bonzini
mem_str will never be an empty string, because qemu_opt_get_size() fails if it encounters one: $ ./qemu-system-x86_64 -m size= qemu-system-x86_64: -m size=: Parameter size expects a non-negative number below 2^64 Optional suffix k, M, G, T, P or E means kilo-, mega-, giga-, tera-, peta-

[PATCH v2] vl: fix [memory] section with -readconfig

2022-08-05 Thread Paolo Bonzini
The -M memory.* options do not have magic applied to them than the -m option, namely no "M" (for mebibytes) is tacked at the end of a suffixless value for "-M memory.size". This magic is performed by parse_memory_options, and we have to do it for both "-m" and the [memory] section of a config file

Re: [PATCH 2/2] target/ppc: Bugfix FP when OE/UE are set

2022-08-05 Thread Richard Henderson
On 8/5/22 07:15, Lucas Mateus Castro(alqotel) wrote: From: "Lucas Mateus Castro (alqotel)" When an overflow exception occurs and OE is set the intermediate result should be adjusted (by subtracting from the exponent) to avoid rounding to inf. The same applies to an underflow exceptionion and UE

Re: [PATCH for-7.1] vl: fix [memory] section with -readconfig

2022-08-05 Thread Paolo Bonzini
On 8/5/22 15:40, Markus Armbruster wrote: +loc_push_none(&loc); +qemu_opts_loc_restore(opts); + prop = qdict_new(); if (qemu_opt_get_size(opts, "size", 0) != 0) { This treats "size=0" like absent size. Before commit ce9d03fb3f, we instead checked mem_str = qemu_o

Re: [PATCH 1/2] fpu: Add rebias bool, value and operation

2022-08-05 Thread Richard Henderson
On 8/5/22 07:15, Lucas Mateus Castro(alqotel) wrote: From: "Lucas Mateus Castro (alqotel)" Added the possibility of recalculating a result if it overflows or underflows, if the result overflow and the rebias bool is true then the intermediate result should have 3/4 of the total range subtracted

Re: [PATCH 0/2] Floating-point OE/UE exception bug

2022-08-05 Thread Richard Henderson
On 8/5/22 07:15, Lucas Mateus Castro(alqotel) wrote: Currently there's no test in this patch series as there's no way to disable MSR.FE0 and MSR.FE1 in linux user, so any overflow/underflow exception with OE/UE set causes a trapping exception. You could check the value in the fp register in the

Re: [PATCH v2 12/20] ppc/ppc405: QOM'ify EBC

2022-08-05 Thread BALATON Zoltan
On Fri, 5 Aug 2022, Peter Maydell wrote: On Fri, 5 Aug 2022 at 17:50, BALATON Zoltan wrote: This also allows to get the cpu without a link with something like: PPC4XX_MACHINE(current_machine /* or qdev_get_machine() */)->soc.cpu ...and now you have device code that's making assumptions about

Re: [PATCH 0/2] Floating-point OE/UE exception bug

2022-08-05 Thread Lucas Mateus Martins Araujo e Castro
It's missing from the title but this is a v2. v1 id: Message-Id: <20220803122217.20847-1-lucas.ara...@eldorado.org.br> On 05/08/2022 11:15, Lucas Mateus Castro(alqotel) wrote: From: "Lucas Mateus Castro (alqotel)" Changes in v2: - Completely reworked the solution: * Created re_bi

Re: [PATCH 0/2] Floating-point OE/UE exception bug

2022-08-05 Thread Lucas Mateus Martins Araujo e Castro
On 05/08/2022 13:20, Alex Bennée wrote: "Lucas Mateus Castro(alqotel)" writes: From: "Lucas Mateus Castro (alqotel)" Changes in v2: - Completely reworked the solution: * Created re_bias in FloatFmt, it is 3/4 of the total exponent range of a FP type I thought this m

Re: [PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len'

2022-08-05 Thread Richard Henderson
On 7/20/22 21:00, Song Gao wrote: @@ -413,7 +413,6 @@ static void acpi_build(AcpiBuildTables *tables, MachineState *machine) AcpiFadtData fadt_data; unsigned facs, rsdt, fadt, dsdt; uint8_t *u; -size_t aml_len = 0; ... @@ -451,7 +444,6 @@ static void acpi_build(AcpiBuildT

Re: [PATCH v2 12/20] ppc/ppc405: QOM'ify EBC

2022-08-05 Thread Peter Maydell
On Fri, 5 Aug 2022 at 17:50, BALATON Zoltan wrote: > This also > allows to get the cpu without a link with something like: > > PPC4XX_MACHINE(current_machine /* or qdev_get_machine() */)->soc.cpu ...and now you have device code that's making assumptions about the machine and SoC it's in. Just do

Re: [PATCH v2 12/20] ppc/ppc405: QOM'ify EBC

2022-08-05 Thread BALATON Zoltan
On Fri, 5 Aug 2022, Peter Maydell wrote: On Fri, 5 Aug 2022 at 13:55, BALATON Zoltan wrote: I know this is a mess curently but QOM is full of boilerplate code which is confusing for new people and makes it hard to undestand the code. So cutting down the boilerplate and making things simpler wou

[PATCH v4 6/6] vdpa: Always start CVQ in SVQ mode

2022-08-05 Thread Eugenio Pérez
Isolate control virtqueue in its own group, allowing to intercept control commands but letting dataplane run totally passthrough to the guest. Signed-off-by: Eugenio Pérez --- v4: * Squash vhost_vdpa_cvq_group_is_independent. * Rebased on last CVQ start series, that allocated CVQ cmd bufs at load

[PATCH v4 4/6] vdpa: Add asid parameter to vhost_vdpa_dma_map/unmap

2022-08-05 Thread Eugenio Pérez
So the caller can choose which ASID is destined. No need to update the batch functions as they will always be called from memory listener updates at the moment. Memory listener updates will always update ASID 0, as it's the passthrough ASID. All vhost devices's ASID are 0 at this moment. Signed-

[PATCH v4 3/6] vdpa: Allocate SVQ unconditionally

2022-08-05 Thread Eugenio Pérez
SVQ may run or not in a device depending on runtime conditions (for example, if the device can move CVQ to its own group or not). Allocate the resources unconditionally, and decide later if to use them or not. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 33 +++-

[PATCH v4 1/6] linux-headers: Update kernel headers

2022-08-05 Thread Eugenio Pérez
Main reason is for new vhost_vdpa address space ioctls to be available. Update kernel headers until 9de1f9c8ca51 ("Merge tag 'irq-core-2022-08-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip"). Signed-off-by: Eugenio Pérez --- include/standard-headers/asm-x86/bootparam.h | 7 +-

[PATCH v4 5/6] vdpa: Store x-svq parameter in VhostVDPAState

2022-08-05 Thread Eugenio Pérez
CVQ can be shadowed two ways: - Device has x-svq=on parameter (current way) - The device can isolate CVQ in its own vq group QEMU needs to check for the second condition dynamically, because CVQ index is not known at initialization time. Since this is dynamic, the CVQ isolation could vary with dif

[PATCH v4 2/6] vdpa: Use v->shadow_vqs_enabled in vhost_vdpa_svqs_start & stop

2022-08-05 Thread Eugenio Pérez
This function used to trust in v->shadow_vqs != NULL to know if it must start svq or not. This is not going to be valid anymore, as qemu is going to allocate svq unconditionally (but it will only start them conditionally). Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 4 ++-- 1 file

[PATCH v4 0/6] ASID support in vhost-vdpa net

2022-08-05 Thread Eugenio Pérez
Control VQ is the way net devices use to send changes to the device state, like the number of active queues or its mac address. QEMU needs to intercept this queue so it can track these changes and is able to migrate the device. It can do it from 1576dbb5bbc4 ("vdpa: Add x-svq to NetdevVhostVDPAOpt

[PATCH v2 4/4] tests/tcg: Test siginfo_t contents when jumping to non-readable pages

2022-08-05 Thread Ilya Leoshkevich
Add x86_64 and s390x tests to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/noexec.h | 114 tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/noexec.c | 145 +++ tests/tcg/x86_64/Makefile.targ

Re: [PATCH 0/2] Floating-point OE/UE exception bug

2022-08-05 Thread Alex Bennée
"Lucas Mateus Castro(alqotel)" writes: > From: "Lucas Mateus Castro (alqotel)" > > Changes in v2: > - Completely reworked the solution: > * Created re_bias in FloatFmt, it is 3/4 of the total exponent > range of a FP type I thought this might have an effect on the effici

libslirp and static linking

2022-08-05 Thread Peter Maydell
Hi; I noticed today that Debian's libslirp-dev package doesn't ship a static library version of libslirp. I was going to file a Debian bug about that, but then looking at upstream 'libslirp' I found that its README.md https://gitlab.freedesktop.org/slirp/libslirp only documents how to build a share

[PATCH 3/5] hw/riscv: virt: Fix the plic's address cells

2022-08-05 Thread Conor Dooley
From: Conor Dooley When optional AIA PLIC support was added the to the virt machine, the address cells property was removed leading the issues with dt-validate on a dump from the virt machine: /stuff/qemu/qemu.dtb: plic@c00: '#address-cells' is a required property From schema: /stuff

[PATCH 4/5] hw/riscv: virt: fix syscon subnode paths

2022-08-05 Thread Conor Dooley
From: Conor Dooley The subnodes of the syscon have been added to the incorrect paths. Rather than add them as subnodes, they were originally added to "/foo" and a later patch moved them to "/soc/foo". Both are incorrect & they should have been added as "/soc/test@###/foo" as "/soc/test" is the sy

[PATCH 1/5] target/riscv: Ignore the S and U letters when formatting ISA strings

2022-08-05 Thread Conor Dooley
From: Palmer Dabbelt The ISA strings we're providing from QEMU aren't actually legal RISC-V ISA strings, as both S and U cannot exist as single-letter extensions and must instead be multi-letter strings. We're still using the ISA strings inside QEMU to track the availiable extensions, so just st

[PATCH 5/5] hw/core: fix platform bus node name

2022-08-05 Thread Conor Dooley
From: Conor Dooley "platform" is not a valid name for a bus node in dt-schema, so warnings can be see in dt-validate on a dump of the riscv virt dtb: /stuff/qemu/qemu.dtb: platform@400: $nodename:0: 'platform@400' does not match '^([a-z][a-z0-9\\-]+-bus|bus|soc|axi|ahb|apb)(@[0-9a-f]+)?

[PATCH 2/5] hw/riscv: virt: fix uart node name

2022-08-05 Thread Conor Dooley
From: Conor Dooley "uart" is not a node name that complies with the dt-schema. Change the node name to "serial" to ix warnings seen during dt-validate on a dtbdump of the virt machine such as: /stuff/qemu/qemu.dtb: uart@1000: $nodename:0: 'uart@1000' does not match '^serial(@.*)?$'

[PATCH 0/5] QEMU: Fix RISC-V virt & spike machines' dtbs

2022-08-05 Thread Conor Dooley
From: Conor Dooley The device trees produced automatically for the virt and spike machines fail dt-validate on several grounds. Some of these need to be fixed in the linux kernel's dt-bindings, but others are caused by bugs in QEMU. Patch one of this series is lifted from an earlier submission by

[PATCH v2 3/3] iotests, parallels: Add a test for duplicated clusters

2022-08-05 Thread alexander . ivanov
From: Alexander Ivanov Check if original and duplicated offsets refer to the same cluster. Repair the image and check that writing to a referred cluster doesn't affects another referred cluster. Signed-off-by: Natalia Kuzmina Signed-off-by: Alexander Ivanov --- tests/qemu-iotests/314

Re: [PATCH RFC 7/7] vl: Allow ThreadContext objects to be created before the sandbox option

2022-08-05 Thread David Hildenbrand
On 05.08.22 13:01, Michal Prívozník wrote: > On 7/21/22 14:07, David Hildenbrand wrote: >> Currently, there is no way to configure a CPU affinity inside QEMU when >> the sandbox option disables it for QEMU as a whole, for example, via: >> -sandbox enable=on,resourcecontrol=deny >> >> While Thre

[PATCH v2 1/3] parallels: Put the image checks in separate functions

2022-08-05 Thread alexander . ivanov
From: Alexander Ivanov We will add more and more checks of images so we need to reorganize the code. Put each check to a separate helper function with a separate loop. Add two helpers: truncate_file() and sync_header(). They will be used in multiple functions. Signed-off-by: Alexander Ivanov --

[PATCH v2 2/3] parallels: Add checking and repairing duplicate offsets in BAT

2022-08-05 Thread alexander . ivanov
From: Alexander Ivanov There could be corruptions in the image file: two guest memory areas refer to the same host cluster. If a duplicate offset is found fix it by copying the content of the referred cluster to a new allocated cluster and replace one of the two referring entries by the new clus

[PATCH v2 0/3] Check and repair duplicated clusters in parallels images

2022-08-05 Thread alexander . ivanov
From: Alexander Ivanov We will add more and more checks of images so we need to reorganize the code. Put each check to a separate helper function with a separate loop. Add two helpers: truncate_file() and sync_header(). They will be used in multiple functions. Parallels image file can be corrupt

Re: [PATCH RFC 0/7] hostmem: NUMA-aware memory preallocation using ThreadContext

2022-08-05 Thread David Hildenbrand
> > I've timed 'virsh start' with a guest that has 47GB worth of 1GB > hugepages and seen the startup time halved basically (from 10.5s to > 5.6s). The host has 4 NUMA nodes and I'm pinning the guest onto two nodes. > > I've written libvirt counterpart (which I'll post as soon as these are > merg

Re: [PATCH for-7.1 v2 0/5] Fix gdb bugs and update gdb-xml

2022-08-05 Thread Richard Henderson
On 8/4/22 20:35, Song Gao wrote: Hi,All This series fiex LoongArch GDB get the wrong pc, because the xml missing the register orig_a0, and update loongarch gdb-xml to match GDB[1] [1]:https://github.com/bminor/binutils-gdb/blob/master/gdb/features/loongarch Please review! V2: - Update o

Re: [PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len'

2022-08-05 Thread Richard Henderson
On 7/20/22 21:00, Song Gao wrote: Fix a compiler warning on openbsd: ../src/hw/loongarch/acpi-build.c:416:12: warning: variable 'aml_len' set but not used [-Wunused-but-set-variable] size_t aml_len = 0; ^ Reported-by: Peter Maydell Signed-off-by: Song Gao --- hw/loongarch/ac

[PULL 6/6] util/qemu-sockets: Replace the call to close a socket with closesocket()

2022-08-05 Thread Daniel P . Berrangé
From: Bin Meng close() is a *nix function. It works on any file descriptor, and sockets in *nix are an example of a file descriptor. closesocket() is a Windows-specific function, which works only specifically with sockets. Sockets on Windows do not use *nix-style file descriptors, and socket() r

[PULL 2/6] QIOChannelSocket: Add support for MSG_ZEROCOPY + IPV6

2022-08-05 Thread Daniel P . Berrangé
From: Leonardo Bras For using MSG_ZEROCOPY, there are two steps: 1 - io_writev() the packet, which enqueues the packet for sending, and 2 - io_flush(), which gets confirmation that all packets got correctly sent Currently, if MSG_ZEROCOPY is used to send packets over IPV6, no error will be repor

[PULL 4/6] target/s390x: display deprecation status in '-cpu help'

2022-08-05 Thread Daniel P . Berrangé
When the user queries CPU models via QMP there is a 'deprecated' flag present, however, this is not done for the CLI '-cpu help' command. Reviewed-by: Cornelia Huck Signed-off-by: Daniel P. Berrangé --- target/s390x/cpu_models.c | 23 ++- 1 file changed, 18 insertions(+), 5

[PULL 0/6] Misc next patches

2022-08-05 Thread Daniel P . Berrangé
The following changes since commit 09ed077d7fae5f825e18ff9a2004dcdd1b165edb: Merge tag 'trivial-branch-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging (2022-08-04 17:21:13 -0700) are available in the Git repository at: https://gitlab.com/berrange/qemu tags/misc-

[PULL 5/6] target/arm: display deprecation status in '-cpu help'

2022-08-05 Thread Daniel P . Berrangé
When the user queries CPU models via QMP there is a 'deprecated' flag present, however, this is not done for the CLI '-cpu help' command. Reviewed-by: Cornelia Huck Signed-off-by: Daniel P. Berrangé --- target/arm/helper.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git

[PULL 1/6] docs: build-platforms: Clarify stance on minor releases and backports

2022-08-05 Thread Daniel P . Berrangé
From: Andrea Bolognani These changes match those made in the following libvirt commits: 2ac78307af docs: Clarify our stance on backported packages 78cffd450a docs: Spell out our policy concerning minor releases Since QEMU's platform support policy is based on libvirt's, it makes sense to mi

[PULL 3/6] target/i386: display deprecation status in '-cpu help'

2022-08-05 Thread Daniel P . Berrangé
When the user queries CPU models via QMP there is a 'deprecated' flag present, however, this is not done for the CLI '-cpu help' command. Reviewed-by: Cornelia Huck Signed-off-by: Daniel P. Berrangé --- target/i386/cpu.c | 5 + 1 file changed, 5 insertions(+) diff --git a/target/i386/cpu.c

Re: [PATCH] target/loongarch: Fix macros SET_FPU_* in cpu.h

2022-08-05 Thread Richard Henderson
On 8/4/22 06:24, Qi Hu wrote: The macros SET_FPU_* are used to set corresponding bits of fcsr. Unfortunately it forgets to set the result and it causes fcsr's "CAUSE" never being updated. This patch is to fix this bug. Signed-off-by: Qi Hu --- target/loongarch/cpu.h | 18 +++---

Re: [PATCH for-7.1 v2 5/5] target/loongarch: Update gdb_set_fpu() and gdb_get_fpu()

2022-08-05 Thread Richard Henderson
On 8/4/22 20:35, Song Gao wrote: GDB LoongArch fpu use fcc register, update gdb_set_fpu() and gdb_get_fpu() to match it. Signed-off-by: Song Gao --- linux-user/loongarch64/signal.c | 24 ++- target/loongarch/gdbstub.c | 34 ++--- target/

Re: [PATCH 2/2] util/aio-win32: Correct the event array size in aio_poll()

2022-08-05 Thread Stefan Weil via
Am 05.08.22 um 16:56 schrieb Bin Meng: From: Bin Meng WaitForMultipleObjects() can only wait for MAXIMUM_WAIT_OBJECTS object handles. Correct the event array size in aio_poll() and add a assert() to ensure it does not cause out of bound access. Signed-off-by: Bin Meng --- util/aio-win32.c

Re: [PATCH for-7.1 v2 4/5] target/loongarch: Update loongarch-fpu.xml

2022-08-05 Thread Richard Henderson
On 8/4/22 20:35, Song Gao wrote: Rename loongarch-fpu64.xml to loongarch-fpu.xml and update loongarch-fpu.xml to match upstream GDB [1] [1]:https://github.com/bminor/binutils-gdb/blob/master/gdb/features/loongarch/fpu.xml Signed-off-by: Song Gao --- configs/targets/loongarch64-softmmu.mak |

Re: [PATCH for-7.1 v2 1/5] target/loongarch: Fix GDB get the wrong pc

2022-08-05 Thread Richard Henderson
On 8/4/22 20:35, Song Gao wrote: GDB LoongArch add a register orig_a0, see the base64.xml [1]. We should add the orig_a0 to match the upstream GDB. [1]:https://github.com/bminor/binutils-gdb/blob/master/gdb/features/loongarch/base64.xml Signed-off-by: Song Gao --- gdb-xml/loongarch-base64.xml

Re: [PATCH] vmxnet3: add stub for encapsulation offload

2022-08-05 Thread Thomas Huth
On 07/08/2021 00.23, Alexander Bulekov wrote: Encapsulation offload (offload mode 1) is a valid mode present in the kernel that isn't implemented in QEMU, yet. https://lore.kernel.org/lkml/20200528015426.8285-4-dos...@vmware.com/ Add a stub for this mode, to avoid the guest-triggerable assertio

Re: [PATCH v2 00/11] Refactor bdrv_try_set_aio_context using transactions

2022-08-05 Thread Emanuele Giuseppe Esposito
Am 05/08/2022 um 16:35 schrieb Vladimir Sementsov-Ogievskiy: > On 8/5/22 16:22, Emanuele Giuseppe Esposito wrote: >> >> >> Am 27/07/2022 um 18:13 schrieb Vladimir Sementsov-Ogievskiy: >>> On 7/25/22 15:21, Emanuele Giuseppe Esposito wrote: The aim of this series is to reorganize bdrv_try_se

[PATCH 2/2] util/aio-win32: Correct the event array size in aio_poll()

2022-08-05 Thread Bin Meng
From: Bin Meng WaitForMultipleObjects() can only wait for MAXIMUM_WAIT_OBJECTS object handles. Correct the event array size in aio_poll() and add a assert() to ensure it does not cause out of bound access. Signed-off-by: Bin Meng --- util/aio-win32.c | 3 ++- 1 file changed, 2 insertions(+),

[PATCH 1/2] util/main-loop: Fix maximum number of wait objects for win32

2022-08-05 Thread Bin Meng
From: Bin Meng The maximum number of wait objects for win32 should be MAXIMUM_WAIT_OBJECTS, not MAXIMUM_WAIT_OBJECTS + 1. Signed-off-by: Bin Meng --- util/main-loop.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/main-loop.c b/util/main-loop.c index f00a2545

Re: [PATCH] hw/net: Discard overly fragmented packets

2022-08-05 Thread Thomas Huth
On 11/08/2021 06.08, Jason Wang wrote: 在 2021/8/4 上午9:43, Jason Wang 写道: 在 2021/8/3 下午5:51, Philippe Mathieu-Daudé 写道: On 8/3/21 11:33 AM, Thomas Huth wrote: On 05/07/2021 10.40, Philippe Mathieu-Daudé wrote: Our infrastructure can handle fragmented packets up to NET_MAX_FRAG_SG_LIST (64) p

Re: [PATCH v2 00/11] Refactor bdrv_try_set_aio_context using transactions

2022-08-05 Thread Vladimir Sementsov-Ogievskiy
On 8/5/22 16:36, Emanuele Giuseppe Esposito wrote: Am 05/08/2022 um 15:22 schrieb Emanuele Giuseppe Esposito: Am 27/07/2022 um 18:13 schrieb Vladimir Sementsov-Ogievskiy: On 7/25/22 15:21, Emanuele Giuseppe Esposito wrote: The aim of this series is to reorganize bdrv_try_set_aio_context an

Re: [PATCH v2 00/11] Refactor bdrv_try_set_aio_context using transactions

2022-08-05 Thread Vladimir Sementsov-Ogievskiy
On 8/5/22 16:22, Emanuele Giuseppe Esposito wrote: Am 27/07/2022 um 18:13 schrieb Vladimir Sementsov-Ogievskiy: On 7/25/22 15:21, Emanuele Giuseppe Esposito wrote: The aim of this series is to reorganize bdrv_try_set_aio_context and drop BDS ->set_aio_context and ->can_set_aio_ctx callbacks i

[PATCH 1/2] fpu: Add rebias bool, value and operation

2022-08-05 Thread Lucas Mateus Castro(alqotel)
From: "Lucas Mateus Castro (alqotel)" Added the possibility of recalculating a result if it overflows or underflows, if the result overflow and the rebias bool is true then the intermediate result should have 3/4 of the total range subtracted from the exponent. The same for underflow but it shoul

[PATCH 2/2] target/ppc: Bugfix FP when OE/UE are set

2022-08-05 Thread Lucas Mateus Castro(alqotel)
From: "Lucas Mateus Castro (alqotel)" When an overflow exception occurs and OE is set the intermediate result should be adjusted (by subtracting from the exponent) to avoid rounding to inf. The same applies to an underflow exceptionion and UE (but adding to the exponent). To do this set the fp_st

[PATCH 0/2] Floating-point OE/UE exception bug

2022-08-05 Thread Lucas Mateus Castro(alqotel)
From: "Lucas Mateus Castro (alqotel)" Changes in v2: - Completely reworked the solution: * Created re_bias in FloatFmt, it is 3/4 of the total exponent range of a FP type * Added rebias bools that dictates if the result should have its exponent add/subtract

Re: [PATCH for-7.1] vl: fix [memory] section with -readconfig

2022-08-05 Thread Markus Armbruster
Paolo Bonzini writes: > The -M memory.* options do not have magic applied to them than the -m > option, namely no "M" (for mebibytes) is tacked at the end of a > suffixless value for "-M memory.size". This sentence is confusing. Do you mean "like the -m option"? > This magic is performed by pa

Re: [PATCH v2 00/11] Refactor bdrv_try_set_aio_context using transactions

2022-08-05 Thread Emanuele Giuseppe Esposito
Am 05/08/2022 um 15:22 schrieb Emanuele Giuseppe Esposito: > > > Am 27/07/2022 um 18:13 schrieb Vladimir Sementsov-Ogievskiy: >> On 7/25/22 15:21, Emanuele Giuseppe Esposito wrote: >>> The aim of this series is to reorganize bdrv_try_set_aio_context >>> and drop BDS ->set_aio_context and ->can

Re: [PATCH v3] hw/i386: place setup_data at fixed place in memory

2022-08-05 Thread Laszlo Ersek
On 08/05/22 14:47, Jason A. Donenfeld wrote: > Hi Paolo, > > On Fri, Aug 05, 2022 at 10:10:02AM +0200, Paolo Bonzini wrote: >> On 8/5/22 01:04, Jason A. Donenfeld wrote: >>> +/* Nothing else uses this part of the hardware mapped region */ >>> +setup_data_base = 0xf - 0x1000; >> >> Isn'

Re: [PATCH v7 05/14] mm/memfd: Introduce MFD_INACCESSIBLE flag

2022-08-05 Thread David Hildenbrand
On 06.07.22 10:20, Chao Peng wrote: > Introduce a new memfd_create() flag indicating the content of the > created memfd is inaccessible from userspace through ordinary MMU > access (e.g., read/write/mmap). However, the file content can be > accessed via a different mechanism (e.g. KVM MMU) indirect

Re: [PATCH v7 04/14] mm/shmem: Support memfile_notifier

2022-08-05 Thread David Hildenbrand
On 06.07.22 10:20, Chao Peng wrote: > From: "Kirill A. Shutemov" > > Implement shmem as a memfile_notifier backing store. Essentially it > interacts with the memfile_notifier feature flags for userspace > access/page migration/page reclaiming and implements the necessary > memfile_backing_store c

Re: [PATCH v7 03/14] mm: Introduce memfile_notifier

2022-08-05 Thread David Hildenbrand
On 06.07.22 10:20, Chao Peng wrote: > This patch introduces memfile_notifier facility so existing memory file > subsystems (e.g. tmpfs/hugetlbfs) can provide memory pages to allow a > third kernel component to make use of memory bookmarked in the memory > file and gets notified when the pages in th

Re: [PATCH v2 00/11] Refactor bdrv_try_set_aio_context using transactions

2022-08-05 Thread Emanuele Giuseppe Esposito
Am 27/07/2022 um 18:13 schrieb Vladimir Sementsov-Ogievskiy: > On 7/25/22 15:21, Emanuele Giuseppe Esposito wrote: >> The aim of this series is to reorganize bdrv_try_set_aio_context >> and drop BDS ->set_aio_context and ->can_set_aio_ctx callbacks in >> favour of a new one, ->change_aio_ctx. >>

Re: [PATCH v2 12/20] ppc/ppc405: QOM'ify EBC

2022-08-05 Thread Peter Maydell
On Fri, 5 Aug 2022 at 13:55, BALATON Zoltan wrote: > I know this is a mess curently but QOM is full of boilerplate code which > is confusing for new people and makes it hard to undestand the code. So > cutting down the boilerplate and making things simpler would help people > who want to get start

Re: [PATCH v10 21/21] job: remove unused functions

2022-08-05 Thread Kevin Wolf
Am 25.07.2022 um 09:38 hat Emanuele Giuseppe Esposito geschrieben: > These public functions are not used anywhere, thus can be dropped. > Also, since this is the final job API that doesn't use AioContext > lock and replaces it with job_lock, adjust all remaining function > documentation to clearly

Re: [PATCH v7 02/14] selftests/memfd: Add tests for F_SEAL_AUTO_ALLOCATE

2022-08-05 Thread David Hildenbrand
On 06.07.22 10:20, Chao Peng wrote: > Add tests to verify sealing memfds with the F_SEAL_AUTO_ALLOCATE works > as expected. > > Signed-off-by: Chao Peng > --- > tools/testing/selftests/memfd/memfd_test.c | 166 + > 1 file changed, 166 insertions(+) > > diff --git a/tools/tes

Re: [PATCH] pc-bios/s390-ccw: Fix booting with logical block size < physical block size

2022-08-05 Thread Eric Farman
On Fri, 2022-08-05 at 12:14 +0200, Cornelia Huck wrote: > On Fri, Aug 05 2022, Thomas Huth wrote: > > > For accessing single blocks during boot, it's the logical block > > size that > > matters. (Physical block sizes are rather interesting e.g. for > > creating > > file systems with the correct a

Re: [PATCH v10 20/21] blockjob: remove unused functions

2022-08-05 Thread Kevin Wolf
Am 25.07.2022 um 09:38 hat Emanuele Giuseppe Esposito geschrieben: > These public functions are not used anywhere, thus can be dropped. > > Signed-off-by: Emanuele Giuseppe Esposito > Reviewed-by: Stefan Hajnoczi > @@ -113,6 +111,7 @@ BlockJob *block_job_next_locked(BlockJob *job); > * Get th

  1   2   3   >