public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Mapping non-page aligned data to user
@ 2009-02-06  0:15 Vira
  2009-02-06  0:27 ` Robert Hancock
  0 siblings, 1 reply; 4+ messages in thread
From: Vira @ 2009-02-06  0:15 UTC (permalink / raw)
  To: linux-kernel

Hi, 

Is there a way to map a non-page aligned kernel physical address to user virtual address? remap_pfn_range and vm_insert_page operate only on page-aligned physical addresses.

If there is no such support, would it be too complicated to try out
writing something on my own to map non-page aligned addresses (the data
size is under my control - so I can make that a multiple of page size)?

Any suggestions appreciated.

Thanks
-- Vira


      

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

* Re: Mapping non-page aligned data to user
  2009-02-06  0:15 Mapping non-page aligned data to user Vira
@ 2009-02-06  0:27 ` Robert Hancock
  2009-02-06  2:29   ` Vira
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Hancock @ 2009-02-06  0:27 UTC (permalink / raw)
  To: Vira; +Cc: linux-kernel

Vira wrote:
> Hi, 
> 
> Is there a way to map a non-page aligned kernel physical address to user virtual address? remap_pfn_range and vm_insert_page operate only on page-aligned physical addresses.
> 
> If there is no such support, would it be too complicated to try out
> writing something on my own to map non-page aligned addresses (the data
> size is under my control - so I can make that a multiple of page size)?
> 
> Any suggestions appreciated.

The CPU, and therefore the kernel, couldn't ensure that the user doesn't 
write outside the mapped region of kernel memory if it's not page 
aligned (the access control is page granularity only). That seems like 
it would be a show-stopper in most cases.

What exactly is it you're trying to achieve with this?

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

* Re: Mapping non-page aligned data to user
  2009-02-06  0:27 ` Robert Hancock
@ 2009-02-06  2:29   ` Vira
  0 siblings, 0 replies; 4+ messages in thread
From: Vira @ 2009-02-06  2:29 UTC (permalink / raw)
  To: linux-kernel

I am trying to map DMAed packets directly to contiguous user buffer (avoiding the copy)- thinking of how to skip the packet headers here.

Thx,
-- vira

--- On Thu, 2/5/09, Robert Hancock <hancockrwd@gmail.com> wrote:

> From: Robert Hancock <hancockrwd@gmail.com>
> Subject: Re: Mapping non-page aligned data to user
> To: linux-kernel@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Date: Thursday, February 5, 2009, 4:27 PM
> Vira wrote:
> > Hi, 
> > Is there a way to map a non-page aligned kernel
> physical address to user virtual address? remap_pfn_range
> and vm_insert_page operate only on page-aligned physical
> addresses.
> > 
> > If there is no such support, would it be too
> complicated to try out
> > writing something on my own to map non-page aligned
> addresses (the data
> > size is under my control - so I can make that a
> multiple of page size)?
> > 
> > Any suggestions appreciated.
> 
> The CPU, and therefore the kernel, couldn't ensure that
> the user doesn't write outside the mapped region of
> kernel memory if it's not page aligned (the access
> control is page granularity only). That seems like it would
> be a show-stopper in most cases.
> 
> What exactly is it you're trying to achieve with this?
> 
> --
> To unsubscribe from this list: send the line
> "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at 
> http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


      

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

* Re: Mapping non-page aligned data to user
       [not found] <c2mBW-7mZ-15@gated-at.bofh.it>
@ 2009-02-06  9:32 ` Bodo Eggert
  0 siblings, 0 replies; 4+ messages in thread
From: Bodo Eggert @ 2009-02-06  9:32 UTC (permalink / raw)
  To: Vira, linux-kernel

Vira <sri1369_s@yahoo.com> wrote:

> Is there a way to map a non-page aligned kernel physical address to user
> virtual address? remap_pfn_range and vm_insert_page operate only on
> page-aligned physical addresses.
> 
> If there is no such support, would it be too complicated to try out
> writing something on my own to map non-page aligned addresses (the data
> size is under my control - so I can make that a multiple of page size)?
> 
> Any suggestions appreciated.

It can only be done using segmented memory, and you don't want that.


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

end of thread, other threads:[~2009-02-06  9:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-06  0:15 Mapping non-page aligned data to user Vira
2009-02-06  0:27 ` Robert Hancock
2009-02-06  2:29   ` Vira
     [not found] <c2mBW-7mZ-15@gated-at.bofh.it>
2009-02-06  9:32 ` Bodo Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox