[PATCH 1/1] MAINTAINERS: Remove myself as maintainer

2018-07-05 Thread Dong Jia Shi
I am leaving IBM and will move on to other working area, so remove myself as a vfio-ccw maintainer. Signed-off-by: Dong Jia Shi --- I've enjoyed working with you guys. Hope to meet you in future, until then, thank you for all your coach and help, please take care, and farewell. [I'v

[PATCH v4 2/4] vfio: ccw: refactor and improve pfn_array_alloc_pin()

2018-05-22 Thread Dong Jia Shi
t was freed. Suggested-by: Pierre Morel , Signed-off-by: Dong Jia Shi --- drivers/s390/cio/vfio_ccw_cp.c | 82 +++--- 1 file changed, 36 insertions(+), 46 deletions(-) diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/drivers/s390/cio/vfio_ccw_cp.c index b38ef387e4f0..2

[PATCH v4 0/4] vfio: ccw: error handling fixes and improvements

2018-05-22 Thread Dong Jia Shi
Fixed typos. Added sanity check on pa->pa_iova_pfn and updated comments accordingly. - #4. Removed unused idaw_nr. - #5. Replaced leading white spaces with TABs. Traced the function in anycase. Dong Jia Shi (3): vfio: ccw: shorten kernel doc description for pfn_array_pin() vfio:

[PATCH v4 4/4] vfio: ccw: add traceponits for interesting error paths

2018-05-22 Thread Dong Jia Shi
From: Halil Pasic Add some tracepoints so we can inspect what is not working as is should. Signed-off-by: Halil Pasic Signed-off-by: Dong Jia Shi --- drivers/s390/cio/Makefile | 1 + drivers/s390/cio/vfio_ccw_fsm.c | 17 +++- drivers/s390/cio/vfio_ccw_trace.h | 54

[PATCH v4 1/4] vfio: ccw: shorten kernel doc description for pfn_array_pin()

2018-05-22 Thread Dong Jia Shi
The kernel doc description for usage of the struct pfn_array in pfn_array_pin() is unnecessary long. Let's shorten it by describing the contents of the struct pfn_array fields at the struct's definition instead. Suggested-by: Cornelia Huck Signed-off-by: Dong Jia Shi --- driver

[PATCH v4 3/4] vfio: ccw: set ccw->cda to NULL defensively

2018-05-22 Thread Dong Jia Shi
Let's avoid free on ccw->cda that points to a guest address or an already freed memory area by setting it to NULL if memory allocation didn't happen or failed. Signed-off-by: Dong Jia Shi --- drivers/s390/cio/vfio_ccw_cp.c | 31 --- 1 file changed,

[PATCH v3 4/4] vfio: ccw: add traceponits for interesting error paths

2018-05-22 Thread Dong Jia Shi
From: Halil Pasic Add some tracepoints so we can inspect what is not working as is should. Signed-off-by: Halil Pasic Signed-off-by: Dong Jia Shi --- drivers/s390/cio/Makefile | 1 + drivers/s390/cio/vfio_ccw_fsm.c | 17 +++- drivers/s390/cio/vfio_ccw_trace.h | 54

[PATCH v3 2/4] vfio: ccw: refactor and improve pfn_array_alloc_pin()

2018-05-22 Thread Dong Jia Shi
From: Dong Jia Shi This refactors pfn_array_alloc_pin() and also improves it by adding defensive code in error handling so that calling pfn_array_unpin_free() after error return won't lead to problem. This mainly does: 1. Merge pfn_array_pin() into pfn_array_alloc_pin(), since there

[PATCH v3 3/4] vfio: ccw: set ccw->cda to NULL defensively

2018-05-22 Thread Dong Jia Shi
From: Dong Jia Shi Let's avoid free on ccw->cda that points to a guest address or an already freed memory area by setting it to NULL if memory allocation didn't happen or failed. Signed-off-by: Dong Jia Shi --- drivers/s390/cio/vfio_ccw_cp.c | 31 --

[PATCH v3 1/4] vfio: ccw: shorten kernel doc description for pfn_array_pin()

2018-05-22 Thread Dong Jia Shi
From: Dong Jia Shi The kernel doc description for usage of the struct pfn_array in pfn_array_pin() is unnecessary long. Let's shorten it by describing the contents of the struct pfn_array fields at the struct's definition instead. Suggested-by: Cornelia Huck Signed-off-by: Do

[PATCH v3 0/4] vfio: ccw: error handling fixes and improvements

2018-05-22 Thread Dong Jia Shi
ts accordingly. - #4. Removed unused idaw_nr. - #5. Replaced leading white spaces with TABs. Traced the function in anycase. Dong Jia Shi (3): vfio: ccw: shorten kernel doc description for pfn_array_pin() vfio: ccw: refactor and improve pfn_array_alloc_pin() vfio: ccw: set cc

[PATCH 1/1] vfio: ccw: fix error return in vfio_ccw_sch_event

2018-05-02 Thread Dong Jia Shi
If device has not been registered, or there is a pending work, we should reschedule a sch_event call again. Signed-off-by: Dong Jia Shi --- drivers/s390/cio/vfio_ccw_drv.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/s390/cio/vfio_ccw_drv.c b/drivers/s390/cio

[PATCH v2 1/5] vfio: ccw: fix cleanup if cp_prefetch fails

2018-04-23 Thread Dong Jia Shi
elements are excluded) cleanup activities based on false assumptions can be avoided. Let's make sure cp_free works properly after cp_prefetch returns with an error by setting ch_len of a ccw chain to the number of the translated CCWs on that chain. Acked-by: Pierre Morel Reviewed-by: Dong Ji

[PATCH v2 4/5] vfio: ccw: set ccw->cda to NULL defensively

2018-04-23 Thread Dong Jia Shi
Let's avoid free on ccw->cda that points to a guest address or an already freed memory area by setting it to NULL if memory allocation didn't happen or failed. Signed-off-by: Dong Jia Shi --- drivers/s390/cio/vfio_ccw_cp.c | 31 --- 1 file changed,

[PATCH v2 3/5] vfio: ccw: refactor and improve pfn_array_alloc_pin()

2018-04-23 Thread Dong Jia Shi
t was freed. Suggested-by: Pierre Morel , Signed-off-by: Dong Jia Shi --- drivers/s390/cio/vfio_ccw_cp.c | 82 +++--- 1 file changed, 36 insertions(+), 46 deletions(-) diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/drivers/s390/cio/vfio_ccw_cp.c index e8fe7450702e..3

[PATCH v2 2/5] vfio: ccw: shorten kernel doc description for pfn_array_pin()

2018-04-23 Thread Dong Jia Shi
The kernel doc description for usage of the struct pfn_array in pfn_array_pin() is unnecessary long. Let's shorten it by describing the contents of the struct pfn_array fields at the struct's definition instead. Suggested-by: Cornelia Huck Signed-off-by: Dong Jia Shi --- driver

[PATCH v2 5/5] vfio: ccw: add traceponits for interesting error paths

2018-04-23 Thread Dong Jia Shi
From: Halil Pasic Add some tracepoints so we can inspect what is not working as is should. Signed-off-by: Halil Pasic Signed-off-by: Dong Jia Shi --- drivers/s390/cio/Makefile | 1 + drivers/s390/cio/vfio_ccw_fsm.c | 16 +++- drivers/s390/cio/vfio_ccw_trace.h | 77

[PATCH v2 0/5] vfio: ccw: error handling fixes and improvements

2018-04-23 Thread Dong Jia Shi
po fixes. - #2. New patch. - #3. Added the missing suggested-by Pierre. Fixed typos. Added sanity check on pa->pa_iova_pfn and updated comments accordingly. - #4. Removed unused idaw_nr. - #5. Replaced leading white spaces with TABs. Traced the function in anycase. Dong

[PATCH 1/4] vfio: ccw: fix cleanup if cp_prefetch fails

2018-03-20 Thread Dong Jia Shi
elements are excluded) cleanup activities based on false assumptions can be avoided. Let's make sure cp_free works properly after cp_prefetch returns with an error by setting ch_len to 0 for the ccw chains those are not prefetched. Acked-by: Pierre Morel Reviewed-by: Dong Jia Shi Signed-o

[PATCH 3/4] vfio: ccw: set ccw->cda to NULL defensively

2018-03-20 Thread Dong Jia Shi
Let's avoid free on ccw->cda that points to a guest address or a already freed memory area by setting it to NULL if memory allocation didn't happen or failed. Signed-off-by: Dong Jia Shi --- drivers/s390/cio/vfio_ccw_cp.c | 28 +++- 1 file changed, 19 ins

[PATCH 4/4] vfio: ccw: add traceponits for interesting error paths

2018-03-20 Thread Dong Jia Shi
From: Halil Pasic Add some tracepoints so we can inspect what is not working as is should. Signed-off-by: Halil Pasic Signed-off-by: Dong Jia Shi --- drivers/s390/cio/Makefile | 1 + drivers/s390/cio/vfio_ccw_fsm.c | 13 ++ drivers/s390/cio/vfio_ccw_trace.h | 86

