Re: [PATCH 11/23] Update ARM AArch64 VM parameter definitions for bsd-user

2024-06-22 Thread Warner Losh
On Tue, Jun 18, 2024 at 4:16 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 6/17/24 11:57, Ajeet Singh wrote: > > From: Stacey Son > > > > Defined address spaces for FreeBSD/arm64 and added function for > > getting stack pointer from CPU and setting a return value. > > > >

Re: [PATCH 02/23] Added CPU loop function

2024-06-22 Thread Warner Losh
On Mon, Jun 17, 2024 at 10:24 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 6/17/24 11:57, Ajeet Singh wrote: > > +/* > > + * The carry bit is cleared for no error; set for error. > > + * See arm64/arm64/vm_machdep.c cpu_set_syscall_retval()

Re: [PATCH 01/23] Add CPU initialization function

2024-06-22 Thread Warner Losh
On Mon, Jun 17, 2024 at 10:17 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 6/17/24 11:57, Ajeet Singh wrote: > > From: Stacey Son > > > > Addded function to initialize ARM CPU > > and to check if it supports 64 bit mode > > > > Signed-off-by: Ajeet Singh > > Signed-off-by:

Re: [PULL 15/23] Revert "host/i386: assume presence of SSE2"

2024-06-22 Thread Richard Henderson
On 6/21/24 23:15, Paolo Bonzini wrote: This reverts commit b18236897ca15c3db1506d8edb9a191dfe51429c. The x86-64 instruction set can now be tuned down to x86-64 v1 or i386 Pentium Pro. Signed-off-by: Paolo Bonzini --- host/include/i386/host/cpuinfo.h | 1 + util/bufferiszero.c |

[PATCH] hw/usb/hcd-ohci: Set transfer error code with no dev

2024-06-22 Thread Ryan Wendland
When a usb device is disconnected the transfer service functions bails before appropraite transfer error flags are set. This patch sets the appropriate condition code OHCI_CC_DEVICENOTRESPONDING when a device is disconnected and consequently has no response on the USB bus. Fixes:

[PULL 17/18] hw/usb/hcd-ohci: Fix ohci_service_td: accept zero-length TDs where CBP=BE+1

2024-06-22 Thread Peter Maydell
From: David Hubbard This changes the way the ohci emulation handles a Transfer Descriptor with "Buffer End" set to "Current Buffer Pointer" - 1, specifically in the case of a zero-length packet. The OHCI spec 4.3.1.2 Table 4-2 specifies td.cbp to be zero for a zero-length packet. Peter Maydell

[PULL 06/18] scripts/coverity-scan/COMPONENTS.md: Fix 'char' component

2024-06-22 Thread Peter Maydell
The 'char' component: * includes the no-longer-present qemu-char.c, which has been long since split into the chardev/ backend code * also includes the hw/char devices Split it into two components: * char is the hw/char devices * chardev is the chardev backends with regexes matching our

[PULL 04/18] hw/arm/xilinx_zynq: Fix IRQ/FIQ routing

2024-06-22 Thread Peter Maydell
From: Sebastian Huber Fix the system bus interrupt line to CPU core assignment. Fixes: ddcf58e044ce0 ("hw/arm/xilinx_zynq: Support up to two CPU cores") Signed-off-by: Sebastian Huber Reviewed-by: Philippe Mathieu-Daudé Message-id: 20240610052906.4432-1-sebastian.hu...@embedded-brains.de

[PULL 08/18] scripts/coverity-scan/COMPONENTS.md: Fix monitor component

2024-06-22 Thread Peter Maydell
Update the 'monitor' component: * qapi/ and monitor/ are now subdirectories * add job-qmp.c Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Message-id: 20240604145934.1230583-5-peter.mayd...@linaro.org --- scripts/coverity-scan/COMPONENTS.md | 2 +- 1 file changed, 1

[PULL 00/18] target-arm queue

2024-06-22 Thread Peter Maydell
Hi; here's the latest target-arm pullreq; this is pretty much just various bugfixes. -- PMM The following changes since commit 02d9c38236cf8c9826e5c5be61780ccb4ae0: Merge tag 'pull-tcg-20240619' of https://gitlab.com/rth7680/qemu into staging (2024-06-19 14:00:39 -0700) are available in

[PULL 13/18] hw/arm/virt: Rename VIRT_UART and VIRT_SECURE_UART to VIRT_UART[01]

2024-06-22 Thread Peter Maydell
We're going to make the second UART not always a secure-only device. Rename the constants VIRT_UART and VIRT_SECURE_UART to VIRT_UART0 and VIRT_UART1 accordingly. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Message-id: 20240610162343.2131524-3-peter.mayd...@linaro.org ---

[PULL 07/18] scripts/coverity-scan/COMPONENTS.md: Add crypto headers in host/include to the crypto component

2024-06-22 Thread Peter Maydell
host/include/*/host/crypto/ are relatively new headers; add them to the crypto component. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Message-id: 20240604145934.1230583-4-peter.mayd...@linaro.org --- scripts/coverity-scan/COMPONENTS.md | 2 +- 1 file changed, 1

