All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <ljs@kernel.org>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: Sean Christopherson <seanjc@google.com>,
	 Pankaj Gupta <pankaj.gupta@amd.com>,
	pbonzini@redhat.com, tglx@kernel.org, mingo@redhat.com,
	 dave.hansen@linux.intel.com, bp@alien8.de, x86@kernel.org,
	thomas.lendacky@amd.com,  hpa@zytor.com, yangge1116@126.com,
	kvm@vger.kernel.org,  linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] KVM: SEV: drop FOLL_LONGTERM for encrypted region registration
Date: Fri, 10 Jul 2026 17:58:01 +0100	[thread overview]
Message-ID: <alEgyNCMizer6uzB@lucifer> (raw)
In-Reply-To: <ad784f05-b36c-4e91-9f17-4c5b826735d0@kernel.org>

On Fri, Jul 10, 2026 at 06:38:23PM +0200, David Hildenbrand (Arm) wrote:
> >>
> >> How long ago did I break this though? Why has it taken until now for this to be
> >> reported? :) commit 8ac268436e6d ("mm/gup: disallow FOLL_LONGTERM GUP-nonfast
> >> writing to file-backed mappings") is from May 2023 :)
> >
> > The break didn't come from your changes, it came from commit 7e066cb9b71a ("KVM:
> > SEV: Use long-term pin when registering encrypted memory regions").  I suggested
> > falling back to a non-longterm pin, but David didn't like that idea :-)
>
> Yes, a longterm pin is a longterm pin.

Yes it'd be very unwise to not use a longterm pin here!

>
> If we don't write to the memory, why do we need a write pin? To make sure that
> what we pin was actually unshared?
>
> Well, FOLL_LONGTERM does that nowadays.
>
>
> ... so is maybe dropping the FOLL_WRITE sufficient?

That solves the whole thing, as the check is gated on FOLL_WRITE anyway.

I hadn't dug into the code enough there, been scanning.

So that's a simple fix then? :)

>
> --
> Cheers,
>
> David

Cheers, Lorenzo

  reply	other threads:[~2026-07-10 16:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 14:45 [PATCH] KVM: SEV: drop FOLL_LONGTERM for encrypted region registration Pankaj Gupta
2026-07-01 14:58 ` sashiko-bot
2026-07-01 16:25 ` David Hildenbrand (Arm)
2026-07-01 16:30   ` Sean Christopherson
2026-07-01 16:39     ` David Hildenbrand (Arm)
2026-07-01 16:56       ` Sean Christopherson
2026-07-06 12:03   ` Gupta, Pankaj
2026-07-07 10:04     ` David Hildenbrand (Arm)
2026-07-07 13:45       ` Gupta, Pankaj
2026-07-07 13:59         ` Sean Christopherson
2026-07-07 14:58         ` David Hildenbrand (Arm)
2026-07-08 16:35           ` Gupta, Pankaj
2026-07-09 14:28           ` Lorenzo Stoakes
2026-07-09 15:19             ` Gupta, Pankaj
2026-07-09 15:44               ` Lorenzo Stoakes
2026-07-10 12:57                 ` David Hildenbrand (Arm)
2026-07-10 13:05                   ` Lorenzo Stoakes
2026-07-10 15:37                     ` David Hildenbrand (Arm)
2026-07-10 15:47                       ` Sean Christopherson
2026-07-10 16:13                         ` Lorenzo Stoakes
2026-07-10 16:24                           ` Sean Christopherson
2026-07-10 16:38                             ` David Hildenbrand (Arm)
2026-07-10 16:58                               ` Lorenzo Stoakes [this message]
2026-07-10 13:06                   ` Gupta, Pankaj

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=alEgyNCMizer6uzB@lucifer \
    --to=ljs@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=david@kernel.org \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pankaj.gupta@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@kernel.org \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    --cc=yangge1116@126.com \
    /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.