From: David Hildenbrand <david@redhat.com>
To: Zheyun Shen <szy0127@sjtu.edu.cn>,
Jason Wang <jasowang@redhat.com>, mst <mst@redhat.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
virtualization <virtualization@lists.linux.dev>,
xuanzhuo <xuanzhuo@linux.alibaba.com>
Subject: Re: [PATCH] driver/virtio: Add Memory Balloon Support for SEV/SEV-ES
Date: Thu, 11 Jan 2024 09:22:56 +0100 [thread overview]
Message-ID: <dfb2662d-900e-4b36-b2a0-78ad7f397861@redhat.com> (raw)
In-Reply-To: <1824181559.1228150.1704954908335.JavaMail.zimbra@sjtu.edu.cn>
>>> For now, SEV pins guest's memory to avoid swapping or
>>> moving ciphertext, but leading to the inhibition of
>>> Memory Ballooning.
>>>
>>> In Memory Ballooning, only guest's free pages will be relocated
>>> in balloon inflation and deflation, so the difference of plaintext
>>> doesn't matter to guest.
>
>> This seems only true if the page is zeroed, is this true here?
>
> Sorry, I cannot figure out why the pages should be zeroed. I think
> both host kernel and guest kernel assume that the pages are not
> zeroed and will use kzalloc or manually zero them in real applications,
> which is same as non-SEV environments.
balloon_page_alloc() will not zero the memory (no __GFP_ZERO set). Only
in some configurations (zero-on-alloc, zero-on-free), the kernel would
do that implicitly.
So we'd eventually be leaking secrets to the untrusted hypervisor?
> I have tested in SEV-ES, reclaiming memory by balloon inflation and reuse
> them after balloon deflation both works well with the patch. Hypervisor
> can normally give the reclaimed memory from one CVM to another, or give
> back to the origin CVM.
I'll comment on your misconception of memory overcommit separately.
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2024-01-11 8:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-11 6:35 Zheyun Shen
2024-01-11 8:22 ` David Hildenbrand [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-01-10 6:22 Zheyun Shen
2024-01-10 8:01 ` Michael S. Tsirkin
2024-01-11 3:20 ` Jason Wang
2024-01-11 8:35 ` David Hildenbrand
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=dfb2662d-900e-4b36-b2a0-78ad7f397861@redhat.com \
--to=david@redhat.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=szy0127@sjtu.edu.cn \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®