kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/1] vfio-ccw: one bugfix for 4.12
@ 2017-07-24 16:47 Cornelia Huck
  2017-07-24 16:47 ` [PULL 1/1] vfio: ccw: fix bad ptr math for TIC cda translation Cornelia Huck
  2017-07-26  6:28 ` [PULL 0/1] vfio-ccw: one bugfix for 4.12 Martin Schwidefsky
  0 siblings, 2 replies; 4+ messages in thread
From: Cornelia Huck @ 2017-07-24 16:47 UTC (permalink / raw)
  To: schwidefsky; +Cc: bjsdjshi, borntraeger, linux-s390, kvm, Cornelia Huck

The following changes since commit 97ca7bfc19605bc08e9183441b8b8545e84032d6:

  s390/mm: set change and reference bit on lazy key enablement (2017-07-13 11:28:29 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw.git tags/vfio-ccw-20170724

for you to fetch changes up to c389377c01bf2d6e2a178e86aef8535931bfbd75:

  vfio: ccw: fix bad ptr math for TIC cda translation (2017-07-24 09:54:37 +0200)

----------------------------------------------------------------
A bugfix in the ccw translation code.

----------------------------------------------------------------
Jason J. Herne (1):
      vfio: ccw: fix bad ptr math for TIC cda translation

 drivers/s390/cio/vfio_ccw_cp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Jason J. Herne (1):
  vfio: ccw: fix bad ptr math for TIC cda translation

 drivers/s390/cio/vfio_ccw_cp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.13.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PULL 1/1] vfio: ccw: fix bad ptr math for TIC cda translation
  2017-07-24 16:47 [PULL 0/1] vfio-ccw: one bugfix for 4.12 Cornelia Huck
@ 2017-07-24 16:47 ` Cornelia Huck
  2017-07-26  6:28 ` [PULL 0/1] vfio-ccw: one bugfix for 4.12 Martin Schwidefsky
  1 sibling, 0 replies; 4+ messages in thread
From: Cornelia Huck @ 2017-07-24 16:47 UTC (permalink / raw)
  To: schwidefsky
  Cc: bjsdjshi, borntraeger, linux-s390, kvm, Jason J. Herne, Cornelia Huck

From: "Jason J. Herne" <jjherne@linux.vnet.ibm.com>

When we are translating channel data addresses from guest to host
address space for TIC instructions we are getting incorrect
addresses because of a pointer arithmetic error.

We currently calculate the offset of the TIC's cda from the start
of the channel program chain (ccw->cda - ccw_head). We then add
that to the address of the ccw chain in host memory (iter->ch_ccw).
The problem is that iter->ch_ccw is a pointer to struct ccw1 so
when we increment it we are actually incrementing by the size of
struct ccw1 which is 8 bytes. The intent was to increment by
n-bytes, not n*8.

The fix: cast iter->ch_ccw to char* so it will be incremented by
n*1.

Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
Signed-off-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Message-Id: <20170721011436.76112-1-bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 drivers/s390/cio/vfio_ccw_cp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/drivers/s390/cio/vfio_ccw_cp.c
index ba6ac83a6c25..5ccfdc80d0ec 100644
--- a/drivers/s390/cio/vfio_ccw_cp.c
+++ b/drivers/s390/cio/vfio_ccw_cp.c
@@ -481,7 +481,7 @@ static int ccwchain_fetch_tic(struct ccwchain *chain,
 		ccw_tail = ccw_head + (iter->ch_len - 1) * sizeof(struct ccw1);
 
 		if ((ccw_head <= ccw->cda) && (ccw->cda <= ccw_tail)) {
-			ccw->cda = (__u32) (addr_t) (iter->ch_ccw +
+			ccw->cda = (__u32) (addr_t) (((char *)iter->ch_ccw) +
 						     (ccw->cda - ccw_head));
 			return 0;
 		}
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PULL 0/1] vfio-ccw: one bugfix for 4.12
  2017-07-24 16:47 [PULL 0/1] vfio-ccw: one bugfix for 4.12 Cornelia Huck
  2017-07-24 16:47 ` [PULL 1/1] vfio: ccw: fix bad ptr math for TIC cda translation Cornelia Huck
@ 2017-07-26  6:28 ` Martin Schwidefsky
  2017-07-26  8:36   ` Cornelia Huck
  1 sibling, 1 reply; 4+ messages in thread
From: Martin Schwidefsky @ 2017-07-26  6:28 UTC (permalink / raw)
  To: Cornelia Huck; +Cc: bjsdjshi, borntraeger, linux-s390, kvm

On Mon, 24 Jul 2017 18:47:00 +0200
Cornelia Huck <cohuck@redhat.com> wrote:

> The following changes since commit 97ca7bfc19605bc08e9183441b8b8545e84032d6:
> 
>   s390/mm: set change and reference bit on lazy key enablement (2017-07-13 11:28:29 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw.git tags/vfio-ccw-20170724
> 
> for you to fetch changes up to c389377c01bf2d6e2a178e86aef8535931bfbd75:
> 
>   vfio: ccw: fix bad ptr math for TIC cda translation (2017-07-24 09:54:37 +0200)
> 
> ----------------------------------------------------------------
> A bugfix in the ccw translation code.
> 
> ----------------------------------------------------------------

Applied to s390/linux:features. Thanks.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PULL 0/1] vfio-ccw: one bugfix for 4.12
  2017-07-26  6:28 ` [PULL 0/1] vfio-ccw: one bugfix for 4.12 Martin Schwidefsky
@ 2017-07-26  8:36   ` Cornelia Huck
  0 siblings, 0 replies; 4+ messages in thread
From: Cornelia Huck @ 2017-07-26  8:36 UTC (permalink / raw)
  To: Martin Schwidefsky; +Cc: bjsdjshi, borntraeger, linux-s390, kvm

On Wed, 26 Jul 2017 08:28:53 +0200
Martin Schwidefsky <schwidefsky@de.ibm.com> wrote:

> On Mon, 24 Jul 2017 18:47:00 +0200
> Cornelia Huck <cohuck@redhat.com> wrote:
> 
> > The following changes since commit 97ca7bfc19605bc08e9183441b8b8545e84032d6:
> > 
> >   s390/mm: set change and reference bit on lazy key enablement (2017-07-13 11:28:29 +0200)
> > 
> > are available in the git repository at:
> > 
> >   git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw.git tags/vfio-ccw-20170724
> > 
> > for you to fetch changes up to c389377c01bf2d6e2a178e86aef8535931bfbd75:
> > 
> >   vfio: ccw: fix bad ptr math for TIC cda translation (2017-07-24 09:54:37 +0200)
> > 
> > ----------------------------------------------------------------
> > A bugfix in the ccw translation code.
> > 
> > ----------------------------------------------------------------  
> 
> Applied to s390/linux:features. Thanks.
> 

Thanks. Would you consider to push this out as a bugfix if you have
anything else queued up as well?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-26  8:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-24 16:47 [PULL 0/1] vfio-ccw: one bugfix for 4.12 Cornelia Huck
2017-07-24 16:47 ` [PULL 1/1] vfio: ccw: fix bad ptr math for TIC cda translation Cornelia Huck
2017-07-26  6:28 ` [PULL 0/1] vfio-ccw: one bugfix for 4.12 Martin Schwidefsky
2017-07-26  8:36   ` Cornelia Huck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).