[PULL 22/26] hw/mips/loongson3_virt: Emulate suspend function

2024-05-08 Thread Philippe Mathieu-Daudé
From: Jiaxun Yang Suspend function is emulated as what hardware actually do. Doorbell register fields are updates to include suspend value, suspend vector is encoded in firmware blob and fw_cfg is updated to include S3 bits as what x86 did. Signed-off-by: Jiaxun Yang Message-ID: <20240

[PULL 26/26] misc: Use QEMU header path relative to include/ directory

2024-05-08 Thread Philippe Mathieu-Daudé
QEMU headers are relative to the include/ directory, not to the project root directory. Remove "include/". See also: https://www.qemu.org/docs/master/devel/style.html#include-directives Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson Message-Id:

[PULL 06/26] system/physmem: Replace qemu_mutex_lock() calls with QEMU_LOCK_GUARD

2024-05-08 Thread Philippe Mathieu-Daudé
Simplify cpu_[un]register_map_client() and cpu_notify_map_clients() by replacing the pair of qemu_mutex_lock/qemu_mutex_unlock calls by the WITH_QEMU_LOCK_GUARD() macro. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Mattias Nissler Reviewed-by: Peter Xu Mess

[PULL 25/26] hw/intc/loongson_ipi: Implement IOCSR address space for MIPS

2024-05-08 Thread Philippe Mathieu-Daudé
: Jiaxun Yang Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240508-loongson3-ipi-v1-3-1a7b67704...@flygoat.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/intc/loongson_ipi.c | 39 ++- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/h

[PULL 23/26] hw/intc/loongarch_ipi: Remove pointless MAX_CPU check

2024-05-08 Thread Philippe Mathieu-Daudé
From: Jiaxun Yang Since cpuid will be checked by ipi_getcpu anyway, there is no point to enforce MAX_CPU here. This also saved us from including loongarch board header. Signed-off-by: Jiaxun Yang Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240508-loongson3-ipi-v1-1-1a7b67

[PULL 24/26] hw/intc/loongarch_ipi: Rename as loongson_ipi

2024-05-08 Thread Philippe Mathieu-Daudé
From: Jiaxun Yang This device will be shared among LoongArch and MIPS based Loongson machine, rename it as loongson_ipi to reflect this nature. Signed-off-by: Jiaxun Yang Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240508-loongson3-ipi-v1-2-1a7b67704...@flygoat.com> Signed-

[PULL 15/26] hw/usb/dev-network: Remove unused struct 'rndis_config_parameter'

2024-05-08 Thread Philippe Mathieu-Daudé
From: "Dr. David Alan Gilbert" As far as I can tell it was never used. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240505171444.02-5-d...@treblig.org> Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/dev-network.c | 8 1 file changed,

[PULL 19/26] hw/loongarch/virt: Fix memory leak

2024-05-08 Thread Philippe Mathieu-Daudé
From: Song Gao The char pointer 'ramName' point to a block of memory, but never free it. Use 'g_autofree' to automatically free it. Resolves: Coverity CID 1544773 Fixes: 0cf1478d6 ("hw/loongarch: Add numa support") Signed-off-by: Song Gao Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathi

[PULL 08/26] system/physmem: Per-AddressSpace bounce buffering

2024-05-08 Thread Philippe Mathieu-Daudé
From: Mattias Nissler Instead of using a single global bounce buffer, give each AddressSpace its own bounce buffer. The MapClient callback mechanism moves to AddressSpace accordingly. This is in preparation for generalizing bounce buffer handling further to allow multiple bounce buffers, with a

[PULL 17/26] hw/ppc: Deprecate 'ref405ep' machine and 405 CPUs

2024-05-08 Thread Philippe Mathieu-Daudé
From: Cédric Le Goater The 'ref405ep' machine and PPC 405 CPU have no known users, firmware images are not available, OpenWRT dropped support in 2019, U-Boot in 2017, Linux also is dropping support in 2024. It is time to let go of this ancient hardware and focus on newer CPUs and platforms. Sign

[PULL 18/26] hw/loongarch: move memory map to boot.c

2024-05-08 Thread Philippe Mathieu-Daudé
From: Paolo Bonzini Ensure that it can be used even if virt.c is not included in the build, as is the case for --without-default-devices. Signed-off-by: Paolo Bonzini Acked-by: Richard Henderson Message-ID: <20240507145135.270803-1-pbonz...@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --

[PULL 10/26] hw/i386/Kconfig: Allow to compile Q35 without FDC_ISA

2024-05-08 Thread Philippe Mathieu-Daudé
From: Thomas Huth The q35 machine can be used without floppy disk controller (FDC), but due to our current Kconfig setup, the FDC code is still always included in the binary. To fix this, the "PC" config option should only imply the "FDC_ISA" instead of always selecting it. The i440fx and the is

[PULL 21/26] hw/loongarch: Rename LoongArchMachineState with LoongArchVirtMachineState

