Re: qemu process consumes 100% host CPU after reverting snapshot

2024-03-31 Thread Dongli Zhang
=limit012,file=libvirt-1-filter \ -netdev user,id=user0,hostfwd=tcp::5028-:22 \ -device virtio-net-pci,netdev=user0,id=net0,mac=52:54:00:12:34:56,bus=pci.0,addr=0x3 \ -monitor stdio (qemu) info status (qemu) savevm snapshot1 (qemu) loadvm snapshot1 Dongli Zhang On 3/28/24 03:50, Chun Feng Wu wrote

Re: [RFC 0/8] virtio,vhost: Add VIRTIO_F_IN_ORDER support

2024-03-21 Thread Dongli Zhang
/byapr18mb2791df7e6c0f61e2d8698e8fa0...@byapr18mb2791.namprd18.prod.outlook.com/ Thank you very much! Dongli Zhang On 3/21/24 08:57, Jonah Palmer wrote: > The goal of these patches is to add support to a variety of virtio and > vhost devices for the VIRTIO_F_IN_ORDER transport feature. This feature > indicates

Re: [PATCH v4 1/1] oslib-posix: initialize backend memory objects in parallel

2024-02-03 Thread Dongli Zhang
_threads_created = true; > +context->all_threads_created = true; > qemu_cond_broadcast(_cond); > qemu_mutex_unlock(_mutex); > > -for (i = 0; i < context.num_threads; i++) { > -int tmp = (uintptr_t)qemu_thread_join([i].pgthread); > +ret = wait_an

[PATCH 1/1] vhost-scsi: fix usage of error_reportf_err()

2023-12-13 Thread Dongli Zhang
al_err -> error_reportf_err() -> error_vprepend() -> g_string_append(newmsg, (*errp)->msg) --> (*errp) is NULL In addition, add ": " at the end of other error_reportf_err() logs. Fixes: 7962e432b4e4 ("vhost-user-scsi: support reconnect to backend") Signed-off-by

[PATCH v3 1/1] target/i386/kvm: introduce 'pmu-cap-disabled' to set KVM_PMU_CAP_DISABLE

2023-11-13 Thread Dongli Zhang
y for x86. Cc: Joe Jin Cc: Like Xu Cc: Denis V. Lunev Signed-off-by: Dongli Zhang --- This is to resurrect the patch to disable PMU. I split the patchset and send the patch to disable PMU. Changed since v1: [PATCH 1/3] kvm: introduce a helper before creating the 1st vcpu https://lore.kernel

Re: [PATCH v3 1/1] hmp: synchronize cpu state for lapic info

2023-10-31 Thread Dongli Zhang
Hi Juan, On 10/30/23 09:31, Juan Quintela wrote: > Dongli Zhang wrote: >> While the default "info lapic" always synchronizes cpu state ... >> >> mon_get_cpu() >> -> mon_get_cpu_sync(mon, true) >>-> cpu_synchronize_state(cpu) >&

Re: [PATCH] target/i386/monitor: synchronize cpu before printing lapic state

2023-10-26 Thread Dongli Zhang
Hi David, Thank you very much for the Reviewed-by in another thread. I have re-based the patch and sent again. https://lore.kernel.org/all/20231026211938.162815-1-dongli.zh...@oracle.com/ Dongli Zhang On 10/26/23 09:39, Dongli Zhang wrote: > Hi David, > > On 10/26/23 08:39, David

[PATCH v3 1/1] hmp: synchronize cpu state for lapic info

2023-10-26 Thread Dongli Zhang
ent. The cpu state should be synchronized when apic-id is available. Otherwise the "info lapic " always returns stale data. Reference: https://lore.kernel.org/all/20211028155457.967291-19-berra...@redhat.com/ Cc: Joe Jin Signed-off-by: Dongli Zhang Reviewed-by: Daniel P. Berrangé

Re: [PATCH] target/i386/monitor: synchronize cpu before printing lapic state

2023-10-26 Thread Dongli Zhang
. and resent by Daniel as part of another patchset (after review): https://lore.kernel.org/qemu-devel/20211028155457.967291-19-berra...@redhat.com/ This utility is helpful for the diagnostic of loss of interrupt issue. Dongli Zhang > } else { > cs = mon_get_cpu(mon); > }

Re: [PATCH 1/1] dump: kdump-zlib data pages not dumped with pvtime/aarch64

2023-07-28 Thread Dongli Zhang
you very much! Dongli Zhang On 7/12/23 22:58, Dongli Zhang wrote: > The kdump-zlib data pages are not dumped from aarch64 host when the > 'pvtime' is involved, that is, when the block->target_end is not aligned to > page_size. In the below example, it is expected to dump two blocks

[PATCH 1/1] dump: kdump-zlib data pages not dumped with pvtime/aarch64

2023-07-13 Thread Dongli Zhang
m". The fix is to break when it is time to come to the next block, so that both 'pfnptr' and 'blockptr' refer to the same block. Fixes: 94d788408d2d ("dump: fix kdump to work over non-aligned blocks") Cc: Joe Jin Signed-off-by: Dongli Zhang --- dump/dump.c | 4 ++-- 1 file changed, 2

Re: [PATCH RESEND v2 2/2] target/i386/kvm: get and put AMD pmu registers

2023-07-03 Thread Dongli Zhang
Hi Like, On 7/2/23 07:15, Like Xu wrote: > On Wed, Jun 21, 2023 at 9:39 AM Dongli Zhang wrote: >> >> The QEMU side calls kvm_get_msrs() to save the pmu registers from the KVM >> side to QEMU, and calls kvm_put_msrs() to store the pmu registers back to >> the KV

Re: [PATCH RESEND v2 1/2] target/i386/kvm: introduce 'pmu-cap-disabled' to set KVM_PMU_CAP_DISABLE

2023-07-03 Thread Dongli Zhang
Hi Like, On 7/2/23 06:41, Like Xu wrote: > On Wed, Jun 21, 2023 at 9:39 AM Dongli Zhang wrote: >> >> The "perf stat" at the VM side still works even we set "-cpu host,-pmu" in >> the QEMU command line. That is, neither "-cpu host,-pmu" nor

[PATCH RESEND v2 1/2] target/i386/kvm: introduce 'pmu-cap-disabled' to set KVM_PMU_CAP_DISABLE

2023-06-20 Thread Dongli Zhang
only for x86. Cc: Joe Jin Cc: Like Xu Signed-off-by: Dongli Zhang --- Changed since v1: - In version 1 we did not introduce the new property. We ioctl KVM_PMU_CAP_DISABLE only before the creation of the 1st vcpu. We had introduced a helpfer function to do this job before creating the 1st

[PATCH RESEND v2 0/2] target/i386/kvm: fix two svm pmu virtualization bugs

2023-06-20 Thread Dongli Zhang
below patchset is merged into the KVM side. It has been queued to kvm-x86 next by Sean. [PATCH v7 00/12] KVM: x86: Add AMD Guest PerfMonV2 PMU support https://lore.kernel.org/all/168609790857.1417369.13152633386083458084.b4...@google.com/ Dongli Zhang (2): target/i386/kvm: introduce 'pmu-cap-di

[PATCH RESEND v2 2/2] target/i386/kvm: get and put AMD pmu registers

2023-06-20 Thread Dongli Zhang
wn NMIs randomly to the VM kernel. [...] Uhhuh. NMI received for unknown reason 30 on CPU 0. The patch is to fix the issue by resetting AMD pmu registers during the reset. Cc: Joe Jin Cc: Like Xu Signed-off-by: Dongli Zhang --- target/i386/cpu.h | 5 +++ target/i38

Re: [PATCH v2 0/2] target/i386/kvm: fix two svm pmu virtualization bugs

2023-06-19 Thread Dongli Zhang
Hi Like and zhenyu, Thank you very much! That will be very helpful. In order to help the review, I will rebase the patchset on top of the most recent QEMU. Thank you very much! Dongli Zhang On 6/19/23 01:52, Like Xu wrote: > I think we've been stuck here too long. Sorry Dongli. > >

Re: [PATCH] target/i386: Clear xsave pkru bit when KVM XCR0 not support

2023-05-17 Thread Dongli Zhang
/linux.git/commit/?id=ad856280ddea3401e1f5060ef20e6de9f6122c76 Since the old target server does not support pkru, I assume the VM's cpu type should not support pkru. Therefore, the pkru should never be migrated away from source server. Dongli Zhang > > Signed-off-by: YuChen > --- &g

Re: [PATCH 1/1] hw/core/cpu: always print cpu index with cpu state

2023-03-06 Thread Dongli Zhang
comparison. We may wait for very long timer until the bug filer can reproduce the error again. To print the cpu index helps a lot. Thank you very much! Dongli Zhang On 2/6/23 15:42, Dongli Zhang wrote: > The cpu_dump_state() does not print the cpu index. When the > cpu_dump_state() is invoke

Re: [PATCH 1/1] hw/core/cpu: always print cpu index with cpu state

2023-02-07 Thread Dongli Zhang
Hi Philippe, On 2/6/23 23:16, Philippe Mathieu-Daudé wrote: > On 7/2/23 00:42, Dongli Zhang wrote: >> The cpu_dump_state() does not print the cpu index. When the >> cpu_dump_state() is invoked due to the KVM failure, we are not able to tell >> from which CPU the state is. Th

[PATCH 1/1] readline: fix hmp completion issue

2023-02-06 Thread Dongli Zhang
) is zero, we remove the check with (name[0] == '\0') because strlen() always returns zero in that case. Fixes: 52f50b1e9f8f ("readline: Extract readline_add_completion_of() from monitor") Cc: Joe Jin Signed-off-by: Dongli Zhang --- monitor/hmp.c | 8 ++-- 1 file changed, 2 insert

