Re: Using ubuntu24.4 system qemu-system-aarch64 +gdb-multiarch to debug the kernel, setting breakpoints cannot be stopped

2024-09-25 Thread jie ren
Thank you very much. Adding kaslr successfully solved the problem. Ilya Leoshkevich 于2024年9月24日周二 00:34写道: > On Mon, 2024-09-23 at 22:36 +0800, jie ren wrote: > > Hi, I have a question for help > > I recently Using ubuntu24.4 system qemu-system-aarch64 +gdb- > > m

Using ubuntu24.4 system qemu-system-aarch64 +gdb-multiarch to debug the kernel, setting breakpoints cannot be stopped

2024-09-23 Thread jie ren
Hi, I have a question for help I recently Using ubuntu24.4 system qemu-system-aarch64 +gdb-multiarch to debug the kernel, setting breakpoints cannot be stopped. system information: ubuntu version: 22.04 Debug kernel version: 5.0.0 qemu version: · qemu-system-a

[PATCH] hw/vhost-user-blk: fix ioeventfd add failed when start reenter

2022-03-28 Thread Jie Wang via
0x7fca423e8ecc in kvm_handle_io 28 0x7fca423ecb48 in kvm_cpu_exec 29 0x7fca424279d5 in qemu_kvm_cpu_thread_fn 30 0x7fca423c9480 in qemu_thread_start 31 0x7fca4257ff3b in ?? () from /usr/lib64/libpthread.so.0 32 0x7fca4270b550 in clone () from /usr/lib64/libc.so.6 Signed-off-by: Ji

[PATCH v3 9/9] hvf: remove the need to lookup memory slots when clearing dirty-bits

2022-03-02 Thread Yan-Jie Wang
`section` passed by the caller to determine the pages that need to be write-protected. Compared to the original method, this saves time. Moreover, this makes only pages whose dirty-bits are cleared write-protected instead of making the whole memory slot write-protected. Signed-off-by: Yan-Jie Wang

[PATCH v3 5/9] hvf: fix memory dirty-tracking

2022-03-02 Thread Yan-Jie Wang
work properly. Buglink: https://bugs.launchpad.net/qemu/+bug/1827005 Signed-off-by: Yan-Jie Wang --- accel/hvf/hvf-mem.c | 62 include/sysemu/hvf_int.h | 14 + target/arm/hvf/hvf.c | 5 target/i386/hvf/hvf.c| 25

[PATCH v3 6/9] hvf: add a lock for memory related functions

2022-03-02 Thread Yan-Jie Wang
We follow how KVM accel does in its memory listener (kvm-all.c) and add a lock for the memory related functions. Signed-off-by: Yan-Jie Wang --- accel/hvf/hvf-mem.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/accel/hvf/hvf-mem.c b/accel/hvf/hvf-mem.c index 896e718374

[PATCH v3 8/9] hvf: only consider directly writeable memory regions for dirty-tracking

2022-03-02 Thread Yan-Jie Wang
It is no need to dirty-track MMIO regions or other readonly regions. Before we start or stop to dirty-track a memory region, check the type of the memory region. The region must be a writeable ram to be dirty-tracked. Signed-off-by: Yan-Jie Wang --- accel/hvf/hvf-mem.c | 6 ++ 1 file

[PATCH v3 1/9] hvf: move memory related functions from hvf-accel-ops.c to hvf-mem.c

2022-03-02 Thread Yan-Jie Wang
Signed-off-by: Yan-Jie Wang --- accel/hvf/hvf-accel-ops.c | 220 + accel/hvf/hvf-mem.c | 252 ++ accel/hvf/meson.build | 1 + include/sysemu/hvf_int.h | 2 + 4 files changed, 256 insertions(+), 219 deletions

[PATCH v3 4/9] hvf: rename struct hvf_slot to HVFSlot

2022-03-02 Thread Yan-Jie Wang
Follow the QEMU coding style. Structured type names are in CamelCase. Signed-off-by: Yan-Jie Wang --- accel/hvf/hvf-mem.c | 14 +++--- include/sysemu/hvf_int.h | 8 target/i386/hvf/hvf.c| 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/accel

[PATCH v3 3/9] hvf: use correct data types for addresses in memory related functions

2022-03-02 Thread Yan-Jie Wang
Follow the QEMU coding style. Use hwaddr for guest physical address. Signed-off-by: Yan-Jie Wang --- accel/hvf/hvf-mem.c | 2 +- include/sysemu/hvf_int.h | 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/accel/hvf/hvf-mem.c b/accel/hvf/hvf-mem.c index 32452696b6

[PATCH v2 9/9] hvf: remove the need to lookup memory slots when clearing dirty-bits

2022-03-02 Thread Yan-Jie Wang
`section` passed by the caller to determine the pages that need to be write-protected. Compared to the original method, this saves time. Moreover, this makes only pages whose dirty-bits are cleared write-protected instead of making the whole memory slot write-protected. Signed-off-by: Yan-Jie Wang

