Re: [Qemu-devel] Help me with QEMU

2016-05-26 Thread Dongli Zhang
> How can I add a kind of new device support in Qemu and What is the steps to do so? https://github.com/rafilia/qemu_example_virtual_pcidev -- Dongli Zhang (张东立) finallyjustice.github.io

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

2022-11-19 Thread Dongli Zhang
ecause 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

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

2022-11-19 Thread Dongli Zhang
able to inject unknown 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

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

2022-11-19 Thread Dongli Zhang
AMD pmu registers 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 Zha

[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

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

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

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

2022-12-01 Thread Dongli Zhang
PABILITY 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

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

2022-12-01 Thread Dongli Zhang
[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 (2): target/i386/kvm: introduce 'pmu-cap-disabled' to set KVM_PMU_CAP_DISABLE target/i386/kvm: get and put AMD pmu registers accel/k

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

2022-12-01 Thread Dongli Zhang
able to inject unknown 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

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

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

2024-02-03 Thread Dongli Zhang
_INSERT_HEAD(&memset_contexts, context, next); > +return 0; > } > > if (!use_madv_populate_write) { > -sigbus_memset_context = &context; > +sigbus_memset_context = context; > } > > qemu_mutex_lock(&page_m

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: 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: [Qemu-devel] ssh session with qemu-arm using busybox

2019-03-12 Thread Dongli Zhang
in-built), which I can use directly to boot ? > > what else I am missing to make ssh/scp working on qemu ? > When I was working on arm binary rewriting/instrumentation in the university, I use the image created by Linaro. http://releases.linaro.org/ One example would be https://www.linaro.org/blog/linaro-16-04-release-available-for-download-2/ or https://releases.linaro.org/archive/ubuntu/images/developer-arm64/15.12/linaro-vivid-developer-20151215-114.tar.gz The license should be good for academia. I do not know if there is any restrictions on commercial/industry usage. Thank for Linaro again for providing those images which helped me a lot when I was in the university! Dongli Zhang

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

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_HO

[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

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

2022-08-29 Thread Dongli Zhang
cations 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/lo

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

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

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

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

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

[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

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

2023-02-06 Thread Dongli Zhang
any completion when strlen(pfx) 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.

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

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 1/1] vhost-scsi: fix memleak of vsc->inflight

2023-01-04 Thread Dongli Zhang
c: Joe Jin 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-co

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

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

2022-09-18 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

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

2021-12-10 Thread Dongli Zhang
27;Fixes:' 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

[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 2/2] scsi/utils: pass host_status = SCSI_HOST_ERROR to guest kernel

2021-12-10 Thread Dongli Zhang
e_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/1] dump: kdump-zlib data pages not dumped with pvtime/aarch64

2023-07-12 Thread Dongli Zhang
it is out of the range of the current "mach-virt.ram". 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: Jo

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

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

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

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

2023-06-20 Thread Dongli Zhang
able to inject unknown 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

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

2023-06-20 Thread Dongli Zhang
until the 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 &

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

2023-06-20 Thread Dongli Zhang
CAPABILITY 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 creati

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

[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
BILITY only 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://l

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); > }

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

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

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

2021-05-07 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/orchestra

Re: [Qemu-devel] Qemu Trace

2018-02-01 Thread Dongli Zhang
nt > Department of Computer Engineering and Applied Mathematics > National Engineering School of Sfax (ENIS) > University of Sfax-Tunisia > Tel: +216 52 620 475 > Dongli Zhang

Re: [Qemu-devel] [PULL 05/33] virtio-blk: fix comment for virtio_blk_rw_complete

2018-11-05 Thread Dongli Zhang
ernal iovec. It was allocated in submit_merged_requests > - * to be able to merge requests. */ > + * external iovec. It was allocated in submit_requests to be > + * able to merge requests. */ > qemu_iovec_destroy(&req->qiov); > } > > Dongli Zhang

[Qemu-devel] [PATCH 1/1] virtio-blk: fix comment for virtio_blk_rw_complete as nalloc is initially -1

2018-11-05 Thread Dongli Zhang
The initial value of nalloc is -1, but not 1. Signed-off-by: Dongli Zhang --- This is based on git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream hw/block/virtio-blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio

Re: [Qemu-devel] How to emulate block I/O timeout on qemu side?

2018-11-05 Thread Dongli Zhang
On 11/06/2018 01:49 AM, Eric Blake wrote: > On 11/2/18 3:11 AM, Dongli Zhang wrote: >> Hi, >> >> Is there any way to emulate I/O timeout on qemu side (not fault injection in >> VM >> kernel) without modifying qemu source code? > > You may be interested

[Qemu-devel] [PATCH 1/1] virtio-blk: rename iov to out_iov in virtio_blk_handle_request()

2018-11-06 Thread Dongli Zhang
In virtio_blk_handle_request(), in_iov is used for input header while iov is used for output header. Rename iov to out_iov to pair output header's name with in_iov to avoid confusing people when reading source code. Signed-off-by: Dongli Zhang --- hw/block/virtio-blk.c | 8 1

Re: [Qemu-devel] [PATCH 1/1 V2] Add vhost-pci-blk driver

2018-11-08 Thread Dongli Zhang
It looks the kernel space vhost-blk can only process raw image. How about to verify that only raw image is used in the drive command line when vhost-blk-pci is paired with it? Otherwise, vhost-blk-pci might be working with qcow2 image without any warning on qemu side. Dongli Zhang On 11/06

Re: [Qemu-devel] [PATCH 1/1 V2] Add vhost-pci-blk driver

2018-11-08 Thread Dongli Zhang
On 11/09/2018 12:47 AM, Michael S. Tsirkin wrote: > On Thu, Nov 08, 2018 at 10:09:00PM +0800, Dongli Zhang wrote: >> It looks the kernel space vhost-blk can only process raw image. >> >> How about to verify that only raw image is used in the drive command line >&g

Re: [Qemu-devel] How to emulate block I/O timeout on qemu side?

2018-11-11 Thread Dongli Zhang
On 11/12/2018 03:13 PM, Marc Olson via Qemu-devel wrote: > On 11/3/18 10:24 AM, Dongli Zhang wrote: >> Hi all, >> >> I tried with the patch at: >> >> https://lists.gnu.org/archive/html/qemu-devel/2018-09/msg00394.html >> >> The patch is applied t

Re: [Qemu-devel] [PATCH v3 1/3] blkdebug: fix one shot rule processing

2018-11-12 Thread Dongli Zhang
drive,serial=deadbeaf1 \ -drive file=blkdebug:blkdebug.config:nvme.img,format=raw,if=none,id=nvmedrive \ -net nic -net user,hostfwd=tcp::5022-:22 I will debug where it hangs. Dongli Zhang On 11/12/2018 03:06 PM, Marc Olson via Qemu-devel wrote: > If 'once' is specified, the rule

Re: [Qemu-devel] How to emulate block I/O timeout on qemu side?

2018-11-12 Thread Dongli Zhang
On 11/13/2018 06:52 AM, Marc Olson via Qemu-devel wrote: > On 11/11/18 11:36 PM, Dongli Zhang wrote: >> On 11/12/2018 03:13 PM, Marc Olson via Qemu-devel wrote: >>> On 11/3/18 10:24 AM, Dongli Zhang wrote: >>>> The 'write' latency of sector=40960 is set t

Re: [Qemu-devel] [PATCH 1/1] virtio-blk: rename iov to out_iov in virtio_blk_handle_request()

2018-11-14 Thread Dongli Zhang
Ping? Thanks! Dongli Zhang On 11/07/2018 12:09 AM, Dongli Zhang wrote: > In virtio_blk_handle_request(), in_iov is used for input header while iov > is used for output header. Rename iov to out_iov to pair output header's > name with in_iov to avoid confusing people when readi

[Qemu-devel] When AioHandler->is_external=true?

2018-11-20 Thread Dongli Zhang
Hi, Would you please help explain in which case AioHandler->is_external is true, and when it is false? I read about iothread and mainloop and I am little bit confused about it. Thank you very much! Dongli Zhang

[Qemu-devel] [PATCH 1/1] virtio: pass argument by value for virtqueue_map_iovec()

2018-11-01 Thread Dongli Zhang
Pass num_sg by value instead of by pointer, as num_sg is never modified in virtqueue_map_iovec(). Signed-off-by: Dongli Zhang --- hw/virtio/virtio.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 4136d23..a5cb4e6 100644

[Qemu-devel] How to emulate block I/O timeout on qemu side?

2018-11-02 Thread Dongli Zhang
purpose on qemu side? Thank you very much! Dongli Zhang

Re: [Qemu-devel] How to emulate block I/O timeout on qemu side?

2018-11-03 Thread Dongli Zhang
re disk when I input some command via qemu monitor. Dongli Zhang On 11/03/2018 02:17 AM, John Snow wrote: > > > On 11/02/2018 01:55 PM, Marc Olson wrote: >> On 11/2/18 10:49 AM, John Snow wrote: >>> On 11/02/2018 04:11 AM, Dongli Zhang wrote: >>>> Hi, >&

[Qemu-devel] vfio failure with intel 760p 128GB nvme

2018-12-01 Thread Dongli Zhang
nfirm if this can be regarded as bug in qemu, or issue with nvme hardware? Should we fix thin in qemu, or we should never use such buggy hardware with vfio? Thank you very much! Dongli Zhang

Re: [Qemu-devel] vfio failure with intel 760p 128GB nvme

2018-12-01 Thread Dongli Zhang
Hi Alex, On 12/02/2018 03:29 AM, Alex Williamson wrote: > On Sat, 1 Dec 2018 10:52:21 -0800 (PST) > Dongli Zhang wrote: > >> Hi, >> >> I obtained below error when assigning an intel 760p 128GB nvme to guest via >> vfio on my desktop: >> >> qemu-syst

[Qemu-devel] [PATCH 1/1] msix: correct pba size calculation used for msix_exclusive_bar initialization

2018-12-16 Thread Dongli Zhang
The bar_pba_size is more than what the pba is expected to have, although this usually would not affect the bar_size used for dev->msix_exclusive_bar initialization. Signed-off-by: Dongli Zhang --- hw/pci/msix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci/msix.

Re: [Qemu-devel] [PATCH 1/1] msix: correct pba size calculation used for msix_exclusive_bar initialization

2018-12-16 Thread Dongli Zhang
Hi Michael, CCed Jason as this is related to commit a0ccd2123ee2 "pci: remove hard-coded bar size in msix_init_exclusive_bar()" Please see my reply inline. On 12/17/2018 10:24 AM, Michael S. Tsirkin wrote: > On Mon, Dec 17, 2018 at 07:34:39AM +0800, Dongli Zhang wrote: >>

[Qemu-devel] [PATCH 1/1] qdev: rename qdev_create() argument to sync with qdev_try_create()

2018-12-23 Thread Dongli Zhang
The second argument used by qdev_create() is typename and 'name' is very confusing. Rename it from 'name' to 'type', which is the same used by qdev_try_create(). Signed-off-by: Dongli Zhang --- hw/core/qdev.c | 8 1 file changed, 4 insertions(+), 4 dele

Re: [Qemu-devel] vfio failure with intel 760p 128GB nvme

2018-12-27 Thread Dongli Zhang
Hi Alex, On 12/02/2018 09:29 AM, Dongli Zhang wrote: > Hi Alex, > > On 12/02/2018 03:29 AM, Alex Williamson wrote: >> On Sat, 1 Dec 2018 10:52:21 -0800 (PST) >> Dongli Zhang wrote: >> >>> Hi, >>> >>> I obtained below error when assignin

Re: [Qemu-devel] vfio failure with intel 760p 128GB nvme

2018-12-27 Thread Dongli Zhang
Hi Alex, On 12/02/2018 09:29 AM, Dongli Zhang wrote: > Hi Alex, > > On 12/02/2018 03:29 AM, Alex Williamson wrote: >> On Sat, 1 Dec 2018 10:52:21 -0800 (PST) >> Dongli Zhang wrote: >> >>> Hi, >>> >>> I obtained below error when assignin

