From: David Hildenbrand <david@redhat.com>
To: kalyazin@amazon.com, James Houghton <jthoughton@google.com>,
"Kalyazin, Nikita" <kalyazin@amazon.co.uk>
Cc: "pbonzini@redhat.com" <pbonzini@redhat.com>,
"shuah@kernel.org" <shuah@kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-kselftest@vger.kernel.org"
<linux-kselftest@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"michael.day@amd.com" <michael.day@amd.com>,
"Roy, Patrick" <roypat@amazon.co.uk>,
"Thomson, Jack" <jackabt@amazon.co.uk>,
"Manwaring, Derek" <derekmn@amazon.com>,
"Cali, Marco" <xmarcalx@amazon.co.uk>
Subject: Re: [PATCH v5 1/2] KVM: guest_memfd: add generic population via write
Date: Fri, 12 Sep 2025 15:36:21 +0200 [thread overview]
Message-ID: <8e55ba3a-e7ae-422a-9c79-11aa0e17eae9@redhat.com> (raw)
In-Reply-To: <87d562a1-89fe-42a8-aa53-c052acf4c564@amazon.com>
On 11.09.25 12:15, Nikita Kalyazin wrote:
>
>
> On 10/09/2025 22:23, James Houghton wrote:
>> On Tue, Sep 2, 2025 at 4:20 AM Kalyazin, Nikita <kalyazin@amazon.co.uk> wrote:
>>>
>>> From: Nikita Kalyazin <kalyazin@amazon.com>
>>
>> Hi Nikita,
>
> Hi James,
>
> Thanks for the review!
>
>
>>>
>>> write syscall populates guest_memfd with user-supplied data in a generic
>>> way, ie no vendor-specific preparation is performed. This is supposed
>>> to be used in non-CoCo setups where guest memory is not
>>> hardware-encrypted.
>>
>> What's meant to happen if we do use this for CoCo VMs? I would expect
>> write() to fail, but I don't see why it would (seems like we need/want
>> a check that we aren't write()ing to private memory).
>
> I am not so sure that write() should fail even in CoCo VMs if we access
> not-yet-prepared pages. My understanding was that the CoCoisation of
> the memory occurs during "preparation". But I may be wrong here.
But how do you handle that a page is actually inaccessible and should
not be touched?
IOW, with CXL you could crash the host.
There is likely some state check missing, or it should be restricted to
VM types.
Do we know how this would interact with the direct-map removal?
--
Cheers
David / dhildenb
next prev parent reply other threads:[~2025-09-12 13:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 11:19 [PATCH v5 0/2] KVM: guest_memfd: use write for population Kalyazin, Nikita
2025-09-02 11:20 ` [PATCH v5 1/2] KVM: guest_memfd: add generic population via write Kalyazin, Nikita
2025-09-10 21:23 ` James Houghton
2025-09-11 10:15 ` Nikita Kalyazin
2025-09-12 13:36 ` David Hildenbrand [this message]
2025-09-12 14:48 ` Nikita Kalyazin
2025-09-12 15:39 ` David Hildenbrand
2025-09-13 0:18 ` Vishal Annapurve
2025-09-15 11:01 ` Nikita Kalyazin
2025-09-12 22:34 ` James Houghton
2025-09-13 0:32 ` Vishal Annapurve
2025-09-15 11:00 ` Nikita Kalyazin
2025-09-16 1:08 ` Vishal Annapurve
2025-09-15 11:00 ` Nikita Kalyazin
2025-09-02 11:20 ` [PATCH v5 2/2] KVM: selftests: update guest_memfd write tests Kalyazin, Nikita
2025-09-10 21:37 ` [PATCH v5 0/2] KVM: guest_memfd: use write for population James Houghton
2025-09-11 10:15 ` Nikita Kalyazin
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=8e55ba3a-e7ae-422a-9c79-11aa0e17eae9@redhat.com \
--to=david@redhat.com \
--cc=derekmn@amazon.com \
--cc=jackabt@amazon.co.uk \
--cc=jthoughton@google.com \
--cc=kalyazin@amazon.co.uk \
--cc=kalyazin@amazon.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=michael.day@amd.com \
--cc=pbonzini@redhat.com \
--cc=roypat@amazon.co.uk \
--cc=shuah@kernel.org \
--cc=xmarcalx@amazon.co.uk \
/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