Re: QOM crash via soundhw_init()

2023-10-12 Thread Peng Liang
On 10/12/2023 18:53, Philippe Mathieu-Daudé wrote: > Hi Martin, Paolo, Markus, Marc-André, > > With the following changes: > > -- >8 -- > diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c > index 137276bcb9..291495f798 100644 > --- a/hw/ppc/prep.c > +++ b/hw/ppc/prep.c > @@ -245,6 +245,7 @@ static vo

Re: [PATCH] hw/arm/virt-acpi-build.c: Add missing header

2023-07-06 Thread Peng Liang
I'm not sure whether the error has already been fixed by others or not. If so, please just ignore this patch. On 07/06/2023 23:08, Peng Liang wrote: virt-acpi-build.c uses warn_report. However, it doesn't include qemu/error-report.h directly, it include qemu/error-report.h via tra

[PATCH] hw/arm/virt-acpi-build.c: Add missing header

2023-07-06 Thread Peng Liang
error-report.h any more and it will lead to build errors. Include qemu/error-report.h directly in virt-acpi-build.c to avoid the errors. Signed-off-by: Peng Liang --- hw/arm/virt-acpi-build.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c

Re: [PATCH V8 20/39] cpr: restart mode

2022-07-05 Thread Peng Liang
On 7/6/2022 2:29 AM, Steven Sistare wrote: > On 7/3/2022 4:15 AM, Peng Liang wrote: >> On 6/15/2022 10:52 PM, Steve Sistare wrote: >>> Provide the cpr-save restart mode, which preserves the guest VM across a >>> restart of the qemu process. After cpr-save, the cal

Re: [PATCH V8 27/39] vfio-pci: cpr part 1 (fd and dma)

2022-07-03 Thread Peng Liang
On 6/15/2022 10:52 PM, Steve Sistare wrote: > Enable vfio-pci devices to be saved and restored across an exec restart > of qemu. > > At vfio creation time, save the value of vfio container, group, and device > descriptors in cpr state. > > In the container pre_save handler, suspend the use of

Re: [PATCH V8 36/39] chardev: cpr for sockets

2022-07-03 Thread Peng Liang
On 6/15/2022 10:52 PM, Steve Sistare wrote: > Save accepted socket fds before cpr-save, and look for them after cpr-load. > Block cpr-exec if a socket enables the TLS or websocket option. Allow a > monitor socket by closing it on exec. > > Signed-off-by: Mark Kanda > Signed-off-by: Steve Sist

Re: [PATCH V8 20/39] cpr: restart mode

2022-07-03 Thread Peng Liang
On 6/15/2022 10:52 PM, Steve Sistare wrote: > Provide the cpr-save restart mode, which preserves the guest VM across a > restart of the qemu process. After cpr-save, the caller passes qemu > command-line arguments to cpr-exec, which directly exec's the new qemu > binary. The arguments must inc

Re: [PATCH V8 12/39] memory: flat section iterator

2022-07-03 Thread Peng Liang
On 6/15/2022 10:51 PM, Steve Sistare wrote: > Add an iterator over the sections of a flattened address space. > > Signed-off-by: Steve Sistare > Reviewed-by: Marc-André Lureau > --- > include/exec/memory.h | 31 +++ > softmmu/memory.c | 20 +++

Re: [PATCH 0/2] block-backend: Retain permissions after migration

2022-01-10 Thread Peng Liang via
On 11/25/2021 9:53 PM, Hanna Reitz wrote: > Hi, > > Peng Liang has reported an issue regarding migration of raw images here: > https://lists.nongnu.org/archive/html/qemu-block/2021-11/msg00673.html > > It turns out that after migrating, all permissions are shared when they >

Re: [PATCH 1/2] block-backend: Retain permissions after migration

2021-11-26 Thread Peng Liang via
5f7772c4d0cf32f4e779fcd5a69ae4dae24aeebf >("block-backend: Defer shared_perm tightening migration >completion") > Reported-by: Peng Liang > Signed-off-by: Hanna Reitz > --- > block/block-backend.c | 11 +++ > 1 file changed, 11 insertions(+) > Thanks for your patch! Tested-by: Peng Liang