[PATCH 1/1] hw/core/cpu: always print cpu index with cpu state

2023-02-06 Thread Dongli Zhang
= DR2= DR3= DR6=fffe0ff0 DR7=0400 EFER=0d01 Code=0f 1f ... ... Print the cpu->cpu_index in cpu_dump_state() and remove it from the caller. Cc: Joe Jin Signed-off-by: Dongli Zhang --- hw/core/cpu-common.c | 1 + moni

Re: [PATCH v2 0/2] target/i386/kvm: fix two svm pmu virtualization bugs

2023-01-08 Thread Dongli Zhang
proc/sys/kernel/unknown_nmi_panic" is enabled. Thank you very much! Dongli Zhang On 12/19/22 06:45, Dongli Zhang wrote: > Can I get feedback for this patchset, especially the [PATCH v2 2/2]? > > About the [PATCH v2 2/2], currently the issue impacts the usage of PMUs on AMD > VM, especially the

[PATCH 1/1] vhost-scsi: fix memleak of vsc->inflight

2023-01-04 Thread Dongli Zhang
Cc: Li Feng Signed-off-by: Dongli Zhang --- hw/scsi/vhost-scsi-common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/scsi/vhost-scsi-common.c b/hw/scsi/vhost-scsi-common.c index 18ea5dcfa1..a06f01af26 100644 --- a/hw/scsi/vhost-scsi-common.c +++ b/hw/scsi/vhost-scsi-common.c @@

Re: [PATCH v2 0/2] target/i386/kvm: fix two svm pmu virtualization bugs