2024-05-08 Thread Philippe Mathieu-Daudé
From: Bibo Mao Rename LoongArchMachineState with LoongArchVirtMachineState, and change variable name LoongArchMachineState *lams with LoongArchVirtMachineState *lvms. Rename function specific for virtmachine loongarch_xxx() with virt_xxx(). However some common functions keep unchanged such as lo

[PULL 20/26] hw/loongarch: Rename LOONGARCH_MACHINE with LOONGARCH_VIRT_MACHINE

2024-05-08 Thread Philippe Mathieu-Daudé
From: Bibo Mao On LoongArch system, there is only virt machine type now, name LOONGARCH_MACHINE is confused, rename it with LOONGARCH_VIRT_MACHINE. Machine name about Other real hw boards can be added in future. Signed-off-by: Bibo Mao Reviewed-by: Philippe Mathieu-Daudé Message-ID: <202405080

[PULL 11/26] hw/i386: Add the possibility to use i440fx and isapc without FDC

2024-05-08 Thread Philippe Mathieu-Daudé
From: Thomas Huth The i440fx and the isapc machines can be used in binaries without FDC, too. We just have to make sure that they don't try to instantiate the FDC when it is not available. Signed-off-by: Thomas Huth Acked-by: Philippe Mathieu-Daudé Message-ID: <20240425184315.553329-4-th...@re

[PULL 14/26] hw/i386/x86: Don't leak "isa-bios" memory regions

2024-05-08 Thread Philippe Mathieu-Daudé
From: Bernhard Beschow Fix the leaking in x86_bios_rom_init() and pc_isa_bios_init() by adding an "isa_bios" attribute to X86MachineState. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240430150643.111976-4-shen...@gmai

[PATCH v3 0/6] X86: Alias isa-bios area and clean up

2024-05-08 Thread Bernhard Beschow
This series changes the "isa-bios" MemoryRegion to be an alias rather than a copy in the pflash case. This fixes issuing pflash commands in the isa-bios region which matches real hardware and which some real-world legacy bioses I'm running rely on. Furthermore, aliasing in the isa-bios area is alre

[PATCH v3 3/6] hw/i386/x86: Don't leak "isa-bios" memory regions

2024-05-08 Thread Bernhard Beschow
Fix the leaking in x86_bios_rom_init() and pc_isa_bios_init() by adding an "isa_bios" attribute to X86MachineState. Suggested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Bernhard Beschow --- include/hw/i386/x86.h | 7 +++ hw/i386/pc_sysfw.c| 7 +++

[PATCH v3 1/6] hw/i386/x86: Eliminate two if statements in x86_bios_rom_init()

2024-05-08 Thread Bernhard Beschow
Given that memory_region_set_readonly() is a no-op when the readonlyness is already as requested it is possible to simplify the pattern if (condition) { foo(true); } to foo(condition); which is shorter and allows to see the invariant of the code more easily. Signed-off-by: Bernhard B

[PATCH v3 4/6] hw/i386/x86: Don't leak "pc.bios" memory region

2024-05-08 Thread Bernhard Beschow
Fix the leaking in x86_bios_rom_init() by adding a "bios" attribute to X86MachineState. Note that it is only used in the -bios case. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Bernhard Beschow --- include/hw/i386/x86.h | 6 ++ hw/i386/x86.c | 13 ++--- 2 files chang

[PATCH v3 2/6] hw/i386: Have x86_bios_rom_init() take X86MachineState rather than MachineState

2024-05-08 Thread Bernhard Beschow
The function creates and leaks two MemoryRegion objects regarding the BIOS which will be moved into X86MachineState in the next steps to avoid the leakage. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Bernhard Beschow --- include/hw/i386/x86.h | 2 +- hw/i386/microvm.c | 2 +- hw/i386

[PATCH v3 6/6] hw/i386/pc_sysfw: Alias rather than copy isa-bios region

2024-05-08 Thread Bernhard Beschow
In the -bios case the "isa-bios" memory region is an alias to the BIOS mapped to the top of the 4G memory boundary. Do the same in the -pflash case, but only for new machine versions for migration compatibility. This establishes common behavior and makes pflash commands work in the "isa-bios" regio

[PATCH v3 5/6] hw/i386/x86: Extract x86_isa_bios_init() from x86_bios_rom_init()

2024-05-08 Thread Bernhard Beschow
The function is inspired by pc_isa_bios_init() and should eventually replace it. Using x86_isa_bios_init() rather than pc_isa_bios_init() fixes pflash commands to work in the isa-bios region. While at it convert the magic number 0x10 (== 1MiB) to increase readability. Reviewed-by: Philippe Ma

[PATCH v14 1/6] ui/gtk: Check if fence_fd is equal to or greater than 0

2024-05-08 Thread dongwon . kim
From: Dongwon Kim 'fence_fd' needs to be validated always before being referenced And the passing condition should include '== 0' as 0 is a valid value for the file descriptor. Suggested-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Cc: Philippe Mathieu-Daudé Cc: Daniel P. Berrangé C

[PATCH v14 2/6] ui/console: new dmabuf.h and dmabuf.c for QemuDmaBuf struct and helpers

2024-05-08 Thread dongwon . kim
From: Dongwon Kim New header and source files are added for containing QemuDmaBuf struct definition and newly introduced helpers for creating/freeing the struct and accessing its data. v10: Change the license type for both dmabuf.h and dmabuf.c from MIT to GPL to be in line with QEMU's defa

[PATCH v14 5/6] ui/console: Use qemu_dmabuf_new() and free() helpers instead

2024-05-08 Thread dongwon . kim
From: Dongwon Kim This commit introduces utility functions for the creation and deallocation of QemuDmaBuf instances. Additionally, it updates all relevant sections of the codebase to utilize these new utility functions. v7: remove prefix, "dpy_gl_" from all helpers qemu_dmabuf_free() return

[PATCH v14 4/6] ui/console: Use qemu_dmabuf_set_..() helpers instead

2024-05-08 Thread dongwon . kim
From: Dongwon Kim This commit updates all occurrences where these fields were set directly have been updated to utilize helper functions. v7: removed prefix, "dpy_gl_" from all helpers v8: Introduction of helpers was removed as those were already added by the previous commit Suggested-by:

[PATCH v14 0/6] ui/console: Private QemuDmaBuf struct

2024-05-08 Thread dongwon . kim
From: Dongwon Kim This series introduces privacy enhancements to the QemuDmaBuf struct and its contained data to bolster security. it accomplishes this by introducing of helper functions for allocating, deallocating, and accessing individual fields within the struct and replacing all direct refer

[PATCH v14 6/6] ui/console: move QemuDmaBuf struct def to dmabuf.c

2024-05-08 Thread dongwon . kim
From: Dongwon Kim To complete privatizing process of QemuDmaBuf, QemuDmaBuf struct def is moved to dmabuf.c Suggested-by: Marc-André Lureau Reviewed-by: Marc-André Lureau Cc: Philippe Mathieu-Daudé Cc: Daniel P. Berrangé Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim --- include/ui/dmabuf

Re: [PATCH v2 0/6] This series changes the "isa-bios" MemoryRegion to be an alias rather than a

2024-05-08 Thread Bernhard Beschow
Am 8. Mai 2024 14:53:49 UTC schrieb "Philippe Mathieu-Daudé" : >On 30/4/24 17:06, Bernhard Beschow wrote: > >> Bernhard Beschow (6): >>hw/i386/x86: Eliminate two if statements in x86_bios_rom_init() >>hw/i386: Have x86_bios_rom_init() take X86MachineState rather than >> MachineStat

[PATCH v14 3/6] ui/console: Use qemu_dmabuf_get_..() helpers instead

2024-05-08 Thread dongwon . kim
From: Dongwon Kim This commit updates all instances where fields within the QemuDmaBuf struct are directly accessed, replacing them with calls to these new helper functions. v6: fix typos in helper names in ui/spice-display.c v7: removed prefix, "dpy_gl_" from all helpers v8: Introduction of h

Re: [PATCH] hw/virtio: Fix obtain the buffer id from the last descriptor

2024-05-08 Thread Michael S. Tsirkin
On Wed, May 08, 2024 at 02:56:11PM +0200, Eugenio Perez Martin wrote: > On Mon, Apr 22, 2024 at 3:41 AM Wafer wrote: > > > > The virtio-1.3 specification > > writes: > > 2.8.6 Next Flag: Descriptor Chaining > > Buffer ID is in

Re: [PATCH 8/9] migration: Add support for fdset with multifd + file

2024-05-08 Thread Peter Xu
On Wed, May 08, 2024 at 09:53:48AM +0100, Daniel P. Berrangé wrote: > On Fri, Apr 26, 2024 at 11:20:41AM -0300, Fabiano Rosas wrote: > > 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 migratio

Re: [PATCH] scripts/simpletrace: Mark output with unstable timestamp as WARN

2024-05-08 Thread Stefan Hajnoczi
On Wed, 8 May 2024 at 00:19, Zhao Liu wrote: > > In some trace log, there're unstable timestamp breaking temporal > ordering of trace records. For example: > > kvm_run_exit -0.015 pid=3289596 cpu_index=0x0 reason=0x6 > kvm_vm_ioctl -0.020 pid=3289596 type=0xc008ae67 arg=0x7ffeefb5aa60 > kv

Re: [PATCH v8] virtio-pci: fix use of a released vector

2024-05-08 Thread Michael Tokarev
15.04.2024 12:34, Michael S. Tsirkin wrote: From: 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

Re: [PATCH v3 0/6] X86: Alias isa-bios area and clean up

2024-05-08 Thread BALATON Zoltan
On Wed, 8 May 2024, Bernhard Beschow wrote: This series changes the "isa-bios" MemoryRegion to be an alias rather than a copy in the pflash case. This fixes issuing pflash commands in the isa-bios region which matches real hardware and which some real-world legacy bioses I'm running rely on. Furt

Re: [PATCH 8/9] migration: Add support for fdset with multifd + file

