From mboxrd@z Thu Jan 1 00:00:00 1970 From: kernelnewbies@mail.i88.de (Micha M.) Date: Fri, 10 Jun 2011 09:46:39 +0200 Subject: Calling function from address In-Reply-To: References: <20110607204716.GV1112@mailer.i88.de> <20110609195012.GJ13434@mailer.i88.de> Message-ID: <20110610074638.GO13434@mailer.i88.de> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Fri, Jun 10, 2011 at 07:30:46AM +0800, Gavin Guo wrote: > > So maybe I have to explain some more. There is some code located in the > > pysical address space and I need to call it from a kernel module. The > > problem is, that the code must be run from that location it is stored (it > > contains absolute jumps). So I'd like to be able to run that code in that > > address space, or to "tell" the keeernel to ignore page faults/memory > > protection on a certain address range, so that I can jump there run the > > code and return to the caller (kernel module) > > What is the architecture do you use? ex: x86, arm, mips,... ARM. > I know in some platform like andes, it is possible to turn off the > virtual memory. > Then you can jump to the physical address. After doing what you want, turning on > virtual memory again. Finally, system return to the normal operation. > However, the > code is a little tricky. Before turning off the virtual memory, you > must lock the > code jumping to physical address in cache. Otherwise, behaviors, after > turning off > the cache, is unpredictable. > > Gavin Guo -- /* To err is human; to really fuck things up requires the root password */