2022-12-19 Thread Dongli Zhang
watchdog has the same effect. 3. A sudden system reset, or a kernel panic (kdump/kexec). 4. After reboot, there will be random unknown NMI. 5. Unfortunately, the "panic on nmi" may panic the VM randomly at any time. Thank you very much! Dongli Zhang On 12/1/22 16:22, Dongli Zhang wrote: >

[PATCH v2 2/2] target/i386/kvm: get and put AMD pmu registers

2022-12-01 Thread Dongli Zhang
wn NMIs randomly to the VM kernel. [...] Uhhuh. NMI received for unknown reason 30 on CPU 0. The patch is to fix the issue by resetting AMD pmu registers during the reset. Cc: Joe Jin Signed-off-by: Dongli Zhang --- target/i386/cpu.h | 5 +++ target/i38

[PATCH v2 0/2] target/i386/kvm: fix two svm pmu virtualization bugs

2022-12-01 Thread Dongli Zhang
0/8] KVM: x86: Add AMD Guest PerfMonV2 PMU support https://lore.kernel.org/all/2022102645.82001-1-lik...@tencent.com/ Dongli Zhang (2): target/i386/kvm: introduce 'pmu-cap-disabled' to set KVM_PMU_CAP_DISABLE target/i386/kvm: get and put AMD pmu registers accel/kvm/kvm-all.c |

[PATCH v2 1/2] target/i386/kvm: introduce 'pmu-cap-disabled' to set KVM_PMU_CAP_DISABLE

2022-12-01 Thread Dongli Zhang
Y only for x86. Cc: Joe Jin Signed-off-by: Dongli Zhang --- Changed since v1: - In version 1 we did not introduce the new property. We ioctl KVM_PMU_CAP_DISABLE only before the creation of the 1st vcpu. We had introduced a helpfer function to do this job before creating the 1st KVM vcp

Re: [PATCH 3/3] target/i386/kvm: get and put AMD pmu registers

2022-11-21 Thread Dongli Zhang
nately, I do not have access to machine with family < 6. It might be interesting to use QEMU to emulate a machine with family < 6. Thank you very much for suggestion! Dongli Zhang > > > On 11/19/22 07:29, Dongli Zhang wrote: >> The QEMU side calls kvm_get_msrs() to

Re: [PATCH 2/3] i386: kvm: disable KVM_CAP_PMU_CAPABILITY if "pmu" is disabled

2022-11-21 Thread Dongli Zhang
Hi Greg and Liang, On 11/21/22 6:23 AM, Liang Yan wrote: > > On 11/21/22 06:03, Greg Kurz wrote: >> On Sat, 19 Nov 2022 04:29:00 -0800 >> Dongli Zhang wrote: >> >>> The "perf stat" at the VM side still works even we set "-cpu host,-pmu" in &

Re: [PATCH 0/3] kvm: fix two svm pmu virtualization bugs

2022-11-20 Thread Dongli Zhang
Hi Like, On 11/20/22 22:42, Like Xu wrote: > On 19/11/2022 8:28 pm, Dongli Zhang wrote: >> This patchset is to fix two svm pmu virtualization bugs. >> >> 1. The 1st bug is that "-cpu,-pmu" cannot disable svm pmu virtualization. >> >> To use "-cpu

[PATCH 1/3] kvm: introduce a helper before creating the 1st vcpu

2022-11-19 Thread Dongli Zhang
s set for the vcpu. Cc: Joe Jin Signed-off-by: Dongli Zhang --- accel/kvm/kvm-all.c| 7 +-- include/sysemu/kvm.h | 2 ++ target/arm/kvm64.c | 4 target/i386/kvm/kvm.c | 4 target/mips/kvm.c | 4 target/ppc/kvm.c | 4 target/riscv/kvm.c | 4

[PATCH 0/3] kvm: fix two svm pmu virtualization bugs

2022-11-19 Thread Dongli Zhang
gisters as well as Intel registers. This patchset does cover does not cover PerfMonV2, until the below patchset is merged into the KVM side. [PATCH v3 0/8] KVM: x86: Add AMD Guest PerfMonV2 PMU support https://lore.kernel.org/all/2022102645.82001-1-lik...@tencent.com/ Dongli Zhang (3):

[PATCH 2/3] i386: kvm: disable KVM_CAP_PMU_CAPABILITY if "pmu" is disabled

2022-11-19 Thread Dongli Zhang
s because the AMD pmu (v1) does not rely on cpuid to decide if the pmu virtualization is supported. We disable KVM_CAP_PMU_CAPABILITY if the 'pmu' is disabled in the vcpu properties. Cc: Joe Jin Signed-off-by: Dongli Zhang --- target/i386/kvm/kvm.c | 17 + 1 file changed, 17 insertion

[PATCH 3/3] target/i386/kvm: get and put AMD pmu registers

2022-11-19 Thread Dongli Zhang
wn NMIs randomly to the VM kernel. [...] Uhhuh. NMI received for unknown reason 30 on CPU 0. The patch is to fix the issue by resetting AMD pmu registers during the reset. Cc: Joe Jin Signed-off-by: Dongli Zhang --- target/i386/cpu.h | 5 +++ target/i38

Re: [PATCH v3 1/1] monitor/hmp: print trace as option in help for log command

2022-09-19 Thread Dongli Zhang
Hi Markus, On 9/17/22 2:44 PM, Philippe Mathieu-Daudé via wrote: > Hi Markus, > > On 2/9/22 14:24, Markus Armbruster wrote: >> Dongli Zhang writes: >> >>> The below is printed when printing help information in qemu-system-x86_64 >>> command lin

Re: [PATCH v2 1/1] monitor/hmp: print trace as option in help for log command

2022-09-02 Thread Dongli Zhang
Hi Markus, On 8/31/22 11:47 PM, Markus Armbruster wrote: > Dongli Zhang writes: > >> Hi Markus, >> >> On 8/30/22 4:04 AM, Markus Armbruster wrote: >>> Dongli Zhang writes: >>> >>>> The below is printed when printing help informa

Re: [PATCH 2/2] util/log: add timestamp to logs via qemu_log()

2022-08-31 Thread Dongli Zhang
Hi Markus and Richard, Thank you very much for the feedback. I agree this is not a good solution. I will look for alternatives to add timestamp. Thank you very much! Dongli Zhang On 8/30/22 8:31 AM, Richard Henderson wrote: > On 8/30/22 04:09, Markus Armbruster wrote: >> Dongli Zhan

[PATCH v3 1/1] monitor/hmp: print trace as option in help for log command

2022-08-31 Thread Dongli Zhang
ace events. However, the options of "trace:PATTERN" are only printed by "qemu-system-x86_64 -d help", but missing in hmp "help log" command. Fixes: c84ea00dc2 ("log: add "-d trace:PATTERN"") Cc: Joe Jin Signed-off-by: Dongli Zhang --- C

Re: [PATCH v2 1/1] monitor/hmp: print trace as option in help for log command

2022-08-31 Thread Dongli Zhang
Hi Markus, On 8/30/22 4:04 AM, Markus Armbruster wrote: > Dongli Zhang writes: > >> The below is printed when printing help information in qemu-system-x86_64 >> command line, and when CONFIG_TRACE_LOG is enabled: >> >> $ qemu-system-x86_64 -d help >> ...

Re: [PATCH 1/1] monitor/hmp: print trace as option in help for log command

2022-08-29 Thread Dongli Zhang
Sorry that the format for "none" should be changed as well. I have sent a v2: https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg04445.html Thank you very much! Dongli Zhang On 8/29/22 3:04 AM, Dongli Zhang wrote: > The below is printed when printing help information i

[PATCH v2 1/1] monitor/hmp: print trace as option in help for log command

2022-08-29 Thread Dongli Zhang
hmp "help log" command. Cc: Joe Jin Signed-off-by: Dongli Zhang --- Changed since v1: - change format for "none" as well. monitor/hmp.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/monitor/hmp.c b/monitor/hmp.c index 15ca047..467fc84 100644 ---

[PATCH 1/2] error-report: make real_time_iso8601() non-static

2022-08-29 Thread Dongli Zhang
To make real_time_iso8601() a non-static function so that it can be used by other files later. No functional change. Cc: Joe Jin Signed-off-by: Dongli Zhang --- include/qemu/error-report.h | 2 ++ util/error-report.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff

[PATCH 2/2] util/log: add timestamp to logs via qemu_log()

2022-08-29 Thread Dongli Zhang
locations to diagnose QEMU issue. Cc: Joe Jin Signed-off-by: Dongli Zhang --- Please let me know if we should use 'error_with_guestname' as well. util/log.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/util/log.c b/util/log.c index d6eb037..f0a081a 100644 --- a/util/log.c +++ b/

[PATCH 1/1] monitor/hmp: print trace as option in help for log command

2022-08-29 Thread Dongli Zhang
hmp "help log" command. Cc: Joe Jin Signed-off-by: Dongli Zhang --- monitor/hmp.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/monitor/hmp.c b/monitor/hmp.c index 15ca047..9f48b70 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -287,8 +287,13 @@ void h

Re: [PATCH 0/2] scsi: to fix issue on passing host_status to the guest kernel

2022-01-10 Thread Dongli Zhang
ping? Thank you very much! Dongli Zhang On 12/10/21 6:16 AM, Dongli Zhang wrote: > This patchset fixes the issue on passing 'host_status' to the guest kernel. > > The 1st patch fixes the erroneous usage of req->host_status. > > The 2nd patch is to pass the SCSI_HOST_ERROR t

[PATCH 2/2] scsi/utils: pass host_status = SCSI_HOST_ERROR to guest kernel

2021-12-10 Thread Dongli Zhang
_code_IO_ERROR to the guest kernel for host_status = SCSI_HOST_ERROR. (This issue is detected by running a testing code from Rui Loura). Cc: Joe Jin Cc: Adnan Misherfi Cc: Rui Loura Signed-off-by: Dongli Zhang --- scsi/utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scsi/utils

[PATCH 1/2] scsi/scsi_bus: use host_status as parameter for scsi_sense_from_host_status()

2021-12-10 Thread Dongli Zhang
CSI drivers") Cc: Joe Jin Signed-off-by: Dongli Zhang --- hw/scsi/scsi-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 77325d8cc7..d46650bd8c 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -1465,7

[PATCH 0/2] scsi: to fix issue on passing host_status to the guest kernel

2021-12-10 Thread Dongli Zhang
because I am not sure if to not pass SCSI_HOST_ERROR was on purpose, especially for security reason. Thank you very much! Dongli Zhang

Re: [PATCH v2 38/53] qapi: introduce x-query-lapic QMP command

2021-09-20 Thread Dongli Zhang
intf(" PPR 0x%02x\n", apic_get_ppr(s)); > -} > -#else > -void x86_cpu_dump_local_apic_state(CPUState *cs, int flags) > -{ > +g_string_append_printf(buf, " PPR 0x%02x\n", apic_get_ppr(s)); > + > +return g_steal_pointer(); > } > #endif /

[PATCH RESEND v2 1/1] hmp: synchronize cpu state for lapic info

2021-09-08 Thread Dongli Zhang
ent. The cpu state should be synchronized when apic-id is available. Otherwise the "info lapic " always returns stale data. Cc: Joe Jin Signed-off-by: Dongli Zhang --- Changed since v1: - I sent out wrong patch version in v1 target/i386/monitor.c | 5 + 1 file changed, 5 insertions

Re: [PATCH v2 1/1] hmp: synchronize cpu state for lapic info

2021-07-22 Thread Dongli Zhang
May I get feedback for this bugfix? So far the "info lapic " returns stale data and could not accurate reflect the status in KVM. Thank you very much! Dongli Zhang On 7/1/21 2:40 PM, Dongli Zhang wrote: > While the default "info lapic" always synchronizes cpu sta

[PATCH v4 3/3] virtio-pci/hmp: implement device specific hmp interface

2021-07-14 Thread Dongli Zhang
2: 3 queue 3: 4 queue 4: 5 queue 5: 6 Cc: Jason Wang Cc: Joe Jin Suggested-by: Jason Wang Signed-off-by: Dongli Zhang Acked-by: Jason Wang --- hw/virtio/virtio-pci.c | 22 ++ hw/virtio/virtio.c | 10 ++ include/hw/virtio/virtio.h | 2 ++ 3 files

[PATCH v4 2/3] msix/hmp: add interface to dump device specific info

2021-07-14 Thread Dongli Zhang
this PCIDeviceClass->msix_info interface. Cc: Jason Wang Cc: Joe Jin Suggested-by: Jason Wang Signed-off-by: Dongli Zhang Acked-by: Jason Wang --- hmp-commands-info.hx | 7 --- include/hw/pci/pci.h | 3 +++ softmmu/qdev-monitor.c | 11 +++ 3 files changed, 18 insertions(+)

[PATCH v4 1/3] msix/hmp: add hmp interface to dump MSI-X info

2021-07-14 Thread Dongli Zhang
0x40d1 0x MSI-X PBA 0 0 0 0 0 0 0 Since this is just for debugging by humans, provide the command only in HMP, not in QMP. Cc: Jason Wang Cc: Joe Jin Signed-off-by: Dongli Zhang Acked-by: Dr. David Alan Gilbert Acked-by: Jason Wang --- Changed since v1/v2: - Add msix_present

[PATCH v4 0/3] To add HMP interface to dump PCI MSI-X table/PBA

2021-07-14 Thread Dongli Zhang
+++ include/hw/pci/msix.h | 2 ++ include/hw/pci/pci.h | 3 ++ include/hw/virtio/virtio.h | 2 ++ include/monitor/hmp.h | 1 + softmmu/qdev-monitor.c | 36 +++ 10 files changed, 158 insertions(+) Thank you very much! Dongli Zhang

Re: [PATCH v3 1/3] msix/hmp: add hmp interface to dump MSI-X info

2021-07-14 Thread Dongli Zhang
Hi Markus, On 7/14/21 2:42 AM, Markus Armbruster wrote: > Dongli Zhang writes: > >> Hi Markus, >> >> On 7/13/21 10:46 PM, Markus Armbruster wrote: >>> Dongli Zhang writes: >>> >>>> This patch is to add the HMP interface to dump MSI-X

Re: [PATCH v3 1/3] msix/hmp: add hmp interface to dump MSI-X info

2021-07-14 Thread Dongli Zhang
Hi Markus, On 7/13/21 10:46 PM, Markus Armbruster wrote: > Dongli Zhang writes: > >> This patch is to add the HMP interface to dump MSI-X table and PBA, in >> order to help diagnose the loss of IRQ issue in VM (e.g., if an MSI-X >> vector is erroneously masked permanent

[PATCH v3 2/3] msix/hmp: add interface to dump device specific info

2021-07-13 Thread Dongli Zhang
this PCIDeviceClass->msix_info interface. Cc: Jason Wang Cc: Joe Jin Suggested-by: Jason Wang Signed-off-by: Dongli Zhang Acked-by: Jason Wang --- hmp-commands-info.hx | 7 --- include/hw/pci/pci.h | 3 +++ softmmu/qdev-monitor.c | 11 +++ 3 files changed, 18 insertions(+)

[PATCH v3 1/3] msix/hmp: add hmp interface to dump MSI-X info

2021-07-13 Thread Dongli Zhang
Wang Cc: Joe Jin Signed-off-by: Dongli Zhang Acked-by: Dr. David Alan Gilbert Acked-by: Jason Wang --- Changed since v1/v2: - Add msix_present() to pci-stub.c to avoid build error hmp-commands-info.hx | 13 + hw/pci/msix.c | 63

[PATCH v3 3/3] virtio-pci/hmp: implement device specific hmp interface

2021-07-13 Thread Dongli Zhang
2: 3 queue 3: 4 queue 4: 5 queue 5: 6 Cc: Jason Wang Cc: Joe Jin Suggested-by: Jason Wang Signed-off-by: Dongli Zhang Acked-by: Jason Wang --- hw/virtio/virtio-pci.c | 22 ++ hw/virtio/virtio.c | 10 ++ include/hw/virtio/virtio.h | 2 ++ 3 files

[PATCH v3 0/3] To add HMP interface to dump PCI MSI-X table/PBA

2021-07-13 Thread Dongli Zhang
| 2 ++ include/monitor/hmp.h | 1 + softmmu/qdev-monitor.c | 36 +++ 10 files changed, 158 insertions(+) Thank you very much! Dongli Zhang

Re: [PATCH RESEND v2 0/3] To add HMP interface to dump PCI MSI-X table/PBA

2021-07-13 Thread Dongli Zhang
On 7/13/21 1:59 PM, Michael S. Tsirkin wrote: > On Mon, Jul 12, 2021 at 04:58:09PM -0700, Dongli Zhang wrote: >> I have just rebased the v2 patchset on top of most recent qemu to resend. >> >> This patch is to introduce the new HMP command to dump the MSI-X table/PBA. >

[PATCH RESEND 1/1] multi-process: fix usage information

2021-07-12 Thread Dongli Zhang
>From source code, the 'devid' of x-remote-object should be one of devices in remote QEMU process. Signed-off-by: Dongli Zhang Reviewed-by: Jagannathan Raman --- Resend to be applied as trivial patch. I have verified by reading the code and playing with below orchestrator. https://github.

[PATCH RESEND v2 3/3] virtio-pci/hmp: implement device specific hmp interface

2021-07-12 Thread Dongli Zhang
2: 3 queue 3: 4 queue 4: 5 queue 5: 6 Cc: Jason Wang Cc: Joe Jin Suggested-by: Jason Wang Signed-off-by: Dongli Zhang --- hw/virtio/virtio-pci.c | 22 ++ hw/virtio/virtio.c | 10 ++ include/hw/virtio/virtio.h | 2 ++ 3 files changed, 34 insertions

[PATCH RESEND v2 1/3] msix/hmp: add hmp interface to dump MSI-X info

2021-07-12 Thread Dongli Zhang
Wang Cc: Joe Jin Signed-off-by: Dongli Zhang Acked-by: Dr. David Alan Gilbert --- hmp-commands-info.hx | 13 + hw/pci/msix.c | 63 ++ include/hw/pci/msix.h | 2 ++ include/monitor/hmp.h | 1 + softmmu/qdev-monitor.c | 25

[PATCH RESEND v2 0/3] To add HMP interface to dump PCI MSI-X table/PBA

2021-07-12 Thread Dongli Zhang
changed, 153 insertions(+) Thank you very much! Dongli Zhang

[PATCH RESEND v2 2/3] msix/hmp: add interface to dump device specific info

2021-07-12 Thread Dongli Zhang
this PCIDeviceClass->msix_info interface. Cc: Jason Wang Cc: Joe Jin Suggested-by: Jason Wang Signed-off-by: Dongli Zhang --- hmp-commands-info.hx | 7 --- include/hw/pci/pci.h | 3 +++ softmmu/qdev-monitor.c | 11 +++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --

[PATCH v2 1/1] hmp: synchronize cpu state for lapic info

2021-07-01 Thread Dongli Zhang
ent. The cpu state should be synchronized when apic-id is available. Otherwise the "info lapic " always returns stale data. Signed-off-by: Dongli Zhang --- Changed since v1: - I sent out wrong patch version in v1 target/i386/monitor.c | 5 + 1 file changed, 5 insertions(+) diff --

Re: [PATCH 1/1] hmp: synchronize cpu state for lapic info

2021-07-01 Thread Dongli Zhang
Please ignore this patch. I sent out the wrong version without memory check. I will re-send again. Thank you very much! Dongli Zhang On 7/1/21 2:26 PM, Dongli Zhang wrote: > While the default "info lapic" always synchronizes cpu state ... > > mon_get_cpu() > -> m

[PATCH 1/1] hmp: synchronize cpu state for lapic info

2021-07-01 Thread Dongli Zhang
ent. The cpu state should be synchronized when apic-id is available. Otherwise the "info lapic " always returns stale data. Cc: Joe Jin Signed-off-by: Dongli Zhang --- target/i386/monitor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/i386/monitor.c b/target/i386/monitor.c

[PATCH v2 0/3] To add HMP interface to dump PCI MSI-X table/PBA

2021-05-18 Thread Dongli Zhang
| 10 +++ include/hw/pci/msix.h | 2 ++ include/hw/pci/pci.h | 3 ++ include/hw/virtio/virtio.h | 2 ++ include/monitor/hmp.h | 1 + softmmu/qdev-monitor.c | 36 +++ 9 files changed, 153 insertions(+) Thank you very much! Dongli Zhang

[PATCH v2 1/3] msix/hmp: add hmp interface to dump MSI-X info

2021-05-18 Thread Dongli Zhang
Wang Cc: Joe Jin Signed-off-by: Dongli Zhang Acked-by: Dr. David Alan Gilbert --- Changed since v1: - Add heading to MSI-X table (suggested by David Alan Gilbert) - Not sure if it is fine to use Acked-by from David and there is very few change hmp-commands-info.hx | 13 + hw

[PATCH v2 3/3] virtio-pci/hmp: implement device specific hmp interface

2021-05-18 Thread Dongli Zhang
2: 3 queue 3: 4 queue 4: 5 queue 5: 6 Cc: Jason Wang Cc: Joe Jin Suggested-by: Jason Wang Signed-off-by: Dongli Zhang --- hw/virtio/virtio-pci.c | 22 ++ hw/virtio/virtio.c | 10 ++ include/hw/virtio/virtio.h | 2 ++ 3 files changed, 34 insertions

[PATCH v2 2/3] msix/hmp: add interface to dump device specific info

2021-05-18 Thread Dongli Zhang
this PCIDeviceClass->msix_info interface. Cc: Jason Wang Cc: Joe Jin Suggested-by: Jason Wang Signed-off-by: Dongli Zhang --- hmp-commands-info.hx | 7 --- include/hw/pci/pci.h | 3 +++ softmmu/qdev-monitor.c | 11 +++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --

[PATCH 1/1] multi-process: fix usage information

2021-05-08 Thread Dongli Zhang
>From source code, the 'devid' of x-remote-object should be one of devices in remote QEMU process. Signed-off-by: Dongli Zhang --- I have verified by reading the code and playing with below orchestrator. https://github.com/finallyjustice/sample/blob/master/kvm/multiprocess/orchestrator.py d

Re: [PATCH RFC 0/1] To add HMP interface to dump PCI MSI-X table/PBA

2021-04-28 Thread Dongli Zhang
On 4/28/21 1:45 AM, Dr. David Alan Gilbert wrote: > * Dongli Zhang (dongli.zh...@oracle.com) wrote: >> Hi Jason, >> >> On 4/27/21 7:31 PM, Jason Wang wrote: >>> >>> 在 2021/4/27 下午4:53, Dr. David Alan Gilbert 写道: >>>> * Dongli Zhang (dongli.zh

Re: [PATCH RFC 0/1] To add HMP interface to dump PCI MSI-X table/PBA

2021-04-28 Thread Dongli Zhang
On 4/27/21 10:55 PM, Jason Wang wrote: > > 在 2021/4/28 下午1:10, Dongli Zhang 写道: >> Hi Jason, >> >> On 4/27/21 7:31 PM, Jason Wang wrote: >>> 在 2021/4/27 下午4:53, Dr. David Alan Gilbert 写道: >>>> * Dongli Zhang (dongli.zh...@oracle.com) wrote: >>

Re: [PATCH RFC 0/1] To add HMP interface to dump PCI MSI-X table/PBA

2021-04-27 Thread Dongli Zhang
Hi Jason, On 4/27/21 7:31 PM, Jason Wang wrote: > > 在 2021/4/27 下午4:53, Dr. David Alan Gilbert 写道: >> * Dongli Zhang (dongli.zh...@oracle.com) wrote: >>> >>> On 4/22/21 11:01 PM, Jason Wang wrote: >>>> 在 2021/4/23 下午12:47, Dongli Zhang 写道: >>&

Re: [PATCH RFC 1/1] msix: add hmp interface to dump MSI-X info

2021-04-25 Thread Dongli Zhang
On 4/24/21 8:36 PM, Jason Wang wrote: > > 在 2021/4/24 上午1:32, Dongli Zhang 写道: >> >> On 4/23/21 12:59 AM, Jason Wang wrote: >>> 在 2021/4/23 下午12:47, Dongli Zhang 写道: >>>> This patch is to add the HMP interface to dump MSI-X table and PBA, in >>&g

Re: [PATCH RFC 1/1] msix: add hmp interface to dump MSI-X info

2021-04-23 Thread Dongli Zhang
On 4/23/21 12:59 AM, Jason Wang wrote: > > 在 2021/4/23 下午12:47, Dongli Zhang 写道: >> This patch is to add the HMP interface to dump MSI-X table and PBA, in >> order to help diagnose the loss of IRQ issue in VM (e.g., if an MSI-X >> vector is erroneously masked permanent

Re: [PATCH RFC 0/1] To add HMP interface to dump PCI MSI-X table/PBA

2021-04-23 Thread Dongli Zhang
On 4/22/21 11:01 PM, Jason Wang wrote: > > 在 2021/4/23 下午12:47, Dongli Zhang 写道: >> This is inspired by the discussion with Jason on below patchset. >> >> https://urldefense.com/v3/__https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg090

[PATCH RFC 1/1] msix: add hmp interface to dump MSI-X info

2021-04-22 Thread Dongli Zhang
-by: Dongli Zhang --- hmp-commands-info.hx | 13 +++ hw/pci/msix.c | 49 ++ include/hw/pci/msix.h | 2 ++ include/monitor/hmp.h | 1 + softmmu/qdev-monitor.c | 25 + 5 files changed, 90 insertions(+) diff --git a/hmp

[PATCH RFC 0/1] To add HMP interface to dump PCI MSI-X table/PBA

2021-04-22 Thread Dongli Zhang
. Is there any issue with output format? 3. Is it fine to add only for HMP, but not QMP? Thank you very much! Dongli Zhang

Re: [PATCH 0/6] Add debug interface to kick/call on purpose

2021-04-07 Thread Dongli Zhang
On 4/6/21 7:20 PM, Jason Wang wrote: > > 在 2021/4/7 上午7:27, Dongli Zhang 写道: >>> This will answer your question that "Can it bypass the masking?". >>> >>> For vhost-scsi, virtio-blk, virtio-scsi and virtio-net, to write to eventfd >>&g

Re: [PATCH 1/6] qdev: introduce qapi/hmp command for kick/call event

2021-04-07 Thread Dongli Zhang
On 4/7/21 6:40 AM, Eduardo Habkost wrote: > On Thu, Mar 25, 2021 at 10:44:28PM -0700, Dongli Zhang wrote: >> The virtio device/driver (e.g., vhost-scsi or vhost-net) may hang due to >> the loss of doorbell kick, e.g., >> >> https://urldefense.com/v3/__https://list

Re: [PATCH 0/6] Add debug interface to kick/call on purpose

2021-04-06 Thread Dongli Zhang
On 4/6/21 1:43 AM, Dongli Zhang wrote: > > > On 4/5/21 6:55 PM, Jason Wang wrote: >> >> 在 2021/4/6 上午4:00, Dongli Zhang 写道: >>> >>> On 4/1/21 8:47 PM, Jason Wang wrote: >>>> 在 2021/3/30 下午3:29, Dongli Zhang 写道: >>>>> On 3/

Re: [PATCH 0/6] Add debug interface to kick/call on purpose

2021-04-06 Thread Dongli Zhang
On 4/5/21 6:55 PM, Jason Wang wrote: > > 在 2021/4/6 上午4:00, Dongli Zhang 写道: >> >> On 4/1/21 8:47 PM, Jason Wang wrote: >>> 在 2021/3/30 下午3:29, Dongli Zhang 写道: >>>> On 3/28/21 8:56 PM, Jason Wang wrote: >>>>> 在 2021/3/27 上午5:16, Dongli Zha

Re: [PATCH 0/6] Add debug interface to kick/call on purpose

2021-04-05 Thread Dongli Zhang
On 4/1/21 8:47 PM, Jason Wang wrote: > > 在 2021/3/30 下午3:29, Dongli Zhang 写道: >> >> On 3/28/21 8:56 PM, Jason Wang wrote: >>> 在 2021/3/27 上午5:16, Dongli Zhang 写道: >>>> Hi Jason, >>>> >>>> On 3/26/21 12:24 AM, Jason Wang wrote: >

Re: [PATCH 0/6] Add debug interface to kick/call on purpose

2021-03-30 Thread Dongli Zhang
On 3/28/21 8:56 PM, Jason Wang wrote: > > 在 2021/3/27 上午5:16, Dongli Zhang 写道: >> Hi Jason, >> >> On 3/26/21 12:24 AM, Jason Wang wrote: >>> 在 2021/3/26 下午1:44, Dongli Zhang 写道: >>>> The virtio device/driver (e.g., vhost-scsi or vhost-net) may ha

Re: [PATCH 0/6] Add debug interface to kick/call on purpose

2021-03-26 Thread Dongli Zhang
Hi Jason, On 3/26/21 12:24 AM, Jason Wang wrote: > > 在 2021/3/26 下午1:44, Dongli Zhang 写道: >> The virtio device/driver (e.g., vhost-scsi or vhost-net) may hang due to >> the loss of doorbell kick, e.g., >> >> https://urldefense.com/v3/__https://lists.gnu.org/a

[PATCH 1/6] qdev: introduce qapi/hmp command for kick/call event

2021-03-25 Thread Dongli Zhang
(e.g., via eventfd, MSI-X or legacy IRQ). The 'call' is to inject irq on purpose by admin for a specific device (e.g., vhost-scsi) from QEMU/host to VM, while the 'kick' is to kick the doorbell on purpose by admin at QEMU/host side for a specific device. Signed-off-by: Dongli Zhang --- hmp-c

[PATCH 5/6] vhost-scsi-pci: implement device event interface for kick/call

2021-03-25 Thread Dongli Zhang
This is to implement the device event interface for vhost-scsi-pci. Signed-off-by: Dongli Zhang --- hw/scsi/vhost-scsi.c | 6 ++ hw/virtio/vhost-scsi-pci.c | 10 ++ include/hw/virtio/vhost-scsi.h | 3 +++ 3 files changed, 19 insertions(+) diff --git a/hw/scsi/vhost

[PATCH 3/6] virtio-blk-pci: implement device event interface for kick/call

2021-03-25 Thread Dongli Zhang
This is to implement the device event interface for virtio-blk-pci. Signed-off-by: Dongli Zhang --- hw/block/virtio-blk.c | 9 + hw/virtio/virtio-blk-pci.c | 10 ++ include/hw/virtio/virtio-blk.h | 2 ++ 3 files changed, 21 insertions(+) diff --git a/hw/block

[PATCH 4/6] virtio-scsi-pci: implement device event interface for kick/call

2021-03-25 Thread Dongli Zhang
This is to implement the device event interface for virtio-scsi-pci. Signed-off-by: Dongli Zhang --- hw/scsi/virtio-scsi.c | 9 + hw/virtio/virtio-scsi-pci.c | 10 ++ include/hw/virtio/virtio-scsi.h | 3 +++ 3 files changed, 22 insertions(+) diff --git a/hw/scsi

[PATCH 6/6] virtio-net-pci: implement device event interface for kick/call

2021-03-25 Thread Dongli Zhang
This is to implement the device event interface for virtio-net-pci. Signed-off-by: Dongli Zhang --- hw/net/virtio-net.c| 9 + hw/virtio/virtio-net-pci.c | 10 ++ include/hw/virtio/virtio-net.h | 3 +++ 3 files changed, 22 insertions(+) diff --git a/hw/net

[PATCH 2/6] virtio: introduce helper function for kick/call device event

2021-03-25 Thread Dongli Zhang
This is to introduce the helper function for virtio device to kick or call. Signed-off-by: Dongli Zhang --- hw/virtio/virtio.c | 64 ++ include/hw/virtio/virtio.h | 3 ++ 2 files changed, 67 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio

[PATCH 0/6] Add debug interface to kick/call on purpose

2021-03-25 Thread Dongli Zhang
devel/2021-01/msg03441.html Changed since RFC: - add support for more virtio/vhost pci devices - add log (toggled by DEBUG_VIRTIO_EVENT) to virtio.c to say that this mischeivous command had been used - fix grammer error (s/lost/loss/) - change version to 6.1 - fix incorrect example in

Re: [PATCH RFC 0/2] Add debug interface to kick/call on purpose

2021-01-19 Thread Dongli Zhang
On 1/18/21 8:59 AM, Dr. David Alan Gilbert wrote: > * Daniel P. Berrangé (berra...@redhat.com) wrote: >> On Thu, Jan 14, 2021 at 04:27:28PM -0800, Dongli Zhang wrote: >>> The virtio device/driver (e.g., vhost-scsi and indeed any device including >>> e1000e) may

[PATCH RFC 2/2] vhost-scsi: implement DeviceEvent

2021-01-14 Thread Dongli Zhang
ents": { "dev": "/machine/peripheral/vscsi0", "event": "kick", "queue": 1 } } Signed-off-by: Dongli Zhang --- hw/virtio/vhost-scsi-pci.c | 10 ++ hw/virtio/virtio.c | 19 +++ include

  1   2   >