Questions about losing the write lock of raw-format disks after migration

2021-11-24 Thread Peng Liang via
Hi folks, When we test migration with raw-format disk, we found that the QEMU process in the dst will lose the write lock after migration. However, the QEMU process in the dst will still hold the write lock for qcow2-format disk. After reading some block layer's code, I found that the first blk_

[PATCH v2] vfio: Fix memory leak of hostwin

2021-11-16 Thread Peng Liang
indow dynamically (SPAPR IOMMU v2)") CC: qemu-sta...@nongnu.org Signed-off-by: Peng Liang --- v1 -> v2: - Don't change to _SAFE variant in vfio_host_win_del. [Alex] --- hw/vfio/common.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/vfio/common.c b/hw/vfio/common.c

Re: [PATCH] vfio: Fix memory leak of hostwin

2021-11-16 Thread Peng Liang
On 11/17/2021 3:01 AM, Alex Williamson wrote: > On Tue, 16 Nov 2021 19:56:26 +0800 > Peng Liang wrote: > >> hostwin is allocated and added to hostwin_list in vfio_host_win_add, but >> it is only deleted from hostwin_list in vfio_host_win_del, which causes >> a memo

[PATCH] vfio: Fix memory leak of hostwin

2021-11-16 Thread Peng Liang
indow dynamically (SPAPR IOMMU v2)") CC: qemu-sta...@nongnu.org Signed-off-by: Peng Liang --- hw/vfio/common.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index dd387b0d3959..2cce60c5fac3 100644 --- a/hw/vfio/common.c +++

Re: [PATCH] vl: Fix an assert failure in error path

2021-06-10 Thread Peng Liang
On 6/10/2021 3:32 PM, Markus Armbruster wrote: > Peng Liang writes: > >> On 6/9/2021 8:15 PM, Daniel P. Berrangé wrote: >>> On Wed, Jun 09, 2021 at 02:09:47PM +0200, Markus Armbruster wrote: >>>> Paolo Bonzini writes: >>>> >>>>>

[PATCH] runstate: Initialize Error * to NULL

2021-06-10 Thread Peng Liang
Based on the description of error_setg(), the local variable err in qemu_init_subsystems() should be initialized to NULL. Fix: efd7ab22fb "vl: extract qemu_init_subsystems" Signed-off-by: Peng Liang --- The patch is generated by the following coccinelle script (thanks to Ma

Re: [PATCH] vl: Fix an assert failure in error path

2021-06-09 Thread Peng Liang
On 6/9/2021 8:15 PM, Daniel P. Berrangé wrote: > On Wed, Jun 09, 2021 at 02:09:47PM +0200, Markus Armbruster wrote: >> Paolo Bonzini writes: >> >>> On 10/06/21 10:47, Zhenzhong Duan wrote: Based on the description of error_setg(), the local variable err in qemu_maybe_daemonize() should b

[PATCH] lsilogic: Use PCIDevice::exit instead of DeviceState::unrealize

2021-03-02 Thread Peng Liang
Move instructions") Cc: qemu-sta...@nongnu.org Signed-off-by: Peng Liang --- hw/scsi/lsi53c895a.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 7d13c7dc1c46..af46c62f0d78 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/s

Re: [PATCH] block/mirror: fix core when using iothreads

2021-02-01 Thread Peng Liang
On 9/23/2020 10:50 PM, John Snow wrote: > On 8/26/20 9:19 AM, Peng Liang wrote: >> We found an issue when doing block-commit with iothreads, which tries to >> dereference a NULL pointer. >> > > I'm clearing out my patch backlog. I am a bit out of the loop on block

Re: [PATCH v4] blockjob: Fix crash with IOthread when block commit after snapshot

2021-02-01 Thread Peng Liang
Hi, I encountered the problem months ago too. Could we move the creation of the block job (block_job_create) before appending the new bs to mirror_top_bs (bdrv_append) as I wrote in [*]? I found that after bdrv_append, qemu will use mirror_top_bs to do write. And when writing, qemu will use bs-

[PATCH] block/nbd: Fix crash when cancelling drive mirror

2020-12-30 Thread Peng Liang
1e8, envp=0x7ffe4cf8f4e0) at ../softmmu/main.c:50 Reported-by: Euler Robot Signed-off-by: Peng Liang --- block/nbd.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/block/nbd.c b/block/nbd.c index 42536702b6f9..b22a9ecbbcd0 100644 --- a/block/nbd.c +++ b/block/nb

