linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Will Deacon <will@kernel.org>
Cc: "Liao, Chang" <liaochang1@huawei.com>,
	Oleg Nesterov <oleg@redhat.com>,
	mhiramat@kernel.org, peterz@infradead.org, mark.rutland@arm.com,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: uprobes: Optimize cache flushes for xol slot
Date: Mon, 23 Sep 2024 17:03:57 +0100	[thread overview]
Message-ID: <ZvGRbeAtpAkZVhLt@arm.com> (raw)
In-Reply-To: <20240923071856.GA31866@willie-the-truck>

On Mon, Sep 23, 2024 at 08:18:57AM +0100, Will Deacon wrote:
> On Mon, Sep 23, 2024 at 09:57:14AM +0800, Liao, Chang wrote:
> > Unfortunately, the comparison assumes the D-cache and I-cache are already
> > in sync for the slot being copied. But this assumption is flawed if we start
> > with a page with some random bits and D-cache has not been sychronized with
> > I-cache. So, besides __GFP_ZERO, should we have a additional cache flush
> > after page allocation?
> 
> No, I think Oleg's right. The initial cache maintenance will happen when the
> executable pte is installed.

For some reason I had kprobes in mind, did not realise that this page
ends up in user-space. So yes, we have cache maintenance when the pte is
set to point to this page. Subsequent changes will need cache
maintenance.

> However, we should use __GFP_ZERO anyway because I don't think it's a
> good idea to map an uninitialised page into userspace.

Oh, that's not good.

-- 
Catalin


  parent reply	other threads:[~2024-09-23 16:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-19 12:17 [PATCH] arm64: uprobes: Optimize cache flushes for xol slot Liao Chang
2024-09-19 14:18 ` Oleg Nesterov
2024-09-20  8:58   ` Liao, Chang
2024-09-20 11:03     ` Oleg Nesterov
2024-09-20 15:32     ` Catalin Marinas
2024-09-20 17:32       ` Oleg Nesterov
2024-09-22 14:09         ` Will Deacon
2024-09-22 14:39           ` Oleg Nesterov
2024-09-23 11:16           ` Liao, Chang
2024-09-23  1:57       ` Liao, Chang
2024-09-23  7:18         ` Will Deacon
2024-09-23 10:52           ` Oleg Nesterov
2024-09-26 12:06             ` Liao, Chang
2024-09-26 16:08               ` Oleg Nesterov
2024-09-23 11:16           ` Liao, Chang
2024-09-23 16:03           ` Catalin Marinas [this message]
2024-11-06  9:55 ` Liao, Chang
2024-11-07 18:35   ` Catalin Marinas
2024-11-08 16:49 ` Catalin Marinas

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=ZvGRbeAtpAkZVhLt@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=liaochang1@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=will@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).