[PATCH] vhost-user-test: no set non-blocking for cal fd less than 0.

2024-04-11 Thread Yuxue Liu yuxue....@jaguarmicro.com
From: Yuxue Liu In the scenario where vhost-user sets eventfd to -1, qemu_chr_fe_get_msgfds retrieves fd as -1. When vhost_user_read receives, it does not perform blocking operations on the descriptor with fd=-1, so non-blocking operations should not be performed here either.This is a normal use

Re: [PATCH 01/12] ui/console-vc: Replace sprintf() by g_strdup_printf()

2024-04-11 Thread Gerd Hoffmann
Hi, > Due to security concerns inherent in the design of sprintf(3), > it is highly recommended that you use snprintf(3) instead. > -char response[40]; > +g_autofree char *response = NULL; > -sprintf(response, "\033[%d;%dR", > +response =

Re: [PATCH for-9.1 09/19] target/i386: move 60-BF opcodes to new decoder

2024-04-11 Thread Richard Henderson
On 4/9/24 06:43, Paolo Bonzini wrote: +static void gen_ARPL(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) +{ +TCGLabel *label1 = gen_new_label(); +TCGv rpl_adj = tcg_temp_new(); +TCGv flags = tcg_temp_new(); + +gen_mov_eflags(s, flags); +tcg_gen_andi_tl(flags, fla

Re: [PATCH for-9.1 07/19] target/i386: extract gen_far_call/jmp, reordering temporaries

2024-04-11 Thread Richard Henderson
On 4/9/24 06:43, Paolo Bonzini wrote: Extract the code into new functions, and swap T0/T1 so that T0 corresponds to the first immediate in the instruction stream. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 93 + 1 file changed, 53 insert

Re: [PATCH for-9.1 06/19] target/i386: move 00-5F opcodes to new decoder

2024-04-11 Thread Richard Henderson
On 4/9/24 06:43, Paolo Bonzini wrote: Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 +- target/i386/tcg/decode-new.c.inc | 120 ++ target/i386/tcg/emit.c.inc | 202 +++ 3 files changed, 323 insertions(+), 1 deletion(

Re: [PATCH for-9.1 08/19] target/i386: allow instructions with more than one immediate

2024-04-11 Thread Richard Henderson
On 4/9/24 06:43, Paolo Bonzini wrote: While keeping decode->immediate for convenience and for 4-operand instructions, store the immediate in X86DecodedOp as well. This enables instructions with more than one immediate such as ENTER. It can also be used for far calls and jumps. Signed-off-by: P

Re: [PATCH for-9.1 10/19] target/i386: generalize gen_movl_seg_T0

2024-04-11 Thread Richard Henderson
On 4/9/24 06:43, Paolo Bonzini wrote: In the new decoder it is sometimes easier to put the segment in T1 instead of T0, usually because another operand was loaded by common code in T0. Genrealize gen_movl_seg_T0 to allow using any source. Signed-off-by: Paolo Bonzini --- target/i386/tcg/trans

Re: [PATCH for-9.1 11/19] target/i386: move C0-FF opcodes to new decoder (except for x87)

2024-04-11 Thread Richard Henderson
On 4/9/24 06:43, Paolo Bonzini wrote: diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 05a1912f8a3..88653c4f824 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -105,6 +105,12 @@ typedef uint64_t TCGRegSet; /* Turn some undef macros into true macros. */ #define TCG_TARGET_HA

Re: [PATCH for-9.1 12/19] target/i386: merge and enlarge a few ranges for call to disas_insn_new

2024-04-11 Thread Richard Henderson
On 4/9/24 09:43, Paolo Bonzini wrote: Since new opcodes are not going to be added in translate.c, round the case labels that call to disas_insn_new(), including whole sets of eight opcodes when possible. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 5 ++--- 1 file changed, 2

Re: [PATCH for-9.1 13/19] target/i386: move remaining conditional operations to new decoder

2024-04-11 Thread Richard Henderson
On 4/9/24 09:43, Paolo Bonzini wrote: Move long-displacement Jcc, SETcc and CMOVcc to the new decoder. While filling in the tables makes the code seem longer, the new emitters are all just one line of code. Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.h | 1 + target/i386/

Re: [PATCH for-9.1 14/19] target/i386: move BSWAP to new decoder

2024-04-11 Thread Richard Henderson
On 4/9/24 09:43, Paolo Bonzini wrote: Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 4 +++- target/i386/tcg/decode-new.c.inc | 9 + target/i386/tcg/emit.c.inc | 11 +++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/target/i386/t

[PATCH v5] virtio-pci: Fix the crash that the vector was used after released.

2024-04-11 Thread Cindy Lu
During the booting process of the non-standard image, the behavior of the called function in qemu is as follows: 1. vhost_net_stop() was triggered by guest image. This will call the function virtio_pci_set_guest_notifiers() with assgin= false, virtio_pci_set_guest_notifiers() will release the irqf

Re: [PATCH for-9.1 15/19] target/i386: port extensions of one-byte opcodes to new decoder

2024-04-11 Thread Richard Henderson
On 4/9/24 09:43, Paolo Bonzini wrote: A few two-byte opcodes are simple extensions of existing one-byte opcodes; they are easy to decode and need no change to emit.c.inc. Port them to the new decoder. Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.h | 1 + target/i386/tcg/t

Re: [PATCH for-9.1 16/19] target/i386: remove now-converted opcodes from old decoder

2024-04-11 Thread Richard Henderson
On 4/9/24 09:43, Paolo Bonzini wrote: Send all converted opcodes to disas_insn_new() directly from the big decoding switch statement; once more, the debugging/bisecting logic disappears. Signed-off-by: Paolo Bonzini --- target/i386/helper.h| 11 - target/i386/tcg/shi

Re: [PATCH for-9.1 17/19] target/i386: decode x87 instructions in a separate function

2024-04-11 Thread Richard Henderson
On 4/9/24 09:43, Paolo Bonzini wrote: These are unlikely to be converted to the table-based decoding soon (perhaps there could be generic ESC decoding in decode-new.c.inc for the Mod/RM byte, but not operand decoding), so keep them separate from the remaining legacy-decoded instructions. Signed-

Re: [PATCH for-9.1 18/19] target/i386: split legacy decoder into a separate function

2024-04-11 Thread Richard Henderson
On 4/9/24 09:43, Paolo Bonzini wrote: Split the bits that have some duplication with disas_insn_new, from those that should be the main topic of the conversion. This is the first step towards removing duplicate decoding of prefixes between disas_insn and disas_insn_new. Signed-off-by: Paolo Bon

Re: [PATCH for-9.1 19/19] target/i386: remove duplicate prefix decoding

2024-04-11 Thread Richard Henderson
On 4/9/24 09:43, Paolo Bonzini wrote: Now that a bulk of opcodes go through the new decoder, it is sensible to do some cleanup. Go immediately through disas_insn_new and only jump back after parsing the prefixes. disas_insn() now only contains the three sigsetjmp cases, and they are more easily

Re: [PATCH 01/12] ui/console-vc: Replace sprintf() by g_strdup_printf()

2024-04-11 Thread Philippe Mathieu-Daudé
On 11/4/24 09:47, Gerd Hoffmann wrote: Hi, Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. -char response[40]; +g_autofree char *response = NULL; -sprintf(response, "\033[%d;

Re: [PATCH 00/12] misc: Remove sprintf() due to macOS deprecation

2024-04-11 Thread Philippe Mathieu-Daudé
On 11/4/24 00:27, BALATON Zoltan wrote: On Wed, 10 Apr 2024, Richard Henderson wrote: On 4/10/24 06:06, Philippe Mathieu-Daudé wrote: Hi, sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Is snprintf also deprecated? It might be easi

Re: [PATCH] hw/isa/vt82c686: Keep track of PIRQ/PINT pins separately

2024-04-11 Thread Philippe Mathieu-Daudé
On 11/4/24 00:25, BALATON Zoltan wrote: Move calculation of mask after the switch which sets the function number for PIRQ/PINT pins to make sure the state of these pins are kept track of separately and IRQ is raised if any of them is active. Fixes: 7e01bd80c1 hw/isa/vt82c686: Bring back via_isa_

[PATCH 3/5] x86/loader: read complete kernel

2024-04-11 Thread Gerd Hoffmann
Load the complete kernel (including setup) into memory. Excluding the setup is handled later when adding the FW_CFG_KERNEL_SIZE and FW_CFG_KERNEL_DATA entries. This is a preparation for the next patch which adds a new fw_cfg file containing the complete, unpatched kernel. No functional change.

[PATCH 4/5] x86/loader: expose unpatched kernel

2024-04-11 Thread Gerd Hoffmann
Add a new "etc/boot/kernel" fw_cfg file, containing the kernel without the setup header patches. Intended use is booting in UEFI with secure boot enabled, where the setup header patching breaks secure boot verification. Needs OVMF changes too to be actually useful. Signed-off-by: Gerd Hoffmann

[PATCH 0/5] x86/loader: secure boot support for direct kernel load

2024-04-11 Thread Gerd Hoffmann
This series allows to boot linux kernels and other efi binaries via direct kernel load with secure boot enabled. The series adds two new fw_cfg files: 'etc/boot/kernel' contains the kernel without modifications (no setup header patching), and 'etc/boot/shim' contains shim. The path to the shim bi

[PATCH 1/5] vl: fix qemu_validate_options() indention

2024-04-11 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- system/vl.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/system/vl.c b/system/vl.c index c64422298245..0c6201c5bdc5 100644 --- a/system/vl.c +++ b/system/vl.c @@ -2411,15 +2411,15 @@ static void qemu_validate_options(const Q

[PATCH 5/5] x86/loader: add -shim option

2024-04-11 Thread Gerd Hoffmann
Add new -shim command line option, wire up for the x86 loader. When specified load shim into the new "etc/boot/shim" fw_cfg file. Needs OVMF changes too to be actually useful. Signed-off-by: Gerd Hoffmann --- include/hw/boards.h | 1 + hw/core/machine.c | 20 hw/i386/x86

[PATCH 2/5] x86/loader: only patch linux kernels

2024-04-11 Thread Gerd Hoffmann
If the binary loaded via -kernel is *not* a linux kernel (in which case protocol == 0), do not patch the linux kernel header fields. It's (a) pointless and (b) might break binaries by random patching and (c) changes the binary hash which in turn breaks secure boot verification. Background: OVMF h

Re: [PATCH 01/12] ui/console-vc: Replace sprintf() by g_strdup_printf()

2024-04-11 Thread Gerd Hoffmann
On Thu, Apr 11, 2024 at 11:36:10AM +0200, Philippe Mathieu-Daudé wrote: > On 11/4/24 09:47, Gerd Hoffmann wrote: > >Hi, > > > > > Due to security concerns inherent in the design of sprintf(3), > > > it is highly recommended that you use snprintf(3) instead. > > > > > -char respo

[PATCH v2 04/13] hw/mips/malta: Add re-usable rng_seed_hex_new() method

2024-04-11 Thread Philippe Mathieu-Daudé
Extract common code from reinitialize_rng_seed() and load_kernel() to rng_seed_hex_new(). Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/malta.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index af74008c82..9fc6a7

[PATCH v2 02/13] hw/vfio/pci: Replace sprintf() by snprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé --- hw/vfio/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 647

[PATCH v2 00/13] misc: Remove sprintf() due to macOS deprecation

2024-04-11 Thread Philippe Mathieu-Daudé
Since v1: - Use snprintf() in patches 1-5 Hi, sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Suggestion to avoid the super-noisy warning on macOS forum are [*]: * use -Wno-deprecated-declarations on the whole build * surgically add #

[PATCH v2 12/13] hw/dma/pl330: Use qemu_hexdump_line() to avoid sprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use qemu_hexdump_line() to avoid sprintf() calls, silencing: [5/8] Compiling C object libcommon.fa.p/hw_dma_pl330.c.o hw/dma/pl330.c:333:13: warning: 'sprintf' is deprecated: This

[PATCH v2 11/13] hw/ide/atapi: Use qemu_hexdump_line() to avoid sprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use qemu_hexdump_line() to avoid sprintf() calls, silencing: [1367/1604] Compiling C object libcommon.fa.p/backends_tpm_tpm_util.c.o backends/tpm/tpm_util.c:355:18: warning: 'sprintf'

[PATCH v2 05/13] hw/mips/malta: Replace sprintf() by snprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Replace sprintf() by snprintf() in order to avoid: [120/169] Compiling C object libcommon.fa.p/system_qtest.c.o hw/mips/malta.c:860:9: warning: 'sprintf' is deprecated: sprin

[PATCH v2 10/13] hw/scsi/scsi-disk: Use qemu_hexdump_line() to avoid sprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use qemu_hexdump_line() to avoid sprintf() calls, silencing: [105/169] Compiling C object libcommon.fa.p/hw_scsi_scsi-disk.c.o hw/scsi/scsi-disk.c:2659:14: warning: 'sprintf' is deprec

[PATCH v2 03/13] hw/ppc/spapr: Replace sprintf() by snprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Replace sprintf() by snprintf() in order to avoid: hw/ppc/spapr.c:385:5: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to securi

[PATCH v2 08/13] util/hexdump: Have qemu_hexdump_line() return heap allocated buffer

2024-04-11 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/cutils.h | 10 +++--- hw/virtio/vhost-vdpa.c | 5 +++-- util/hexdump.c | 12 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index 70ca4b876b..e8d6b86098

[PATCH v2 13/13] backends/tpm: Use qemu_hexdump_line() to avoid sprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use qemu_hexdump_line() to avoid sprintf() calls, silencing: backends/tpm/tpm_util.c:357:14: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons onl

[PATCH v2 07/13] util/hexdump: Rename @offset argument in qemu_hexdump_line()

2024-04-11 Thread Philippe Mathieu-Daudé
@offset argument is more descriptive than @b. Inverse @bufptr <-> @offset arguments order. Document qemu_hexdump_line(). Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/cutils.h | 11 +-- hw/virtio/vhost-vdpa.c | 8 util/hexdump.c | 16 3 file

Re: [PATCH v2] hw/mem/cxl_type3: reset dvsecs in ct3d_reset()

2024-04-11 Thread Jonathan Cameron via
On Tue, 9 Apr 2024 15:58:46 +0800 Li Zhijian wrote: > After the kernel commit > 0cab68720598 ("cxl/pci: Fix disabling memory if DVSEC CXL Range does not > match a CFMWS window") > CXL type3 devices cannot be enabled again after the reboot because the > control register(see 8.1.3.2 in CXL specif

[PATCH v2 06/13] system/qtest: Replace sprintf() by g_string_append_printf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Replace sprintf() by GString API uses in order to avoid: [120/169] Compiling C object libcommon.fa.p/system_qtest.c.o system/qtest.c:623:13: warning: 'sprintf' is deprecated: This

[PATCH v2 01/13] ui/console-vc: Replace sprintf() by snprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Replace sprintf() by snprintf() in order to avoid: [702/1310] Compiling C object libcommon.fa.p/ui_console-vc.c.o ui/console-vc.c:824:21: warning: 'sprintf' is deprecated: This fun

[PATCH v7 00/10] Support blob memory and venus on qemu

2024-04-11 Thread Dmitry Osipenko
Hello, This series enables Vulkan Venus context support on virtio-gpu. Upstreaming of Venus to Qemu was originally started by Antonio Caggiano, later Huang Rui continued the effort. I'm now taking it over because Rui will be busy for awhile and he asked me to do so. All virglrender and almost all

[PATCH v2 09/13] util/hexdump: Replace sprintf() by g_string_append_printf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Replace sprintf() by GString API in order to avoid: [426/1310] Compiling C object libqemuutil.a.p/util_hexdump.c.o util/hexdump.c:35:21: warning: 'sprintf' is deprecated: This func

[PATCH v7 04/10] virtio-gpu: Don't require udmabuf when blobs and virgl are enabled

2024-04-11 Thread Dmitry Osipenko
The udmabuf usage is mandatory when virgl is disabled and blobs feature enabled in the Qemu machine configuration. If virgl and blobs are enabled, then udmabuf requirement is optional. Since udmabuf isn't widely supported by a popular Linux distros today, let's relax the udmabuf requirement for blo

[PATCH v7 03/10] virtio-gpu: Support context-init feature with virglrenderer

2024-04-11 Thread Dmitry Osipenko
From: Huang Rui Patch "virtio-gpu: CONTEXT_INIT feature" has added the context_init feature flags. Expose this feature and support creating virglrenderer context with flags using context_id if libvirglrenderer is new enough. Originally-by: Antonio Caggiano Signed-off-by: Huang Rui Reviewed-by:

[PATCH v7 01/10] linux-headers: Update to Linux v6.9-rc3

2024-04-11 Thread Dmitry Osipenko
Update kernel headers to get new VirtIO-GPU capsets, in particular the Venus capset. Signed-off-by: Huang Rui Signed-off-by: Dmitry Osipenko --- hw/i386/x86.c | 8 - include/standard-headers/asm-x86/bootparam.h | 17 +- include/standard-headers/asm-x86/kvm_pa

[PATCH v7 02/10] virtio-gpu: Use pkgconfig version to decide which virgl features are available

2024-04-11 Thread Dmitry Osipenko
New virglrerenderer features were stabilized with release of v1.0.0. Presence of symbols in virglrenderer.h doesn't guarantee ABI compatibility with pre-release development versions of libvirglerender. Use virglrenderer version to decide reliably which virgl features are available. Signed-off-by:

[PATCH v7 09/10] virtio-gpu: Support Venus capset

2024-04-11 Thread Dmitry Osipenko
From: Antonio Caggiano Add support for the Venus capset, which enables Vulkan support through the Venus Vulkan driver for virtio-gpu. Signed-off-by: Antonio Caggiano Signed-off-by: Huang Rui Signed-off-by: Dmitry Osipenko --- hw/display/virtio-gpu-virgl.c | 21 + 1 file c

[PATCH v7 07/10] virtio-gpu: Handle resource blob commands

2024-04-11 Thread Dmitry Osipenko
From: Antonio Caggiano Support BLOB resources creation, mapping and unmapping by calling the new stable virglrenderer 0.10 interface. Only enabled when available and via the blob config. E.g. -device virtio-vga-gl,blob=true Signed-off-by: Antonio Caggiano Signed-off-by: Xenia Ragiadakou Signed

[PATCH v7 05/10] virtio-gpu: Add virgl resource management

2024-04-11 Thread Dmitry Osipenko
From: Huang Rui In a preparation to adding host blobs support to virtio-gpu, add virgl resource management that allows to retrieve resource based on its ID. Signed-off-by: Huang Rui Reviewed-by: Antonio Caggiano Signed-off-by: Dmitry Osipenko --- hw/display/virtio-gpu-virgl.c | 57 ++

[PATCH v7 08/10] virtio-gpu: Resource UUID

2024-04-11 Thread Dmitry Osipenko
From: Antonio Caggiano Enable resource UUID feature and implement command resource assign UUID. UUID feature availability is mandatory for Vulkan Venus context. UUID is intended for sharing dmabufs between virtio devices on host. Qemu doesn't have second virtio device for sharing, thus a simple

Re: [PATCH v2 01/13] ui/console-vc: Replace sprintf() by snprintf()

2024-04-11 Thread Marc-André Lureau
On Thu, Apr 11, 2024 at 2:16 PM Philippe Mathieu-Daudé wrote: > > sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, > resulting in painful developper experience. > > Replace sprintf() by snprintf() in order to avoid: > > [702/1310] Compiling C object libcommon.fa.p/ui_console-vc.c

[PATCH v7 06/10] virtio-gpu: Support blob scanout using dmabuf fd

2024-04-11 Thread Dmitry Osipenko
From: Robert Beckett Support displaying blob resources by handling SET_SCANOUT_BLOB command. Signed-by: Antonio Caggiano Signed-off-by: Robert Beckett Signed-off-by: Huang Rui Reviewed-by: Antonio Caggiano Signed-off-by: Dmitry Osipenko --- hw/display/virtio-gpu-virgl.c | 109

[PATCH v7 10/10] virtio-gpu: Initialize Venus

2024-04-11 Thread Dmitry Osipenko
From: Antonio Caggiano Request Venus when initializing VirGL and if vulkan=true flag is set for virtio-gpu device. Signed-off-by: Antonio Caggiano Signed-off-by: Huang Rui Signed-off-by: Dmitry Osipenko --- hw/display/virtio-gpu-virgl.c | 5 + hw/display/virtio-gpu.c| 15 ++

[PATCH 2/9] disas/microblaze: Replace sprintf() by snprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé --- disas/microblaze.c | 25 - 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/disas/m

[PATCH 1/9] disas/m68k: Replace sprintf() by snprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé --- disas/m68k.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disas/m68k.c b/disas/m68k.c index 1f16e2

[PATCH 0/9] misc: Replace sprintf() by snprintf() due to macOS deprecation

2024-04-11 Thread Philippe Mathieu-Daudé
Continuation of: https://lore.kernel.org/qemu-devel/20240411101550.99392-1-phi...@linaro.org/ *** BLURB HERE *** Philippe Mathieu-Daudé (9): disas/m68k: Replace sprintf() by snprintf() disas/microblaze: Replace sprintf() by snprintf() disas/riscv: Replace sprintf() by snprintf() linux-use

[PATCH 7/9] hw/riscv/virt: Replace sprintf() by snprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé --- hw/riscv/virt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.

[PATCH 3/9] disas/riscv: Replace sprintf() by snprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé --- disas/riscv.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/disas/riscv.c b/disas/riscv.

[PATCH 5/9] hw/misc/imx: Replace sprintf() by snprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/imx25_ccm.c | 2 +- hw/misc/imx31_ccm.c | 2 +- hw/misc/imx6_ccm.c | 4 ++-- hw/misc/imx6_src.c | 2 +- hw/

[PATCH 9/9] target/i386: Replace sprintf() by snprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/kvm/kvm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/i386/kvm/kvm.c b/targe

[PATCH 8/9] target/arm: Replace sprintf() by snprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/cpu64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/cpu64.c b/target/ar

[PATCH 6/9] hw/net/rocker: Replace sprintf() by snprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé --- hw/net/rocker/rocker.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/

[PATCH 4/9] linux-user/flatload: Replace sprintf() by snprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé --- linux-user/flatload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/flatload.c b/linux-u

[PATCH] hw/misc: Avoid sprintf() in the imx devices

2024-04-11 Thread Peter Maydell
Various imx devices in hw/misc have a pattern in the debug logging where a function which prints register names has a fallback case for an unknown offset that uses sprintf(). Use snprintf() instead to avoid warnings on macos. (The buffer could never overflow because it is 20 bytes and we will write

Re: [PATCH 5/9] hw/misc/imx: Replace sprintf() by snprintf()

2024-04-11 Thread Peter Maydell
On Thu, 11 Apr 2024 at 11:44, Philippe Mathieu-Daudé wrote: > > sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, > resulting in painful developper experience. Use snprintf() instead. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/misc/imx25_ccm.c | 2 +- > hw/misc/imx31_cc

Re: [PATCH] hw/misc: Avoid sprintf() in the imx devices

2024-04-11 Thread Peter Maydell
On Thu, 11 Apr 2024 at 11:45, Peter Maydell wrote: > > Various imx devices in hw/misc have a pattern in the > debug logging where a function which prints register names > has a fallback case for an unknown offset that uses sprintf(). > Use snprintf() instead to avoid warnings on macos. (The > buff

Re: [PATCH for-9.1 09/19] target/i386: move 60-BF opcodes to new decoder

2024-04-11 Thread Paolo Bonzini
On Thu, Apr 11, 2024 at 9:47 AM Richard Henderson wrote: > > +case MO_32: > > +#ifdef TARGET_X86_64 > > +/* > > + * This could also use the same algorithm as MO_16. It produces > > fewer > > + * TCG ops and better code if flags are needed, but it requires a > > 64-bi

Re: [PATCH v9 13/20] virtio-net: Return an error when vhost cannot enable RSS

2024-04-11 Thread Yan Vugenfirer
On Mon, Apr 8, 2024 at 4:31 AM Akihiko Odaki wrote: > > On 2024/04/08 6:46, Yuri Benditovich wrote: > > On Wed, Apr 3, 2024 at 2:11 PM Akihiko Odaki > > wrote: > >> > >> vhost requires eBPF for RSS. When eBPF is not available, virtio-net > >> implicitly disables RSS even if the user explicitly r

Re: [PATCH 6/9] hw/net/rocker: Replace sprintf() by snprintf()

2024-04-11 Thread Peter Maydell
On Thu, 11 Apr 2024 at 11:47, Philippe Mathieu-Daudé wrote: > > sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, > resulting in painful developper experience. Use snprintf() instead. ("developer") > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/net/rocker/rocker.c | 24 +

Re: [PATCH 8/9] target/arm: Replace sprintf() by snprintf()

2024-04-11 Thread Peter Maydell
On Thu, 11 Apr 2024 at 11:44, Philippe Mathieu-Daudé wrote: > > sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, > resulting in painful developper experience. Use snprintf() instead. > > Signed-off-by: Philippe Mathieu-Daudé > --- > target/arm/cpu64.c | 4 ++-- > 1 file changed,

[PATCH] target/riscv: fix instructions count handling in icount mode

2024-04-11 Thread Clément Léger
When icount is enabled, rather than returning the virtual CPU time, we should return the instruction count itself. Add an instructions bool parameter to get_ticks() to correctly return icount_get_raw() when icount_enabled() == 1 and instruction count is queried. This will modify the existing behavi

[PATCH] linux-headers: change the annotation of VFIO_IOMMU_SPAPR_REGISTER_MEMORY in vfio.h

2024-04-11 Thread JianChunfu
The ioctl(VFIO_IOMMU_MAP_DMA/VFIO_IOMMU_UNMAP_DMA) won't be called in SPAPR machine, which is replaced by VFIO_IOMMU_SPAPR_TCE_CREATE/ VFIO_IOMMU_SPAPR_TCE_REMOVE, so change the description. Signed-off-by: JianChunfu --- linux-headers/linux/vfio.h | 2 +- 1 file changed, 1 insertion(+), 1 deleti

Re: [PATCH 4/9] linux-user/flatload: Replace sprintf() by snprintf()

2024-04-11 Thread Peter Maydell
On Thu, 11 Apr 2024 at 11:44, Philippe Mathieu-Daudé wrote: > > sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, > resulting in painful developper experience. Use snprintf() instead. > > Signed-off-by: Philippe Mathieu-Daudé > --- > linux-user/flatload.c | 2 +- > 1 file changed,

[PATCH] linux-user/flatload.c: Remove unused bFLT shared-library and ZFLAT code

2024-04-11 Thread Peter Maydell
Ever since the bFLT format support was added in 2006, there has been a chunk of code in the file guarded by CONFIG_BINFMT_SHARED_FLAT which is supposedly for shared library support. This is not enabled and it's not possible to enable it, because if you do you'll run into the "#error needs checking

Re: [PATCH 9/9] target/i386: Replace sprintf() by snprintf()

2024-04-11 Thread Peter Maydell
On Thu, 11 Apr 2024 at 11:44, Philippe Mathieu-Daudé wrote: > > sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, > resulting in painful developper experience. Use snprintf() instead. > > Signed-off-by: Philippe Mathieu-Daudé > --- > target/i386/kvm/kvm.c | 3 ++- > 1 file changed

Re: [PATCH 3/9] disas/riscv: Replace sprintf() by snprintf()

2024-04-11 Thread Peter Maydell
On Thu, 11 Apr 2024 at 11:44, Philippe Mathieu-Daudé wrote: > > sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, > resulting in painful developper experience. Use snprintf() instead. > > Signed-off-by: Philippe Mathieu-Daudé > --- Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH 1/9] disas/m68k: Replace sprintf() by snprintf()

2024-04-11 Thread Peter Maydell
On Thu, 11 Apr 2024 at 11:44, Philippe Mathieu-Daudé wrote: > > sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, > resulting in painful developper experience. Use snprintf() instead. > > Signed-off-by: Philippe Mathieu-Daudé > --- > disas/m68k.c | 2 +- > 1 file changed, 1 insert

[PATCH for-9.0] meson.build: Disable -fzero-call-used-regs on OpenBSD

2024-04-11 Thread Thomas Huth
QEMU currently does not work on OpenBSD since the -fzero-call-used-regs option that we added to meson.build recently does not work with the "retguard" extension from OpenBSD's Clang. Thus let's disable the -fzero-call-used-regs here until there's a better solution available. Resolves: https://gitl

Re: [PATCH for-9.0] meson.build: Disable -fzero-call-used-regs on OpenBSD

2024-04-11 Thread Thomas Huth
On 11/04/2024 14.08, Thomas Huth wrote: QEMU currently does not work on OpenBSD since the -fzero-call-used-regs That should be "OpenBSD 7.5" ... older versions are fine since they are using an older version of Clang that does not have -fzero-call-used-regs yet, I think. Thomas option th

[PATCH v5 0/3] Add support for the RAPL MSRs series

2024-04-11 Thread Anthony Harivel
Dear maintainers, First of all, thank you very much for your review of my patch [1]. In this version (v5), I have attempted to address all the problems addressed by Daniel during the last review. I've been more careful with all the remarks made. However, one question remains unanswered poin

[PATCH v5 2/3] tools: build qemu-vmsr-helper

2024-04-11 Thread Anthony Harivel
Introduce a privileged helper to access RAPL MSR. The privileged helper tool, qemu-vmsr-helper, is designed to provide virtual machines with the ability to read specific RAPL (Running Average Power Limit) MSRs without requiring CAP_SYS_RAWIO privileges or relying on external, out-of-tree patches.

[PATCH v5 3/3] Add support for RAPL MSRs in KVM/Qemu

2024-04-11 Thread Anthony Harivel
Starting with the "Sandy Bridge" generation, Intel CPUs provide a RAPL interface (Running Average Power Limit) for advertising the accumulated energy consumption of various power domains (e.g. CPU packages, DRAM, etc.). The consumption is reported via MSRs (model specific registers) like MSR_PKG_E

[PATCH v5 1/3] qio: add support for SO_PEERCRED for socket channel

2024-04-11 Thread Anthony Harivel
The function qio_channel_get_peercred() returns a pointer to the credentials of the peer process connected to this socket. This credentials structure is defined in as follows: struct ucred { pid_t pid;/* Process ID of the sending process */ uid_t uid;/* User ID of the sen

Re: [PATCH 1/4] Revert "migration: modify test_multifd_tcp_none() to use new QAPI syntax"

2024-04-11 Thread Het Gala
On 10/04/24 6:34 pm, Fabiano Rosas wrote: !---| CAUTION: External Email |---! Het Gala writes: This reverts commit 8e3766eefbb4036cbc280c1f1a0d28537929f7fb Aft

Re: [PATCH 3/4] tests/qtest/migration: Add channels parameter in migrate_incoming_qmp

2024-04-11 Thread Het Gala
On 10/04/24 6:44 pm, Fabiano Rosas wrote: !---| CAUTION: External Email |---! Het Gala writes: Alter migrate_incoming_qmp() to allow both uri and channels indep

Re: [PATCH v7 09/10] virtio-gpu: Support Venus capset

2024-04-11 Thread Antonio Caggiano
Hi Dmitry, I have a new version of this patch which you might want to include in this series. Please, you can find it below. I hope it would also solve the issue raised by Pierre-Eric in v6. Cheers, Antonio --- virtio-gpu: Support Venus capset While querying the number of capsets, map each

Re: [PATCH 2/9] disas/microblaze: Replace sprintf() by snprintf()

2024-04-11 Thread Edgar E. Iglesias
On Thu, Apr 11, 2024 at 12:43 PM Philippe Mathieu-Daudé wrote: > > sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, > resulting in painful developper experience. Use snprintf() instead. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias > --- > disas/mic

Re: [PATCH v7 09/10] virtio-gpu: Support Venus capset

2024-04-11 Thread Dmitry Osipenko
Hi, On 4/11/24 15:52, Antonio Caggiano wrote: > Hi Dmitry, > > I have a new version of this patch which you might want to include in > this series. > Please, you can find it below. > > I hope it would also solve the issue raised by Pierre-Eric in v6. AFAICS, this patch should be relevant only o

Re: [PATCH 4/4] tests/qtest/migration: Add postcopy migration qtests to use 'channels' argument instead of uri

2024-04-11 Thread Het Gala
On 10/04/24 6:45 pm, Fabiano Rosas wrote: !---| CAUTION: External Email |---! Het Gala writes: Add qtests to perform postcopy live migration by having list of '

Re: [PATCH v4 02/10] hw/core: create Resettable QOM interface

2024-04-11 Thread Peter Maydell
On Wed, 21 Aug 2019 at 17:34, Damien Hedde wrote: > > This commit defines an interface allowing multi-phase reset. This aims > to solve a problem of the actual single-phase reset (built in > DeviceClass and BusClass): reset behavior is dependent on the order > in which reset handlers are called. I

Re: [PATCH 1/4] Revert "migration: modify test_multifd_tcp_none() to use new QAPI syntax"

2024-04-11 Thread Het Gala
On 10/04/24 8:23 pm, Peter Xu wrote: !---| CAUTION: External Email |---! On Wed, Apr 10, 2024 at 10:04:33AM -0300, Fabiano Rosas wrote: Het Gala writes: This

Re: [PATCH for-9.1 09/19] target/i386: move 60-BF opcodes to new decoder

2024-04-11 Thread Zhao Liu
Hi Paolo, I just did some tests, > +[0x98] = X86_OP_ENTRY1(CBW,0,v), /* rAX */ > +[0x99] = X86_OP_ENTRY3(CWD,2,v, 0,v, None, None), /* rDX, rAX */ > +[0x9A] = X86_OP_ENTRYrr(CALLF, I_unsigned,p, I_unsigned,w, chk(i64)), X86_TYPE_I_unsigned is defined in patch 11, so the relat

Re: [PATCH v6 0/7] Resolve issues with booting distros on x86

2024-04-11 Thread Tom Rini
On Thu, 04 Jan 2024 08:10:35 -0700, Simon Glass wrote: > This little series reprises the EFI-video fix, fixes a USB problem and > enables a boot script for coreboot. > > It also moves to truetype fonts for coreboot and qemu-x86, since the > menus look much better and there are no strong size cons

Re: [PATCH-for-9.1 v2 2/3] migration: Remove RDMA protocol handling

2024-04-11 Thread Peter Xu
On Wed, Apr 10, 2024 at 09:49:15AM -0400, Peter Xu wrote: > On Wed, Apr 10, 2024 at 02:28:59AM +, Zhijian Li (Fujitsu) via wrote: > > > > > > on 4/10/2024 3:46 AM, Peter Xu wrote: > > > > >> Is there document/link about the unittest/CI for migration tests, Why > > >> are those tests missing?

Re: [PATCH 1/4] Revert "migration: modify test_multifd_tcp_none() to use new QAPI syntax"

2024-04-11 Thread Peter Xu
On Thu, Apr 11, 2024 at 07:45:21PM +0530, Het Gala wrote: > > On 10/04/24 8:23 pm, Peter Xu wrote: > > !---| > >CAUTION: External Email > > > > |---! > > > > On Wed

Re: [PATCH for-9.1 10/19] target/i386: generalize gen_movl_seg_T0

2024-04-11 Thread Zhao Liu
Hi Paolo, On Tue, Apr 09, 2024 at 06:43:14PM +0200, Paolo Bonzini wrote: > Date: Tue, 9 Apr 2024 18:43:14 +0200 > From: Paolo Bonzini > Subject: [PATCH for-9.1 10/19] target/i386: generalize gen_movl_seg_T0 > X-Mailer: git-send-email 2.44.0 > > In the new decoder it is sometimes easier to put t

COLO state?

2024-04-11 Thread Fabiano Rosas
Hi COLO maintainers, Would you please take a look at this issue? https://gitlab.com/qemu-project/qemu/-/issues/2277 The reporter claims it affects from 9.0-rc2 all the way back to QEMU 7.2. I don't have any kind of setup for COLO, so it will take me a while to be able to verify this. Could you

Re: [PATCH-for-9.1 v2 2/3] migration: Remove RDMA protocol handling

2024-04-11 Thread Jinpu Wang
Hi Peter, On Tue, Apr 9, 2024 at 9:47 PM Peter Xu wrote: > > On Tue, Apr 09, 2024 at 09:32:46AM +0200, Jinpu Wang wrote: > > Hi Peter, > > > > On Mon, Apr 8, 2024 at 6:18 PM Peter Xu wrote: > > > > > > On Mon, Apr 08, 2024 at 04:07:20PM +0200, Jinpu Wang wrote: > > > > Hi Peter, > > > > > > Jinp

Re: [PATCH] linux-user/flatload.c: Remove unused bFLT shared-library and ZFLAT code

2024-04-11 Thread Philippe Mathieu-Daudé
On 11/4/24 13:53, Peter Maydell wrote: Ever since the bFLT format support was added in 2006, there has been a chunk of code in the file guarded by CONFIG_BINFMT_SHARED_FLAT which is supposedly for shared library support. This is not enabled and it's not possible to enable it, because if you do y

  1   2   >