Re: [PATCH 3/8] gitlab: always use updated msys installer

2023-08-02 Thread Thomas Huth
On 01/08/2023 15.03, Daniel P. Berrangé wrote: We current reference an msys installer binary from mid-2022, which means after installation, it immediately has to re-download a bunch of newer content. This wastes precious CI time. The msys project publishes an installer binary with a fixed URL

Re: [PATCH v3 05/17] i386/cpu: Use APIC ID offset to encode cache topo in CPUID[4]

2023-08-02 Thread Moger, Babu
Hi Zhao, On 8/1/23 05:35, Zhao Liu wrote: > From: Zhao Liu > > Refer to the fixes of cache_info_passthrough ([1], [2]) and SDM, the > CPUID.04H:EAX[bits 25:14] and CPUID.04H:EAX[bits 31:26] should use the > nearest power-of-2 integer. > > The nearest power-of-2 integer can be caculated by

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

2023-08-02 Thread Michael S. Tsirkin
On Wed, Aug 02, 2023 at 03:57:17PM +0200, Thomas Huth wrote: > The intel-iommu device is currently unusable on big endian hosts. > When doing something like this on a s390x host: > > wget >

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

2023-08-02 Thread Peter Xu
On Wed, Aug 02, 2023 at 03:57:17PM +0200, Thomas Huth wrote: > The intel-iommu device is currently unusable on big endian hosts. > When doing something like this on a s390x host: > > wget >

Re: [PATCH v3 03/17] softmmu: Fix CPUSTATE.nr_cores' calculation

2023-08-02 Thread Moger, Babu
Hi Zhao, On 8/1/23 05:35, Zhao Liu wrote: > From: Zhuocheng Ding > > From CPUState.nr_cores' comment, it represents "number of cores within > this CPU package". > > After 003f230e37d7 ("machine: Tweak the order of topology members in > struct CpuTopology"), the meaning of smp.cores changed to

[PATCH v2 1/2] migration: Split await_return_path_close_on_source

2023-08-02 Thread Fabiano Rosas
This function currently has a straight-forward part which is waiting for the thread to join and a complicated part which is doing a qemu_file_shutdown() on the return path file. The shutdown is tricky because all calls to qemu_file_shutdown() set f->last_error to -EIO, which means we can never

Re: [PULL 0/5] Misc fixes, for thread-pool, xen, and xen-emulate

2023-08-02 Thread Michael Tokarev
01.08.2023 12:40, Anthony PERARD via wrote: ... Anthony PERARD (2): xen-block: Avoid leaks on new error path thread-pool: signal "request_cond" while locked David Woodhouse (1): hw/xen: Clarify (lack of) error handling in transaction_commit() Olaf Hering (1):

[PATCH v2 0/2] Fix segfault on migration return path

2023-08-02 Thread Fabiano Rosas
For this version: - moved the await into postcopy_pause() as Peter suggested; - brought back the mark_source_rp_bad call. Turns out that piece of code is filled with nuance. I just moved it aside since it doesn't make sense during pause/resume. We can tackle that when we get the chance. CI run:

Re: [PULL 00/10] Misc fixes for 2023-08-01

2023-08-02 Thread Richard Henderson
On 8/1/23 14:54, Philippe Mathieu-Daudé wrote: The following changes since commit 802341823f1720511dd5cf53ae40285f7978c61b: Merge tag 'pull-tcg-20230731' ofhttps://gitlab.com/rth7680/qemu into staging (2023-07-31 14:02:51 -0700) are available in the Git repository at:

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

2023-08-02 Thread Richard Henderson
On 8/2/23 00:40, Markus Armbruster wrote: The following changes since commit 38a6de80b917b2a822cff0e38d83563ab401c890: Merge tag 'pull-xen-20230801' ofhttps://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:

Re: [PULL 0/1 for 8.1] TLS crash fix

2023-08-02 Thread Richard Henderson
On 8/1/23 10:46, Daniel P. Berrangé wrote: The following changes since commit 802341823f1720511dd5cf53ae40285f7978c61b: Merge tag 'pull-tcg-20230731' ofhttps://gitlab.com/rth7680/qemu into staging (2023-07-31 14:02:51 -0700) are available in the Git repository at:

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 04:14:01PM +0200, Thomas Huth wrote: > 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;

[PATCH v2 2/2] migration: Replace the return path retry logic

2023-08-02 Thread Fabiano Rosas
Replace the return path retry logic with finishing and restarting the thread. This fixes a race when resuming the migration that leads to a segfault. Currently when doing postcopy we consider that an IO error on the return path file could be due to a network intermittency. We then keep the thread

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

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 >

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

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] 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: [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

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;

[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

[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

[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

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

[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

[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

[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

[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

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] -

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

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] 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

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

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:

[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

[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

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

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

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

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

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

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: > >

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

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

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 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

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 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.

[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

[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 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 ->

[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

[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

[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

[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

[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 ---

[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 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 +++

[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

[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 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 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

[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

[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.

[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 ---

[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 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

[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

[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 ++--

[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 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 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

[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

[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 +--

[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

[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.

[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 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 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 +

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

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 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: ~

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 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

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:

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

[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:

[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 ---

[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

[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

[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

[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

[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.

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

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

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

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

[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

[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

[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

<    1   2   3   >