Skip to contentSkip to conversation

The 720/50 saga continues...

parisc-linux Jochen Friedrich 1 participant 1 message Sep 26, 2001 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi Jurij,

Quoted 3 lines

down_read(&mm->mmap_sem);
vma = find_vma_prev(mm, address, &prev_vma);

I was roughly thinking about something like this (completely untested!!!):

case 18:
if (in_interrupt() || !mm)
goto pagefault; /* shouldn't happen */

/* FIXME: do propper locking here */

pgd = pgd_offset(mm, address); /* page directory */
if (pgd_none(pgd) || pgd_bad(pgd))
goto pagefault; /* expandable stack etc */

pmd = pmd_offset(pgd, address); /* middle page directory */
if (pmd_none(pmd) || pmd_bad((pmd))
goto pagefault; /* expandable stack etc */

pte = pte_offset(pmd, address); /* page table entry */
if (pte_none(pte))
goto pagefault; /* expandable stack etc */

if (!pte_present(pte)) /* is this test sufficient? */
goto pagefault; /* page not loaded */

acc_type = parisc_acctyp(code,regs->iir);

if ((acc_type & VM_WRITE) && (!(pte_write(pte))))
goto pagefault; /* Write protected access */

if ((acc_type & VM_READ) && (!(pte_read(pte))))
goto pagefault; /* Read protected access */

if ((acc_type & VM_EXEC) && (!(pte_exec(pte))))
goto pagefault; /* Exec protected access */

/* fall through to case 28 */

Does this make sense?

Cheers,
Jochen