Re: [PATCH 1/2] uio: provide vm access to UIO_MEM_PHYS maps

2013-07-27 Thread Uwe Kleine-König
On Fri, Jul 26, 2013 at 05:58:10PM -0700, Greg Kroah-Hartman wrote:
> On Tue, Jul 16, 2013 at 07:21:03PM +0200, Uwe Kleine-König wrote:
> > This makes it possible to let gdb access mappings of the process that is
> > being debugged.
> > 
> > uio_mmap_logical was moved and uio_vm_ops renamed to group related code
> > and differentiate to new stuff.
> > 
> > Signed-off-by: Uwe Kleine-König 
> 
> This patch breaks the build:
> 
> drivers/uio/uio.c: In function ‘uio_mmap_logical’:
> drivers/uio/uio.c:627:17: error: ‘uio_vm_ops’ undeclared (first use in this 
> function)
Hmm, in my original patch this is OK, I don't have no idea how I could
bork that for submission. While looking into that problem I noticed that
there is yet another problem. I will send a fixed patch early next week.

Best regards and thanks for testing,
Uwe

-- 
Pengutronix e.K.   | Uwe Kleine-König|
Industrial Linux Solutions | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] uio: provide vm access to UIO_MEM_PHYS maps

2013-07-27 Thread Uwe Kleine-König
On Fri, Jul 26, 2013 at 05:58:10PM -0700, Greg Kroah-Hartman wrote:
 On Tue, Jul 16, 2013 at 07:21:03PM +0200, Uwe Kleine-König wrote:
  This makes it possible to let gdb access mappings of the process that is
  being debugged.
  
  uio_mmap_logical was moved and uio_vm_ops renamed to group related code
  and differentiate to new stuff.
  
  Signed-off-by: Uwe Kleine-König u.kleine-koe...@pengutronix.de
 
 This patch breaks the build:
 
 drivers/uio/uio.c: In function ‘uio_mmap_logical’:
 drivers/uio/uio.c:627:17: error: ‘uio_vm_ops’ undeclared (first use in this 
 function)
Hmm, in my original patch this is OK, I don't have no idea how I could
bork that for submission. While looking into that problem I noticed that
there is yet another problem. I will send a fixed patch early next week.

Best regards and thanks for testing,
Uwe

-- 
Pengutronix e.K.   | Uwe Kleine-König|
Industrial Linux Solutions | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] uio: provide vm access to UIO_MEM_PHYS maps

2013-07-26 Thread Greg Kroah-Hartman
On Tue, Jul 16, 2013 at 07:21:03PM +0200, Uwe Kleine-König wrote:
> This makes it possible to let gdb access mappings of the process that is
> being debugged.
> 
> uio_mmap_logical was moved and uio_vm_ops renamed to group related code
> and differentiate to new stuff.
> 
> Signed-off-by: Uwe Kleine-König 

This patch breaks the build:

drivers/uio/uio.c: In function ‘uio_mmap_logical’:
drivers/uio/uio.c:627:17: error: ‘uio_vm_ops’ undeclared (first use in this 
function)

:(
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] uio: provide vm access to UIO_MEM_PHYS maps

2013-07-26 Thread Greg Kroah-Hartman
On Tue, Jul 16, 2013 at 07:21:03PM +0200, Uwe Kleine-König wrote:
 This makes it possible to let gdb access mappings of the process that is
 being debugged.
 
 uio_mmap_logical was moved and uio_vm_ops renamed to group related code
 and differentiate to new stuff.
 
 Signed-off-by: Uwe Kleine-König u.kleine-koe...@pengutronix.de

This patch breaks the build:

drivers/uio/uio.c: In function ‘uio_mmap_logical’:
drivers/uio/uio.c:627:17: error: ‘uio_vm_ops’ undeclared (first use in this 
function)

:(
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] uio: provide vm access to UIO_MEM_PHYS maps

2013-07-16 Thread Uwe Kleine-König
This makes it possible to let gdb access mappings of the process that is
being debugged.

uio_mmap_logical was moved and uio_vm_ops renamed to group related code
and differentiate to new stuff.

Signed-off-by: Uwe Kleine-König 
---
 drivers/uio/uio.c | 24 +++-
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index 3b96f18..159cfb3 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -630,12 +630,24 @@ static int uio_vma_fault(struct vm_area_struct *vma, 
struct vm_fault *vmf)
return 0;
 }
 
-static const struct vm_operations_struct uio_vm_ops = {
+static const struct vm_operations_struct uio_logical_vm_ops = {
.open = uio_vma_open,
.close = uio_vma_close,
.fault = uio_vma_fault,
 };
 
+static int uio_mmap_logical(struct vm_area_struct *vma)
+{
+   vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
+   vma->vm_ops = _vm_ops;
+   uio_vma_open(vma);
+   return 0;
+}
+
+static const struct vm_operations_struct uio_physical_vm_ops = {
+   .access = generic_access_phys,
+};
+
 static int uio_mmap_physical(struct vm_area_struct *vma)
 {
struct uio_device *idev = vma->vm_private_data;
@@ -643,6 +655,8 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
if (mi < 0)
return -EINVAL;
 
+   vma->vm_ops = _physical_vm_ops;
+
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 
return remap_pfn_range(vma,
@@ -652,14 +666,6 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
   vma->vm_page_prot);
 }
 
-static int uio_mmap_logical(struct vm_area_struct *vma)
-{
-   vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
-   vma->vm_ops = _vm_ops;
-   uio_vma_open(vma);
-   return 0;
-}
-
 static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
 {
struct uio_listener *listener = filep->private_data;
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] uio: provide vm access to UIO_MEM_PHYS maps

2013-07-16 Thread Uwe Kleine-König
This makes it possible to let gdb access mappings of the process that is
being debugged.

uio_mmap_logical was moved and uio_vm_ops renamed to group related code
and differentiate to new stuff.

Signed-off-by: Uwe Kleine-König u.kleine-koe...@pengutronix.de
---
 drivers/uio/uio.c | 24 +++-
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index 3b96f18..159cfb3 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -630,12 +630,24 @@ static int uio_vma_fault(struct vm_area_struct *vma, 
struct vm_fault *vmf)
return 0;
 }
 
-static const struct vm_operations_struct uio_vm_ops = {
+static const struct vm_operations_struct uio_logical_vm_ops = {
.open = uio_vma_open,
.close = uio_vma_close,
.fault = uio_vma_fault,
 };
 
+static int uio_mmap_logical(struct vm_area_struct *vma)
+{
+   vma-vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
+   vma-vm_ops = uio_vm_ops;
+   uio_vma_open(vma);
+   return 0;
+}
+
+static const struct vm_operations_struct uio_physical_vm_ops = {
+   .access = generic_access_phys,
+};
+
 static int uio_mmap_physical(struct vm_area_struct *vma)
 {
struct uio_device *idev = vma-vm_private_data;
@@ -643,6 +655,8 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
if (mi  0)
return -EINVAL;
 
+   vma-vm_ops = uio_physical_vm_ops;
+
vma-vm_page_prot = pgprot_noncached(vma-vm_page_prot);
 
return remap_pfn_range(vma,
@@ -652,14 +666,6 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
   vma-vm_page_prot);
 }
 
-static int uio_mmap_logical(struct vm_area_struct *vma)
-{
-   vma-vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
-   vma-vm_ops = uio_vm_ops;
-   uio_vma_open(vma);
-   return 0;
-}
-
 static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
 {
struct uio_listener *listener = filep-private_data;
-- 
1.8.3.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] uio: provide vm access to UIO_MEM_PHYS maps

2013-04-26 Thread Uwe Kleine-König
This makes it possible to let gdb access mappings of the process that is
being debugged.

uio_mmap_logical was moved and uio_vm_ops renamed to group related code
and differentiate to new stuff.

Signed-off-by: Uwe Kleine-König 
---
 drivers/uio/uio.c | 24 +++-
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index c8b9262..f9c905a 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -629,12 +629,24 @@ static int uio_vma_fault(struct vm_area_struct *vma, 
struct vm_fault *vmf)
return 0;
 }
 
-static const struct vm_operations_struct uio_vm_ops = {
+static const struct vm_operations_struct uio_logical_vm_ops = {
.open = uio_vma_open,
.close = uio_vma_close,
.fault = uio_vma_fault,
 };
 
+static int uio_mmap_logical(struct vm_area_struct *vma)
+{
+   vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
+   vma->vm_ops = _vm_ops;
+   uio_vma_open(vma);
+   return 0;
+}
+
+static const struct vm_operations_struct uio_physical_vm_ops = {
+   .access = generic_access_phys,
+};
+
 static int uio_mmap_physical(struct vm_area_struct *vma)
 {
struct uio_device *idev = vma->vm_private_data;
@@ -642,6 +654,8 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
if (mi < 0)
return -EINVAL;
 
+   vma->vm_ops = _physical_vm_ops;
+
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 
return remap_pfn_range(vma,
@@ -651,14 +665,6 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
   vma->vm_page_prot);
 }
 
-static int uio_mmap_logical(struct vm_area_struct *vma)
-{
-   vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
-   vma->vm_ops = _vm_ops;
-   uio_vma_open(vma);
-   return 0;
-}
-
 static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
 {
struct uio_listener *listener = filep->private_data;
-- 
1.8.2.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] uio: provide vm access to UIO_MEM_PHYS maps

2013-04-26 Thread Uwe Kleine-König
This makes it possible to let gdb access mappings of the process that is
being debugged.

uio_mmap_logical was moved and uio_vm_ops renamed to group related code
and differentiate to new stuff.

Signed-off-by: Uwe Kleine-König u.kleine-koe...@pengutronix.de
---
 drivers/uio/uio.c | 24 +++-
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index c8b9262..f9c905a 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -629,12 +629,24 @@ static int uio_vma_fault(struct vm_area_struct *vma, 
struct vm_fault *vmf)
return 0;
 }
 
-static const struct vm_operations_struct uio_vm_ops = {
+static const struct vm_operations_struct uio_logical_vm_ops = {
.open = uio_vma_open,
.close = uio_vma_close,
.fault = uio_vma_fault,
 };
 
+static int uio_mmap_logical(struct vm_area_struct *vma)
+{
+   vma-vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
+   vma-vm_ops = uio_vm_ops;
+   uio_vma_open(vma);
+   return 0;
+}
+
+static const struct vm_operations_struct uio_physical_vm_ops = {
+   .access = generic_access_phys,
+};
+
 static int uio_mmap_physical(struct vm_area_struct *vma)
 {
struct uio_device *idev = vma-vm_private_data;
@@ -642,6 +654,8 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
if (mi  0)
return -EINVAL;
 
+   vma-vm_ops = uio_physical_vm_ops;
+
vma-vm_page_prot = pgprot_noncached(vma-vm_page_prot);
 
return remap_pfn_range(vma,
@@ -651,14 +665,6 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
   vma-vm_page_prot);
 }
 
-static int uio_mmap_logical(struct vm_area_struct *vma)
-{
-   vma-vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
-   vma-vm_ops = uio_vm_ops;
-   uio_vma_open(vma);
-   return 0;
-}
-
 static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
 {
struct uio_listener *listener = filep-private_data;
-- 
1.8.2.rc2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/