physmem: Is 0644 OK for new created file?

2020-11-23 Thread Peng Liang
Hi, Recently, I tried to use ivshmem-plain devices to share some information between guests. I found that if the file of the shmem doesn't exist, then QEMU will create one and the mode of it is 0644. Maybe it is risky because everyone can read the content of the file? Do we need to change it to

Re: [PATCH] ui/vnc: Add missing lock for send_color_map

2020-11-22 Thread Peng Liang
Kindly ping. On 11/16/2020 10:13 PM, Peng Liang wrote: > vnc_write() should be locked after the RFB protocol is initialized. > > Fixes: 0c426e4534b4 ("vnc: Add support for color map") > Cc: qemu-sta...@nongnu.org > Reported-by: Euler Robot > Signed-off-by: Peng

[PATCH] ui/vnc: Add missing lock for send_color_map

2020-11-16 Thread Peng Liang
vnc_write() should be locked after the RFB protocol is initialized. Fixes: 0c426e4534b4 ("vnc: Add support for color map") Cc: qemu-sta...@nongnu.org Reported-by: Euler Robot Signed-off-by: Peng Liang --- ui/vnc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/vnc.c b/ui/v

[PATCH v2] ACPI: Avoid infinite recursion when dump-vmstate

2020-11-11 Thread Peng Liang
There is a field with vmstate_ghes_state as vmsd in vmstate_ghes_state, which will lead to infinite recursion in dump_vmstate_vmsd. Fixes: a08a64627b ("ACPI: Record the Generic Error Status Block address") Reported-by: Euler Robot Signed-off-by: Peng Liang Acked-by: Igor Mammedov --

Re: [PATCH] ACPI: Avoid infinite recursion when dump-vmstate

2020-11-11 Thread Peng Liang
On 11/12/2020 1:26 AM, Dr. David Alan Gilbert wrote: > * Igor Mammedov (imamm...@redhat.com) wrote: >> On Wed, 11 Nov 2020 14:01:12 + >> "Dr. David Alan Gilbert" wrote: >> >>> Is someone taking a fix for this in 5.2 - it's breaking vmstate >>> comparison. >> can you merge it via migration tree

[RFC v3 09/10] target/arm: introduce CPU feature dependency mechanism

2020-11-01 Thread Peng Liang
CPU features are in relationship a->b, which means b is dependent on a. If b is enabled by user, then a is enabled automatically. And if a is disabled by user, then b is disabled automatically. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/cpu.c

[RFC v3 08/10] target/arm: Introduce user_mask to indicate whether the feature is set explicitly

2020-11-01 Thread Peng Liang
To add CPU feature dependencies, we need to known whether a CPU feature is set explicitly or automatically by dependencies mechanism. Introduce user_mask to do that. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/cpu.c | 2 ++ target/arm/cpu.h | 1 + 2 files changed, 3

[RFC v3 04/10] target/arm: convert isar regs to array

2020-11-01 Thread Peng Liang
gisters in AArch32, it's harmless to change the ID registers in AArch32 to 64-bits. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- hw/intc/armv7m_nvic.c | 32 ++--- target/arm/cpu.c | 251 target/arm/cp

[RFC v3 00/10] Support disable/enable CPU features for AArch64

2020-11-01 Thread Peng Liang
linux-headers/linux/kvm.h Peng Liang (10): linux-header: Introduce KVM_CAP_ARM_CPU_FEATURE target/arm: Update ID fields target/arm: only set ID_PFR1_EL1.GIC for AArch32 guest target/arm: convert isar regs to array target/arm: Introduce kvm_arm_cpu_feature_supported target/arm: regist

[RFC v3 01/10] linux-header: Introduce KVM_CAP_ARM_CPU_FEATURE

2020-11-01 Thread Peng Liang
Introduce KVM_CAP_ARM_CPU_FEATURE. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- linux-headers/linux/kvm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 43580c767c33..146eaec35d49 100644 --- a/linux-headers/linux