[PATCH v2 5/9] hvf: fix memory dirty-tracking

2022-03-02 Thread Yan-Jie Wang
work properly. Buglink: https://bugs.launchpad.net/qemu/+bug/1827005 Signed-off-by: Yan-Jie Wang --- accel/hvf/hvf-mem.c | 62 include/sysemu/hvf_int.h | 14 + target/arm/hvf/hvf.c | 5 target/i386/hvf/hvf.c| 25

[PATCH v2 0/9] Many improvements to HVF memory-related codes

2022-03-02 Thread Yan-Jie Wang
es instead of arrays to store in-kernel KVM memory slots. 5. Add a lock to protect the data structures of HVF memory slots Patches have been tested on Apple Silicon Macs and Intel Macs. Yan-Jie Wang (9): hvf: move memory related functions from hvf-accel-ops.c to hvf-mem.c hvf: sim

[PATCH v2 3/9] hvf: use correct data types for addresses in memory related functions

2022-03-02 Thread Yan-Jie Wang
Follow the QEMU coding style. Use hwaddr for guest physical address. Signed-off-by: Yan-Jie Wang --- accel/hvf/hvf-mem.c | 2 +- include/sysemu/hvf_int.h | 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/accel/hvf/hvf-mem.c b/accel/hvf/hvf-mem.c index 32452696b6

[PATCH v2 1/9] hvf: move memory related functions from hvf-accel-ops.c to hvf-mem.c

2022-03-02 Thread Yan-Jie Wang
Signed-off-by: Yan-Jie Wang --- accel/hvf/hvf-accel-ops.c | 220 + accel/hvf/hvf-mem.c | 252 ++ accel/hvf/meson.build | 1 + include/sysemu/hvf_int.h | 2 + 4 files changed, 256 insertions(+), 219 deletions

[PATCH v2 7/9] hvf: use GTree to store memory slots instead of fixed-size array

2022-03-02 Thread Yan-Jie Wang
Currently, there are only 32 memory slots in the fixed size array. It is not scalable. Instead of using fixed size array, use GTree (from glib library) and dynamically-allocated structures to store memory slots. Signed-off-by: Yan-Jie Wang --- accel/hvf/hvf-mem.c | 63

[PATCH v2 6/9] hvf: add a lock for memory related functions

2022-03-02 Thread Yan-Jie Wang
We follow how KVM accel does in its memory listener (kvm-all.c) and add a lock for the memory related functions. Signed-off-by: Yan-Jie Wang --- accel/hvf/hvf-mem.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/accel/hvf/hvf-mem.c b/accel/hvf/hvf-mem.c index 896e718374

[PATCH v2 4/9] hvf: rename struct hvf_slot to HVFSlot

2022-03-02 Thread Yan-Jie Wang
Follow the QEMU coding style. Structured type names are in CamelCase. Signed-off-by: Yan-Jie Wang --- accel/hvf/hvf-mem.c | 14 +++--- include/sysemu/hvf_int.h | 8 target/i386/hvf/hvf.c| 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/accel

[PATCH v3 7/9] hvf: use GTree to store memory slots instead of fixed-size array

2022-03-02 Thread Yan-Jie Wang
Currently, there are only 32 memory slots in the fixed size array. It is not scalable. Instead of using fixed size array, use GTree (from glib library) and dynamically-allocated structures to store memory slots. Signed-off-by: Yan-Jie Wang --- accel/hvf/hvf-mem.c | 63

[PATCH v2 2/9] hvf: simplify data structures and codes of memory related functions

2022-03-02 Thread Yan-Jie Wang
not overlap with existing sections. - Try to align memory sections first before giving up sections that are not aligned to host page size. Signed-off-by: Yan-Jie Wang --- accel/hvf/hvf-accel-ops.c | 1 - accel/hvf/hvf-mem.c | 211 +++--- include/sysemu

[PATCH v3 2/9] hvf: simplify data structures and codes of memory related functions

2022-03-02 Thread Yan-Jie Wang
not overlap with existing sections. - Try to align memory sections first before giving up sections that are not aligned to host page size. Signed-off-by: Yan-Jie Wang --- accel/hvf/hvf-accel-ops.c | 1 - accel/hvf/hvf-mem.c | 211 +++--- include/sysemu

[PATCH v3 0/9] Many improvements to HVF memory-related codes

2022-03-02 Thread Yan-Jie Wang
t the data structures of HVF memory slots Patches have been tested on Apple Silicon Macs and Intel Macs. Yan-Jie Wang (9): hvf: move memory related functions from hvf-accel-ops.c to hvf-mem.c hvf: simplify data structures and codes of memory related functions hvf: use correct data types for

[PATCH v2 8/9] hvf: only consider directly writeable memory regions for dirty-tracking

2022-03-02 Thread Yan-Jie Wang
It is no need to dirty-track MMIO regions or other readonly regions. Before we start or stop to dirty-track a memory region, check the type of the memory region. The region must be a writeable ram to be dirty-tracked. Signed-off-by: Yan-Jie Wang --- accel/hvf/hvf-mem.c | 5 + 1 file

Re: [PATCH qemu 0/7] Many improvements to HVF memory-related codes

2022-03-01 Thread Yan-Jie Wang
Sorry, I made a mistake. The last line in the function, hvf_find_free_slot, introduced in this commit "hvf: simplify data structures and codes of memory related functions" should be "return NULL;" static hvf_slot *hvf_find_free_slot(void) { hvf_slot *slot; int x; for (x = 0; x < HVF_NU

Re: [PATCH qemu 0/7] Many improvements to HVF memory-related codes

2022-03-01 Thread Yan-Jie Wang
For the dirty-tracking part in my patch series, the major difference between this patch and Alex's patch is that the dirty-tracking logic in my patch will only mark the page being written dirty instead of marking the whole memory slot dirty, and will only restore the write permission to the pag

[PATCH] scsi: fix bug scsi resp sense is 0 when expand disk

2021-06-29 Thread Jie Wang
s add req_has_ua to avoid this kind of thing. Signed-off-by: suruifeng Signed-off-by: Jie Wang --- hw/scsi/scsi-bus.c | 10 -- include/hw/scsi/scsi.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 2a0a98cac9..20ec4

[PATCH v2] util: fix fd leak in qemu_write_pidfile()

2021-05-10 Thread Jie Wang
if execute qemu_open success, have no branch to free the fd, so unlink it inadvance, let it free by process exit. Signed-off-by: Jie Wang --- util/oslib-posix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 36820fec16..fa881f2ee8 100644 --- a

[PATCH] util: fix fd leak in qemu_write_pidfile()

2021-05-10 Thread Jie Wang
if execute qemu_open success, have no branch to free the fd, so unlink it inadvance, let it free by process exit. Signed-off-by: Jie Wang --- util/oslib-posix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 36820fec16..30bf39bf4f 100644 --- a

Re: [PATCH V2 4/6] tools/vhost-user-i2c: Add backend driver

2021-04-01 Thread Jie Deng
On 2021/4/1 20:12, Viresh Kumar wrote: + +/* vhost-user-i2c definitions */ + +#define MAX_I2C_VDEV(1 << 7) +#define MAX_I2C_ADAPTER 16 Generally speaking, 16 is big enough for most cases. But comparing with static configuration, I think it is better if we

Re: [PATCH 3/5] tools/vhost-user-i2c: Add backend driver

2021-03-24 Thread Jie Deng
On 2021/3/24 15:33, Viresh Kumar wrote: +static int vi2c_parse(VuI2c *i2c) +{ +uint16_t client_addr[MAX_I2C_VDEV]; +int32_t n_adapter = 0, n_client; +int64_t addr, bus; +const char *cp, *t; + +while (device_list) { +/* Read :[:] entries one by one */ +cp = st

Re: [PATCH 3/5] tools/vhost-user-i2c: Add backend driver

2021-03-24 Thread Jie Deng
On 2021/3/24 15:33, Viresh Kumar wrote: + +/* Definitions from virtio-i2c specifications */ +#define VHOST_USER_I2C_MAX_QUEUES 1 + +/* Status */ +#define VIRTIO_I2C_MSG_OK 0 +#define VIRTIO_I2C_MSG_ERR 1 + +/* The bit 0 of the @virtio_i2c_out_hdr.@flags, used to

[Qemu-devel] Ping Re: [PATCH] vhost: remove the dead code

2019-05-29 Thread Jie Wang
On 2019/5/2 0:38, Stefan Hajnoczi wrote: > On Tue, Apr 30, 2019 at 02:10:14PM +0800, Jie Wang wrote: >> remove the dead code >> >> Signed-off-by: Jie Wang >> --- >> hw/virtio/vhost.c | 1 - >> 1 file changed, 1 deletion(-) > Reviewed-by: Stefan Hajnoczi

[Qemu-devel] Ping Re: [PATCH] vhost: fix memory leak in vhost_user_scsi_realize

2019-05-29 Thread Jie Wang
On 2019/5/2 0:40, Stefan Hajnoczi wrote: > On Tue, Apr 30, 2019 at 03:15:00PM +0800, Jie Wang wrote: >> fix memory leak in vhost_user_scsi_realize >> >> Signed-off-by: Jie Wang >> --- >> hw/scsi/vhost-user-scsi.c | 3 +++ >> 1 file changed, 3 insertions(+) > Reviewed-by: Stefan Hajnoczi

Re: [Qemu-devel] [Qemu-block] [PATCH] pr-manager-helper: fix pr process been killed when reconectting

2019-05-29 Thread Jie Wang
wrote: > On 5/28/19 7:45 PM, Paolo Bonzini wrote: >> On 28/05/19 15:06, Jie Wang wrote: >>> if pr-helper been killed and qemu send disconnect event to libvirt >>> and libvirt started a new pr-helper process, the new pr-heleper >>> been killed again when qemu is c

[Qemu-devel] [PATCH] pr-manager-helper: fix pr process been killed when reconectting

2019-05-28 Thread Jie Wang
-off-by: Jie Wang --- scsi/pr-manager-helper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/scsi/pr-manager-helper.c b/scsi/pr-manager-helper.c index 438380fced..b7341b8f47 100644 --- a/scsi/pr-manager-helper.c +++ b/scsi/pr-manager-helper.c @@ -120,6 +120,7 @@ static int

[Qemu-devel] [PATCH] vhost: fix memory leak in vhost_user_scsi_realize

2019-04-30 Thread Jie Wang
fix memory leak in vhost_user_scsi_realize Signed-off-by: Jie Wang --- hw/scsi/vhost-user-scsi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c index 8b1e6876db..a9fd8ea305 100644 --- a/hw/scsi/vhost-user-scsi.c +++ b/hw/scsi/vhost

[Qemu-devel] [PATCH] vhost: fix incorrect print type

2019-04-30 Thread Jie Wang
fix incorrect print type in vhost_virtqueue_stop Signed-off-by: Jie Wang --- hw/virtio/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 7f61018f2a..286bb27c65 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1081,7

[Qemu-devel] [PATCH] vhost: remove the dead code

2019-04-30 Thread Jie Wang
remove the dead code Signed-off-by: Jie Wang --- hw/virtio/vhost.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 7f61018f2a..2303a8c206 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1650,7 +1650,6 @@ fail_vq

[Qemu-devel] question: Does qemu-pr-helper have its own log files?

2019-04-22 Thread Jie Wang
 Does qemu-pr-helper have its own log files?

[Qemu-devel] [PATCH] block/file-posix: fix the wrong result of find_allocation() in macOS.

2018-09-08 Thread Yan-Jie Wang
as input may create corrupted images in macOS especially for large files, and qemu-img map may also report wrong things. This patch fixes this undesired behaviors. Signed-off-by: Yan-Jie Wang --- block/file-posix.c | 59 ++ 1 file changed, 59 insertions

[Qemu-devel] [Bug 1776920] Re: qemu-img convert on Mac OSX creates corrupt images

2018-09-07 Thread Yan-Jie Wang
I have done some experiments and find out that the behavior of lseek with whence set to SEEK_DATA is different from the behavior of Linux's lseek. If the supplied offset is in the middle of a data region, it returns the start of the next data region. There may be many data regions in a big file

[Qemu-devel] [Bug 1779120] Re: disk missing in the guest contingently when hotplug several virtio scsi disks consecutively

2018-06-28 Thread Jie Wang
I also met this bug -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1779120 Title: disk missing in the guest contingently when hotplug several virtio scsi disks consecutively Status in QEMU: New

[Qemu-devel] [PATCH v2] util/async: avoid NULL pointer dereference

2018-06-11 Thread Jie Wang
if laio_init create linux_aio failed and return NULL, NULL pointer dereference will occur when laio_attach_aio_context dereference linux_aio in aio_get_linux_aio. Let's avoid it and report error. Signed-off-by: Jie Wang --- block/file-posix.c | 19 +-- util/async.c

[Qemu-devel] [PATCH v2] util/async: avoid NULL pointer dereference

2018-06-11 Thread Jie Wang
if laio_init create linux_aio failed and return NULL, NULL pointer dereference will occur when laio_attach_aio_context dereference linux_aio in aio_get_linux_aio. Let's avoid it and report error. Signed-off-by: Jie Wang --- block/file-posix.c | 19 +-- util/async.c

[Qemu-devel] [PATCH] util/async: avoid NULL pointer dereference

2018-06-11 Thread Jie Wang
if laio_init create linux_aio failed and return NULL, NULL pointer dereference will occur when laio_attach_aio_context dereference linux_aio in aio_get_linux_aio, so add assert to avoid it. Signed-off-by: Jie Wang --- util/async.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/async.c

[Qemu-devel] [PATCH v6 2/2] iothread: let aio_epoll_disable fit to aio_context_destroy

2018-05-16 Thread Jie Wang
epoll_available will only be set if epollfd != -1, os we can swap the two variables in aio_epoll_disable, and aio_context_destroy can call aio_epoll_disable directly. Signed-off-by: Jie Wang --- util/aio-posix.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/util

[Qemu-devel] [PATCH v6 1/2] iothread: fix epollfd leak in the process of delIOThread

2018-05-16 Thread Jie Wang
When we call addIOThread, the epollfd created in aio_context_setup, but not close it in the process of delIOThread, so the epollfd will leak. Signed-off-by: Jie Wang --- include/block/aio.h | 8 util/aio-posix.c| 9 + util/aio-win32.c| 4 util/async.c| 1

[Qemu-devel] [PATCH v5] iothread: fix epollfd leak in the process of delIOThread

2018-05-16 Thread Jie Wang
When we call addIOThread, the epollfd created in aio_context_setup, but not close it in the process of delIOThread, so the epollfd will leak. Signed-off-by: Jie Wang --- include/block/aio.h | 8 util/aio-posix.c| 13 ++--- util/aio-win32.c| 4 util/async.c

[Qemu-devel] [PATCH v4] iothread: fix epollfd leak in the process of delIOThread

2018-05-16 Thread Jie Wang
When we call addIOThread, the epollfd created in aio_context_setup, but not close it in the process of delIOThread, so the epollfd will leak. Signed-off-by: Jie Wang --- include/block/aio.h | 8 util/aio-posix.c| 9 + util/aio-win32.c| 4 util/async.c| 1

[Qemu-devel] [PATCH v3] iothread: fix epollfd leak in the process of delIOThread

2018-05-16 Thread Jie Wang
From: w00251574 When we call addIOThread, the epollfd created in aio_context_setup, but not close it in the process of delIOThread, so the epollfd will leak. Signed-off-by: Jie Wang --- include/block/aio.h | 8 util/aio-posix.c| 9 + util/aio-win32.c| 4 util

[Qemu-devel] [PATCH v2] iothread: fix epollfd leak in the process of delIOThread

2018-05-16 Thread Jie Wang
From: w00251574 When we call addIOThread, the epollfd created in aio_context_setup, but not close it in the process of delIOThread, so the epollfd will leak. Signed-off-by: Jie Wang --- include/block/aio.h | 8 util/aio-posix.c| 7 +++ util/aio-win32.c| 4 util

[Qemu-devel] [PATCH] iothread: fix epollfd leak in the process of delIOThread

2018-05-15 Thread Jie Wang
When we call addIOThread, the epollfd created in aio_context_setup, but not close it in the process of delIOThread, so the epollfd will leak. Signed-off-by: Jie Wang --- iothread.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iothread.c b/iothread.c index aff1281..23ac0a8 100644 --- a

[Qemu-devel] [Bug 1641861] [NEW] fail to correctly emulate FPSCR register on arm

2016-11-15 Thread Jie
Public bug reported: Hi all, we systematically tested the QEMU implementation for emulating arm user mode programs. We found that QEMU incorrectly emulate the FPSCR register. The following the proof of code: /*** Beginning of the bug: arm.c **/ int printf(const char *format, ...)

[Qemu-devel] [Bug 1641637] [NEW] incorrect illegal SSE3 instructions reporting on x86_64

2016-11-14 Thread Jie
Public bug reported: Hi all, we found 28 differently encoded illegal SSE3 instructions reporting on the most recent x86_64 user mode linux qemu (version 2.7.0). We believe these reporting should be incorrect because the same code can be executed on a real machine. The instructions are the followin

[Qemu-devel] [PATCH] test: add drive-mirror qtest

2016-09-06 Thread Jie Wang
Signed-off-by: Jie Wang --- tests/Makefile.include| 3 ++ tests/drive-mirror-test.c | 96 +++ 2 files changed, 99 insertions(+) create mode 100755 tests/drive-mirror-test.c diff --git a/tests/Makefile.include b/tests/Makefile.include index

[Qemu-devel] [PATCH] tests: add drive-mirror qtest

2016-09-06 Thread Jie Wang
Signed-off-by: Jie Wang --- tests/Makefile.include| 3 ++ tests/drive-mirror-test.c | 96 +++ 2 files changed, 99 insertions(+) create mode 100755 tests/drive-mirror-test.c diff --git a/tests/Makefile.include b/tests/Makefile.include index

Re: [Qemu-devel] [PATCH v3] vfio : add aer process

2016-08-18 Thread Zhou Jie
ping On 2016/8/15 10:53, Zhou Jie wrote: ping On 2016/8/2 11:57, Zhou Jie wrote: During aer err occurs and resume do following to protect device from being accessed. 1. Make config space read only. 2. Disable INTx/MSI Interrupt. 3. Do nothing for bar regions. Signed-off-by: Zhou Jie --- v2

Re: [Qemu-devel] [PATCH v3] vfio : add aer process

2016-08-14 Thread Zhou Jie
ping On 2016/8/2 11:57, Zhou Jie wrote: During aer err occurs and resume do following to protect device from being accessed. 1. Make config space read only. 2. Disable INTx/MSI Interrupt. 3. Do nothing for bar regions. Signed-off-by: Zhou Jie --- v2-v3: 1. Call init_completion() in

[Qemu-devel] [PATCH v3] vfio : add aer process

2016-08-01 Thread Zhou Jie
During aer err occurs and resume do following to protect device from being accessed. 1. Make config space read only. 2. Disable INTx/MSI Interrupt. 3. Do nothing for bar regions. Signed-off-by: Zhou Jie --- v2-v3: 1. Call init_completion() in vfio_pci_probe. 2. Call reinit_completion() in

Re: [Qemu-devel] [PATCH v2 2/2] vfio : add aer process

2016-08-01 Thread Zhou Jie
Hi, Alex Clearly this has only been tested for a single instance of an AER error event and resume per device. Are the things you're intending to block actually blocked for subsequent events? Note how complete_all() fills the done field to let all current and future waiters go through and nowhe

Re: [Qemu-devel] [PATCH v2 2/2] vfio : add aer process

2016-07-31 Thread Zhou Jie
Hi, Alex On 2016/7/30 1:12, Alex Williamson wrote: On Tue, 19 Jul 2016 15:32:43 +0800 Zhou Jie wrote: From: Chen Fan During aer err occurs and resume do following to protect device from being accessed. 1. Make config space read only. 2. Disable INTx/MSI Interrupt. 3. Do nothing for bar

Re: [Qemu-devel] [PATCH v2 1/2] vfio : resume notifier

2016-07-31 Thread Zhou Jie
Hi, Alex On 2016/7/30 1:11, Alex Williamson wrote: On Tue, 19 Jul 2016 15:52:45 +0800 Zhou Jie wrote: From: Chen Fan An empty commit log is unacceptable for all but the most trivial patches. There's also no sign-off on this patch. Sorry. I should note it. I also don't know w

Re: [Qemu-devel] [PATCH v2 0/2] vfio: add aer process

2016-07-25 Thread Zhou Jie
ping On 2016/7/19 16:13, Zhou Jie wrote: From: Chen Fan v1-v2: 1. Add aer process to vfio driver. Chen Fan (2): vfio : add aer process vfio : resume notifier drivers/vfio/pci/vfio_pci.c | 58 - drivers/vfio/pci/vfio_pci_intrs.c | 18

[Qemu-devel] [PATCH v2 0/2] vfio: add aer process

2016-07-19 Thread Zhou Jie
From: Chen Fan v1-v2: 1. Add aer process to vfio driver. Chen Fan (2): vfio : add aer process vfio : resume notifier drivers/vfio/pci/vfio_pci.c | 58 - drivers/vfio/pci/vfio_pci_intrs.c | 18 drivers/vfio/pci/vfio_pci_private.h

[Qemu-devel] [PATCH v2 1/2] vfio : resume notifier

2016-07-19 Thread Zhou Jie
From: Chen Fan --- drivers/vfio/pci/vfio_pci.c | 28 +++- drivers/vfio/pci/vfio_pci_intrs.c | 18 ++ drivers/vfio/pci/vfio_pci_private.h | 1 + include/uapi/linux/vfio.h | 1 + 4 files changed, 47 insertions(+), 1 deletion(-) diff --

[Qemu-devel] [PATCH v9 10/11] vfio: Add waiting for host aer error progress

2016-07-19 Thread Zhou Jie
prevent it from further interacting with the VM. 4. Reset bus. Signed-off-by: Chen Fan Signed-off-by: Zhou Jie --- hw/vfio/pci.c | 51 +- hw/vfio/pci.h | 1 + linux-headers/linux/vfio.h | 4 3 files changed, 55

[Qemu-devel] [PATCH v9 04/11] vfio: refine function vfio_pci_host_match

2016-07-19 Thread Zhou Jie
From: Chen Fan Signed-off-by: Chen Fan --- hw/vfio/pci.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 11c895c..21fd801 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -2060,14 +2060,27 @@ static void vfio_pci_po

[Qemu-devel] [PATCH v9 09/11] vfio-pci: pass the aer error to guest

2016-07-19 Thread Zhou Jie
From: Chen Fan when the vfio device encounters an uncorrectable error in host, the vfio_pci driver will signal the eventfd registered by this vfio device, resulting in the qemu eventfd handler getting invoked. this patch is to pass the error to guest and let the guest driver recover from the err

[Qemu-devel] [PATCH v9 11/11] vfio: add 'aer' property to expose aercap

2016-07-19 Thread Zhou Jie
From: Chen Fan add 'aer' property to let user able to decide whether expose the aer capability. by default we should disable aer feature, because it needs configuration restrictions. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/vfio/pci.c b

[Qemu-devel] [PATCH v9 03/11] vfio: add aer support for vfio device

2016-07-19 Thread Zhou Jie
From: Chen Fan Calling pcie_aer_init to initilize aer related registers for vfio device, then reload physical related registers to expose device capability. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 75 ++- hw/vfio/pci.h | 3 +++ 2 fil

[Qemu-devel] [PATCH v9 05/11] vfio: add check host bus reset is support or not

2016-07-19 Thread Zhou Jie
From: Chen Fan When assigning a vfio device with AER enabled, we must check whether the device supports a host bus reset (ie. hot reset) as this may be used by the guest OS in order to recover the device from an AER error. QEMU must therefore have the ability to perform a physical host bus reset

[Qemu-devel] [PATCH v9 08/11] vfio: vote the function 0 to do host bus reset when aer occurred

2016-07-19 Thread Zhou Jie
From: Chen Fan Due to all devices assigned to VM on the same way as host if enable aer, so we can easily do the hot reset by selecting the function #0 to do the hot reset. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 14 ++ hw/vfio/pci.h | 1 + 2 files changed, 15 insertions(+) di

[Qemu-devel] [PATCH v9 07/11] vfio: add check aer functionality for hotplug device

2016-07-19 Thread Zhou Jie
From: Chen Fan when function 0 is hot-added, we can check the vfio device whether support hot bus reset. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 242c1e4..8bcb26b 100644 --- a/hw/vfio/pci.c

[Qemu-devel] [PATCH v9 00/11] vfio-pci: pass the aer error to guest

2016-07-19 Thread Zhou Jie
From: Chen Fan v8-v9: 1. Don't use resume notification. Host vfio driver will process aer. Poll the vfio_device_info to assure host reset completely. v7-v8: 1. Use bitmap to record error and resume notification. v6-v7: 1. Stall any access to the device until resume is signa

[Qemu-devel] [PATCH v9 02/11] vfio: squeeze out vfio_pci_do_hot_reset for support bus reset

2016-07-19 Thread Zhou Jie
From: Chen Fan Squeeze out vfio_pci_do_hot_reset to do host bus reset when AER recovery. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 75 +++ 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c ind

[Qemu-devel] [PATCH v9 06/11] pci: add a pci_function_is_valid callback to check function if valid

2016-07-19 Thread Zhou Jie
From: Chen Fan PCI hotplug requires that function 0 is added last to close the slot. Since vfio supporting AER, we require that the VM bus contains the same set of devices as the host bus to support AER, we can perform an AER validation test whenever a function 0 in the VM is hot-added. Signed-

[Qemu-devel] [PATCH v9 01/11] vfio: extract vfio_get_hot_reset_info as a single function

2016-07-19 Thread Zhou Jie
From: Chen Fan The function is used to get affected devices by bus reset. So here extract it, and can used for aer soon. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 66 +++ 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/h

[Qemu-devel] [PATCH v2 2/2] vfio : add aer process

2016-07-19 Thread Zhou Jie
From: Chen Fan During aer err occurs and resume do following to protect device from being accessed. 1. Make config space read only. 2. Disable INTx/MSI Interrupt. 3. Do nothing for bar regions. Signed-off-by: Zhou Jie --- drivers/vfio/pci/vfio_pci.c | 30

[Qemu-devel] [PATCH v2 1/2] vfio : resume notifier

2016-07-19 Thread Zhou Jie
From: root --- drivers/vfio/pci/vfio_pci.c | 28 +++- drivers/vfio/pci/vfio_pci_intrs.c | 18 ++ drivers/vfio/pci/vfio_pci_private.h | 1 + include/uapi/linux/vfio.h | 1 + 4 files changed, 47 insertions(+), 1 deletion(-) diff --git

[Qemu-devel] [PATCH v2 0/2] vfio: add aer process

2016-07-19 Thread Zhou Jie
From: Chen Fan v1-v2: 1. Add aer process to vfio driver. Chen Fan (1): vfio : add aer process root (1): vfio : resume notifier drivers/vfio/pci/vfio_pci.c | 58 - drivers/vfio/pci/vfio_pci_intrs.c | 18 drivers/vfio/pci/vfio_pc

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-07-12 Thread Zhou Jie
e to true in "struct vfio_pci_device" 6. vfio_fops Add poll function I would still suggest that the name "workable_state" is quite vague. Something like aer_error_in_progress is much more specific. Thanks, OK, I will alter the name. Sincerely Zhou Jie

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-07-12 Thread Zhou Jie
to false in "struct vfio_pci_device" teardown the interrupt 5. vfio_pci_aer_resume Set workable_state to true in "struct vfio_pci_device" 6. vfio_fops Add poll function Sincerely Zhou Jie

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-07-11 Thread Zhou Jie
_slot_reset, .resume = ixgbevf_io_resume, }; User tear-down the interrupts in ixgbevf_io_error_detected function. And up the interrupts in ixgbevf_io_resume. Guest OS driver will do both tear-down the interrupts and re-establish them. Because it don't know what host vfio driver has done. I disable the interrupts to pretend them interfere with device reset. Sincerely Zhou Jie

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-07-09 Thread Zhou Jie
Hi Alex, The variable clearly isn't visible to the user, so the user can know whether the kernel supports this feature, but not whether the feature is currently active. Perhaps there's no way to avoid races completely, but don't you expect that if we define that certain operations are blocked a

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-07-07 Thread Zhou Jie
he guest will do. What I want to do in vfio driver is as following. 1. aer occurs 2. Disable INTx and MSI 3. aer driver reset the device 4. Restore INTx and MSI 5. user process the aer event Sincerely Zhou Jie

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-07-05 Thread Zhou Jie
user 5. user process the aer event Maybe reset the device and reinitialization What I do is make sure the following points. 1. Host can reset the device between step 2 and 4. 2. The user settings is the same at step 1 and 5. Sincerely Zhou Jie

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-07-04 Thread Zhou Jie
ping On 2016/7/3 12:00, Zhou Jie wrote: Hi Alex, On 2016/6/30 9:45, Zhou Jie wrote: Hi Alex, On 2016/6/30 2:22, Alex Williamson wrote: On Wed, 29 Jun 2016 16:54:05 +0800 Zhou Jie wrote: Hi Alex, And yet we have struct pci_dev.broken_intx_masking and we test for working DisINTx via

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-07-02 Thread Zhou Jie
Hi Alex, On 2016/6/30 9:45, Zhou Jie wrote: Hi Alex, On 2016/6/30 2:22, Alex Williamson wrote: On Wed, 29 Jun 2016 16:54:05 +0800 Zhou Jie wrote: Hi Alex, And yet we have struct pci_dev.broken_intx_masking and we test for working DisINTx via pci_intx_mask_supported() rather than simply

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-29 Thread Zhou Jie
Hi Alex, On 2016/6/30 2:22, Alex Williamson wrote: On Wed, 29 Jun 2016 16:54:05 +0800 Zhou Jie wrote: Hi Alex, And yet we have struct pci_dev.broken_intx_masking and we test for working DisINTx via pci_intx_mask_supported() rather than simply looking for a PCIe device. Some devices are

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-29 Thread Zhou Jie
cause write configure space maybe happened in interrupt handler. I think block is not a good choice. Sincerely Zhou Jie

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-27 Thread Zhou Jie
Hi Alex, On 2016/6/28 11:58, Alex Williamson wrote: On Tue, 28 Jun 2016 11:26:33 +0800 Zhou Jie wrote: Hi Alex, The INTx/MSI part needs further definition for the user. Are we actually completely tearing down interrupts with the expectation that the user will re-enable them or are we just

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-27 Thread Zhou Jie
ms like a reasonable approach, but I can't guarantee we won't find new issues along the way. For instance we'll need to test how -EAGAIN returns interact with existing QEMU and maybe decided whether there are cases that are better handled by doing an interruptible wait. Thanks, I will dig into it. Sincerely Zhou Jie

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-24 Thread Zhou Jie
Hi Alex, We should never depend on the guest driver to behave in a certain way, but we need to prioritize what that actually means. vfio in the kernel has a responsibility first and foremost to the host kernel. User owned devices cannot be allowed to exploit or interfere with the host regardle

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-22 Thread Zhou Jie
Hi Alex, On 2016/6/22 13:45, Zhou Jie wrote: Hi Alex, In vfio I have some questions. 1. How can I disable the access by mmap? We can disable all access to vfio fd by returning a EAGAIN error if user try to access it during the reset period until the host reset finished. But

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-21 Thread Zhou Jie
Hi Alex, In vfio I have some questions. 1. How can I disable the access by mmap? We can disable all access to vfio fd by returning a EAGAIN error if user try to access it during the reset period until the host reset finished. But about the bar region which is maped by vfio_pci_m

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-21 Thread Zhou Jie
Hi Alex, Hi Alex, on kernel side, I think if we don't trust the user behaviors, we should disable the access of vfio-pci interface once vfio-pci driver got the error_detected, we should disable all access to vfio fd regardless whether the vfio-pci was assigned to a VM, we also can re

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-20 Thread Zhou Jie
only make sure the disabled device will not interact with the VM. Sincerely Zhou jie Alex . -- 周潔 Dept 1 No. 6 Wenzhu Road, Nanjing, 210012, China TEL:+86+25-86630566-8557 FUJITSU INTERNAL:7998-8557 E-Mail:zhoujie2...@cn.fujitsu.com

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-20 Thread Zhou Jie
ping On 2016/6/12 10:38, Zhou Jie wrote: Hi, Alex It seems like we have a number of questions open in the thread with MST from the previous version, particularly whether we should actually drop the resume notifier and block the reset in the kernel. The concern being that it's not very

Re: [Qemu-devel] [RFC PATCH 0/3] x86: Add support for guest DMA dirty page tracking

2016-06-11 Thread Zhou Jie
Hi, Alex On 2016/6/9 23:39, Alexander Duyck wrote: On Thu, Jun 9, 2016 at 3:14 AM, Zhou Jie wrote: TO Alex TO Michael In your solution you add a emulate PCI bridge to act as a bridge between direct assigned devices and the host bridge. Do you mean put all direct assigned devices to

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-11 Thread Zhou Jie
ing resume notification? Sincerely Zhou Jie

  1   2   >