[PULL 03/18] hw/intc/arm_gic: Fix deactivation of SPI lines

2024-06-22 Thread Peter Maydell
From: "Edgar E. Iglesias" Julien reported that he has seen strange behaviour when running Xen on QEMU using GICv2. When Xen migrates a guest's vCPU from one pCPU to another while the vCPU is handling an interrupt, the guest is unable to properly deactivate interrupts. Looking at it a little

[PULL 14/18] hw/arm/virt: allow creation of a second NonSecure UART

2024-06-22 Thread Peter Maydell
For some use-cases, it is helpful to have more than one UART available to the guest. If the second UART slot is not already used for a TrustZone Secure-World-only UART, create it as a NonSecure UART only when the user provides a serial backend (e.g. via a second -serial command line option).

[PULL 18/18] hw/arm/sbsa-ref: Enable CPU cluster on ARM sbsa machine

2024-06-22 Thread Peter Maydell
From: Xiong Yining Enable CPU cluster support on SbsaQemu platform, so that users can specify a 4-level CPU hierarchy sockets/clusters/cores/threads. And this topology can be passed to the firmware through /cpus/topology Device Tree. Signed-off-by: Xiong Yining Reviewed-by: Marcin Juszkiewicz

[PULL 12/18] hw/arm/virt: Add serial aliases in DTB

2024-06-22 Thread Peter Maydell
If there is more than one UART in the DTB, then there is no guarantee on which order a guest is supposed to initialise them. The standard solution to this is "serialN" entries in the "/aliases" node of the dtb which give the nodename of the UARTs. At the moment we only have two UARTs in the DTB

[PULL 02/18] hw/arm/sbsa-ref: switch to 1GHz timer frequency

2024-06-22 Thread Peter Maydell
From: Marcin Juszkiewicz Updated firmware for QEMU CI is already in merge queue so we can move platform to be future proof. All supported cpus work fine with 1GHz timer frequency when firmware is fresh enough. Signed-off-by: Marcin Juszkiewicz Reviewed-by: Leif Lindholm Message-id:

[PULL 16/18] hw/misc: Set valid access size for Exynos4210 RNG

2024-06-22 Thread Peter Maydell
From: Zheyu Ma The Exynos4210 RNG module requires 32-bit (4-byte) accesses to its registers. According to the User Manual Section 25.3[1], the registers for RNG operations are 32-bit. This change ensures that the memory region operations for the RNG module enforce the correct access sizes,

[PULL 05/18] scripts/coverity-scan/COMPONENTS.md: Update paths to match gitlab CI

2024-06-22 Thread Peter Maydell
Since commit 83aa1baa069c we have been running the build for Coverity Scan as a Gitlab CI job, rather than the old setup where it was run on a local developer's machine. This is working well, but the absolute paths of files are different for the Gitlab CI job, which means that the regexes we use

[PULL 11/18] hw/usb/hcd-dwc2: Handle invalid address access in read and write functions

2024-06-22 Thread Peter Maydell
From: Zheyu Ma This commit modifies the dwc2_hsotg_read() and dwc2_hsotg_write() functions to handle invalid address access gracefully. Instead of using g_assert_not_reached(), which causes the program to abort, the functions now log an error message and return a default value for reads or do

[PULL 10/18] hw/timer/a9gtimer: Handle QTest mode in a9_gtimer_get_current_cpu

2024-06-22 Thread Peter Maydell
From: Zheyu Ma This commit updates the a9_gtimer_get_current_cpu() function to handle cases where QTest is enabled. When QTest is used, it returns 0 instead of dereferencing the current_cpu, which can be NULL. This prevents the program from crashing during QTest runs. Reproducer: cat << EOF |

[PULL 15/18] hw/arm/virt: Avoid unexpected warning from Linux guest on host with Fujitsu CPUs

2024-06-22 Thread Peter Maydell
From: Zhenyu Zhang Multiple warning messages and corresponding backtraces are observed when Linux guest is booted on the host with Fujitsu CPUs. One of them is shown as below. [0.032443] [ cut here ] [0.032446] uart-pl011 900.pl011: ARCH_DMA_MINALIGN smaller

[PULL 09/18] scripts/coverity-scan/COMPONENTS.md: Include libqmp in testlibs

2024-06-22 Thread Peter Maydell
Add libqmp to the testlibs component. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Message-id: 20240604145934.1230583-6-peter.mayd...@linaro.org --- scripts/coverity-scan/COMPONENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PULL 01/18] hw/net/can/xlnx-versal-canfd: Fix sorting of the tx queue

2024-06-22 Thread Peter Maydell
From: Shiva sagar Myana Returning an uint32_t casted to a gint from g_cmp_ids causes the tx queue to become wrongly sorted when executing g_slist_sort. Fix this by always returning -1 or 1 from g_cmp_ids based on the ID comparison instead. Also, if two message IDs are the same, sort them by

[PATCH v4 2/3] hw/clock: Expose 'qtest-clock-period' QOM property for QTests

2024-06-22 Thread Inès Varhol
Expose the clock period via the QOM 'qtest-clock-period' property so it can be used in QTests. This property is only accessible in QTests (not via HMP). Signed-off-by: Inès Varhol Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Luc Michel --- docs/devel/clocks.rst | 6 ++

[PATCH v4 3/3] tests/qtest: Check STM32L4x5 clock connections

2024-06-22 Thread Inès Varhol
For USART, GPIO and SYSCFG devices, check that clock frequency before and after enabling the peripheral clock in RCC is correct. Signed-off-by: Inès Varhol Reviewed-by: Peter Maydell --- tests/qtest/stm32l4x5.h | 42 + tests/qtest/stm32l4x5_gpio-test.c

[PATCH v4 1/3] hw/misc: Create STM32L4x5 SYSCFG clock

2024-06-22 Thread Inès Varhol
This commit creates a clock in STM32L4x5 SYSCFG and wires it up to the corresponding clock from STM32L4x5 RCC. Signed-off-by: Inès Varhol Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- include/hw/misc/stm32l4x5_syscfg.h | 1 + hw/arm/stm32l4x5_soc.c | 2 ++

[PATCH v4 0/3] Check clock connection between STM32L4x5 RCC and peripherals

2024-06-22 Thread Inès Varhol
Among implemented STM32L4x5 devices, USART, GPIO and SYSCFG have a clock source, but none has a corresponding test in QEMU. This patch makes sure that all 3 devices create a clock correctly, adds a QOM property to access clocks' periods from QTests, and adds QTests checking that clock enable in

Re: [PATCH 09/13] qapi: convert "Note" sections to plain rST

2024-06-22 Thread Markus Armbruster
John Snow writes: > On Fri, Jun 21, 2024 at 8:23 AM Markus Armbruster wrote: [...] >> My reason for four spaces is reducing churn. To see by how much, I >> redid your change. I found a few more notes that don't start with a >> capital letter, or don't end with a period. >> > > ^ Guess I'll

Re: [PATCH 04/13] qapi/parser: preserve indentation in QAPIDoc sections

2024-06-22 Thread Markus Armbruster
John Snow writes: > On Fri, Jun 21, 2024 at 2:38 AM Markus Armbruster wrote: [...] >> I'd like you to express more clearly that you're talking about an >> alternative you rejected. Perhaps like this: >> >> block-level constructs such as code blocks, lists, and other such >> markup. >> >>

Re: standardizing i2c device ids

2024-06-22 Thread Markus Armbruster
Patrick Leis writes: > Corey and Peter, > > My team builds lots of configurations for Qemu boards, and one pain point > has been that the qom path for a device depends on the device insertion > order, child[0], child[1] and the like. Yes. Discussed in my "Dynamic & heterogeneous machines,

Re: [PATCH] docs/cxl: fix some typos

2024-06-22 Thread Hyeongtak Ji
Hello Jonathan, Thank you for your response. On Sat, Jun 22, 2024 at 1:10 AM Jonathan Cameron wrote: > > On Wed, 19 Jun 2024 13:54:59 +0900 > Hyeongtak Ji wrote: > > Hi, some description would be good of how you caught these > (I'm guessing a close read). Just to confirm, are you suggesting

[PULL 21/23] block: rename former bdrv_file_open callbacks

2024-06-22 Thread Paolo Bonzini
Since there is no bdrv_file_open callback anymore, rename the implementations so that they end with "_open" instead of "_file_open". NFS is the exception because all the functions are named nfs_file_*. Suggested-by: Kevin Wolf Signed-off-by: Paolo Bonzini --- block/blkio.c | 8

[PULL 15/23] Revert "host/i386: assume presence of SSE2"

2024-06-22 Thread Paolo Bonzini
This reverts commit b18236897ca15c3db1506d8edb9a191dfe51429c. The x86-64 instruction set can now be tuned down to x86-64 v1 or i386 Pentium Pro. Signed-off-by: Paolo Bonzini --- host/include/i386/host/cpuinfo.h | 1 + util/bufferiszero.c | 4 ++-- util/cpuinfo-i386.c |

[PULL 17/23] meson: remove dead optimization option

2024-06-22 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- meson.build | 13 - meson_options.txt | 2 -- scripts/meson-buildoptions.sh | 3 --- 3 files changed, 18 deletions(-) diff --git a/meson.build b/meson.build index

[PULL 02/23] target/i386: fix CC_OP dump

2024-06-22 Thread Paolo Bonzini
POPCNT was missing, and the entries were all out of order after ADCX/ADOX/ADCOX were moved close to EFLAGS. Just use designated initializers. Fixes: 4885c3c4953 ("target-i386: Use ctpop helper", 2017-01-10) Fixes: cc155f19717 ("target/i386: rewrite flags writeback for ADCX/ADOX", 2024-06-11)

[PULL 07/23] target/i386: decode address before going back to translate.c

2024-06-22 Thread Paolo Bonzini
There are now relatively few unconverted opcodes in translate.c (there are 13 of them including 8 for x87), and all of them have the same format with a mod/rm byte and no immediate. A good next step is to remove the early bail out to disas_insn_x87/disas_insn_old, instead giving these legacy

[PULL 01/23] configure: detect --cpu=mipsisa64r6

2024-06-22 Thread Paolo Bonzini
Treat it as a MIPS64 machine. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 5ad1674ca5f..8b6a2f16ceb 100755 --- a/configure +++ b/configure

[PULL 14/23] Revert "host/i386: assume presence of SSSE3"

2024-06-22 Thread Paolo Bonzini
This reverts commit 433cd6d94a8256af70a5200f236dc8047c3c1468. The x86-64 instruction set can now be tuned down to x86-64 v1 or i386 Pentium Pro. Signed-off-by: Paolo Bonzini --- util/cpuinfo-i386.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/cpuinfo-i386.c

[PULL 22/23] exec: avoid using C++ keywords in function parameters

2024-06-22 Thread Paolo Bonzini
From: Roman Kiryanov to use the QEMU headers with a C++ compiler. Signed-off-by: Roman Kiryanov Link: https://lore.kernel.org/r/20240618224553.878869-1-r...@google.com Signed-off-by: Paolo Bonzini --- include/exec/memory.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PULL 10/23] target/i386: list instructions still in translate.c

2024-06-22 Thread Paolo Bonzini
Group them so that it is easier to figure out which two-byte opcodes to tackle together. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 31 +++ 1 file changed, 31 insertions(+) diff --git

[PULL 04/23] target/i386: give CC_OP_POPCNT low bits corresponding to MO_TL

2024-06-22 Thread Paolo Bonzini
Handle it like the other arithmetic cc_ops. This simplifies a bit the implementation of bit test instructions. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 13 +++-- target/i386/tcg/translate.c | 3 +-- 2 files changed, 12

[PULL 00/23] Misc changes for 2024-06-22

2024-06-22 Thread Paolo Bonzini
The following changes since commit 223696363bb117241ad9c2facbff0c474afa4104: Merge tag 'edgar/xilinx-queue-2024-06-17.for-upstream' of https://gitlab.com/edgar.iglesias/qemu into staging (2024-06-18 13:08:01 -0700) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git

[PULL 05/23] target/i386: convert bit test instructions to new decoder

2024-06-22 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.h | 3 + target/i386/tcg/translate.c | 147 +- target/i386/tcg/decode-new.c.inc | 40 ++--- target/i386/tcg/emit.c.inc | 149

[PULL 08/23] target/i386: convert CMPXCHG8B/CMPXCHG16B to new decoder

2024-06-22 Thread Paolo Bonzini
This moves the last LOCK-enabled instructions to the new decoder. It is now possible to assume that PREFIX_LOCK gen_multi0F is called only after checking that LOCK was not specified. The gen_cmpxchg8b and gen_cmpxchg16b functions even have the correct prototype already; the only thing that needs

[PULL 23/23] exec: don't use void* in pointer arithmetic in headers

2024-06-22 Thread Paolo Bonzini
From: Roman Kiryanov void* pointer arithmetic is a GCC extentension which could not be available in other build tools (e.g. C++). This changes removes this assumption. Signed-off-by: Roman Kiryanov Suggested-by: Paolo Bonzini Link:

[PULL 20/23] block: remove separate bdrv_file_open callback

2024-06-22 Thread Paolo Bonzini
bdrv_file_open and bdrv_open are completely equivalent, they are never checked except to see which one to invoke. So merge them into a single one. Signed-off-by: Paolo Bonzini --- include/block/block_int-common.h | 3 --- block.c | 4 +--- block/blkdebug.c

[PULL 19/23] block: do not check bdrv_file_open

2024-06-22 Thread Paolo Bonzini
The set of BlockDrivers that have .bdrv_file_open coincides with those that have .protocol_name and guess what---checking drv->bdrv_file_open is done to see if the driver is a protocol. So check drv->protocol_name instead. Signed-off-by: Paolo Bonzini --- block.c | 11 +-- 1 file

[PULL 18/23] block: make assertion more generic

2024-06-22 Thread Paolo Bonzini
.bdrv_needs_filename is only set for drivers that also set bdrv_file_open, i.e. protocol drivers. So we can make the assertion always, it will always pass for those drivers that use bdrv_open. Signed-off-by: Paolo Bonzini --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PULL 12/23] target/i386: remove gen_ext_tl

2024-06-22 Thread Paolo Bonzini
With the introduction of tcg_gen_ext_tl, most uses can be converted directly because they do not have a NULL destination. tcg_gen_ext_tl is able to drop no-ops like "tcg_gen_ext_tl(tcgv, tcgv, MO_TL)" just fine, and the only thing that gen_ext_tl was adding on top was avoiding the creation of a

[PULL 16/23] meson: allow configuring the x86-64 baseline

2024-06-22 Thread Paolo Bonzini
Add a Meson option to configure which x86-64 instruction set to use. QEMU will now default to x86-64-v1 + cmpxchg16b for 64-bit builds (that corresponds to a Pentium 4 for 32-bit builds). The baseline can be tuned down to Pentium Pro for 32-bit builds (with -Dx86_version=0), or up as desired.

[PULL 13/23] Revert "host/i386: assume presence of POPCNT"

2024-06-22 Thread Paolo Bonzini
This reverts commit 45ccdbcb24baf99667997fac5cf60318e5e7db51. The x86-64 instruction set can now be tuned down to x86-64 v1 or i386 Pentium Pro. Signed-off-by: Paolo Bonzini --- host/include/i386/host/cpuinfo.h | 1 + tcg/i386/tcg-target.h| 5 +++-- util/cpuinfo-i386.c

[PULL 09/23] target/i386: do not check PREFIX_LOCK in old-style decoder

2024-06-22 Thread Paolo Bonzini
It is already checked before getting there. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 26 -- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c

[PULL 03/23] target/i386: use cpu_cc_dst for CC_OP_POPCNT

2024-06-22 Thread Paolo Bonzini
It is the only CCOp, among those that compute ZF from one of the cc_op_* registers, that uses cpu_cc_src. Do not make it the odd one off, instead use cpu_cc_dst like the others. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 2 +-

[PULL 11/23] target/i386: assert that cc_op* and pc_save are preserved

2024-06-22 Thread Paolo Bonzini
Now all decoding has been done before any code generation. There is no need anymore to save and restore cc_op* and pc_save but, for the time being, assert that this is indeed the case. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 12 +++-

[PULL 06/23] target/i386: try not to force EFLAGS computation for CC_OP_ADOX/ADCX

2024-06-22 Thread Paolo Bonzini
When computing the "other" flag (CF for CC_OP_ADOX, OF for CC_OP_ADCX), take into account that it is already in the right position of cpu_cc_src, just like for CC_OP_EFLAGS. There is no need to call gen_compute_eflags(). Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini ---

Re: [RFC] vhost: Introduce packed vq and add buffer elements

2024-06-21 Thread Sahil
Hi, On Wednesday, June 19, 2024 3:49:29 PM GMT+5:30 Eugenio Perez Martin wrote: > [...] > Hi Sahil, > > Just some nitpicks here and there, > > > [1] https://wiki.qemu.org/Internships/ProjectIdeas/PackedShadowVirtqueue > > > > hw/virtio/vhost-shadow-virtqueue.c | 124

Re: [PATCH v3 02/16] migration: Fix file migration with fdset

2024-06-21 Thread Michael Tokarev
17.06.2024 21:57, Fabiano Rosas wrote: When the "file:" migration support was added we missed the special case in the qemu_open_old implementation that allows for a particular file name format to be used to refer to a set of file descriptors that have been previously provided to QEMU via the

Re: [RFC] vhost: Introduce packed vq and add buffer elements

2024-06-21 Thread Sahil
Hi, Thank you for your reply. On Wednesday, June 19, 2024 1:07:54 PM GMT+5:30 Eugenio Perez Martin wrote: > [...] > > "curr" is being updated here, but descs[i].id is always set to id which > > doesn't change in the loop. So all the descriptors in the chain will have > > the same id. I can't

Re: [PULL 00/28] Migration patches for 2024-06-21

2024-06-21 Thread Richard Henderson
On 6/21/24 10:54, Fabiano Rosas wrote: The following changes since commit 02d9c38236cf8c9826e5c5be61780ccb4ae0: Merge tag 'pull-tcg-20240619' ofhttps://gitlab.com/rth7680/qemu into staging (2024-06-19 14:00:39 -0700) are available in the Git repository at:

Re: [PATCH v1] memory tier: consolidate the initialization of memory tiers

2024-06-21 Thread Andrew Morton
On Fri, 21 Jun 2024 04:48:30 + "Ho-Ren (Jack) Chuang" wrote: > If we simply move the set_node_memory_tier() from memory_tier_init() to > late_initcall(), it will result in HMAT not registering the > mt_adistance_algorithm callback function, Immediate reaction: then don't do that! >

Re: [PATCH v14 00/14] Support blob memory and venus on qemu

2024-06-21 Thread Dmitry Osipenko
On 6/21/24 11:59, Alex Bennée wrote: > Dmitry Osipenko writes: > >> On 6/19/24 20:37, Alex Bennée wrote: >>> So I've been experimenting with Aarch64 TCG with an Intel backend like >>> this: >>> >>> ./qemu-system-aarch64 \ >>>-M virt -cpu cortex-a76 \ >>>-device

Re: [PATCH 05/20] qapi/parser: adjust info location for doc body section

2024-06-21 Thread John Snow
On Mon, May 27, 2024 at 7:58 AM Markus Armbruster wrote: > John Snow writes: > > > On Thu, May 16, 2024, 1:58 AM Markus Armbruster > wrote: > > > >> John Snow writes: > >> > >> > Instead of using the info object for the doc block as a whole, update > >> > the info pointer for each call to

Re: [RFC PATCH 0/7] migration/multifd: Introduce storage slots

2024-06-21 Thread Peter Xu
On Fri, Jun 21, 2024 at 07:40:01PM +0200, Maciej S. Szmigiero wrote: > On 21.06.2024 17:56, Peter Xu wrote: > > On Fri, Jun 21, 2024 at 05:31:54PM +0200, Maciej S. Szmigiero wrote: > > > On 21.06.2024 17:04, Fabiano Rosas wrote: > > > > "Maciej S. Szmigiero" writes: > > > > > > > > > Hi Fabiano,

Re: [PATCH 0/7] pc-bios/s390-ccw: Merge the netboot loader into s390-ccw.img

2024-06-21 Thread Eric Farman
On Fri, 2024-06-21 at 10:24 +0200, Thomas Huth wrote: > We originally built a separate binary for the netboot code since it > was considered as experimental and we could not be sure that the > necessary SLOF module had been checked out. Time passed, the netboot > code proved its usefulness, and

RE: [RFC PATCH] cxl: avoid duplicating report from MCE & device

2024-06-21 Thread Luck, Tony
> So who actually cares about recovering poisoned volatile memory? > I'd like to understand more on how significant a use case this is. > Whilst I can conjecture that its an extreme case of wanting to avoid > loosing the ability to create 1GiB or larger pages due to poison > is that a real problem

Re: [RFC PATCH] cxl: avoid duplicating report from MCE & device

2024-06-21 Thread Jonathan Cameron via
On Fri, 21 Jun 2024 10:59:46 -0700 Dan Williams wrote: > Jonathan Cameron wrote: > > On Wed, 19 Jun 2024 00:53:10 +0800 > > Shiyang Ruan wrote: > > > > > Background: > > > Since CXL device is a memory device, while CPU consumes a poison page of > > > CXL device, it always triggers a MCE by

Re: [RFC PATCH 1/1] hw/arm: FW first ARM processor error injection.

2024-06-21 Thread Jonathan Cameron via
On Fri, 21 Jun 2024 17:51:15 +0100 wrote: > From: Shiju Jose Thanks for posting this. Given this is going to linux-edac, probably should mention this is QEMU based error injection. For cross postings between kernel related and qemu lists I tend to stick qemu in the [] of the patch

[PULL 27/28] tests/migration-tests: Cover postcopy failure on reconnect

2024-06-21 Thread Fabiano Rosas
From: Peter Xu Make sure there will be an event for postcopy recovery, irrelevant of whether the reconnect will success, or when the failure happens. The added new case is to fail early in postcopy recovery, in which case it didn't even reach RECOVER stage on src (and in real life it'll be the

[PULL 06/28] monitor: Introduce monitor_fdset_*free

2024-06-21 Thread Fabiano Rosas
Introduce new functions to remove and free no longer used fds and fdsets. We need those to decouple the remove/free routines from monitor_fdset_cleanup() which will go away in the next patches. The new functions: - monitor_fdset_free/_if_empty() will be used when a monitor connection closes

[PULL 03/28] tests/qtest/migration: Fix file migration offset check

2024-06-21 Thread Fabiano Rosas
When doing file migration, QEMU accepts an offset that should be skipped when writing the migration stream to the file. The purpose of the offset is to allow the management layer to put its own metadata at the start of the file. We have tests for this in migration-test, but only testing that the

[PULL 02/28] migration: Fix file migration with fdset

2024-06-21 Thread Fabiano Rosas
When the "file:" migration support was added we missed the special case in the qemu_open_old implementation that allows for a particular file name format to be used to refer to a set of file descriptors that have been previously provided to QEMU via the add-fd QMP command. When using this fdset

[PULL 23/28] tests/migration-tests: Drop most WIN32 ifdefs for postcopy failure tests

2024-06-21 Thread Fabiano Rosas
From: Peter Xu Most of them are not needed, we can stick with one ifdef inside postcopy_recover_fail() so as to cover the scm right tricks only. The tests won't run on windows anyway due to has_uffd always false. Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu Signed-off-by: Fabiano Rosas

[PULL 17/28] migration/multifd: Avoid the final FLUSH in complete()

2024-06-21 Thread Fabiano Rosas
From: Peter Xu We always do the flush when finishing one round of scan, and during complete() phase we should scan one more round making sure no dirty page existed. In that case we shouldn't need one explicit FLUSH at the end of complete(), as when reaching there all pages should have been

[PULL 20/28] migration: Cleanup incoming migration setup state change

2024-06-21 Thread Fabiano Rosas
From: Peter Xu Destination QEMU can setup incoming ports for two purposes: either a fresh new incoming migration, in which QEMU will switch to SETUP for channel establishment, or a paused postcopy migration, in which QEMU will stay in POSTCOPY_PAUSED until kicking off the RECOVER phase. Now the

[PULL 01/28] migration: Drop reference to QIOChannel if file seeking fails

2024-06-21 Thread Fabiano Rosas
We forgot to drop the reference to the QIOChannel in the error path of the offset adjustment. Do it now. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/migration/file.c b/migration/file.c index ab18ba505a..2bb8c64092

[PULL 08/28] monitor: Simplify fdset and fd removal

2024-06-21 Thread Fabiano Rosas
Remove fds right away instead of setting the ->removed flag. We don't need the extra complexity of having a cleanup function reap the removed entries at a later time. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- monitor/fds.c | 27 ++- 1 file changed, 6

[PULL 05/28] monitor: Drop monitor_fdset_dup_fd_find/_remove()

2024-06-21 Thread Fabiano Rosas
From: Peter Xu Those functions are not needed, one remove function should already work. Clean it up. Here the code doesn't really care about whether we need to keep that dupfd around if close() failed: when that happens something got very wrong, keeping the dup_fd around the fdsets may not

[PULL 13/28] tests/qtest/migration: Add tests for file migration with direct-io

2024-06-21 Thread Fabiano Rosas
The tests are only allowed to run in systems that know about the O_DIRECT flag and in filesystems which support it. Note: this also brings back migrate_set_parameter_bool() which went away when we removed the compression tests. I copied it verbatim. Reviewed-by: Peter Xu Signed-off-by: Fabiano

[PULL 24/28] tests/migration-tests: Always enable migration events

2024-06-21 Thread Fabiano Rosas
From: Peter Xu Libvirt should always enable it, so it'll be nice qtest also cover that for all tests on both sides. migrate_incoming_qmp() used to enable it only on dst, now we enable them on both, as we'll start to sanity check events even on the src QEMU. We'll need to leave the one in

[PULL 14/28] monitor: fdset: Match against O_DIRECT

2024-06-21 Thread Fabiano Rosas
We're about to enable the use of O_DIRECT in the migration code and due to the alignment restrictions imposed by filesystems we need to make sure the flag is only used when doing aligned IO. The migration will do parallel IO to different regions of a file, so we need to use more than one file

[PULL 16/28] tests/qtest/migration: Add a test for mapped-ram with passing of fds

2024-06-21 Thread Fabiano Rosas
Add a multifd test for mapped-ram with passing of fds into QEMU. This is how libvirt will consume the feature. There are a couple of details to the fdset mechanism: - multifd needs two distinct file descriptors (not duplicated with dup()) so it can enable O_DIRECT only on the channels that do

[PULL 00/28] Migration patches for 2024-06-21

2024-06-21 Thread Fabiano Rosas
The following changes since commit 02d9c38236cf8c9826e5c5be61780ccb4ae0: Merge tag 'pull-tcg-20240619' of https://gitlab.com/rth7680/qemu into staging (2024-06-19 14:00:39 -0700) are available in the Git repository at: https://gitlab.com/farosas/qemu.git

[PULL 04/28] tests/qtest/migration: Add a precopy file test with fdset

2024-06-21 Thread Fabiano Rosas
Add a test for file migration using fdset. The passing of fds is more complex than using a file path. This is also the scenario where it's most important we ensure that the initial migration stream offset is respected because the fdset interface is the one used by the management layer when

[PULL 19/28] migration: Use MigrationStatus instead of int

2024-06-21 Thread Fabiano Rosas
From: Peter Xu QEMU uses "int" in most cases even if it stores MigrationStatus. I don't know why, so let's try to do that right and see what blows up.. Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration.c | 24 +++-

[PULL 26/28] tests/migration-tests: Verify postcopy-recover-setup status

2024-06-21 Thread Fabiano Rosas
From: Peter Xu Making sure the postcopy-recover-setup status is present in the postcopy failure unit test. Note that it only applies to src QEMU not dest. Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Signed-off-by: Fabiano Rosas --- tests/qtest/migration-test.c | 6 ++ 1 file

[PULL 09/28] monitor: Report errors from monitor_fdset_dup_fd_add

2024-06-21 Thread Fabiano Rosas
I'm keeping the EACCES because callers expect to be able to look at errno. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- include/monitor/monitor.h | 2 +- monitor/fds.c | 10 +- stubs/fdset.c | 2 +- util/osdep.c | 10 +- 4 files

[PULL 21/28] migration/postcopy: Add postcopy-recover-setup phase

2024-06-21 Thread Fabiano Rosas
From: Peter Xu This patch adds a migration state on src called "postcopy-recover-setup". The new state will describe the intermediate step starting from when the src QEMU received a postcopy recovery request, until the migration channels are properly established, but before the recovery process

[PULL 25/28] tests/migration-tests: migration_event_wait()

2024-06-21 Thread Fabiano Rosas
From: Peter Xu Introduce a small helper to wait for a migration event, generalized from the incoming migration path. Make the helper easier to use by allowing it to keep waiting until the expected event is received. Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Signed-off-by: Fabiano

[PULL 22/28] migration/docs: Update postcopy recover session for SETUP phase

2024-06-21 Thread Fabiano Rosas
From: Peter Xu Firstly, the "Paused" state was added in the wrong place before. The state machine section was describing PostcopyState, rather than MigrationStatus. Drop the Paused state descriptions. Then in the postcopy recover session, add more information on the state machine for

[PULL 18/28] migration: Rename thread debug names

2024-06-21 Thread Fabiano Rosas
From: Peter Xu The postcopy thread names on dest QEMU are slightly confusing, partly I'll need to blame myself on 36f62f11e4 ("migration: Postcopy preemption preparation on channel creation"). E.g., "fault-fast" reads like a fast version of "fault-default", but it's actually the fast version of

[PULL 28/28] migration: Remove unused VMSTATE_ARRAY_TEST() macro

2024-06-21 Thread Fabiano Rosas
From: Philippe Mathieu-Daudé Last use of VMSTATE_ARRAY_TEST() was removed in commit 46baa9007f ("migration/i386: Remove old non-softfloat 64bit FP support"), we can safely get rid of it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Li Zhijian Reviewed-by: Peter Xu Signed-off-by:

[PULL 12/28] migration/multifd: Add direct-io support

2024-06-21 Thread Fabiano Rosas
When multifd is used along with mapped-ram, we can take benefit of a filesystem that supports the O_DIRECT flag and perform direct I/O in the multifd threads. This brings a significant performance improvement because direct-io writes bypass the page cache which would otherwise be thrashed by the

[PULL 11/28] migration: Add direct-io parameter

2024-06-21 Thread Fabiano Rosas
Add the direct-io migration parameter that tells the migration code to use O_DIRECT when opening the migration stream file whenever possible. This is currently only used with the mapped-ram migration that has a clear window guaranteed to perform aligned writes. Acked-by: Markus Armbruster

[PULL 10/28] io: Stop using qemu_open_old in channel-file

2024-06-21 Thread Fabiano Rosas
We want to make use of the Error object to report fdset errors from qemu_open_internal() and passing the error pointer to qemu_open_old() would require changing all callers. Move the file channel to the new API instead. Reviewed-by: Daniel P. Berrangé Reviewed-by: Peter Xu Signed-off-by:

[PULL 15/28] migration: Add documentation for fdset with multifd + file

2024-06-21 Thread Fabiano Rosas
With the last few changes to the fdset infrastructure, we now allow multifd to use an fdset when migrating to a file. This is useful for the scenario where the management layer wants to have control over the migration file. By receiving the file descriptors directly, QEMU can delegate some high

[PULL 07/28] monitor: Stop removing non-duplicated fds

2024-06-21 Thread Fabiano Rosas
monitor_fdsets_cleanup() currently has three responsibilities: 1- Remove the fds that have been marked for removal(->removed=true) by qmp_remove_fd(). This is overly complicated, but ok. 2- Remove any file descriptors that have been passed into QEMU and never duplicated[1,2]. A file

Re: [RFC PATCH] cxl: avoid duplicating report from MCE & device

2024-06-21 Thread Dan Williams
Shiyang Ruan wrote: > Background: > Since CXL device is a memory device, while CPU consumes a poison page of > CXL device, it always triggers a MCE by interrupt (INT18), no matter > which-First path is configured. This is the first report. Then > currently, in FW-First path, the poison event

command line syntax for connecting a chardev to a CPU

2024-06-21 Thread Peter Maydell
Arm CPUs have a "debug communications channel" which on real hardware is basically a way to talk to the debugger on the other end of a JTAG connection; Linux supports using this as a console. This patchseries: https://patchew.org/QEMU/20240614093026.328271-1-sai.pavan.bo...@amd.com/ proposes

Re: [PATCH 09/13] qapi: convert "Note" sections to plain rST

2024-06-21 Thread John Snow
On Fri, Jun 21, 2024 at 8:23 AM Markus Armbruster wrote: > John Snow writes: > > > On Thu, Jun 20, 2024 at 11:46 AM John Snow wrote: > > > >> > >> > >> On Thu, Jun 20, 2024, 9:35 AM Markus Armbruster > wrote: > >> > >>> Markus Armbruster writes: > >>> > >>> > John Snow writes: > >>> > >>>

  1   2   3   4   5   6   7   8   9   10   >