summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorSree Vemuri <Sree.Vemuri@Sun.COM>2009-04-16 16:02:55 -0700
committerSree Vemuri <Sree.Vemuri@Sun.COM>2009-04-16 16:02:55 -0700
commit9b69f4d8bcb72a1963771e18a2e8b2a0b5462a3c (patch)
tree4cf058b9e2d366a745ffb2636ee9880e951e88bd /usr/src
parent286822dd6ee35fa0959e7b55e659b92ea1c12f71 (diff)
downloadillumos-joyent-9b69f4d8bcb72a1963771e18a2e8b2a0b5462a3c.tar.gz
6804371 Fault not reported on domain for UE Hyperpriviledged mode error
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/sun4v/io/ds_pri.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/usr/src/uts/sun4v/io/ds_pri.c b/usr/src/uts/sun4v/io/ds_pri.c
index b7abd6f0ca..edaf086965 100644
--- a/usr/src/uts/sun4v/io/ds_pri.c
+++ b/usr/src/uts/sun4v/io/ds_pri.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -493,6 +493,7 @@ ds_pri_read(dev_t dev, struct uio *uiop, cred_t *credp)
size_t len;
int retval;
caddr_t tmpbufp;
+ offset_t off = uiop->uio_offset;
instance = getminor(dev);
if ((sp = ddi_get_soft_state(ds_pri_statep, instance)) == NULL)
@@ -526,15 +527,9 @@ ds_pri_read(dev_t dev, struct uio *uiop, cred_t *credp)
}
}
- if (uiop->uio_offset < 0 || uiop->uio_offset > sp->ds_pri_len) {
- mutex_exit(&sp->lock);
- return (EINVAL);
- }
-
- if (len > (sp->ds_pri_len - uiop->uio_offset))
- len = sp->ds_pri_len - uiop->uio_offset;
+ if (len > sp->ds_pri_len)
+ len = sp->ds_pri_len;
- /* already checked that offset < ds_pri_len above */
if (len == 0) {
mutex_exit(&sp->lock);
return (0);
@@ -552,13 +547,19 @@ ds_pri_read(dev_t dev, struct uio *uiop, cred_t *credp)
*/
tmpbufp = kmem_alloc(len, KM_SLEEP);
- bcopy(((caddr_t)sp->ds_pri) + uiop->uio_offset, tmpbufp, len);
+ bcopy(((caddr_t)sp->ds_pri), tmpbufp, len);
mutex_exit(&sp->lock);
retval = uiomove(tmpbufp, len, UIO_READ, uiop);
kmem_free(tmpbufp, len);
+ /*
+ * restore uio_offset after uiomove since the driver
+ * does not support the concept of position.
+ */
+ uiop->uio_offset = off;
+
return (retval);
}