2024-05-08 Thread Fabiano Rosas
Peter Xu writes: > On Wed, May 08, 2024 at 09:53:48AM +0100, Daniel P. Berrangé wrote: >> On Fri, Apr 26, 2024 at 11:20:41AM -0300, Fabiano Rosas wrote: >> > Allow multifd to use an fdset when migrating to a file. This is useful >> > for the scenario where the management layer wants to have contr

Re: [PATCH 2/9] migration: Fix file migration with fdset

2024-05-08 Thread Fabiano Rosas
Daniel P. Berrangé writes: > On Fri, Apr 26, 2024 at 11:20:35AM -0300, Fabiano Rosas wrote: >> When the migration using the "file:" URI was implemented, I don't >> think any of us noticed that if you pass in a file name with the >> format "/dev/fdset/N", this allows a file descriptor to be passed

Re: [PATCH] loongarch64: move memory map to boot.c

2024-05-08 Thread Philippe Mathieu-Daudé
On 7/5/24 16:51, Paolo Bonzini wrote: Ensure that it can be used even if virt.c is not included in the build, as is the case for --without-default-devices. Signed-off-by: Paolo Bonzini --- include/hw/loongarch/boot.h | 10 ++ include/hw/loongarch/virt.h | 10 -- hw/loongarch

Re: [PATCH] misc: Use QEMU header path relative to include/ directory

2024-05-08 Thread Philippe Mathieu-Daudé
On 7/5/24 16:27, Philippe Mathieu-Daudé wrote: QEMU headers are relative to the include/ directory, not to the project root directory. Remove "include/". See also: https://www.qemu.org/docs/master/devel/style.html#include-directives Signed-off-by: Philippe Mathieu-Daudé --- hw/audio/virtio-s

Re: [PATCH v10 0/7] Support message-based DMA in vfio-user server

2024-05-08 Thread Philippe Mathieu-Daudé
On 7/5/24 16:34, Mattias Nissler wrote: This series adds basic support for message-based DMA in qemu's vfio-user server. This is useful for cases where the client does not provide file descriptors for accessing system memory via memory mappings. My motivating use case is to hook up device models

Re: [PATCH v2] ppc: Deprecate 'ref405ep' machine and 405 CPUs

2024-05-08 Thread Philippe Mathieu-Daudé
On 7/5/24 14:33, Cédric Le Goater wrote: The 'ref405ep' machine and PPC 405 CPU have no known users, firmware images are not available, OpenWRT dropped support in 2019, U-Boot in 2017, Linux also is dropping support in 2024. It is time to let go of this ancient hardware and focus on newer CPUs an

Re: [PATCH] hw/loongarch/virt: Fix memory leak

2024-05-08 Thread Philippe Mathieu-Daudé
On 7/5/24 04:22, Song Gao wrote: The char pointer 'ramName' point to a block of memory, but never free it. Use 'g_autofree' to automatically free it. Resolves: Coverity CID 1544773 Fixes: 0cf1478d6 ("hw/loongarch: Add numa support") Signed-off-by: Song Gao --- hw/loongarch/virt.c | 3 +-- 1

Re: [PATCH v10 0/7] Support message-based DMA in vfio-user server

2024-05-08 Thread Mattias Nissler
On Wed, May 8, 2024 at 11:16 PM Philippe Mathieu-Daudé wrote: > > On 7/5/24 16:34, Mattias Nissler wrote: > > This series adds basic support for message-based DMA in qemu's vfio-user > > server. This is useful for cases where the client does not provide file > > descriptors for accessing system me

Re: [PATCH v3 00/28] glib: Replace g_memdup() by g_memdup2()

2024-05-08 Thread Philippe Mathieu-Daudé
On 3/9/21 19:44, Philippe Mathieu-Daudé wrote: Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accide

Re: [PATCH] hw/clock: Expose 'freq-hz' QOM property

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 19:46, Peter Maydell wrote: On Wed, 8 May 2024 at 15:13, Philippe Mathieu-Daudé wrote: Expose the clock frequency via the QOM 'freq-hz' property, as it might be useful for QTests. HMP example: $ qemu-system-mips -S -monitor stdio -M mipssim (qemu) qom-get /machine/cpu-refclk

Re: [PATCH 0/5] hw/mips/loongson3_virt: Implement IPI support

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 15:06, Jiaxun Yang wrote: Hi all, This series enabled IPI support for loongson3 virt board, loosely based on my previous work[1]. It generalized loongarch_ipi device to share among both loongarch and MIPS machines. Signed-off-by: Jiaxun Yang --- Jiaxun Yang (5): hw/intc/loo

Re: [PATCH] hw/mips/loongson3_virt: Emulate suspend function

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 19:28, Jiaxun Yang wrote: 在2024年5月8日五月 下午5:48,Philippe Mathieu-Daudé写道: On 8/5/24 17:35, Philippe Mathieu-Daudé wrote: On 8/5/24 11:31, Jiaxun Yang wrote: Suspend function is emulated as what hardware actually do. Doorbell register fields are updates to include suspend value, suspend

Re: [PATCH] hw/mips/loongson3_virt: Emulate suspend function

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 23:54, Philippe Mathieu-Daudé wrote: On 8/5/24 19:28, Jiaxun Yang wrote: 在2024年5月8日五月 下午5:48,Philippe Mathieu-Daudé写道: On 8/5/24 17:35, Philippe Mathieu-Daudé wrote: On 8/5/24 11:31, Jiaxun Yang wrote: Suspend function is emulated as what hardware actually do. Doorbell register fiel

Re: [PATCH v4 0/5] Add migration test for loongarch64

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 05:11, Bibo Mao wrote: Bibo Mao (5): hw/loongarch: Rename LOONGARCH_MACHINE with LOONGARCH_VIRT_MACHINE hw/loongarch: Rename LoongArchMachineState with LoongArchVirtMachineState Patches 1 & 2 queued to hw-misc so far, thanks.

Re: [PATCH v3 0/6] X86: Alias isa-bios area and clean up

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 19:55, Bernhard Beschow wrote: v3: * Add comments for bios memory regions (Phil) Bernhard Beschow (6): hw/i386/x86: Eliminate two if statements in x86_bios_rom_init() hw/i386: Have x86_bios_rom_init() take X86MachineState rather than MachineState hw/i386/x86: Don't

[PULL v2 00/28] Misc HW patches for 2024-05-08

2024-05-08 Thread Philippe Mathieu-Daudé
d/qemu.git tags/hw-misc-20240508 for you to fetch changes up to 8b4d80bb53af30db5de91749216d0bb73fa93cab: misc: Use QEMU header path relative to include/ directory (2024-05-09 00:07:21 +0200) Misc HW patches - Few more g_memdu

[PULL v2 15/28] hw/i386/x86: Don't leak "pc.bios" memory region

2024-05-08 Thread Philippe Mathieu-Daudé
From: Bernhard Beschow Fix the leaking in x86_bios_rom_init() by adding a "bios" attribute to X86MachineState. Note that it is only used in the -bios case. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Bernhard Beschow Message-ID: <20240508175507.22270-5-shen...@gmail.com> Signed-off-by:

[PULL v2 14/28] hw/i386/x86: Don't leak "isa-bios" memory regions

2024-05-08 Thread Philippe Mathieu-Daudé
From: Bernhard Beschow Fix the leaking in x86_bios_rom_init() and pc_isa_bios_init() by adding an "isa_bios" attribute to X86MachineState. Suggested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Bernhard Beschow Message-ID: <20240508175507.22270-4-shen...@gmail

[PULL v2 16/28] hw/i386/x86: Extract x86_isa_bios_init() from x86_bios_rom_init()

2024-05-08 Thread Philippe Mathieu-Daudé
From: Bernhard Beschow The function is inspired by pc_isa_bios_init() and should eventually replace it. Using x86_isa_bios_init() rather than pc_isa_bios_init() fixes pflash commands to work in the isa-bios region. While at it convert the magic number 0x10 (== 1MiB) to increase readability.

Re: [PATCH] gitlab: Update msys2-64bit runner tags

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 10:28, Philippe Mathieu-Daudé wrote: On 7/5/24 19:53, Richard Henderson wrote: Gitlab has deprecated and removed support for windows-1809 and shared-windows.  Update to saas-windows-medium-amd64 per https://about.gitlab.com/blog/2024/01/22/windows-2022-support-for-gitlab-saas-runners/

Re: [PATCH v2 26/28] target/ppc/mmu_common.c: Move BookE MMU functions together

2024-05-08 Thread BALATON Zoltan
On Wed, 8 May 2024, Nicholas Piggin wrote: On Tue May 7, 2024 at 10:31 PM AEST, BALATON Zoltan wrote: On Tue, 7 May 2024, Nicholas Piggin wrote: What do you think about adding mmu-book3e.c instead? I have considered that but found that some functions have to be in the same file and declared s

[PULL v2 00/13] Migration patches for 2024-05-08

2024-05-08 Thread Fabiano Rosas
The following changes since commit 4e66a08546a2588a4667766a1edab9caccf24ce3: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2024-05-07 09:26:30 -0700) are available in the Git repository at: https://gitlab.com/farosas/qemu.git tags/migration-20240508-pu

Re: [PATCH v3 33/33] target/ppc: Add a macro to check for page protection bit

2024-05-08 Thread BALATON Zoltan
On Wed, 8 May 2024, Nicholas Piggin wrote: On Wed May 8, 2024 at 10:15 AM AEST, BALATON Zoltan wrote: Checking if a page protection bit is set for a given access type is a common operation. Add a macro to avoid repeating the same check at multiple places and also avoid a function call. As this r

[PULL v2 06/13] qapi: introduce exit-on-error parameter for migrate-incoming

2024-05-08 Thread Fabiano Rosas
From: Vladimir Sementsov-Ogievskiy Now we do set MIGRATION_FAILED state, but don't give a chance to orchestrator to query migration state and get the error. Let's provide a possibility for QMP-based orchestrators to get an error like with outgoing migration. For hmp_migrate_incoming(), let's en

