All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dimitri Sivanich <sivanich@hpe.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: David Hildenbrand <david@redhat.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Dan Carpenter <dan.carpenter@linaro.org>,
	linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <liam.howlett@oracle.com>,
	Laurent Dufour <ldufour@linux.ibm.com>,
	Michel Lespinasse <michel@lespinasse.org>,
	Jerome Glisse <jglisse@google.com>,
	Michal Hocko <mhocko@suse.com>, Vlastimil Babka <vbabka@suse.cz>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Peter Xu <peterx@redhat.com>,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Steve Wahl <steve.wahl@hpe.com>
Subject: Re: [bug report] mm: replace vma->vm_flags direct modifications with modifier calls
Date: Mon, 17 Jul 2023 14:54:03 -0500	[thread overview]
Message-ID: <20230717195403.GA6016@hpe.com> (raw)
In-Reply-To: <ZK8AMisNxhF/bJsU@casper.infradead.org>

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.


      reply	other threads:[~2023-07-17 19:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11  7:21 [bug report] mm: replace vma->vm_flags direct modifications with modifier calls Dan Carpenter
2023-07-11 21:55 ` Suren Baghdasaryan
2023-07-11 22:21   ` Matthew Wilcox
2023-07-11 23:45     ` Suren Baghdasaryan
2023-07-12  7:35       ` David Hildenbrand
2023-07-12 15:01         ` Suren Baghdasaryan
2023-07-12 15:52           ` Matthew Wilcox
2023-07-12 15:55             ` David Hildenbrand
2023-07-12 16:03               ` Suren Baghdasaryan
2023-07-12 18:49               ` Matthew Wilcox
2023-07-12 18:52                 ` David Hildenbrand
2023-07-12 19:48                   ` Suren Baghdasaryan
2023-07-17  6:13                     ` Yan Zhao
2023-07-17 16:18                       ` Suren Baghdasaryan
2023-07-18  0:27                         ` Yan Zhao
2023-07-18 16:27                           ` Suren Baghdasaryan
2023-07-12 19:34                 ` Matthew Wilcox
2023-07-17 19:54                   ` Dimitri Sivanich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230717195403.GA6016@hpe.com \
    --to=sivanich@hpe.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.carpenter@linaro.org \
    --cc=david@redhat.com \
    --cc=dimitri.sivanich@hpe.com \
    --cc=hannes@cmpxchg.org \
    --cc=jglisse@google.com \
    --cc=ldufour@linux.ibm.com \
    --cc=liam.howlett@oracle.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=michel@lespinasse.org \
    --cc=peterx@redhat.com \
    --cc=steve.wahl@hpe.com \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.