Re: [bug report] mm: replace vma->vm_flags direct modifications with modifier calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 12, 2023 at 08:34:10PM +0100, Matthew Wilcox wrote:
> On Wed, Jul 12, 2023 at 07:49:53PM +0100, Matthew Wilcox wrote:
> > @@ -964,9 +966,12 @@ vm_fault_t gru_fault(struct vm_fault *vmf)
> >  		}
> >  		gru_load_context(gts);
> >  		paddr = gseg_physical_address(gts->ts_gru, gts->ts_ctxnum);
> > -		remap_pfn_range(vma, vaddr & ~(GRU_GSEG_PAGESIZE - 1),
> > -				paddr >> PAGE_SHIFT, GRU_GSEG_PAGESIZE,
> > -				vma->vm_page_prot);
> > +
> > +		pte = pfn_pte(paddr / PAGE_SIZE, vma->vm_page_prot);
> > +		ptep = vmf->pte - (vaddr % GRU_GSEG_PAGESIZE) / PAGE_SIZE;
> > +		set_ptes(vma->vm_mm, vaddr & ~(GRU_GSEG_PAGESIZE - 1),
> > +				ptep, pte_mkspecial(pte),
> > +				GRU_GSEG_PAGESIZE / PAGE_SIZE);
> >  	}
> 
> Argh, no, this is wrong.  The page table isn't mapped at this point.
> What we want is a cross between vmf_insert_pfn() and vm_insert_pages().
> Let me add that ...

I should be able to test this once you have something ready.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux