lkml.org 
[lkml]   [2022]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v1 2/2] x86/sev: Add SNP-specific unaccepted memory support
>
> +void snp_accept_memory(phys_addr_t start, phys_addr_t end)
> +{
> + unsigned long vaddr;
> + unsigned int npages;
> +
> + if (!cc_platform_has(CC_ATTR_GUEST_SEV_SNP))
> + return;
> +
> + vaddr = (unsigned long)__va(start);
> + npages = (end - start) >> PAGE_SHIFT;
> +
> + set_pages_state(vaddr, npages, SNP_PAGE_STATE_PRIVATE);
> +
> + pvalidate_pages(vaddr, npages, true);
> +}

My testing of this patch shows that a significant amount of time is
spent using the MSR protocol to change page state, in such a
significant fashion that it's slower than eagerly accepting all
memory. The difference gets worse as the RAM size goes up, so I think
there's some phase problem with the GHCB protocol not getting used
early enough?

--
-Dionna Glaze, PhD (she/her)

\
 
 \ /
  Last update: 2022-08-23 02:25    [W:0.222 / U:1.664 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site