Re: [PATCH v2 4/6] python/machine: use socketpair() for console connections

2023-07-27 Thread Ani Sinha
> On 27-Jul-2023, at 11:22 AM, Ani Sinha wrote: > > > >> On 26-Jul-2023, at 10:51 PM, John Snow wrote: >> >> >> >> On Wed, Jul 26, 2023, 6:50 AM Ani Sinha wrote: >> >> >>> On 25-Jul-2023, at 11:33 PM, John Snow wrote: >>> >>> Create a socketpair for the console output. This should h

[PATCH v4 0/3] linux-user: Fix static armhf binaries and optmize memory layout

2023-07-27 Thread Helge Deller
This patch series: - fixes qemu-arm to run static armhf binaries - shows address of heap in /proc/pid/maps output for all architectures - optimizes address layout of loaded executable - increases free heap for guest apps NOTE: - this patch series is for qemu v8.1.0-rc ONLY. - do not apply on top o

[PATCH v4 1/3] linux-user: Show heap address in /proc/pid/maps

2023-07-27 Thread Helge Deller
Show the memory location of the heap in the /proc/pid/maps file inside the guest. The heap address will be stored in ts->heap_base, so make that variable visible for all guest architectures, not just architectures for semihosted binaries (arm, m68k, riscv). Show 32- and 64-bit pointers with 8 digi

[PATCH v4 2/3] linux-user: Optimize memory layout for static and dynamic executables

2023-07-27 Thread Helge Deller
Organize the emulated memory layout in a way which leaves as much memory as possible for heap for the application. This patch tries to optize the memory layout by loading pie executables into lower memory and shared libs into higher memory (at TASK_UNMAPPED_BASE). This leaves a bigger memory area

[PATCH v5 5/6] accel/kvm: Free as when an error occurred

2023-07-27 Thread Akihiko Odaki
An error may occur after s->as is allocated, for example while determining KVM type. Signed-off-by: Akihiko Odaki --- accel/kvm/kvm-all.c | 1 + 1 file changed, 1 insertion(+) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 94a62efa3c..4591669d78 100644 --- a/accel/kvm/kvm-all.c ++

[PATCH v5 3/6] mips: Report an error when KVM_VM_MIPS_VZ is unavailable

2023-07-27 Thread Akihiko Odaki
On MIPS, QEMU requires KVM_VM_MIPS_VZ type for KVM. Report an error in such a case as other architectures do when an error occurred during KVM type decision. Signed-off-by: Akihiko Odaki --- target/mips/kvm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/mips/kvm.c b/target/mips/kvm

[PATCH v5 4/6] accel/kvm: Use negative KVM type for error propagation

2023-07-27 Thread Akihiko Odaki
On MIPS, kvm_arch_get_default_type() returns a negative value when an error occurred so handle the case. Also, let other machines return negative values when errors occur and declare returning a negative value as the correct way to propagate an error that happened when determining KVM type. Signed

[PATCH v5 0/6] accel/kvm: Specify default IPA size for arm64

2023-07-27 Thread Akihiko Odaki
Some Arm systems such as Apple Silicon Macs have IPA size smaller than the default used by KVM. Introduce our own default IPA size that fits on such a system. When reviewing this series, Philippe Mathieu-Daudé found the error handling around KVM type decision logic is flawed so I added a few patch

[PATCH v5 6/6] accel/kvm: Make kvm_dirty_ring_reaper_init() void

2023-07-27 Thread Akihiko Odaki
The returned value was always zero and had no meaning. Signed-off-by: Akihiko Odaki --- accel/kvm/kvm-all.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 4591669d78..a4a1b4e05d 100644 --- a/accel/kvm/kvm-all.c +++ b/a

[PATCH v4 3/3] linux-user: Load pie executables at upper memory

2023-07-27 Thread Helge Deller
Adjust the loader to load dynamic pie executables at around: ~ 0x55 for 64-bit guest binaries on 64-bit host, - 0x0050for 32-bit guest binaries on 64-bit host, and - 0xfor 32-bit guest binaries on 32-bit host. This fixes the Thread Sanitizer (TSan) application again, a

Sending data from host to guest via VirtIO

2023-07-27 Thread 黄瑞哲
Hi, All: I'd like to send data and requests from the host kernel to the guest OS through virtio, and I have read current virtio-driver implementations both backend and frontend. All these implementations start sending requests from the guest. Is there any way sending requests starts from the host?

[PATCH v5 1/6] kvm: Introduce kvm_arch_get_default_type hook

2023-07-27 Thread Akihiko Odaki
kvm_arch_get_default_type() returns the default KVM type. This hook is particularly useful to derive a KVM type that is valid for "none" machine model, which is used by libvirt to probe the availability of KVM. For MIPS, the existing mips_kvm_type() is reused. This function ensures the availabilit

[RFC PATCH] hw/riscv: hart: allow other cpu instance

