Re: [PATCH v2 0/9] gfxstream + rutabaga_gfx

2023-08-02 Thread Akihiko Odaki
On 2023/08/01 10:17, Gurchetan Singh wrote: Latest iteration of rutabaga_gfx + gfxstream patches. Previous versions available here: https://patchew.org/QEMU/20230711025649.708-1-gurchetansi...@chromium.org/ https://patchew.org/QEMU/20230421011223.718-1-gurchetansi...@chromium.org/ Changes sin

[PATCH v2 5/6] linux-user: Do nothing if too small brk is specified

2023-08-02 Thread Akihiko Odaki
Linux 6.4.7 does nothing when a value smaller than the initial brk is specified. Fixes: 86f04735ac ("linux-user: Fix brk() to release pages") Reviewed-by: Helge Deller Signed-off-by: Akihiko Odaki --- linux-user/syscall.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[PATCH v2 3/6] linux-user: Do not call get_errno() in do_brk()

2023-08-02 Thread Akihiko Odaki
Later the returned value is compared with -1, and negated errno is not expected. Fixes: 00faf08c95 ("linux-user: Don't use MAP_FIXED in do_brk()") Reviewed-by: Helge Deller Signed-off-by: Akihiko Odaki --- linux-user/syscall.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --

[PATCH v2 4/6] linux-user: Use MAP_FIXED_NOREPLACE for do_brk()

2023-08-02 Thread Akihiko Odaki
MAP_FIXED_NOREPLACE can ensure the mapped address is fixed without concerning that the new mapping overwrites something else. Signed-off-by: Akihiko Odaki --- linux-user/syscall.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/linux-user/syscall.c b/linux-

[PATCH v2 6/6] linux-user: Do not align brk with host page size

2023-08-02 Thread Akihiko Odaki
do_brk() minimizes calls into target_mmap() by aligning the address with host page size, which is potentially larger than the target page size. However, the current implementation of this optimization has two bugs: - The start of brk is rounded up with the host page size while brk advertises an

[PATCH v2 2/6] linux-user: Fix MAP_FIXED_NOREPLACE on old kernels

2023-08-02 Thread Akihiko Odaki
The man page states: > Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE > flag will typically (upon detecting a collision with a preexisting > mapping) fall back to a “non-MAP_FIXED” type of behavior: they will > return an address that is different from the requested address.

[PATCH v2 0/6] linux-user: brk/mmap fixes

2023-08-02 Thread Akihiko Odaki
linux-user was failing on M2 MacBook Air. Digging into the details, I found several bugs in brk and mmap so here are fixes. V1 -> V2: Added reserved_va check. (Richard Henderson) Fixed MAP_FIXED_NOREPLACE on old kernels. Akihiko Odaki (6): linux-user: Unset MAP_FIXED_NOREPLACE for host li

[PATCH v2 1/6] linux-user: Unset MAP_FIXED_NOREPLACE for host

2023-08-02 Thread Akihiko Odaki
Passing MAP_FIXED_NOREPLACE to host will fail if the virtual address space is reserved with mmap. Replace it with MAP_FIXED in such a case. Signed-off-by: Akihiko Odaki --- linux-user/mmap.c | 4 1 file changed, 4 insertions(+) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index a5dfb

Re: [PATCH QEMU v3 1/3] qapi: Reformat the dirty-limit migration doc comments

2023-08-02 Thread Markus Armbruster
Yong Huang writes: > On Tue, Aug 1, 2023 at 8:34 PM Markus Armbruster wrote: > >> ~hyman writes: >> >> > From: Hyman Huang(黄勇) >> > >> > Reformat the dirty-limit migration doc comments to conform >> > to current conventions as commit a937b6aa739 (qapi: Reformat >> > doc comments to conform to

Re: [PATCH 0/5] linux-user: brk/mmap fixes

2023-08-02 Thread Akihiko Odaki
On 2023/08/01 19:43, Helge Deller wrote: On 8/1/23 06:49, Joel Stanley wrote: On Mon, 31 Jul 2023 at 18:24, Helge Deller wrote: As suggested, I've based my patches on top of yours and the tree can be pulled from: git pull https://github.com/hdeller/qemu-hppa/   brk-fixes-akihiko-2 My patches

Re: [PATCH QEMU v3 3/3] MAINTAINERS: Add section "Migration dirty limit and dirty page rate"

2023-08-02 Thread Markus Armbruster
~hyman writes: > From: Hyman Huang(黄勇) > > I've built interests in dirty limit and dirty page rate > features and also have been working on projects related > to this subsystem. > > Add a section to the MAINTAINERS file for migration > dirty limit and dirty page rate. > > Add myself as a maintai

Re: [PATCH QEMU v3 2/3] qapi: Craft the dirty-limit capability comment

2023-08-02 Thread Markus Armbruster
~hyman writes: > From: Hyman Huang(黄勇) > > Signed-off-by: Markus Armbruster > Signed-off-by: Hyman Huang(黄勇) > --- > qapi/migration.json | 13 + > 1 file changed, 5 insertions(+), 8 deletions(-) > > diff --git a/qapi/migration.json b/qapi/migration.json > index a74ade4d72..62ab151

[PULL 0/3] QAPI patches patches for 2023-08-02

2023-08-02 Thread Markus Armbruster
The following changes since commit 38a6de80b917b2a822cff0e38d83563ab401c890: Merge tag 'pull-xen-20230801' of https://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging (2023-08-01 07:27:31 -0700) are available in the Git repository at: https://repo.or.cz/qemu/armbru.git tags/pul

[PULL 1/3] qapi: Reformat the dirty-limit migration doc comments

2023-08-02 Thread Markus Armbruster
From: Hyman Huang(黄勇) Reformat the dirty-limit migration doc comments to conform to current conventions as commit a937b6aa739 (qapi: Reformat doc comments to conform to current conventions). Signed-off-by: Hyman Huang(黄勇) Message-ID: <169073570563.19893.292836476110473348...@git.sr.ht> Reviewed

[PULL 3/3] MAINTAINERS: Add section "Migration dirty limit and dirty page rate"

2023-08-02 Thread Markus Armbruster
From: Hyman Huang(黄勇) I've built interests in dirty limit and dirty page rate features and also have been working on projects related to this subsystem. Add a section to the MAINTAINERS file for migration dirty limit and dirty page rate. Add myself as a maintainer for this subsystem so that I c

[PULL 2/3] qapi: Craft the dirty-limit capability comment

2023-08-02 Thread Markus Armbruster
From: Hyman Huang(黄勇) Signed-off-by: Hyman Huang(黄勇) Message-ID: <169073570563.19893.292836476110473348...@git.sr.ht> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- qapi/migration.json | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/qapi/

Re: [PATCH v6 8/8] linux-user: Load pie executables at upper memory

2023-08-02 Thread Akihiko Odaki
On 2023/08/02 8:27, Helge Deller wrote: Fix the elf loader to calculate a valid TASK_UNMAPPED_BASE address for all 32-bit architectures, based on the GUEST_ADDR_MAX constant. Additionally modify the elf loader to load dynamic pie executables at around: ~ 0x55 for 64-bit guest binaries o

Re: [RFC PATCH 08/19] HostMem: Add private property to indicate to use kvm gmem

2023-08-02 Thread Xiaoyao Li
On 8/2/2023 1:21 AM, David Hildenbrand wrote: On 31.07.23 18:21, Xiaoyao Li wrote: From: Isaku Yamahata Signed-off-by: Isaku Yamahata Signed-off-by: Xiaoyao Li ---   backends/hostmem.c   | 18 ++   include/sysemu/hostmem.h |  2 +-   qapi/qom.json    |  4   3 f

Re: [RFC PATCH 08/19] HostMem: Add private property to indicate to use kvm gmem

2023-08-02 Thread Xiaoyao Li
On 8/1/2023 10:57 PM, Daniel P. Berrangé wrote: On Mon, Jul 31, 2023 at 07:22:05PM +0200, Markus Armbruster wrote: Xiaoyao Li writes: From: Isaku Yamahata Signed-off-by: Isaku Yamahata Signed-off-by: Xiaoyao Li [...] diff --git a/qapi/qom.json b/qapi/qom.json index 7f92ea43e8e1..e0b20

Re: [RFC PATCH 04/19] memory: Introduce memory_region_can_be_private()

2023-08-02 Thread Xiaoyao Li
On 8/2/2023 12:52 AM, Claudio Fontana wrote: On 8/1/23 18:48, Claudio Fontana wrote: On 7/31/23 18:21, Xiaoyao Li wrote: Signed-off-by: Xiaoyao Li --- include/exec/memory.h | 9 + softmmu/memory.c | 5 + 2 files changed, 14 insertions(+) diff --git a/include/exec/memory.h

[PATCH for-8.2 v3 2/6] sysemu: Add prepare callback to struct VMChangeStateEntry

2023-08-02 Thread Avihai Horon
Add prepare callback to struct VMChangeStateEntry. The prepare callback is optional and can be set by the new function qemu_add_vm_change_state_handler_prio_full() that allows setting this callback in addition to the main callback. The prepare callbacks and main callbacks are called in two separa

[PATCH for-8.2 v3 0/6] vfio/migration: Add P2P support for VFIO migration

2023-08-02 Thread Avihai Horon
Hi all, The first patch in this series adds a small optimization to VFIO migration by moving the STOP_COPY->STOP transition to vfio_save_cleanup(). Testing with a ConnectX-7 VFIO device showed that this can reduce downtime by up to 6%. The rest of the series adds P2P support for VFIO migration.

[PATCH for-8.2 v3 1/6] vfio/migration: Move from STOP_COPY to STOP in vfio_save_cleanup()

2023-08-02 Thread Avihai Horon
Changing the device state from STOP_COPY to STOP can take time as the device may need to free resources and do other operations as part of the transition. Currently, this is done in vfio_save_complete_precopy() and therefore it is counted in the migration downtime. To avoid this, change the device

[PATCH for-8.2 v3 3/6] qdev: Add qdev_add_vm_change_state_handler_full()

2023-08-02 Thread Avihai Horon
Add qdev_add_vm_change_state_handler_full() variant that allows setting a prepare callback in addition to the main callback. This will facilitate adding P2P support for VFIO migration in the following patches. Signed-off-by: Avihai Horon Signed-off-by: Joao Martins Reviewed-by: Cédric Le Goater

[PATCH for-8.2 v3 5/6] vfio/migration: Add P2P support for VFIO migration

2023-08-02 Thread Avihai Horon
VFIO migration uAPI defines an optional intermediate P2P quiescent state. While in the P2P quiescent state, P2P DMA transactions cannot be initiated by the device, but the device can respond to incoming ones. Additionally, all outstanding P2P transactions are guaranteed to have been completed by th

[PATCH for-8.2 v3 6/6] vfio/migration: Allow migration of multiple P2P supporting devices

2023-08-02 Thread Avihai Horon
Now that P2P support has been added to VFIO migration, allow migration of multiple devices if all of them support P2P migration. Single device migration is allowed regardless of P2P migration support. Signed-off-by: Avihai Horon Signed-off-by: Joao Martins Reviewed-by: Cédric Le Goater --- hw

Re: [PATCH v2 1/3] linux-user: Fix openat() emulation to correctly detect accesses to /proc

2023-08-02 Thread Daniel P . Berrangé
On Wed, Aug 02, 2023 at 01:08:40AM +0200, Helge Deller wrote: > In qemu we catch accesses to files like /proc/cpuinfo or /proc/net/route > and return to the guest contents which would be visible on a real system > (instead what the host would show). > > This patch fixes a bug, where for example th

[PATCH for-8.2 v3 4/6] vfio/migration: Refactor PRE_COPY and RUNNING state checks

2023-08-02 Thread Avihai Horon
From: Joao Martins Move the PRE_COPY and RUNNING state checks to helper functions. This is in preparation for adding P2P VFIO migration support, where these helpers will also test for PRE_COPY_P2P and RUNNING_P2P states. Signed-off-by: Joao Martins Signed-off-by: Avihai Horon Reviewed-by: Céd

Re: [PATCH v2 1/2] contrib/plugins: add meson build file

2023-08-02 Thread Akihiko Odaki
Thanks for letting me know this on GitLab. On 2023/06/29 1:26, Anton Kochkov wrote: Add crossplatform Meson file to build TCG plugins since the Makefile makes wrong assumptions about it being used only on Linux. Tested on Linux and macOS. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/

Re: [PATCH v2 1/2] contrib/plugins: add meson build file

2023-08-02 Thread Akihiko Odaki
I used a wrong email account. I also forgot to mention that you must update other places referring to the Makefile. I'm aware of the following: - root Makefile - tests/tcg/Makefile.target - docs/devel/tcg-plugins.rst On 2023/08/02 17:16, Akihiko Odaki wrote: Thanks for letting me know this on

Re: [PATCH 0/3] hw/ufs: fix compilation warnings

2023-08-02 Thread Mike Maslenkin
Hello All, I'm ok with that. Regards, Mike. On Wed, Aug 2, 2023 at 3:52 AM Jeuk Kim wrote: > > On 8/2/2023 6:03 AM, Philippe Mathieu-Daudé wrote: > > Hi Mike, > > > > On 28/7/23 01:34, Mike Maslenkin wrote: > >> This patchset contains a trivial compilation fixes for UFS support > >> applied to

Re: [PATCH v6 8/8] linux-user: Load pie executables at upper memory

2023-08-02 Thread Helge Deller
On 8/2/23 09:49, Akihiko Odaki wrote: On 2023/08/02 8:27, Helge Deller wrote: Fix the elf loader to calculate a valid TASK_UNMAPPED_BASE address for all 32-bit architectures, based on the GUEST_ADDR_MAX constant. Additionally modify the elf loader to load dynamic pie executables at around: ~ 0x

Re: [PATCH for-8.2 v3 5/6] vfio/migration: Add P2P support for VFIO migration

2023-08-02 Thread Cédric Le Goater
On 8/2/23 10:14, Avihai Horon wrote: VFIO migration uAPI defines an optional intermediate P2P quiescent state. While in the P2P quiescent state, P2P DMA transactions cannot be initiated by the device, but the device can respond to incoming ones. Additionally, all outstanding P2P transactions are

Re: [PATCH v6 8/8] linux-user: Load pie executables at upper memory

2023-08-02 Thread Akihiko Odaki
On 2023/08/02 17:42, Helge Deller wrote: On 8/2/23 09:49, Akihiko Odaki wrote: On 2023/08/02 8:27, Helge Deller wrote: Fix the elf loader to calculate a valid TASK_UNMAPPED_BASE address for all 32-bit architectures, based on the GUEST_ADDR_MAX constant. Additionally modify the elf loader to l

[PATCH v2 03/24] gdbstub: Add num_regs member to GDBFeature

2023-08-02 Thread Akihiko Odaki
Currently the number of registers exposed to GDB is written as magic numbers in code. Derive the number of registers GDB actually see from XML files to replace the magic numbers in code later. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- include/exec/gdbstub.h | 1 + s

[PATCH v2 02/24] gdbstub: Introduce GDBFeature structure

2023-08-02 Thread Akihiko Odaki
Before this change, the information from a XML file was stored in an array that is not descriptive. Introduce a dedicated structure type to make it easier to understand and to extend with more fields. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- MAINTAINERS |

[PATCH v2 00/24] plugins: Allow to read registers

2023-08-02 Thread Akihiko Odaki
I and other people in the University of Tokyo, where I research processor design, found TCG plugins are very useful for processor design exploration. The feature we find missing is the capability to read registers from plugins. In this series, I propose to add such a capability by reusing gdbstub

[PATCH v2 05/24] target/arm: Move the reference to arm-core.xml

2023-08-02 Thread Akihiko Odaki
Some subclasses overwrite gdb_core_xml_file member but others don't. Always initialize the member in the subclasses for consistency. This especially helps for AArch64; in a following change, the file specified by gdb_core_xml_file is always looked up even if it's going to be overwritten later. Loo

[PATCH v2 04/24] gdbstub: Introduce gdb_find_static_feature()

2023-08-02 Thread Akihiko Odaki
This function is useful to determine the number of registers exposed to GDB from the XML name. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- include/exec/gdbstub.h | 2 ++ gdbstub/gdbstub.c | 13 + 2 files changed, 15 insertions(+) diff --git a/include/

[PATCH v2 06/24] hw/core/cpu: Replace gdb_core_xml_file with gdb_core_feature

2023-08-02 Thread Akihiko Odaki
This is a tree-wide change to replace gdb_core_xml_file, the path to GDB XML file with gdb_core_feature, the pointer to GDBFeature. This also replaces the values assigned to gdb_num_core_regs with the num_regs member of GDBFeature where applicable to remove magic numbers. A following change will u

[PATCH v2 07/24] target/arm: Use GDBFeature for dynamic XML

2023-08-02 Thread Akihiko Odaki
In preparation for a change to use GDBFeature as a parameter of gdb_register_coprocessor(), convert the internal representation of dynamic feature from plain XML to GDBFeature. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- target/arm/cpu.h | 20 +-- target/a

[PATCH v2 11/24] gdbstub: Use GDBFeature for GDBRegisterState

2023-08-02 Thread Akihiko Odaki
Simplify GDBRegisterState by replacing num_regs and xml members with one member that points to GDBFeature. Signed-off-by: Akihiko Odaki --- gdbstub/gdbstub.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index e84364e97c.

[PATCH v2 10/24] gdbstub: Use GDBFeature for gdb_register_coprocessor

2023-08-02 Thread Akihiko Odaki
This is a tree-wide change to introduce GDBFeature parameter to gdb_register_coprocessor(). The new parameter just replaces num_regs and xml parameters for now. GDBFeature will be utilized to simplify XML lookup in a following change. Signed-off-by: Akihiko Odaki --- include/exec/gdbstub.h |

[PATCH v2 08/24] target/ppc: Use GDBFeature for dynamic XML

2023-08-02 Thread Akihiko Odaki
In preparation for a change to use GDBFeature as a parameter of gdb_register_coprocessor(), convert the internal representation of dynamic feature from plain XML to GDBFeature. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- target/ppc/cpu-qom.h | 3 +-- target/ppc/cpu.h

[PATCH v2 09/24] target/riscv: Use GDBFeature for dynamic XML

2023-08-02 Thread Akihiko Odaki
In preparation for a change to use GDBFeature as a parameter of gdb_register_coprocessor(), convert the internal representation of dynamic feature from plain XML to GDBFeature. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- target/riscv/cpu.h | 4 ++-- target/riscv/cp

[PATCH v2 12/24] gdbstub: Simplify XML lookup

2023-08-02 Thread Akihiko Odaki
Now we know all instances of GDBFeature that is used in CPU so we can traverse them to find XML. This removes the need for a CPU-specific lookup function for dynamic XMLs. Signed-off-by: Akihiko Odaki --- gdbstub/gdbstub.c | 28 +--- 1 file changed, 9 insertions(+), 19 de

[PATCH v2 01/24] contrib/plugins: Use GRWLock in execlog

2023-08-02 Thread Akihiko Odaki
execlog had the following comment: > As we could have multiple threads trying to do this we need to > serialise the expansion under a lock. Threads accessing already > created entries can continue without issue even if the ptr array > gets reallocated during resize. However, when the ptr array get

[PATCH v2 15/24] target/arm: Fill new members of GDBFeature

2023-08-02 Thread Akihiko Odaki
These members will be used to help plugins to identify registers. Signed-off-by: Akihiko Odaki --- target/arm/gdbstub.c | 46 +++--- target/arm/gdbstub64.c | 42 +- 2 files changed, 58 insertions(+), 30 deletions(-) diff

[PATCH v2 16/24] target/ppc: Fill new members of GDBFeature

2023-08-02 Thread Akihiko Odaki
These members will be used to help plugins to identify registers. Signed-off-by: Akihiko Odaki --- target/ppc/gdbstub.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c index 19c4935260..ac4ed12371 100644 --- a/target/ppc/

[PATCH v2 18/24] hw/core/cpu: Add a parameter to gdb_read_register/gdb_write_register

2023-08-02 Thread Akihiko Odaki
gdbstub has a static variable named gdb_has_xml that tells if workarounds for old GDB versions are required when manipulating registers for GDB. Now we are reusing the infrastructure to manipulate registers for plugins. Plugins will not need these workarounds even when an old GDB is attached. Conv

[PATCH v2 14/24] gdbstub: Add members to identify registers to GDBFeature

2023-08-02 Thread Akihiko Odaki
These members will be used to help plugins to identify registers. The added members in instances of GDBFeature dynamically generated by CPUs will be filled in later changes. Signed-off-by: Akihiko Odaki --- include/exec/gdbstub.h | 2 ++ scripts/feature_to_c.py | 14 +- 2 files cha

[PATCH v2 20/24] gdbstub: Expose functions to read registers

2023-08-02 Thread Akihiko Odaki
gdb_foreach_feature() enumerates features that are useful to identify registers. gdb_read_register() actually reads registers. Signed-off-by: Akihiko Odaki --- include/exec/gdbstub.h | 6 ++ gdbstub/gdbstub.c | 38 ++ 2 files changed, 36 insertions(+

[PATCH v2 13/24] hw/core/cpu: Remove gdb_get_dynamic_xml member

2023-08-02 Thread Akihiko Odaki
This function is no longer used. Signed-off-by: Akihiko Odaki --- include/hw/core/cpu.h | 4 target/arm/cpu.h | 6 -- target/ppc/cpu.h | 1 - target/arm/cpu.c | 1 - target/arm/gdbstub.c | 18 -- target/ppc/cpu_init.c | 3 --- target/ppc/gdbstub.c |

[PATCH v2 22/24] contrib/plugins: Allow to log registers

2023-08-02 Thread Akihiko Odaki
This demonstrates how a register can be read from a plugin. Signed-off-by: Akihiko Odaki --- docs/devel/tcg-plugins.rst | 10 ++- contrib/plugins/execlog.c | 130 - 2 files changed, 108 insertions(+), 32 deletions(-) diff --git a/docs/devel/tcg-plugins.rst

[PATCH v2 19/24] gdbstub: Hide gdb_has_xml

2023-08-02 Thread Akihiko Odaki
gdb_has_xml is no longer referenced by the other components. Signed-off-by: Akihiko Odaki --- gdbstub/internals.h| 8 include/exec/gdbstub.h | 8 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gdbstub/internals.h b/gdbstub/internals.h index f2b46cce41..92f5c

[PATCH v2 23/24] plugins: Support C++

2023-08-02 Thread Akihiko Odaki
Make qemu-plugin.h consumable for C++ platform. Signed-off-by: Akihiko Odaki --- include/qemu/qemu-plugin.h | 4 1 file changed, 4 insertions(+) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 214b12bfd6..8637e3d8cf 100644 --- a/include/qemu/qemu-plugin.h +++ b/i

[PATCH v2 24/24] contrib/plugins: Add cc plugin

2023-08-02 Thread Akihiko Odaki
This demonstrates how to write a plugin in C++. Signed-off-by: Akihiko Odaki --- docs/devel/tcg-plugins.rst | 8 configure | 15 --- contrib/plugins/Makefile | 5 + contrib/plugins/cc.cc | 17 + tests/tcg/Makefile.target | 3 ++

[PATCH v2 21/24] plugins: Allow to read registers

2023-08-02 Thread Akihiko Odaki
It is based on GDB protocol to ensure interface stability. The timing of the vcpu init hook is also changed so that the hook will get called after GDB features are initialized. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1706 Signed-off-by: Akihiko Odaki --- include/qemu/qemu-plugin

[PATCH v2 17/24] target/riscv: Fill new members of GDBFeature

2023-08-02 Thread Akihiko Odaki
These members will be used to help plugins to identify registers. Signed-off-by: Akihiko Odaki --- target/riscv/gdbstub.c | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/target/riscv/gdbstub.c b/target/riscv/gdbstub.c index 224c69ea99..b3d4d4de3e 100644

[PATCH v5 2/4] virtio-dmabuf: introduce virtio-dmabuf

2023-08-02 Thread Albert Esteve
This API manages objects (in this iteration, dmabuf fds) that can be shared along different virtio devices, associated to a UUID. The API allows the different devices to add, remove and/or retrieve the objects by simply invoking the public functions that reside in the virtio-dmabuf file. For vhos

[PATCH v5 4/4] vhost-user: refactor send_resp code

2023-08-02 Thread Albert Esteve
Refactor code to send response message so that all common parts both for the common REPLY_ACK case, and other data responses, can call it and avoid code repetition. Signed-off-by: Albert Esteve --- hw/virtio/vhost-user.c | 36 +--- 1 file changed, 9 insertions(+),

[PATCH v5 3/4] vhost-user: add shared_object msg

2023-08-02 Thread Albert Esteve
Add three new vhost-user protocol `VHOST_USER_BACKEND_SHARED_OBJECT_* messages`. These new messages are sent from vhost-user back-ends to interact with the virtio-dmabuf table in order to add or remove themselves as virtio exporters, or lookup for virtio dma-buf shared objects. The action taken in

[PATCH v5 0/4] Virtio shared dma-buf

2023-08-02 Thread Albert Esteve
v1 link -> https://lists.gnu.org/archive/html/qemu-devel/2023-05/msg00598.html v2 link -> https://lists.gnu.org/archive/html/qemu-devel/2023-05/msg04530.html v3 link -> https://lists.gnu.org/archive/html/qemu-devel/2023-05/msg06126.html v4 link -> https://lists.gnu.org/archive/html/qemu-devel/2023-

[PATCH v5 1/4] uuid: add a hash function

2023-08-02 Thread Albert Esteve
Add hash function to uuid module using the djb2 hash algorithm. Add a couple simple unit tests for the hash function, checking collisions for similar UUIDs. Signed-off-by: Albert Esteve --- include/qemu/uuid.h| 2 ++ tests/unit/test-uuid.c | 27 +++ util/uuid.c

[PATCH] hw/i386/intel_iommu: Fix endianness problems related to VTD_IR_TableEntry

2023-08-02 Thread Thomas Huth
The code already tries to do some endianness handling here, but currently fails badly: - While it already swaps the data when logging errors / tracing, it fails to byteswap the value before e.g. accessing entry->irte.present - entry->irte.source_id is swapped with le32_to_cpu(), though this is

Re: [PATCH v6 8/8] linux-user: Load pie executables at upper memory

2023-08-02 Thread Helge Deller
On 8/2/23 10:44, Akihiko Odaki wrote: On 2023/08/02 17:42, Helge Deller wrote: On 8/2/23 09:49, Akihiko Odaki wrote: On 2023/08/02 8:27, Helge Deller wrote: Fix the elf loader to calculate a valid TASK_UNMAPPED_BASE address for all 32-bit architectures, based on the GUEST_ADDR_MAX constant. A

hvf: Invalid ISV on data abort

2023-08-02 Thread Antonio Caggiano
Hi there, I am trying to bring up a guest on HVF, which at a certain point is trying to write to an area of mmio space and it triggers a data abort where ISV=0 (translation fault level 2). I wonder what could cause it and how to recover. Kind regards, Antonio

Re: [PATCH v6 8/8] linux-user: Load pie executables at upper memory

2023-08-02 Thread Akihiko Odaki
On 2023/08/02 18:34, Helge Deller wrote: On 8/2/23 10:44, Akihiko Odaki wrote: On 2023/08/02 17:42, Helge Deller wrote: On 8/2/23 09:49, Akihiko Odaki wrote: On 2023/08/02 8:27, Helge Deller wrote: Fix the elf loader to calculate a valid TASK_UNMAPPED_BASE address for all 32-bit architecture

Re: hvf: Invalid ISV on data abort

2023-08-02 Thread Alexander Graf
Hi Antonio, On 02.08.23 11:43, Antonio Caggiano wrote: Hi there, I am trying to bring up a guest on HVF, which at a certain point is trying to write to an area of mmio space and it triggers a data abort where ISV=0 (translation fault level 2). I wonder what could cause it and how to recover.

Re: [PATCH v6 8/8] linux-user: Load pie executables at upper memory

2023-08-02 Thread Helge Deller
On 8/2/23 11:58, Akihiko Odaki wrote: On 2023/08/02 18:34, Helge Deller wrote: On 8/2/23 10:44, Akihiko Odaki wrote: On 2023/08/02 17:42, Helge Deller wrote: On 8/2/23 09:49, Akihiko Odaki wrote: On 2023/08/02 8:27, Helge Deller wrote: Fix the elf loader to calculate a valid TASK_UNMAPPED_BA

Re: [PATCH 0/5] linux-user: brk/mmap fixes

2023-08-02 Thread Helge Deller
On 8/2/23 09:26, Akihiko Odaki wrote: On 2023/08/01 19:43, Helge Deller wrote: On 8/1/23 06:49, Joel Stanley wrote: On Mon, 31 Jul 2023 at 18:24, Helge Deller wrote: As suggested, I've based my patches on top of yours and the tree can be pulled from: git pull https://github.com/hdeller/qemu-h

Re: [PATCH 00/21] Patch Round-up for stable 7.2.2, freeze on 2023-04-20

2023-08-02 Thread Mauro Matteo Cascella
Hi Michael, > 13.04.2023 23:50, Konstantin Kostiuk wrote: > > Hi Michael, > > > > You cherry-picked one of my patch qga/win32: Remove change action from MSI > > installer > > but it is part of the CVE fix. > > > > Please cherry-pick one more patch. > > > > Original mail: > > https://patchew.org/

Re: [PATCH] gdbstub: use 0 ("any process") on packets with no PID

2023-08-02 Thread Matheus Tavares Bernardino
Ilya Leoshkevich wrote: > > On Tue, 2023-08-01 at 12:37 -0300, Matheus Tavares Bernardino wrote: > > Previously, qemu-user would always report PID 1 to GDB. This was > > changed > > at dc14a7a6e9 (gdbstub: Report the actual qemu-user pid, 2023-06-30), > > but read_thread_id() still considers GDB p

Re: [PATCH 1/2] block/blkio: close the fd when blkio_connect() fails

2023-08-02 Thread Hanna Czenczek
On 01.08.23 18:03, Stefano Garzarella wrote: libblkio drivers take ownership of `fd` only after a successful blkio_connect(), so if it fails, we are still the owners. Fixes: cad2ccc395 ("block/blkio: use qemu_open() to support fd passing for virtio-blk") Suggested-by: Hanna Czenczek Signed-off

Re: [PATCH 2/2] block/blkio: add more comments on the fd passing handling

2023-08-02 Thread Hanna Czenczek
On 01.08.23 18:03, Stefano Garzarella wrote: As Hanna pointed out, it is not clear in the code why qemu_open() can fail, and why blkio_set_int("fd") is not enough to discover the `fd` property support. Let's fix them by adding more details in the code comments. Suggested-by: Hanna Czenczek Sig

Re: [PATCH 0/2] virtio-gpu: reset gfx resources in main thread

2023-08-02 Thread Marc-André Lureau
Hi Kim Could you review those patches? I would like them for 8.1 and somewhat fix your commit 0d0be87659b ("virtio-gpu: replace the surface with null surface when resetting"). thanks On Wed, Jul 26, 2023 at 10:53 PM wrote: > > From: Marc-André Lureau > > Hi, > > See the second patch for detai

Re: Reducing vdpa migration downtime because of memory pin / maps

2023-08-02 Thread Eugenio Perez Martin
On Thu, Jul 20, 2023 at 2:49 AM Si-Wei Liu wrote: > > > > On 7/19/2023 3:40 AM, Eugenio Perez Martin wrote: > > On Mon, Jul 17, 2023 at 9:57 PM Si-Wei Liu wrote: > >> Hey, > >> > >> I am now back from the break. Sorry for the delayed response, please see > >> in line. > >> > >> On 7/9/2023 11:04

[PATCH] target/riscv: Implement WARL behaviour for mcountinhibit/mcounteren

2023-08-02 Thread Rob Bradford
These are WARL fields - zero out the bits for unavailable counters and special case the TM bit in mcountinhibit which is hardwired to zero. This patch achieves this by modifying the value written so that any use of the field will see the correctly masked bits. Tested by modifying OpenSBI to write

[PATCH] Fix SEGFAULT on getting physical address of MMIO region.

2023-08-02 Thread Mikhail Tyutin
The fix is to clear TLB_INVALID_MASK bit in tlb_addr, as it happens in other places e.g. load_helper(). Signed-off-by: Dmitriy Solovev Signed-off-by: Mikhail Tyutin --- accel/tcg/cputlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb

Re: [PATCH 00/21] Patch Round-up for stable 7.2.2, freeze on 2023-04-20

2023-08-02 Thread Michael Tokarev
02.08.2023 13:53, Mauro Matteo Cascella wrote: Hi Michael, 13.04.2023 23:50, Konstantin Kostiuk wrote: Hi Michael, You cherry-picked one of my patch qga/win32: Remove change action from MSI installer but it is part of the CVE fix. Please cherry-pick one more patch. Original mail: https://

Re: [PATCH] target/riscv: Fix page_check_range use in fault-only-first

2023-08-02 Thread Alistair Francis
On Fri, Jul 28, 2023 at 11:34 PM LIU Zhiwei wrote: > > Commit bef6f008b98(accel/tcg: Return bool from page_check_range) converts > integer return value to bool type. However, it wrongly converted the use > of the API in riscv fault-only-first, where page_check_range < = 0, should > be converted to

Re: [PATCH] hw/i386/intel_iommu: Fix endianness problems related to VTD_IR_TableEntry

2023-08-02 Thread Thomas Huth
On 02/08/2023 11.28, Thomas Huth wrote: The code already tries to do some endianness handling here, but currently fails badly: - While it already swaps the data when logging errors / tracing, it fails to byteswap the value before e.g. accessing entry->irte.present - entry->irte.source_id is sw

Re: [PATCH 1/1] Added support for the MMU node in the RHCT

2023-08-02 Thread Alistair Francis
On Mon, Jul 31, 2023 at 6:22 PM Lilly Anderson wrote: > Hello, Thanks for the patch. Do you mind writing a commit message here. You will also need to include a signed-off-by line, see https://www.qemu.org/docs/master/devel/submitting-a-patch.html#patch-emails-must-include-a-signed-off-by-line

Re: [PATCH v2] target/riscv: Use existing lookup tables for MixColumns

2023-08-02 Thread Alistair Francis
On Mon, Jul 31, 2023 at 4:42 AM Ard Biesheuvel wrote: > > The AES MixColumns and InvMixColumns operations are relatively > expensive 4x4 matrix multiplications in GF(2^8), which is why C > implementations usually rely on precomputed lookup tables rather than > performing the calculations on demand

Re: [PATCH 1/1] Added support for the MMU node in the RHCT

2023-08-02 Thread Sunil V L
Hi Lilly, I have already sent patch series [1] which includes MMU node patch [2]. I am preparing v2 of that series based on the feedback I received. [1] - https://lists.gnu.org/archive/html/qemu-devel/2023-07/msg02657.html [2] - https://lists.gnu.org/archive/html/qemu-devel/2023-07/msg02667.html

[PATCH 3/6] hw/i386/intel_iommu: Fix struct VTDInvDescIEC on big endian hosts

2023-08-02 Thread Thomas Huth
On big endian hosts, we need to reverse the bitfield order in the struct VTDInvDescIEC, just like it is already done for the other bitfields in the various structs of the intel-iommu device. Signed-off-by: Thomas Huth --- hw/i386/intel_iommu_internal.h | 9 + 1 file changed, 9 insertions

[PATCH 4/6] hw/i386/intel_iommu: Fix index calculation in vtd_interrupt_remap_msi()

2023-08-02 Thread Thomas Huth
The values in "addr" are populated locally in this function in host endian byte order, so we must not swap the index_l field here. Signed-off-by: Thomas Huth --- hw/i386/intel_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.

[PATCH 1/6] hw/i386/intel_iommu: Fix trivial endianness problems

2023-08-02 Thread Thomas Huth
After reading the guest memory with dma_memory_read(), we have to make sure that we byteswap the little endian data to the host's byte order. Signed-off-by: Thomas Huth --- hw/i386/intel_iommu.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.

[PATCH 2/6] hw/i386/intel_iommu: Fix endianness problems related to VTD_IR_TableEntry

2023-08-02 Thread Thomas Huth
The code already tries to do some endianness handling here, but currently fails badly: - While it already swaps the data when logging errors / tracing, it fails to byteswap the value before e.g. accessing entry->irte.present - entry->irte.source_id is swapped with le32_to_cpu(), though this is

Re: [PATCH 1/2] block/blkio: close the fd when blkio_connect() fails

2023-08-02 Thread Stefano Garzarella
On Wed, Aug 02, 2023 at 01:15:40PM +0200, Hanna Czenczek wrote: On 01.08.23 18:03, Stefano Garzarella wrote: libblkio drivers take ownership of `fd` only after a successful blkio_connect(), so if it fails, we are still the owners. Fixes: cad2ccc395 ("block/blkio: use qemu_open() to support fd p

[PATCH 6/6] include/hw/i386/x86-iommu: Fix struct X86IOMMU_MSIMessage for big endian hosts

2023-08-02 Thread Thomas Huth
The first bitfield here is supposed to be used as a 64-bit equivalent to the "uint64_t msi_addr" in the union. To make this work correctly on big endian hosts, too, the __addr_hi field has to be part of the bitfield, and the the bitfield members must be declared with "uint64_t" instead of "uint32_t

[PATCH 5/6] hw/i386/x86-iommu: Fix endianness issue in x86_iommu_irq_to_msi_message()

2023-08-02 Thread Thomas Huth
The values in "msg" are assembled in host endian byte order (the other field are also not swapped), so we must not swap the __addr_head here. Signed-off-by: Thomas Huth --- hw/i386/x86-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/x86-iommu.c b/hw/i386/x86-i

[PATCH for-8.1 0/6] Fix endianness issues in the intel-iommu device

2023-08-02 Thread Thomas Huth
The intel-iommu device is currently unusable on big endian hosts. When doing something like this on a s390x host: wget https://download.fedoraproject.org/pub/fedora/linux/releases/38/Server/x86_64/images/Fedora-Server-KVM-38-1.6.x86_64.qcow2 ./qemu-system-x86_64 -M q35 -device intel-iommu -m 2G

Re: [PATCH] hw/i386/intel_iommu: Fix endianness problems related to VTD_IR_TableEntry

2023-08-02 Thread Peter Xu
On Wed, Aug 02, 2023 at 11:28:37AM +0200, Thomas Huth wrote: > #if HOST_BIG_ENDIAN > -uint32_t __reserved_1:8; /* Reserved 1 */ > -uint32_t vector:8; /* Interrupt Vector */ > -uint32_t irte_mode:1;/* IRTE Mode */ > -uint32_t __reserved_0:3;

Re: [PATCH] Fix some typos in documentation and comments

2023-08-02 Thread Michael Tokarev
30.07.2023 21:03, Stefan Weil via wrote: Signed-off-by: Stefan Weil --- This patch was triggered by a spelling check for the generated QEMU documentation using codespell. It does not try to fix all typos which still exist in the QEMU code, but has a focus on those required to fix the documentat

Re: [PATCH] hw/i386/intel_iommu: Fix endianness problems related to VTD_IR_TableEntry

2023-08-02 Thread Thomas Huth
On 02/08/2023 16.02, Peter Xu wrote: On Wed, Aug 02, 2023 at 11:28:37AM +0200, Thomas Huth wrote: #if HOST_BIG_ENDIAN -uint32_t __reserved_1:8; /* Reserved 1 */ -uint32_t vector:8; /* Interrupt Vector */ -uint32_t irte_mode:1;/* IRTE Mode */ -

Re: [RFC PATCH 08/19] HostMem: Add private property to indicate to use kvm gmem

2023-08-02 Thread David Hildenbrand
On 02.08.23 10:03, Xiaoyao Li wrote: On 8/2/2023 1:21 AM, David Hildenbrand wrote: On 31.07.23 18:21, Xiaoyao Li wrote: From: Isaku Yamahata Signed-off-by: Isaku Yamahata Signed-off-by: Xiaoyao Li ---   backends/hostmem.c   | 18 ++   include/sysemu/hostmem.h |  2 +-  

Re: [PATCH v8 03/15] target/riscv: Remove redundant "cpu_vl == 0" checks

2023-08-02 Thread Alistair Francis
On Tue, Jul 11, 2023 at 1:00 PM Max Chou wrote: > > From: Nazar Kazakov > > Remove the redundant "vl == 0" check which is already included within the > vstart >= vl check, when vl == 0. > > Signed-off-by: Nazar Kazakov > Reviewed-by: Weiwei Li > Signed-off-by: Max Chou Acked-by: Alistair Fr

Re: [PATCH v8 04/15] target/riscv: Add Zvbc ISA extension support

2023-08-02 Thread Alistair Francis
On Tue, Jul 11, 2023 at 1:00 PM Max Chou wrote: > > From: Lawrence Hunter > > This commit adds support for the Zvbc vector-crypto extension, which > consists of the following instructions: > > * vclmulh.[vx,vv] > * vclmul.[vx,vv] > > Translation functions are defined in > `target/riscv/insn_trans

Re: [PATCH v8 00/15] Add RISC-V vector cryptographic instruction set support

2023-08-02 Thread Alistair Francis
On Tue, Jul 11, 2023 at 12:59 PM Max Chou wrote: > > This patchset provides an implementation for Zvbb, Zvbc, Zvkned, Zvknh, > Zvksh, Zvkg, and Zvksed of the draft RISC-V vector cryptography > extensions as per the v20230620 version of the specification(1)(168e7b4). > This is an update to the patc

  1   2   3   >