[RFC v3 06/10] target/arm: register CPU features for property

2020-11-01 Thread Peng Liang
in DDI.0487 Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/cpu.c | 188 +++ 1 file changed, 188 insertions(+) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 13179e13e358..c5530550ece0 100644 --- a/target/arm/cpu.c

[RFC v3 05/10] target/arm: Introduce kvm_arm_cpu_feature_supported

2020-11-01 Thread Peng Liang
Introduce kvm_arm_cpu_feature_supported to check whether KVM supports to set CPU features in ARM. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/kvm64.c | 14 ++ target/arm/kvm_arm.h | 7 +++ 2 files changed, 21 insertions(+) diff --git a/target/arm

[RFC v3 07/10] target/arm: Allow ID registers to synchronize to KVM

2020-11-01 Thread Peng Liang
because GIC has been initialized. Hence, let's give all ID registers a chance to write to KVM. If the write is successful, then write to (index,value) list. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/helper.c | 46 +--- t

[RFC v3 10/10] target/arm: Add CPU features to query-cpu-model-expansion

2020-11-01 Thread Peng Liang
Add CPU features to the result of query-cpu-model-expansion so that other applications (such as libvirt) can know the supported CPU features. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/monitor.c | 4 1 file changed, 4 insertions(+) diff --git a/target/arm

[RFC v3 03/10] target/arm: only set ID_PFR1_EL1.GIC for AArch32 guest

2020-11-01 Thread Peng Liang
Some AArch64 CPU doesn't support AArch32 mode, AArch32 registers should be 0. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 97bb6b8

[RFC v3 02/10] target/arm: Update ID fields

2020-11-01 Thread Peng Liang
Update definitions for ID fields, up to ARMv8.6. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/cpu.h | 17 + 1 file changed, 17 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index c18a91676656..4c76fff1985f 100644 --- a/target/arm/cpu.h

Re: [PATCH] ACPI: Avoid infinite recursion when dump-vmstate

2020-10-25 Thread Peng Liang
On 10/24/2020 2:54 AM, Dr. David Alan Gilbert wrote: > * Igor Mammedov (imamm...@redhat.com) wrote: >> On Mon, 19 Oct 2020 17:31:56 +0800 >> Peng Liang wrote: >> >>> There is a field with vmstate_ghes_state as vmsd in vmstate_ghes_state, >>> w

Re: [PATCH] microbit_i2c: Fix coredump when dump-vmstate

2020-10-20 Thread Peng Liang
On 10/20/2020 7:27 PM, Peter Maydell wrote: > On Tue, 20 Oct 2020 at 12:17, Peng Liang wrote: >> >> On 10/19/2020 6:35 PM, Philippe Mathieu-Daudé wrote: >>> On 10/19/20 11:34 AM, Peng Liang wrote: >>>> VMStateDescription.fields should be end with

Re: [PATCH] microbit_i2c: Fix coredump when dump-vmstate

2020-10-20 Thread Peng Liang
On 10/20/2020 7:27 PM, Philippe Mathieu-Daudé wrote: > On 10/20/20 1:17 PM, Peng Liang wrote: >> On 10/19/2020 6:35 PM, Philippe Mathieu-Daudé wrote: >>> On 10/19/20 11:34 AM, Peng Liang wrote: >>>> VMStateDescription.fields should be end with VMSTA

Re: [PATCH] microbit_i2c: Fix coredump when dump-vmstate

2020-10-20 Thread Peng Liang
On 10/19/2020 6:35 PM, Philippe Mathieu-Daudé wrote: > On 10/19/20 11:34 AM, Peng Liang wrote: >> VMStateDescription.fields should be end with VMSTATE_END_OF_LIST(). >> However, microbit_i2c_vmstate doesn't follow it.  Let's change it. > > It might be easy to a

Re: [PATCH] microbit_i2c: Fix coredump when dump-vmstate

2020-10-19 Thread Peng Liang
On 10/19/2020 6:35 PM, Philippe Mathieu-Daudé wrote: > On 10/19/20 11:34 AM, Peng Liang wrote: >> VMStateDescription.fields should be end with VMSTATE_END_OF_LIST(). >> However, microbit_i2c_vmstate doesn't follow it.  Let's change it. > > It might be easy to a

[PATCH] microbit_i2c: Fix coredump when dump-vmstate

2020-10-19 Thread Peng Liang
VMStateDescription.fields should be end with VMSTATE_END_OF_LIST(). However, microbit_i2c_vmstate doesn't follow it. Let's change it. Fixes: 9d68bf564e ("arm: Stub out NRF51 TWI magnetometer/accelerometer detection") Reported-by: Euler Robot Signed-off-by: Pen

[PATCH] ACPI: Avoid infinite recursion when dump-vmstate

2020-10-19 Thread Peng Liang
There is a field with vmstate_ghes_state as vmsd in vmstate_ghes_state, which will lead to infinite recursion in dump_vmstate_vmsd. Fixes: a08a64627b ("ACPI: Record the Generic Error Status Block address") Reported-by: Euler Robot Signed-off-by: Peng Liang --- hw/acpi/generic_even

[RFC v2 06/10] target/arm: register CPU features for property

2020-09-17 Thread Peng Liang
in DDI.0487 Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/cpu.c | 188 +++ 1 file changed, 188 insertions(+) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 1dd7228875db..10a52518dd14 100644 --- a/target/arm/cpu.c

[RFC v2 08/10] target/arm: Introduce user_mask to indicate whether the feature is set explicitly

2020-09-17 Thread Peng Liang
To add CPU feature dependencies, we need to known whether a CPU feature is set explicitly or automatically by dependencies mechanism. Introduce user_mask to do that. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/cpu.h | 1 + target/arm/cpu.c | 2 ++ 2 files changed, 3

[RFC v2 05/10] target/arm: Introduce kvm_arm_cpu_feature_supported

2020-09-17 Thread Peng Liang
Introduce kvm_arm_cpu_feature_supported to check whether KVM supports to set CPU features in ARM. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/kvm_arm.h | 7 +++ target/arm/kvm64.c | 14 ++ 2 files changed, 21 insertions(+) diff --git a/target/arm

[RFC v2 04/10] target/arm: convert isar regs to array

2020-09-17 Thread Peng Liang
gisters in AArch32, it's harmless to change the ID registers in AArch32 to 64-bits. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/cpu.h | 225 +++-- target/arm/internals.h | 15 +-- hw/intc/armv7m_nvic.c | 28 ++--- t

[RFC v2 09/10] target/arm: introduce CPU feature dependency mechanism

2020-09-17 Thread Peng Liang
CPU features are in relationship a->b, which means b is dependent on a. If b is enabled by user, then a is enabled automatically. And if a is disabled by user, then b is disabled automatically. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/cpu.c

[RFC v2 10/10] target/arm: Add CPU features to query-cpu-model-expansion

2020-09-17 Thread Peng Liang
Add CPU features to the result of query-cpu-model-expansion so that other applications (such as libvirt) can know the supported CPU features. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/monitor.c | 4 1 file changed, 4 insertions(+) diff --git a/target/arm

[RFC v2 02/10] target/arm: Update ID fields

2020-09-17 Thread Peng Liang
Update definitions for ID fields, up to ARMv8.6. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/cpu.h | 17 + 1 file changed, 17 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 6036f61d60b3..d89043448923 100644 --- a/target/arm/cpu.h

[RFC v2 01/10] linux-header: Introduce KVM_CAP_ARM_CPU_FEATURE

2020-09-17 Thread Peng Liang
Introduce KVM_CAP_ARM_CPU_FEATURE. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- linux-headers/linux/kvm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index a28c3667370b..169eb0bb31c8 100644 --- a/linux-headers/linux

[RFC v2 07/10] target/arm: Allow ID registers to synchronize to KVM

2020-09-17 Thread Peng Liang
because GIC has been initialized. Hence, let's give all ID registers a chance to write to KVM. If the write is successful, then write to (index,value) list. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/kvm_arm.h | 3 +++ target/arm/helper.c

[RFC v2 03/10] target/arm: only set ID_PFR1_EL1.GIC for AArch32 guest

2020-09-17 Thread Peng Liang
Some AArch64 CPU doesn't support AArch32 mode, AArch32 registers should be 0. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 88bd9dd

[RFC v2 00/10] Support disable/enable CPU features for AArch64

2020-09-17 Thread Peng Liang
/patch/11782361/ v1 -> v2: - adjust the order of patches - only expose AArch64 features which are exposed by kernel via /proc/cpuinfo - add check for conflict CPU features set by user - split the change in linux-headers/linux/kvm.h Peng Liang (10): linux-header: Introduce KVM_CAP_ARM_CPU_FEAT

[PATCH] block/mirror: fix core when using iothreads

2020-08-26 Thread Peng Liang
| (s->job is not NULL until 3!) 3. bs_opaque->job = s;| Just moving step 2 & 3 before 1 can avoid this. Reported-by: Euler Robot Signed-off-by: Peng Liang --- block/mirror.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions

Re: [RFC 5/9] target/arm: introduce CPU feature dependency mechanism

2020-08-15 Thread Peng Liang
On 8/13/2020 8:48 PM, Andrew Jones wrote: > On Thu, Aug 13, 2020 at 06:26:53PM +0800, Peng Liang wrote: >> Some CPU features are dependent on other CPU features. For example, >> ID_AA64PFR0_EL1.FP field and ID_AA64PFR0_EL1.AdvSIMD must have the same >> value, which mea

Re: [RFC 2/9] target/arm: parse cpu feature related options

2020-08-15 Thread Peng Liang
On 8/13/2020 8:21 PM, Andrew Jones wrote: > On Thu, Aug 13, 2020 at 06:26:50PM +0800, Peng Liang wrote: >> The implementation of CPUClass::parse_features only supports CPU >> features in "feature=value" format. However, libvirt maybe send us a >> CPU feature strin

Re: [RFC 7/9] target/arm: Add CPU features to query-cpu-model-expansion

2020-08-15 Thread Peng Liang
On 8/13/2020 8:56 PM, Andrew Jones wrote: > On Thu, Aug 13, 2020 at 06:26:55PM +0800, Peng Liang wrote: >> Add CPU features to the result of query-cpu-model-expansion so that >> other applications (such as libvirt) can know the supported CPU >> features. >> >

Re: [RFC 6/9] target/arm: introduce KVM_CAP_ARM_CPU_FEATURE

2020-08-15 Thread Peng Liang
On 8/13/2020 7:00 PM, Cornelia Huck wrote: > On Thu, 13 Aug 2020 18:26:54 +0800 > Peng Liang wrote: > >> Introduce KVM_CAP_ARM_CPU_FEATURE to check whether KVM supports to set >> CPU features in ARM. >> >> Signed-off-by: zhanghailiang >> Signed-off-by: Pen

[RFC 9/9] target/arm: Add more CPU features

2020-08-13 Thread Peng Liang
Add i8mm, bf16, and dgh CPU features for AArch64. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/cpu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 0f620e8afe..9e2ddbc3ed 100644 --- a/target/arm/cpu.c +++ b/target/arm

[RFC 8/9] target/arm: Update ID fields

2020-08-13 Thread Peng Liang
Update definitions for ID fields, up to ARMv8.6. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/cpu.h | 17 + 1 file changed, 17 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index da68b7f8f4..7a46d223bc 100644 --- a/target/arm/cpu.h

[RFC 3/9] target/arm: register CPU features for property

2020-08-13 Thread Peng Liang
in DDI.0487 Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/cpu.c | 343 +++ 1 file changed, 343 insertions(+) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 79d7a6b45c..113cf4a9e7 100644 --- a/target/arm/cpu.c +++ b

[RFC 6/9] target/arm: introduce KVM_CAP_ARM_CPU_FEATURE

2020-08-13 Thread Peng Liang
Introduce KVM_CAP_ARM_CPU_FEATURE to check whether KVM supports to set CPU features in ARM. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- linux-headers/linux/kvm.h | 1 + target/arm/cpu.c | 5 + target/arm/kvm64.c| 14 ++ target/arm/kvm_arm.h

[RFC 1/9] target/arm: convert isar regs to array

2020-08-13 Thread Peng Liang
gisters in AArch32, it's harmless to change the ID registers in AArch32 to 64-bits. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- hw/intc/armv7m_nvic.c | 48 target/arm/cpu.c | 232 +++--- target/arm/cp

[RFC 7/9] target/arm: Add CPU features to query-cpu-model-expansion

2020-08-13 Thread Peng Liang
Add CPU features to the result of query-cpu-model-expansion so that other applications (such as libvirt) can know the supported CPU features. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/cpu.c | 41 + target/arm/cpu.h

[RFC 2/9] target/arm: parse cpu feature related options

2020-08-13 Thread Peng Liang
ures is upper for convenience. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/cpu64.c | 101 + 1 file changed, 101 insertions(+) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 4b52505b6e..981011b3da 100644 --- a/target/arm/cp

[RFC 4/9] target/arm: Allow ID registers to synchronize to KVM

2020-08-13 Thread Peng Liang
because GIC has been initialized. Hence, let's give all ID registers a chance to write to KVM. If the write is successful, then write to (index,value) list. Signed-off-by: zhanghailiang Signed-off-by: Peng Liang --- target/arm/helper.c | 31 --- target/arm/

[RFC 5/9] target/arm: introduce CPU feature dependency mechanism

2020-08-13 Thread Peng Liang
d c CPU features are in relationship a->b->c, which means c is dependent on b and b is dependent on a. If c is enabled by user, then a and b is enabled automatically. And if a is disabled by user, then b and c is disabled automatically. Signed-off-by: zhanghailiang Signed-off-by: P

[RFC 0/9] Support disable/enable CPU features for AArch64

2020-08-13 Thread Peng Liang
/cover/11711693/ Peng Liang (9): target/arm: convert isar regs to array target/arm: parse cpu feature related options target/arm: register CPU features for property target/arm: Allow ID registers to synchronize to KVM target/arm: introduce CPU feature dependency mechanism target/arm

[PATCH 5/5] log: Add logs during qemu start

2020-08-06 Thread Peng Liang
Add logs during qemu start. Signed-off-by: Peng Liang --- blockdev.c | 2 ++ softmmu/vl.c | 2 ++ util/oslib-posix.c | 3 +-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 3848a9c8ab..8e3ab8a9b2 100644 --- a/blockdev.c +++ b

[PATCH 2/5] log: Add log for each modules

2020-08-06 Thread Peng Liang
Add log for each modules. Signed-off-by: Peng Liang --- accel/kvm/kvm-all.c | 5 - hw/pci/pci.c| 1 + hw/usb/host-libusb.c| 5 + hw/virtio/virtio-pci.c | 2 ++ hw/virtio/virtio-scsi-pci.c | 3 +++ hw/virtio/virtio.c | 13

[PATCH 0/5] log: Add logs for some modules

2020-08-06 Thread Peng Liang
This path serial add some logs for some modeuls to make it easier to debug. Peng Liang (5): log: Add logs for vm start and destroy log: Add log for each modules log: Add more details to virtio_report in virtqueue_pop log: Add log at boot & cpu init for aarch64 log: Add logs during

[PATCH 4/5] log: Add log at boot & cpu init for aarch64

2020-08-06 Thread Peng Liang
Add log at boot & cpu init for aarch64. Signed-off-by: Peng Liang --- hw/arm/boot.c | 2 ++ hw/arm/virt.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 3e9816af80..a2d5787807 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -1292,6 +1292,8 @@

[PATCH 1/5] log: Add logs for vm start and destroy

2020-08-06 Thread Peng Liang
Add logs for vm start and destroy. Signed-off-by: Peng Liang --- hw/acpi/core.c | 3 +++ hw/core/reset.c | 2 ++ softmmu/vl.c| 8 3 files changed, 13 insertions(+) diff --git a/hw/acpi/core.c b/hw/acpi/core.c index ac06db3450..0a24f018cf 100644 --- a/hw/acpi/core.c +++ b/hw/acpi

[PATCH 3/5] log: Add more details to virtio_report in virtqueue_pop

2020-08-06 Thread Peng Liang
Add virtio device name and virtqueue info to virtio_report in virtqueue_pop so that we can find out which device's virtqueue is broken. Signed-off-by: Peng Liang --- hw/virtio/virtio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/vir