Re: [PATCH 0/5] x86: Impplement support for unaccepted memory

From: Dave Hansen
Date: Tue Aug 10 2021 - 13:45:57 EST


On 8/10/21 10:31 AM, Kirill A. Shutemov wrote:
> On Tue, Aug 10, 2021 at 08:51:01AM -0700, Dave Hansen wrote:
>> Let's say we have a 128GB VM. How much does faster does this approach
>> reach userspace than if all memory was accepted up front? How much
>> memory _could_ have been accepted at the point userspace starts running?
>
> Acceptance code is not optimized yet: we accept memory in 4k chunk which
> is very slow because hypercall overhead dominates the picture.
>
> As of now, kernel boot time of 1 VCPU and 64TiB VM with upfront memory
> accept is >20 times slower than with this lazy memory accept approach.

That's a pretty big deal.

> The difference is going to be substantially lower once we get it optimized
> properly.

What does this mean? Is this future work in the kernel or somewhere in
the TDX hardware/firmware which will speed things up?