[PULL v2 09/13] migration: Remove 'blk/-b' option from migrate commands

2024-05-08 Thread Fabiano Rosas
The block migration is considered obsolete and has been deprecated in 8.2. Remove the migrate command option that enables it. This only affects the QMP and HMP commands, the feature can still be accessed by setting the migration 'block' capability. The whole feature will be removed in a future patc

[PATCH v4 14/33] target/ppc/mmu_common.c: Split off real mode cases in get_physical_address_wtlb()

2024-05-08 Thread BALATON Zoltan
The real mode handling is identical in the remaining switch cases. Split off these common real mode cases into a separate conditional to leave only the else branches in the switch that are different. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 34 +++

[PULL v2 04/13] migration: process_incoming_migration_co(): fix reporting s->error

2024-05-08 Thread Fabiano Rosas
From: Vladimir Sementsov-Ogievskiy It's bad idea to leave critical section with error object freed, but s->error still set, this theoretically may lead to use-after-free crash. Let's avoid it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-

[PATCH v4 17/33] target/ppc/mmu_common.c: Deindent ppc_jumbo_xlate()

2024-05-08 Thread BALATON Zoltan
Instead of putting a large block of code in an if, invert the condition and return early to be able to deindent the code block. Signed-off-by: BALATON Zoltan Acked-by: Nicholas Piggin --- target/ppc/mmu_common.c | 319 1 file changed, 159 insertions(+),

[PATCH v4 27/33] target/ppc/mmu_common.c: Simplify ppc_booke_xlate() part 2

2024-05-08 Thread BALATON Zoltan
Merge the code fetch and data access cases in a common switch. Signed-off-by: BALATON Zoltan --- target/ppc/mmu_common.c | 52 - 1 file changed, 20 insertions(+), 32 deletions(-) diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_common.c index bb49721

[PATCH v4 21/33] target/ppc/mmu_common.c: Don't use mmu_ctx_t in mmubooke206_get_physical_address()

2024-05-08 Thread BALATON Zoltan
mmubooke206_get_physical_address() only uses the raddr and prot fields from mmu_ctx_t. Pass these directly instead of using a ctx struct. Signed-off-by: BALATON Zoltan --- target/ppc/mmu_common.c | 32 ++-- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git

[PULL v2 03/13] migration: process_incoming_migration_co(): complete cleanup on failure

2024-05-08 Thread Fabiano Rosas
From: Vladimir Sementsov-Ogievskiy Make call to migration_incoming_state_destroy(), instead of doing only partial of it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration.c | 5 + 1 file chan

[PATCH v4 24/33] target/ppc/mmu_common.c: Remove BookE from direct store handling

2024-05-08 Thread BALATON Zoltan
As BookE never returns -4 we can drop BookE from the direct store case in ppc_jumbo_xlate(). Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_

[PATCH v4 20/33] target/ppc/mmu_common.c: Don't use mmu_ctx_t in mmubooke_get_physical_address()

2024-05-08 Thread BALATON Zoltan
mmubooke_get_physical_address() only uses the raddr and prot fields from mmu_ctx_t. Pass these directly instead of using a ctx struct. Signed-off-by: BALATON Zoltan --- target/ppc/mmu_common.c | 30 ++ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/ta

[PULL v2 08/13] migration: Remove 'inc' option from migrate command

2024-05-08 Thread Fabiano Rosas
The block incremental option for block migration has been deprecated in 8.2 in favor of using the block-mirror feature. Remove it now. Deprecation commit 40101f320d ("migration: migrate 'inc' command option is deprecated."). Reviewed-by: Markus Armbruster Reviewed-by: Peter Xu Signed-off-by: Fa

[PATCH v4 23/33] target/ppc: Remove pp_check() and reuse ppc_hash32_pp_prot()

2024-05-08 Thread BALATON Zoltan
The ppc_hash32_pp_prot() function in mmu-hash32.c is the same as pp_check() in mmu_common.c, merge these to remove duplicated code. Define the common function in internal.h as static lnline otherwise exporting the function from mmu-hash32.c would stop the compiler inlining it which results in sligh

[PATCH v4 16/33] target/ppc/mmu_common.c: Fix misindented qemu_log_mask() calls

2024-05-08 Thread BALATON Zoltan
Fix several qemu_log_mask() calls that are misindented. Signed-off-by: BALATON Zoltan Acked-by: Nicholas Piggin --- target/ppc/mmu_common.c | 42 - 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_co

[PATCH v4 07/33] target/ppc/mmu_common.c: Simplify checking for real mode

2024-05-08 Thread BALATON Zoltan
In get_physical_address_wtlb() the real_mode flag depends on either the MSR[IR] or MSR[DR] bit depending on access_type. Extract just the needed bit in a more straight forward way instead of doing unnecessary computation. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc

[PATCH v4 05/33] target/ppc/mmu_common.c: Move calculation of a value closer to its usage

2024-05-08 Thread BALATON Zoltan
In mmubooke_check_tlb() and mmubooke206_check_tlb() prot2 is calculated first but only used after an unrelated check that can return before tha value is used. Move the calculation after the check, closer to where it is used, to keep them together and avoid computing it when not needed. Signed-off-

[PATCH v4 12/33] target/ppc/mmu_common.c: Eliminate ret from mmu6xx_get_physical_address()

2024-05-08 Thread BALATON Zoltan
Return directly, which is simpler than dragging a return value through multpile if and else blocks. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 84 +++-- 1 file changed, 39 insertions(+), 45 deletions(-) diff --gi

[PATCH v4 13/33] target/ppc/mmu_common.c: Split out BookE cases before checking real mode

2024-05-08 Thread BALATON Zoltan
BookE does not have real mode so split off and handle it first in get_physical_address_wtlb() before checking for real mode for other MMU models. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deleti

[PULL v2 13/13] hmp/migration: Fix "migrate" command's documentation

2024-05-08 Thread Fabiano Rosas
From: Peter Xu Peter missed the Sphinx HMP document for the "resume/-r" flag in commit 7a4da28b26 ("qmp: hmp: add migrate "resume" option"). Add it. When at it, slightly cleanup the lines around: - Move "detach/-d" to a separate section rather than appending it at the end of the command de

[PATCH v4 02/33] target/ppc: Move patching nip from exception handler to helper_scv

2024-05-08 Thread BALATON Zoltan
From: Nicholas Piggin Unlike sc, for scv a facility unavailable interrupt must be generated if FSCR[SCV]=0 so we can't raise the exception with nip set to next instruction but we can move advancing nip if the FSCR check passes to helper_scv so the exception handler does not need to change it. [b

[PATCH v4 18/33] target/ppc/mmu_common.c: Replace hard coded constants in ppc_jumbo_xlate()

2024-05-08 Thread BALATON Zoltan
The "2" in booke206_update_mas_tlb_miss() call corresponds to MMU_INST_FETCH which is the value of access_type in this branch; mmubooke206_esr() only checks for MMU_DATA_STORE and it's called from code access so using MMU_DATA_LOAD here seems wrong so replace it with access_type here as well that y

[PATCH v4 29/33] target/ppc: Split off common embedded TLB init

2024-05-08 Thread BALATON Zoltan
Several 4xx CPUs and e200 share the same TLB settings enclosed in an ifdef. Split it off in a common function to reduce code duplication and the number of ifdefs. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/cpu_init.c | 46 --

[PULL v2 12/13] migration: Deprecate fd: for file migration

2024-05-08 Thread Fabiano Rosas
The fd: URI can currently trigger two different types of migration, a TCP migration using sockets and a file migration using a plain file. This is in conflict with the recently introduced (8.2) QMP migrate API that takes structured data as JSON-like format. We cannot keep the same backend for both

[PATCH v4 11/33] target/ppc/mmu_common.c: Move some debug logging

2024-05-08 Thread BALATON Zoltan
Move the debug logging within ppc6xx_tlb_check() from after its only call to simplify the caller. Signed-off-by: BALATON Zoltan --- target/ppc/mmu_common.c | 54 ++--- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/target/ppc/mmu_common.c b/ta

[PATCH v4 03/33] target/ppc: Simplify syscall exception handlers

2024-05-08 Thread BALATON Zoltan
After previous changes the hypercall handling in 7xx and 74xx exception handlers can be folded into one if statement to simplify this code. Also add "unlikely" to mark the less frequently used branch for the compiler. Signed-off-by: BALATON Zoltan Reviewed-by: Harsh Prateek Bora --- target/ppc/

[PATCH v4 33/33] target/ppc: Move out BookE and related MMU functions from mmu_common.c

2024-05-08 Thread BALATON Zoltan
Add a new mmu-booke.c file for BookE and related MMU bits from mmu_common.c. Signed-off-by: BALATON Zoltan --- target/ppc/cpu.h| 4 - target/ppc/meson.build | 1 + target/ppc/mmu-booke.c | 532 target/ppc/mmu-booke.h | 17 ++ target/ppc/mm

[PATCH v4 15/33] target/ppc/mmu_common.c: Inline and remove check_physical()

2024-05-08 Thread BALATON Zoltan
This function just does two assignments and and unnecessary check that is always true so inline it in the only caller left and remove it. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 26 +++--- 1 file changed, 3 insertions(+), 23 d

[PULL v2 11/13] migration: Remove non-multifd compression

2024-05-08 Thread Fabiano Rosas
The 'compress' migration capability enables the old compression code which has shown issues over the years and is thought to be less stable and tested than the more recent multifd-based compression. The old compression code has been deprecated in 8.2 and now is time to remove it. Deprecation commi

[PATCH v4 06/33] target/ppc/mmu_common.c: Remove unneeded local variable

2024-05-08 Thread BALATON Zoltan
In mmubooke_check_tlb() and mmubooke206_check_tlb() we can assign the value directly the the destination, no need to have a separate local variable for it. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 30 +- 1 file changed,

[PATCH v4 31/33] target/ppc/mmu-radix64.c: Drop a local variable

2024-05-08 Thread BALATON Zoltan
The value is only used once so no need to introduce a local variable for it. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu-radix64.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c index

[PATCH v4 26/33] target/ppc/mmu_common.c: Simplify ppc_booke_xlate() part 1

2024-05-08 Thread BALATON Zoltan
Move setting error_code that appears in every case out in front and hoist the common fall through case for BOOKE206 as well which allows removing the nested switches. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 41

[PULL v2 01/13] migration/ram.c: API Conversion qemu_mutex_lock(), and qemu_mutex_unlock() to WITH_QEMU_LOCK_GUARD macro

2024-05-08 Thread Fabiano Rosas
From: Will Gyda migration/ram.c: API Conversion qemu_mutex_lock(), and qemu_mutex_unlock() to WITH_QEMU_LOCK_GUARD macro Signed-off-by: Will Gyda Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/ram.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --

[PULL v2 07/13] migration: Remove 'skipped' field from MigrationStats

2024-05-08 Thread Fabiano Rosas
The 'skipped' field of the MigrationStats struct has been deprecated in 8.1. Time to remove it. Deprecation commit 7b24d32634 ("migration: skipped field is really obsolete."). Reviewed-by: Markus Armbruster Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- docs/about/deprecated.rst

[PATCH v4 22/33] target/ppc/mmu_common.c: Make get_physical_address_wtlb() static

2024-05-08 Thread BALATON Zoltan
This function is not used from any other files so make it static and fix the maybe used uninitialised warnings this has uncovered. Also remove mmu_ctx_t definition from internal.h as this type is only used within this file. Signed-off-by: BALATON Zoltan --- target/ppc/internal.h | 17 +

[PULL v2 05/13] migration: process_incoming_migration_co(): rework error reporting

2024-05-08 Thread Fabiano Rosas
From: Vladimir Sementsov-Ogievskiy Unify error reporting in the function. This simplifies the following commit, which will not-exit-on-error behavior variant to the function. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Signed-off-by: F

[PULL v2 02/13] migration: move trace-point from migrate_fd_error to migrate_set_error

2024-05-08 Thread Fabiano Rosas
From: Vladimir Sementsov-Ogievskiy Cover more cases by trace-point. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration.c | 4 +++- migration/trace-events | 2 +- 2 files changed, 4 insertions(+),

[PATCH v4 19/33] target/ppc/mmu_common.c: Don't use mmu_ctx_t for mmu40x_get_physical_address()

2024-05-08 Thread BALATON Zoltan
mmu40x_get_physical_address() only uses the raddr and prot fields from mmu_ctx_t. Pass these directly instead of using a ctx struct. Signed-off-by: BALATON Zoltan --- target/ppc/mmu_common.c | 38 -- 1 file changed, 16 insertions(+), 22 deletions(-) diff --gi

[PATCH v4 04/33] target/ppc: Remove unused helper

2024-05-08 Thread BALATON Zoltan
The helper_rac function is defined but not used, remove it. Fixes: 005b69fdcc (target/ppc: Remove PowerPC 601 CPUs) Signed-off-by: BALATON Zoltan Reviwed-by: Nicholas Piggin --- target/ppc/helper.h | 2 -- target/ppc/mmu_helper.c | 24 2 files changed, 26 deletions

[PULL v2 10/13] migration: Remove block migration

2024-05-08 Thread Fabiano Rosas
The block migration has been considered obsolete since QEMU 8.2 in favor of the more flexible storage migration provided by the blockdev-mirror driver. Two releases have passed so now it's time to remove it. Deprecation commit 66db46ca83 ("migration: Deprecate block migration"). Reviewed-by: Mark

[PATCH v4 25/33] target/ppc/mmu_common.c: Split off BookE handling from ppc_jumbo_xlate()

2024-05-08 Thread BALATON Zoltan
Introduce ppc_booke_xlate() to handle BookE and BookE 2.06 cases to reduce ppc_jumbo_xlate() further. Signed-off-by: BALATON Zoltan --- target/ppc/mmu_common.c | 148 ++-- 1 file changed, 98 insertions(+), 50 deletions(-) diff --git a/target/ppc/mmu_common.c

[PATCH v4 09/33] target/ppc/mmu_common.c: Introduce mmu6xx_get_physical_address()

2024-05-08 Thread BALATON Zoltan
Repurpose get_segment_6xx_tlb() to do the whole address translation for POWERPC_MMU_SOFT_6xx MMU model by moving the BAT check there and renaming it to match other similar functions. These are only called once together so no need to keep these separate functions and combining them simplifies the ca

[PATCH v4 10/33] target/ppc/mmu_common.c: Move else branch to avoid large if block

2024-05-08 Thread BALATON Zoltan
In mmu6xx_get_physical_address() we have a large if block with a two line else branch that effectively returns. Invert the condition and move the else there to allow deindenting the large if block to make the flow easier to follow. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin ---

<    1   2   3   4   >