LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-09-2016, 01:40 PM   #1
Jungsik Choi
LQ Newbie
 
Registered: Dec 2016
Posts: 1

Rep: Reputation: Disabled
How to raise a page fault?


Hello everyone!! I have a question.

I want to generate a page fault intentionally even if the page table entry already exists.

So I cleared a _PAGE_PRESENT bit to generate a page fault.

Here's the kernel code I wrote:

Code:
pte = get_locked_pte(mm, addr, &ptl);
entry = *pte;
entry = pte_clear_flags(entry, _PAGE_PRESENT);
set_pte_at(mm, addr, pte, entry);
pte_unmap_unlock(pte, ptl);
flush_tlb_range(vma, vma->vm_start, vma->vm_end);
However, this code does not work. The page fault I intended does not occur. I want to know exactly how I can trigger a page fault.

Thank you.

Last edited by Jungsik Choi; 12-09-2016 at 03:11 PM.
 
Old 12-11-2016, 08:03 AM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,610
Blog Entries: 4

Rep: Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905
You can't "fake the system to produce a page fault" in this way. You would certainly destroy the integrity of the kernel with such an attempt.

First of all, why do you feel the need to generate a page-fault for data which exists?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrying page fault ataur038 Linux - Kernel 2 09-30-2016 11:24 AM
Page fault kanis Linux - Server 1 03-04-2010 11:52 AM
kprobe-fault handler(how to generate page fault) hnshashi Linux - Newbie 0 11-13-2008 12:25 AM
Page Fault in Nonpaged Area XPediTioN Slackware 0 09-30-2003 07:57 AM
RedHat 8.0 ---> W2k - Page Fault Abrid Linux - Newbie 1 09-18-2003 10:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration