On 4/26/06, Thomas Petazzoni <thomas.petazzoni@xxxxxxxx> wrote: > Hi, > > Le Wed, 26 Apr 2006 19:39:00 +0530, > "Gaurav Dhiman" <gauravd.chd@xxxxxxxxx> a écrit : > > > If I am not wrong, "address" ( got from cr2 register) in > > do_page_fault() will be same as regs->eip , as in Linux we do not use > > the segmentation concept and so the virtual address space is same a s > > linear address space. Correct me if I am wrong anywhere. > > You're wrong. If you execute a code at address A, that does a memory > access at address B, and that a page fault occurs, then regs->eip will > contain address A, and cr2 will contain address B. Thanks Thomas for correcting .... yes youa are right "address" and "regs->eip" can be different. Gaurav > > Of course, there are cases where regs->eip is the faulting address, but > it's not always the case. > > Sincerly, > > Thomas > -- > Thomas Petazzoni - thomas.petazzoni@xxxxxxxx > http://{thomas,sos,kos}.enix.org - http://www.toulibre.org > http://www.{livret,agenda}dulibre.org > > -- > Kernelnewbies: Help each other learn about the Linux kernel. > Archive: http://mail.nl.linux.org/kernelnewbies/ > FAQ: http://kernelnewbies.org/faq/ > > -- -- -Gaurav Email: gauravd.chd@xxxxxxxxx --------------------------------- Read my blog at: http://lkdp.blogspot.com/ --------------------------------- -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/