Re: [Qemu-devel] vfio failure with intel 760p 128GB nvme

2018-12-27 Thread Dongli Zhang
Hi Alex, On 12/27/2018 10:20 PM, Alex Williamson wrote: > On Thu, 27 Dec 2018 20:30:48 +0800 > Dongli Zhang wrote: > >> Hi Alex, >> >> On 12/02/2018 09:29 AM, Dongli Zhang wrote: >>> Hi Alex, >>> >>> On 12/02/2018 03:29 AM, Alex Williamso

Re: [Qemu-devel] [PATCH v3 1/5] virtio_net: Add VIRTIO_NET_F_STANDBY feature bit.

2019-01-08 Thread Dongli Zhang
hotplug via qemu, as VF is only a vfio pci device? I am trying to play with this with only qemu (w/o libvirt). Thank you very much! Dongli Zhang On 01/08/2019 06:29 AM, Venu Busireddy wrote: > From: Sridhar Samudrala > > This feature bit can be used by a hypervisor to indicate to the v

Re: [Qemu-devel] [PATCH v3 1/5] virtio_net: Add VIRTIO_NET_F_STANDBY feature bit.

2019-01-08 Thread Dongli Zhang
Hi Venu, On 2019/1/9 上午1:25, Venu Busireddy wrote: > On 2019-01-09 00:56:38 +0800, Dongli Zhang wrote: >> I am not familiar with libvirt and I would like to play with this only with >> qemu. >> >> With failover, we need to hotplug the VF on destination server to VM

Re: [Qemu-devel] [PATCH v3 1/5] virtio_net: Add VIRTIO_NET_F_STANDBY feature bit.

2019-01-08 Thread Dongli Zhang
Hi Samudrala, On 2019/1/9 上午8:18, Samudrala, Sridhar wrote: > On 1/8/2019 4:14 PM, Dongli Zhang wrote: >> Hi Venu, >> >> On 2019/1/9 上午1:25, Venu Busireddy wrote: >>> On 2019-01-09 00:56:38 +0800, Dongli Zhang wrote: >>>> I am not familiar with libvi

Re: [Qemu-devel] [Qemu-discuss] IRQ per CPU

2018-07-04 Thread Dongli Zhang
rstanding per-queue vector. > have written a PCI device from the template which does not generate > IRQ per CPU. How can write such device in Qemu? > > The code of current device is here: > https://gist.github.com/proywm/6ca98d3e8ca001965e2c8792fcf97911 > > Regards, > Probir > Dongli Zhang

Re: [Qemu-devel] [Qemu-discuss] IRQ per CPU

2018-07-05 Thread Dongli Zhang
me as the number of CPU, it is sort of 'per CPU basis', as each CPU will be serving irq for its own queue. Dongli Zhang

[Qemu-devel] Why qom-get is not available in qemu monitor

2018-06-25 Thread Dongli Zhang
Hi, Would you mind help confirm why qom-get command is not supported by qemu monitor, but only qapi? Is this a feature (qom-get in monitor) totally useless for some reason, or it is still not implemented yet? Thank you very much! Dongli Zhang

[PATCH 1/1] pci: don't skip function 0 occupancy verification for devfn auto assign

2024-07-07 Thread Dongli Zhang
I: slot 1 is not valid for virtio-net-pci, parent device only allows plugging into slot 0. Fix the issue by moving the verification into an independent 'if' statement. Fixes: 3f1e1478db2d ("enable multi-function hot-add") Reported-by: Aswin Unnikrishnan Signed-off-by: Dong

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

2021-03-25 Thread Dongli Zhang
36 } Original RFC link: https://lists.nongnu.org/archive/html/qemu-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

[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 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 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 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 1/6] qdev: introduce qapi/hmp command for kick/call event

2021-03-25 Thread Dongli Zhang
) may implement the interface (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 specifi

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

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

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

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

  1   2   >