[PATCH 2/4] vfio: ccw: refactor and improve pfn_array_alloc_pin()

2018-03-20 Thread Dong Jia Shi
er of pfn_array_pin(). As a result, also remove kernel-doc for pfn_array_pin() and add kernel-doc for pfn_array_alloc_pin(). 2. For a vfio_pin_pages() failure, set pa->pa_nr to zero to indicate zero pages were pinned. 3. Set pa->pa_iova_pfn to NULL right after it was freed. Signed-off-by: D

[PATCH 0/4] vfio: ccw: error handling fixes and improvements

2018-03-20 Thread Dong Jia Shi
idual patches. Thanks. Dong Jia Shi (2): vfio: ccw: refactor and improve pfn_array_alloc_pin() vfio: ccw: set ccw->cda to NULL defensively Halil Pasic (2): vfio: ccw: fix cleanup if cp_prefetch fails vfio: ccw: add traceponits for interesting error paths drivers/s390/cio/Makefile

Re: [Qemu-devel] [RFC PATCH 0/3] vfio: ccw: basic channel path event handling

2018-01-29 Thread Dong Jia Shi
t? > > I'm not sure about the later. What prevents the guest from believing > the (to use your terminology shared) chp 0.00 has become unavailable > if 0.00 becomes unavailable in the host? > > Would that adversely affect the virtual devices? It would at > least look strange. AFAI read the code, this series does not hurt the vritual devices, which always have fixed path information in SCHIB. The strange thing is, the chp 0.00 is both virtual and non-virtual with mix use of virtual and non-virtual devices. And any existing problem is not caused or enhanced by this work. If we can not fix the problem without MCSS support or chp re-modelling in the near future, we should document the problem and the effect. I will do some test on this. > >> >> We'd have to document this either I think. >> >>> Note: this is another unpleasant effect of not having MCSSE in the >>> guest. The original design was to have a separate css for vfio, and >>> then we would not have this kind of a problem. (Virtualization of >>> chps would still be good for migration.) >> Nod. BTW, I don't say that I do not want channel path virtualization in >> the long run. It's just I want a minimal function set more currently >> from what I'm focusing perspective. >> >> THANKS for these insightful questions! >> -- Dong Jia Shi

Re: [Qemu-devel] [RFC PATCH 0/3] vfio: ccw: basic channel path event handling

2018-01-29 Thread Dong Jia Shi
up being ignored)? >> You mean the clash that sharing path 0.00 between a physical dasd and >> the virtio ccw devices? The problem I saw is in the checking of the >> chpid.is_virtual in css_do_rchp(). For a virtual chp, we should generate >> INIT CRWs; while for a non-virtual one, we shouldn't. If the chp is >> shared with virtual and non-virtual device, I don't know what to do >> then... >> >> I don't think we can fix this before we re-modelled the channel path. >> But this is neither introduced nor aggravated by this series, right? > > I'm not sure about the later. What prevents the guest from believing > the (to use your terminology shared) chp 0.00 has become unavailable > if 0.00 becomes unavailable in the host? > > Would that adversely affect the virtual devices? It would at > least look strange. > >> >> We'd have to document this either I think. >> >>> Note: this is another unpleasant effect of not having MCSSE in the >>> guest. The original design was to have a separate css for vfio, and >>> then we would not have this kind of a problem. (Virtualization of >>> chps would still be good for migration.) >> Nod. BTW, I don't say that I do not want channel path virtualization in >> the long run. It's just I want a minimal function set more currently >> from what I'm focusing perspective. >> >> THANKS for these insightful questions! >> -- Dong Jia Shi

[RFC PATCH 2/3] vfio: ccw: introduce channel path irq

2018-01-10 Thread Dong Jia Shi
This introduces a new irq for vfio-ccw to provide channel path related event for userland. Signed-off-by: Dong Jia Shi --- drivers/s390/cio/vfio_ccw_ops.c | 29 + drivers/s390/cio/vfio_ccw_private.h | 2 ++ include/uapi/linux/vfio.h | 1 + 3 files

[RFC PATCH 2/5] vfio/ccw: get schib region info

2018-01-10 Thread Dong Jia Shi
the schib likeness. Signed-off-by: Dong Jia Shi --- hw/vfio/ccw.c | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index 16713f2c52..e673695509 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -32,6 +32,10 @@ typedef

[RFC PATCH 1/5] vfio: linux-headers update for vfio-ccw

2018-01-10 Thread Dong Jia Shi
This is a placeholder for a linux-headers update. Signed-off-by: Dong Jia Shi --- linux-headers/linux/vfio.h | 2 ++ linux-headers/linux/vfio_ccw.h | 6 ++ 2 files changed, 8 insertions(+) diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h index 4312e961ff..24d85be022

[RFC PATCH 3/5] vfio/ccw: get irq info and set up handler for chp irq

2018-01-10 Thread Dong Jia Shi
path information out once got the eventfd signal, and do further process. Signed-off-by: Dong Jia Shi --- hw/vfio/ccw.c | 92 +-- 1 file changed, 70 insertions(+), 22 deletions(-) diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index e673695509

[RFC PATCH 5/5] vfio/ccw: build schib with real schib information

2018-01-10 Thread Dong Jia Shi
le we are at it, touch one line of the comment around by adding white space to make it aligned. Signed-off-by: Dong Jia Shi --- hw/s390x/css.c | 83 - hw/s390x/s390-ccw.c | 20 +++ hw/vfio/ccw.c

[RFC PATCH 4/5] vfio/ccw: update subchanel information block lazily

2018-01-10 Thread Dong Jia Shi
path information update, we only do update if we were signaled. We sets scsw.pno and pmcw.pnom to indicate path related event for a guest. This is a bit lazy, but it works. Signed-off-by: Dong Jia Shi --- hw/s390x/css.c | 14 +-- hw/s390x/s390-ccw.c | 12 + hw

[RFC PATCH 0/5] vfio/ccw: basic channel path event handling

2018-01-10 Thread Dong Jia Shi
Hi Folks, This is the QEMU couterpart for the "basic channel path event handling" series. For more information, please refer to the kernel counterpart. Dong Jia Shi (5): vfio: linux-headers update for vfio-ccw vfio/ccw: get schib region info vfio/ccw: get irq info and set up h

[RFC PATCH 1/3] vfio: ccw: introduce schib region

2018-01-10 Thread Dong Jia Shi
This introduces a new region for vfio-ccw to provide subchannel information for user space. Signed-off-by: Dong Jia Shi --- drivers/s390/cio/vfio_ccw_fsm.c | 21 ++ drivers/s390/cio/vfio_ccw_ops.c | 79 +++-- drivers/s390/cio/vfio_ccw_private.h

[RFC PATCH 3/3] vfio: ccw: handle chp event

2018-01-10 Thread Dong Jia Shi
This adds channel path related event handler for vfio-ccw. This also signals userland when there is a chp event. Signed-off-by: Dong Jia Shi --- drivers/s390/cio/vfio_ccw_drv.c | 51 + drivers/s390/cio/vfio_ccw_fsm.c | 22 drivers

[RFC PATCH 0/3] vfio: ccw: basic channel path event handling

2018-01-10 Thread Dong Jia Shi
Use PIM PAM POM CHPIDs -- 0.0.3f3f 0.0.0002 3390/0c 3990/e9 f0 f0 ff 42434445 #Notice: PAM changed again. Dong Jia Shi (3): vfio: ccw: introduce schib region vfio: ccw: introduce channel path irq vfio: ccw: handle chp event drivers/s390/cio/

[PATCH 2/2] vfio: ccw: validate the count field of a ccw before pinning

2017-10-10 Thread Dong Jia Shi
If the count field of a ccw is zero, there is no need to try to pin page(s) for it. Let's check the count value before starting pinning operations. Reviewed-by: Pierre Morel Signed-off-by: Dong Jia Shi --- drivers/s390/cio/vfio_ccw_cp.c | 18 +- 1 file changed, 17 inser

[PATCH 1/2] vfio: ccw: bypass bad idaw address when fetching IDAL ccws

2017-10-10 Thread Dong Jia Shi
ahead of the bad idaw) could possibly be executed by the device before I/O conclusion. Suggested-by: Halil Pasic Reviewed-by: Pierre Morel Signed-off-by: Dong Jia Shi --- drivers/s390/cio/vfio_ccw_cp.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/dr

[PATCH 0/2] vfio-ccw bugfix

2017-10-10 Thread Dong Jia Shi
Some bugfixes according to recent discussion. Dong Jia Shi (2): vfio: ccw: bypass bad idaw address when fetching IDAL ccws vfio: ccw: validate the count field of a ccw before pinning drivers/s390/cio/vfio_ccw_cp.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions