lkml.org 
[lkml]   [2005]   [Apr]   [16]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
/
SubjectRe: Why system call need to copy the date from the userspace before using it
DateSat, 16 Apr 2005 00:50:52 -0400
FromHacksaw <>
Sorry if this bugs anyone, but I'm learning things here.

What I would expect the kernel to do is this:

system_call_data_prep (userdata, size){	
   if !4G/4G {
      for each page from userdata to userdata+size
      {
 	if the page is swapped out, swap it in
	if the page is not owned by the user process, return -ENOWAYMAN
	otherwise, lock the page
      }
      return userdata;
    }
    else { //kernel land and userland are mutually exclusive
	   copy the data into kernel land
	   return kernelland_copy_of_userdata;
          }
}
(And then the syscall would need to run the opposite function 
sys_call_data_unprep to unlock pages.)

Hmm, maybe that interface sucks.

Is it anything close to that? 

-- 
The best is the enemy of the good  -- Voltaire
The Good Enough is the enemy of the Great -- Me
http://www.hacksaw.org -- http://www.privatecircus.com -- KB1FVD


-
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/

\
 
 \ /
  Last update: 2005-04-16 04:55    [W:0.247 / U:0.350 seconds]
©2003-2008 Jasper Spaans