2023-07-27 Thread Nikita Shubin
From: Nikita Shubin Allow using instances derivative from RISCVCPU Signed-off-by: Nikita Shubin --- Currently it is not possible to overload instance of RISCVCPU, i.e. something like this: static const TypeInfo riscv_cpu_type_infos[] = { { .name = TYPE_ANOTHER_RISCV_CPU,

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

2023-07-27 Thread Ard Biesheuvel
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. Given that we already carry those tables in QEMU, we can just

[PATCH v2] target/riscv: don't read write-only CSR

2023-07-27 Thread Nikita Shubin
From: Nikita Shubin In case of write-only CSR don't return illegal inst error when CSR is written and lacks read op. Signed-off-by: Nikita Shubin --- Changelog: - fixed uninitialized old_value Anyway it not might be a good idea to read CSR when we are not asked for, during CSRRW or CSRRWI: "F

[PATCH v5 2/6] accel/kvm: Specify default IPA size for arm64

2023-07-27 Thread Akihiko Odaki
Before this change, the default KVM type, which is used for non-virt machine models, was 0. The kernel documentation says: > On arm64, the physical address size for a VM (IPA Size limit) is > limited to 40bits by default. The limit can be configured if the host > supports the extension KVM_CAP_ARM

[PATCH v8 0/4] hw/ufs: Add Universal Flash Storage (UFS) support

2023-07-27 Thread Jeuk Kim
Since v7: In ufs-test.c, make the following changes - Change TIMEOUT from 5 to 10 (Thomas's review comment) - Rename the temporary file to "qemu-ufs." (Thomas's review comment) - Use "-blockdev" instead of "-drive" (Stefan's review comment) Since v6: - Add tests/qtest/ufs-test.c to test ufs in

[PATCH v8 1/4] hw/ufs: Initial commit for emulated Universal-Flash-Storage

2023-07-27 Thread Jeuk Kim
Universal Flash Storage (UFS) is a high-performance mass storage device with a serial interface. It is primarily used as a high-performance data storage device for embedded applications. This commit contains code for UFS device to be recognized as a UFS PCI device. Patches to handle UFS logical un

Re: [PULL 21/30] migration: Refactor repeated call of yank_unregister_instance

2023-07-27 Thread Tejus GK
On 22/06/23 10:25 pm, Juan Quintela wrote: From: Tejus GK In the function qmp_migrate(), yank_unregister_instance() gets called twice which isn't required. Hence, refactoring it so that it gets called during the local_error cleanup. Reviewed-by: Daniel P. Berrangé Reviewed-by: Juan Quintela

Re: [PATCH v1] xen-platform: do full PCI reset during unplug of IDE devices

2023-07-27 Thread Paul Durrant
On 20/07/2023 08:29, Olaf Hering wrote: The IDE unplug function needs to reset the entire PCI device, to make sure all state is initialized to defaults. This is done by calling pci_device_reset, which resets not only the chip specific registers, but also all PCI state. This fixes "unplug" in a Xe

[PATCH v8 3/4] hw/ufs: Support for UFS logical unit

2023-07-27 Thread Jeuk Kim
This commit adds support for ufs logical unit. The LU handles processing for the SCSI command, unit descriptor query request. This commit enables the UFS device to process IO requests. Signed-off-by: Jeuk Kim Reviewed-by: Stefan Hajnoczi --- hw/ufs/lu.c | 1445

[PATCH v8 4/4] tests/qtest: Introduce tests for UFS

2023-07-27 Thread Jeuk Kim
This patch includes the following tests Test mmio read Test ufs device initialization and ufs-lu recognition Test I/O (Performs a write followed by a read to verify) Signed-off-by: Jeuk Kim Acked-by: Thomas Huth Reviewed-by: Stefan Hajnoczi --- MAINTAINERS | 1 + tests/qtes

[PATCH v8 2/4] hw/ufs: Support for Query Transfer Requests

2023-07-27 Thread Jeuk Kim
This commit makes the UFS device support query and nop out transfer requests. The next patch would be support for UFS logical unit and scsi command transfer request. Signed-off-by: Jeuk Kim Reviewed-by: Stefan Hajnoczi --- hw/ufs/trace-events | 1 + hw/ufs/ufs.c| 980

Re: [PATCH v2 3/8] machine: Print supported CPU models instead of typenames

2023-07-27 Thread Igor Mammedov
On Thu, 27 Jul 2023 15:16:18 +1000 Gavin Shan wrote: > On 7/27/23 09:08, Richard Henderson wrote: > > On 7/25/23 17:32, Gavin Shan wrote: > >> -static const char *q800_machine_valid_cpu_types[] = { > >> +static const char * const q800_machine_valid_cpu_types[] = { > >>   M68K_CPU_TYPE_NAME(

Re: [PATCH] target/i386: Fix reporting of CPU dies when nr_cores=nr_threads=1

2023-07-27 Thread ‍小太
On Thu, 27 Jul 2023 at 11:25, Xiaoyao Li wrote: > > On 7/24/2023 2:59 AM, 小太 wrote: > > When QEMU is started with `-smp D,sockets=1,dies=D,cores=1,threads=1` (that > > is, 1 socket with D dies but each die contains just a single thread), both > > Linux and Windows guests incorrectly interprets the

Re: [PATCH for-8.2 2/2] arm/kvm: convert to kvm_get_one_reg

2023-07-27 Thread Cornelia Huck
On Tue, Jul 25 2023, Gavin Shan wrote: > On 7/24/23 18:48, Cornelia Huck wrote: >> On Mon, Jul 24 2023, Gavin Shan wrote: >>> >>> On 7/18/23 21:14, Cornelia Huck wrote: We can neaten the code by switching the callers that work on a CPUstate to the kvm_get_one_reg function. Si

[PATCH v7 5/5] target/riscv: select KVM AIA in riscv virt machine

2023-07-27 Thread Yong-Xuan Wang
Select KVM AIA when the host kernel has in-kernel AIA chip support. Since KVM AIA only has one APLIC instance, we map the QEMU APLIC devices to KVM APLIC. Signed-off-by: Yong-Xuan Wang Reviewed-by: Jim Shu Reviewed-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones --- hw/riscv/virt.c | 94

Re: [PATCH v2 4/6] python/machine: use socketpair() for console connections

2023-07-27 Thread Daniel P . Berrangé
On Thu, Jul 27, 2023 at 11:22:35AM +0530, Ani Sinha wrote: > > > > On 26-Jul-2023, at 10:51 PM, John Snow wrote: > > > > > > > > On Wed, Jul 26, 2023, 6:50 AM Ani Sinha wrote: > > > > > > > On 25-Jul-2023, at 11:33 PM, John Snow wrote: > > > > > > Create a socketpair for the console outp

Re: [PATCH] gitlab: remove duplication between msys jobs

2023-07-27 Thread Daniel P . Berrangé
On Wed, Jul 26, 2023 at 08:21:33PM +0200, Thomas Huth wrote: > On 26/07/2023 18.19, Daniel P. Berrangé wrote: > > Although they share a common parent, the two msys jobs still have > > massive duplication in their script definitions that can easily be > > collapsed. > > > > Signed-off-by: Daniel P.

Re: [PATCH 04/10] hw/riscv: virt: Add PCIe HIGHMEM in memmap

2023-07-27 Thread Sunil V L
On Mon, Jul 24, 2023 at 05:32:54PM +0200, Igor Mammedov wrote: > On Wed, 12 Jul 2023 22:09:37 +0530 > Sunil V L wrote: > > > PCIe High MMIO base is actually dynamic and fixed at > > run time based on the RAM configured. Currently, this is > > not part of the memmap and kept in separate static var

[PATCH v7 1/5] target/riscv: support the AIA device emulation with KVM enabled

2023-07-27 Thread Yong-Xuan Wang
In this patch, we create the APLIC and IMSIC FDT helper functions and remove M mode AIA devices when using KVM acceleration. Signed-off-by: Yong-Xuan Wang Reviewed-by: Jim Shu Reviewed-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones --- hw/riscv/virt.c | 290 +++-

RE: [RFC PATCH] vfio-user: add live migration to vfio-user protocol specification

2023-07-27 Thread William Henderson
On Tue, 15 Jul 2023 at 21:48, Stefan Hajnoczi wrote: > > On Tue, 18 Jul 2023 at 05:42, William Henderson > wrote: > > > > This patch adds live migration to the vfio-user specification, based > > on the new VFIO migration interface introduced in the kernel here: > > > > https://lore.kernel.org/

Re: [PATCH 1/1] qemu-nbd: regression with arguments passing into nbd_client_thread()

2023-07-27 Thread Denis V. Lunev
On 7/26/23 19:57, Eric Blake wrote: On Wed, Jul 26, 2023 at 04:52:47PM +0200, Denis V. Lunev wrote: Unfortunately commit 03b67621445d601c9cdc7dfe25812e9f19b81488 Author: Denis V. Lunev Date: Mon Jul 17 16:55:40 2023 +0200 qemu-nbd: pass structure into nbd_client_thread ins

[PATCH v2 1/1] qemu-nbd: regression with arguments passing into nbd_client_thread()

2023-07-27 Thread Denis V. Lunev
Unfortunately commit 03b67621445d601c9cdc7dfe25812e9f19b81488 Author: Denis V. Lunev Date: Mon Jul 17 16:55:40 2023 +0200 qemu-nbd: pass structure into nbd_client_thread instead of plain char* has introduced a regression. struct NbdClientOpts resides on stack inside 'if' block. T

[PATCH v7 4/5] target/riscv: update APLIC and IMSIC to support KVM AIA

2023-07-27 Thread Yong-Xuan Wang
KVM AIA can't emulate APLIC only. When "aia=aplic" parameter is passed, APLIC devices is emulated by QEMU. For "aia=aplic-imsic", remove the mmio operations of APLIC when using KVM AIA and send wired interrupt signal via KVM_IRQ_LINE API. After KVM AIA enabled, MSI messages are delivered by KVM_SIG

[PATCH v7 3/5] target/riscv: Create an KVM AIA irqchip

2023-07-27 Thread Yong-Xuan Wang
We create a vAIA chip by using the KVM_DEV_TYPE_RISCV_AIA and then set up the chip with the KVM_DEV_RISCV_AIA_GRP_* APIs. We also extend KVM accelerator to specify the KVM AIA mode. The "riscv-aia" parameter is passed along with --accel in QEMU command-line. 1) "riscv-aia=emul": IMSIC is emulated b

Re: Implementing "tee" in python asyncio

2023-07-27 Thread Daniel P . Berrangé
On Wed, Jul 26, 2023 at 04:25:34PM -0400, John Snow wrote: > Hi folks, > > I'm currently wondering how to take a StreamReader as found on > https://docs.python.org/3/library/asyncio-subprocess.html#asyncio.subprocess.Process > and to consume the data while optionally re-streaming it to a > seconda

Re: [PATCH v10 00/10] migration: Modify 'migrate' and 'migrate-incoming' QAPI commands for migration

2023-07-27 Thread Het Gala
This is just a ping for Juan and other migration maintainers, if it's possible to have a look at the migration patches for new QAPI design and suggest some review comments if any. Update till now : Have got acked-by label from Markus for the new migrate QAPI design, and reviewd-by label from D

Re: [PATCH v2 1/2] qmp: remove virtio_list, search QOM tree instead

2023-07-27 Thread Jonah Palmer
On 6/27/23 07:23, Jonah Palmer wrote: On 6/26/23 08:16, Michael S. Tsirkin wrote: On Mon, Jun 26, 2023 at 08:08:28AM -0400, Jonah Palmer wrote: On 6/23/23 01:47, Michael S. Tsirkin wrote: On Fri, Jun 09, 2023 at 09:20:39AM -0400, Jonah Palmer wrote: The virtio_list duplicates

[PATCH] target/arm: Avoid writing to constant TCGv in trans_CSEL()

2023-07-27 Thread Peter Maydell
In commit 0b188ea05acb5 we changed the implementation of trans_CSEL() to use tcg_constant_i32(). However, this change was incorrect, because the implementation of the function sets up the TCGv_i32 rn and rm to be either zero or else a TCG temp created in load_reg(), and these TCG temps are then in

[PATCH v7 0/5] Add RISC-V KVM AIA Support

2023-07-27 Thread Yong-Xuan Wang
This series adds support for KVM AIA in RISC-V architecture. In order to test these patches, we require Linux with KVM AIA support which can be found in the riscv_kvm_aia_hwaccel_v1 branch at https://github.com/avpatel/linux.git --- v7: - fix compiler warning in PATCH3 - rename the "kvm-aia" prop

[PATCH v7 2/5] target/riscv: check the in-kernel irqchip support

2023-07-27 Thread Yong-Xuan Wang
We check the in-kernel irqchip support when using KVM acceleration. Signed-off-by: Yong-Xuan Wang Reviewed-by: Jim Shu Reviewed-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones --- target/riscv/kvm.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/target/ris

Re: [PATCH 1/2] block/file-posix: fix g_file_get_contents return path

2023-07-27 Thread Sam Li
Matthew Rosato 于2023年7月27日周四 19:46写道: > > On 7/5/23 10:54 AM, Matthew Rosato wrote: > > On 6/4/23 2:16 AM, Sam Li wrote: > >> The g_file_get_contents() function returns a g_boolean. If it fails, the > >> returned value will be 0 instead of -1. Solve the issue by skipping > >> assigning ret value.

Re: [PATCH v2 1/2] qmp: remove virtio_list, search QOM tree instead

2023-07-27 Thread Daniel P . Berrangé
On Fri, Jun 09, 2023 at 09:20:39AM -0400, Jonah Palmer wrote: > The virtio_list duplicates information about virtio devices that already > exist in the QOM composition tree. Instead of creating this list of > realized virtio devices, search the QOM composition tree instead. > > This patch modifies

Re: [PATCH 1/2] block/file-posix: fix g_file_get_contents return path

2023-07-27 Thread Matthew Rosato
On 7/5/23 10:54 AM, Matthew Rosato wrote: > On 6/4/23 2:16 AM, Sam Li wrote: >> The g_file_get_contents() function returns a g_boolean. If it fails, the >> returned value will be 0 instead of -1. Solve the issue by skipping >> assigning ret value. >> >> This issue was found by Matthew Rosato using

[PATCH v2] block/file-posix: fix g_file_get_contents return path

2023-07-27 Thread Sam Li
The g_file_get_contents() function returns a g_boolean. If it fails, the returned value will be 0 instead of -1. Solve the issue by skipping assigning ret value. This issue was found by Matthew Rosato using virtio-blk-{pci,ccw} backed by an NVMe partition e.g. /dev/nvme0n1p1 on s390x. Signed-off-

Re: [PATCH v2] block/file-posix: fix g_file_get_contents return path

2023-07-27 Thread Daniel P . Berrangé
On Thu, Jul 27, 2023 at 07:58:44PM +0800, Sam Li wrote: > The g_file_get_contents() function returns a g_boolean. If it fails, the > returned value will be 0 instead of -1. Solve the issue by skipping > assigning ret value. > > This issue was found by Matthew Rosato using virtio-blk-{pci,ccw} back

[PATCH 2/3] target/s390x: refractor AP functionalities

2023-07-27 Thread Steffen Eiden
Signed-off-by: Steffen Eiden --- target/s390x/kvm/kvm.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c index 3ac7ec9acf..bd62a7f606 100644 --- a/target/s390x/kvm/kvm.c +++ b/target/s390x/kvm/kvm.c @@ -250,7 +

[PATCH 1/3] linux-headers: update asm-s390/kvm.h

2023-07-27 Thread Steffen Eiden
Signed-off-by: Steffen Eiden --- linux-headers/asm-s390/kvm.h | 21 + 1 file changed, 21 insertions(+) diff --git a/linux-headers/asm-s390/kvm.h b/linux-headers/asm-s390/kvm.h index e2afd95420..178edb959e 100644 --- a/linux-headers/asm-s390/kvm.h +++ b/linux-headers/asm-s390/

[PATCH 3/3] target/s390x: AP-passthrough for PV guests

2023-07-27 Thread Steffen Eiden
Enabling AP-passthrough(AP-pt) for PV-guest via using the new CPU features for PV-AP-pt of kvm. As usual QEMU first checks which CPU features are available and then sets them if available and selected by user. An additional check is done to verify that PV-AP can only be enabled if "regular" AP-pt

Re: [PATCH 04/10] hw/riscv: virt: Add PCIe HIGHMEM in memmap

2023-07-27 Thread Sunil V L
On Thu, Jul 27, 2023 at 02:04:46PM +0200, Igor Mammedov wrote: > On Thu, 27 Jul 2023 16:29:19 +0530 > Sunil V L wrote: > > > On Mon, Jul 24, 2023 at 05:32:54PM +0200, Igor Mammedov wrote: > > > On Wed, 12 Jul 2023 22:09:37 +0530 > > > Sunil V L wrote: > > > > > > > PCIe High MMIO base is actu

Re: [PATCH 04/10] hw/riscv: virt: Add PCIe HIGHMEM in memmap

2023-07-27 Thread Igor Mammedov
On Thu, 27 Jul 2023 16:29:19 +0530 Sunil V L wrote: > On Mon, Jul 24, 2023 at 05:32:54PM +0200, Igor Mammedov wrote: > > On Wed, 12 Jul 2023 22:09:37 +0530 > > Sunil V L wrote: > > > > > PCIe High MMIO base is actually dynamic and fixed at > > > run time based on the RAM configured. Currently

Re: [PATCH 2/6] target/ppc: Fix VRMA page size for ISA v3.0

2023-07-27 Thread Cédric Le Goater
On 7/26/23 20:22, Nicholas Piggin wrote: Until v2.07s, the VRMA page size (L||LP) was encoded in LPCR[VRMASD]. In v3.0 that moved to the partition table PS field. The powernv machine can now run KVM HPT guests on POWER9/10 CPUs with this fix and the patch to add ASDR. Fixes: 3367c62f522b ("targ

Re: [External] Re: [PATCH] memory: avoid updating ioeventfds for some address_space

2023-07-27 Thread Peter Xu
On Thu, Jul 27, 2023 at 11:59:43AM +0800, hongmainquan wrote: > > > 在 2023/7/27 1:45 上午, Peter Xu 写道: > > On Tue, Jul 25, 2023 at 07:20:37PM +0800, hongmianquan wrote: > > > When updating ioeventfds, we need to iterate all address spaces, > > > but some address spaces do not register eventfd_add|

Re: [PATCH 5/6] hw/ppc: Always store the decrementer value

2023-07-27 Thread Cédric Le Goater
Hello Nick, On 7/26/23 20:22, Nicholas Piggin wrote: When writing a value to the decrementer that raises an exception, the irq is raised, but the value is not stored so the store doesn't appear to have changed the register when it is read again. Always store the write value to the register. T

Re: [PATCH v2] softmmu/physmem: try opening file readonly before failure in file_ram_open

2023-07-27 Thread David Hildenbrand
On 26.07.23 16:59, Thiner Logoer wrote: Users may give "-mem-path" a read only file and expect the file to be mapped read-write privately. Allow this but give a warning since other users may surprise when the ram file is readonly and qemu suddenly aborts elsewhere. Suggested-by: David Hildenbran

Re: [PATCH 3/6] vhost: Do not reset suspended devices on stop

2023-07-27 Thread Eugenio Perez Martin
On Wed, Jul 26, 2023 at 8:57 AM Hanna Czenczek wrote: > > On 25.07.23 20:53, Eugenio Perez Martin wrote: > > On Tue, Jul 25, 2023 at 3:09 PM Hanna Czenczek wrote: > >> On 25.07.23 12:03, Eugenio Perez Martin wrote: > >>> On Tue, Jul 25, 2023 at 9:53 AM Hanna Czenczek wrote: > On 24.07.23 17

Re: [PATCH 3/6] target/ppc: Fix pending HDEC when entering PM state

2023-07-27 Thread Cédric Le Goater
On 7/26/23 20:22, Nicholas Piggin wrote: HDEC is defined to not wake from PM state. There is a check in the HDEC timer to avoid setting the interrupt if we are in a PM state, but no check on PM entry to lower HDEC if it already fired. This can cause a HDECR wake up and QEMU abort with unsupporte

[PATCH 0/3] KVM: s390: Enable AP instructions for pv-guests

2023-07-27 Thread Steffen Eiden
This series enables general QEMU support for AP pass-through for Secure Execution guests (pv-guests). To enable AP-PT on pv-guests QEMU has to turn on the corresponding bits in the KVM CPU-model[1] if the CPU firmware supports it. However, it only makes sense to turn on AP-PT if the QEMU user enab

Re: [RFC PATCH 00/12] Prefer to use SVQ to stall dataplane at NIC state restore through CVQ

2023-07-27 Thread Eugenio Perez Martin
On Tue, Jul 25, 2023 at 9:15 AM Jason Wang wrote: > > > 在 2023/7/21 14:48, Eugenio Perez Martin 写道: > > On Thu, Jul 20, 2023 at 8:15 PM Eugenio Pérez wrote: > >> At this moment the migration of net features that depends on CVQ is not > >> possible, as there is no reliable way to restore the devic

Re: [PATCH v2 0/6] python/machine: use socketpair() for console socket

2023-07-27 Thread Peter Maydell
On Tue, 25 Jul 2023 at 19:04, John Snow wrote: > > Like we did for the QMP socket, use socketpair() for the console socket > so that hopefully there isn't a race condition during early boot where > data might get dropped on the floor. > > May or may not help with various race conditions where earl

Re: [RFC PATCH 00/12] Prefer to use SVQ to stall dataplane at NIC state restore through CVQ

2023-07-27 Thread Michael S. Tsirkin
On Fri, Jul 21, 2023 at 08:48:02AM +0200, Eugenio Perez Martin wrote: > * Leave _F_RING_RESET to be added on top, as the semantics are not > implemented in vDPA at the moment. We really need _F_RING_RESET in vdpa too though. You did code it up already - why do you want to leave it out? -- MST

Re: [PATCH for-8.1] target/arm: Fix MemOp for STGP

2023-07-27 Thread Peter Maydell
On Wed, 26 Jul 2023 at 19:34, Richard Henderson wrote: > > When converting to decodetree, the code to rebuild mop for the pair > only made it into trans_STP and not into trans_STGP. > > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1790 > Fixes: 8c212eb6594 ("target/arm: Convert load/sto

[PATCH RFC v1 0/3] Support dynamic MSI-X allocation

2023-07-27 Thread Jing Liu
Before kernel v6.5, dynamic allocation of MSI-X interrupts was not supported. Qemu therefore when allocating a new interrupt, should first release all previously allocated interrupts (including disable of MSI-X) and re-allocate all interrupts that includes the new one. The kernel series [1] adds t

[PATCH RFC v1 2/3] vfio/pci: enable vector on dynamic MSI-X allocation

2023-07-27 Thread Jing Liu
The vector_use callback is used to enable vector that is unmasked in guest. The kernel used to only support static MSI-X allocation. When allocating a new interrupt using "static MSI-X allocation" kernels, Qemu first disables all previously allocated vectors and then re-allocates all including the

[PATCH RFC v1 3/3] vfio/pci: dynamic MSI-X allocation in interrupt restoring

2023-07-27 Thread Jing Liu
During migration restoring, vfio_enable_vectors() is called to restore enabling MSI-X interrupts for assigned devices. It sets the range from 0 to nr_vectors to kernel to enable MSI-X and the vectors unmasked in guest. During the MSI-X enabling, all the vectors within the range are allocated accord

Re: [PATCH v2] block/file-posix: fix g_file_get_contents return path

2023-07-27 Thread Stefan Hajnoczi
On Thu, Jul 27, 2023 at 07:58:44PM +0800, Sam Li wrote: > The g_file_get_contents() function returns a g_boolean. If it fails, the > returned value will be 0 instead of -1. Solve the issue by skipping > assigning ret value. > > This issue was found by Matthew Rosato using virtio-blk-{pci,ccw} back

[PATCH RFC v1 1/3] vfio/pci: detect the support of dynamic MSI-X allocation

2023-07-27 Thread Jing Liu
From: Reinette Chatre Kernel provides the guidance of dynamic MSI-X allocation support of passthrough device, by clearing the VFIO_IRQ_INFO_NORESIZE flag to guide user space. Fetch and store the flags from host for later use to determine if specific flags are set. Signed-off-by: Reinette Chatre

Re: Lost partition tables on ide-hd + ahci drive

2023-07-27 Thread Simon Rowe
On Wednesday, 14 June 2023 Simon Rowe wrote: > We've also seen a handful of similar reports. Again, just the MBR sector > overwritten by what looks to be guest data (e.g. log messages). The > common thread with our incidents is again a SATA disk under the AHCI > controller, we have a network backe

Re: [PATCH 1/6] target/ppc: Implement ASDR register for ISA v3.0 for HPT

2023-07-27 Thread Cédric Le Goater
On 7/26/23 20:22, Nicholas Piggin wrote: The ASDR register was introduced in ISA v3.0. It has not been implemented for HPT. With HPT, ASDR is the format of the slbmte RS operand (containing VSID), which matches the ppc_slb_t field. Fixes: 3367c62f522b ("target/ppc: Support for POWER9 native hash

Re: [PATCH for-8.2 v5 09/11] target/riscv: add 'max' CPU type

2023-07-27 Thread Conor Dooley
Hey Daniel, On Thu, Jul 20, 2023 at 02:19:31PM -0300, Daniel Henrique Barboza wrote: > The 'max' CPU type is used by tooling to determine what's the most > capable CPU a current QEMU version implements. Other archs such as ARM > implements this type. Let's add it to RISC-V. > > What we consider "

Re: [External] Re: [PATCH] memory: avoid updating ioeventfds for some address_space

2023-07-27 Thread hongmainquan
在 2023/7/27 8:53 下午, Peter Xu 写道: On Thu, Jul 27, 2023 at 11:59:43AM +0800, hongmainquan wrote: 在 2023/7/27 1:45 上午, Peter Xu 写道: On Tue, Jul 25, 2023 at 07:20:37PM +0800, hongmianquan wrote: When updating ioeventfds, we need to iterate all address spaces, but some address spaces do not r

Re: [PATCH v2 1/1] qemu-nbd: regression with arguments passing into nbd_client_thread()

2023-07-27 Thread Eric Blake
On Thu, Jul 27, 2023 at 12:58:28PM +0200, Denis V. Lunev wrote: > Unfortunately > commit 03b67621445d601c9cdc7dfe25812e9f19b81488 > Author: Denis V. Lunev > Date: Mon Jul 17 16:55:40 2023 +0200 > qemu-nbd: pass structure into nbd_client_thread instead of plain char* > has introdu

Re: [PATCH for-8.2 v5 09/11] target/riscv: add 'max' CPU type

2023-07-27 Thread Daniel Henrique Barboza
On 7/27/23 11:16, Conor Dooley wrote: On Thu, Jul 27, 2023 at 11:12:34AM -0300, Daniel Henrique Barboza wrote: On 7/27/23 10:59, Conor Dooley wrote: Hey Daniel, On Thu, Jul 20, 2023 at 02:19:31PM -0300, Daniel Henrique Barboza wrote: The 'max' CPU type is used by tooling to determine wha

Re: [PATCH v2] block/file-posix: fix g_file_get_contents return path

2023-07-27 Thread Stefan Hajnoczi
On Thu, Jul 27, 2023 at 01:15:32PM +0100, Daniel P. Berrangé wrote: > On Thu, Jul 27, 2023 at 07:58:44PM +0800, Sam Li wrote: > > The g_file_get_contents() function returns a g_boolean. If it fails, the > > returned value will be 0 instead of -1. Solve the issue by skipping > > assigning ret value.

[PATCH] hw/riscv: virt: Fix riscv,pmu DT node path

2023-07-27 Thread Conor Dooley
From: Conor Dooley On a dtb dumped from the virt machine, dt-validate complains: soc: pmu: {'riscv,event-to-mhpmcounters': [[1, 1, 524281], [2, 2, 524284], [65561, 65561, 524280], [65563, 65563, 524280], [65569, 65569, 524280]], 'compatible': ['riscv,pmu']} should not be valid under {'type': 'o

RE: [Question - ARM CCA] vCPU Hotplug Support in ARM Realm world might require ARM spec change?

2023-07-27 Thread Salil Mehta via
Hi Bibo, > From: bibo mao > Sent: Tuesday, July 25, 2023 7:24 AM > To: Salil Mehta [...] > 在 2023/7/25 13:45, Salil Mehta 写道: > > Hello, > > > >> From: bibo mao > >> Sent: Tuesday, July 25, 2023 2:14 AM > >> To: Salil Mehta [...] > >> 在 2023/7/25 08:56, Salil Mehta 写道: > >>> > From: b

Re: [PATCH] hw/riscv: virt: Fix riscv,pmu DT node path

2023-07-27 Thread Daniel Henrique Barboza
On 7/27/23 11:24, Conor Dooley wrote: From: Conor Dooley On a dtb dumped from the virt machine, dt-validate complains: soc: pmu: {'riscv,event-to-mhpmcounters': [[1, 1, 524281], [2, 2, 524284], [65561, 65561, 524280], [65563, 65563, 524280], [65569, 65569, 524280]], 'compatible': ['riscv,p

Re: [External] Re: [PATCH] memory: avoid updating ioeventfds for some address_space

2023-07-27 Thread Peter Xu
On Thu, Jul 27, 2023 at 09:23:34PM +0800, hongmainquan wrote: > > > 在 2023/7/27 8:53 下午, Peter Xu 写道: > > On Thu, Jul 27, 2023 at 11:59:43AM +0800, hongmainquan wrote: > > > > > > > > > 在 2023/7/27 1:45 上午, Peter Xu 写道: > > > > On Tue, Jul 25, 2023 at 07:20:37PM +0800, hongmianquan wrote: > > >

Re: [PATCH for-8.2 v5 09/11] target/riscv: add 'max' CPU type

2023-07-27 Thread Daniel Henrique Barboza
On 7/27/23 10:59, Conor Dooley wrote: Hey Daniel, On Thu, Jul 20, 2023 at 02:19:31PM -0300, Daniel Henrique Barboza wrote: The 'max' CPU type is used by tooling to determine what's the most capable CPU a current QEMU version implements. Other archs such as ARM implements this type. Let's add

Re: [PATCH v2 3/8] machine: Print supported CPU models instead of typenames

2023-07-27 Thread Richard Henderson
On 7/26/23 22:16, Gavin Shan wrote: On 7/27/23 09:08, Richard Henderson wrote: On 7/25/23 17:32, Gavin Shan wrote: -static const char *q800_machine_valid_cpu_types[] = { +static const char * const q800_machine_valid_cpu_types[] = {   M68K_CPU_TYPE_NAME("m68040"),   NULL   }; +static co

Re: [PATCH for-8.2 v5 09/11] target/riscv: add 'max' CPU type

2023-07-27 Thread Conor Dooley
On Thu, Jul 27, 2023 at 11:12:34AM -0300, Daniel Henrique Barboza wrote: > > > On 7/27/23 10:59, Conor Dooley wrote: > > Hey Daniel, > > > > On Thu, Jul 20, 2023 at 02:19:31PM -0300, Daniel Henrique Barboza wrote: > > > The 'max' CPU type is used by tooling to determine what's the most > > > cap

RE: [PATCH 0/8] Adds CPU hot-plug support to Loongarch

2023-07-27 Thread Salil Mehta via
Hello, > From: lixianglai > Sent: Thursday, July 27, 2023 3:14 AM > To: Gavin Shan ; qemu-devel@nongnu.org; Salil Mehta > ; zhukeqian ; Bibo Mao > > Subject: Re: [PATCH 0/8] Adds CPU hot-plug support to Loongarch > > Hi Gavin and Salil, > > On 7/27/23 8:57 AM, Gavin Shan wrote: > > Hi Xianglai

Re: [PATCH] semihosting/uaccess.c: Replaced a malloc call with g_malloc.

2023-07-27 Thread Peter Maydell
On Wed, 26 Jul 2023 at 16:21, Richard Henderson wrote: > > On 7/26/23 02:43, Peter Maydell wrote: > > (Something went wrong with the quoting in your email. I've > > fixed it up.) > > > > On Wed, 26 Jul 2023 at 05:38, wrote: > >> Peter Maydell wrote: > >>> The third part here, is that g_malloc() d

RE: [PATCH 0/8] Adds CPU hot-plug support to Loongarch

2023-07-27 Thread Salil Mehta via
Hi Gavin, > From: Gavin Shan > Sent: Thursday, July 27, 2023 1:57 AM > > Hi Xianglai, > > On 7/20/23 17:15, xianglai li wrote: > > Hello everyone, We refer to the implementation of ARM CPU > > Hot-Plug to add GED-based CPU Hot-Plug support to Loongarch. > > > > The first 4 patches are changes t

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

2023-07-27 Thread Albert Esteve
On Mon, Jul 17, 2023 at 4:11 PM Michael S. Tsirkin wrote: > > > > > On Mon, Jul 17, 2023 at 01:42:02PM +0200, Albert Esteve wrote: > > Hi Michael, > > > > True. It may be a good idea to impose a limit in the number of entries > that can > > be added to the table. > > And fail to add new entries o

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

2023-07-27 Thread Michael S. Tsirkin
On Thu, Jul 27, 2023 at 04:48:30PM +0200, Albert Esteve wrote: > > > On Mon, Jul 17, 2023 at 4:11 PM Michael S. Tsirkin wrote: > > > > > > On Mon, Jul 17, 2023 at 01:42:02PM +0200, Albert Esteve wrote: > > Hi Michael, > > > > True. It may be a good idea to impose a limit in

Re: virtio-blk using a single iothread

2023-07-27 Thread Stefan Hajnoczi
On Sun, Jun 11, 2023 at 03:27:57PM +0300, Sagi Grimberg wrote: > > > On 6/8/23 19:08, Stefan Hajnoczi wrote: > > On Thu, Jun 08, 2023 at 10:40:57AM +0300, Sagi Grimberg wrote: > > > Hey Stefan, Paolo, > > > > > > I just had a report from a user experiencing lower virtio-blk > > > performance tha

Re: [PATCH] block/iscsi: Document why we use raw malloc()

2023-07-27 Thread Peter Maydell
On Thu, 27 Jul 2023 at 16:07, Peter Maydell wrote: > > In block/iscsi.c we use a raw malloc() call, which is unusual > given the project standard is to use the glib memory allocation > functions. Document why we do so, to avoid it being converted > to g_malloc() by mistake. > > Signed-off-by: Pete

RE: [PATCH v1] migration: refactor migration_completion

2023-07-27 Thread Wang, Wei W
On Thursday, July 27, 2023 1:10 AM, Peter Xu wrote: > On Fri, Jul 21, 2023 at 11:14:55AM +, Wang, Wei W wrote: > > On Friday, July 21, 2023 4:38 AM, Peter Xu wrote: > > > Looks good to me, after addressing Isaku's comments. > > > > > > The current_active_state is very unfortunate, along with mo

Re: avocado test failing INTERRUPTED for "Missing asset"

2023-07-27 Thread Cleber Rosa
On Tue, Jul 25, 2023 at 1:13 PM Peter Maydell wrote: > > Currently this CI job is failing: > > https://gitlab.com/qemu-project/qemu/-/jobs/4737819946 > > because: > > (05/59) > tests/avocado/boot_linux_console.py:BootLinuxConsole.test_arm_exynos4210_initrd: > INTERRUPTED: Missing asset > https://

Re: [External] Re: [PATCH] memory: avoid updating ioeventfds for some address_space

2023-07-27 Thread hongmainquan
在 2023/7/27 10:36 下午, Peter Xu 写道: On Thu, Jul 27, 2023 at 09:23:34PM +0800, hongmainquan wrote: 在 2023/7/27 8:53 下午, Peter Xu 写道: On Thu, Jul 27, 2023 at 11:59:43AM +0800, hongmainquan wrote: 在 2023/7/27 1:45 上午, Peter Xu 写道: On Tue, Jul 25, 2023 at 07:20:37PM +0800, hongmianquan wrot

Re: [PATCH] semihosting/uaccess.c: Replaced a malloc call with g_malloc.

2023-07-27 Thread Daniel P . Berrangé
On Thu, Jul 27, 2023 at 03:56:23PM +0100, Peter Maydell wrote: > On Wed, 26 Jul 2023 at 16:21, Richard Henderson > wrote: > > > > On 7/26/23 02:43, Peter Maydell wrote: > > > (Something went wrong with the quoting in your email. I've > > > fixed it up.) > > > > > > On Wed, 26 Jul 2023 at 05:38, w

Re:Re: [PATCH v2] softmmu/physmem: try opening file readonly before failure in file_ram_open

2023-07-27 Thread ThinerLogoer
At 2023-07-27 21:18:44, "David Hildenbrand" wrote: >On 26.07.23 16:59, Thiner Logoer wrote: >> Users may give "-mem-path" a read only file and expect the file >> to be mapped read-write privately. Allow this but give a warning >> since other users may surprise when the ram file is readonly and >>

Re: [RFC PATCH 00/12] Prefer to use SVQ to stall dataplane at NIC state restore through CVQ

2023-07-27 Thread Eugenio Perez Martin
On Thu, Jul 27, 2023 at 3:06 PM Michael S. Tsirkin wrote: > > On Fri, Jul 21, 2023 at 08:48:02AM +0200, Eugenio Perez Martin wrote: > > * Leave _F_RING_RESET to be added on top, as the semantics are not > > implemented in vDPA at the moment. > > We really need _F_RING_RESET in vdpa too though. > Y

[PATCH] block/iscsi: Document why we use raw malloc()

2023-07-27 Thread Peter Maydell
In block/iscsi.c we use a raw malloc() call, which is unusual given the project standard is to use the glib memory allocation functions. Document why we do so, to avoid it being converted to g_malloc() by mistake. Signed-off-by: Peter Maydell --- There aren't many uses of raw malloc() in the code

Re: [PATCH v4 6/9] throttle: use enum ThrottleDirection instead of bool is_write

2023-07-27 Thread Hanna Czenczek
On 24.07.23 12:09, zhenwei pi wrote: enum ThrottleDirection is already there, use ThrottleDirection instead of 'bool is_write' for throttle API, also modify related codes from block, fsdev, cryptodev and tests. Signed-off-by: zhenwei pi --- backends/cryptodev.c| 9 + block/t

Re: [PATCH v4 8/9] fsdev: Use ThrottleDirection instread of bool is_write

2023-07-27 Thread Hanna Czenczek
On 24.07.23 12:09, zhenwei pi wrote: 'bool is_write' style is obsolete from throttle framework, adapt fsdev to the new style. Cc: Greg Kurz Signed-off-by: zhenwei pi --- fsdev/qemu-fsdev-throttle.c | 14 +++--- fsdev/qemu-fsdev-throttle.h | 4 ++-- hw/9pfs/cofile.c| 4

Re: [PATCH v8 0/4] hw/ufs: Add Universal Flash Storage (UFS) support

2023-07-27 Thread Stefan Hajnoczi
On Thu, Jul 27, 2023 at 05:45:17PM +0900, Jeuk Kim wrote: > Since v7: > In ufs-test.c, make the following changes > - Change TIMEOUT from 5 to 10 (Thomas's review comment) > - Rename the temporary file to "qemu-ufs." (Thomas's review comment) > - Use "-blockdev" instead of "-drive" (Stefan's re

Re: [PATCH v2 1/2] qmp: remove virtio_list, search QOM tree instead

2023-07-27 Thread Jonah Palmer
On 7/27/23 07:46, Daniel P. Berrangé wrote: On Fri, Jun 09, 2023 at 09:20:39AM -0400, Jonah Palmer wrote: The virtio_list duplicates information about virtio devices that already exist in the QOM composition tree. Instead of creating this list of realized virtio devices, search the QOM compositi

  1   2   3   >