lkml.org 
[lkml]   [2022]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v1 1/2] x86/sev: Use per-CPU PSC structure in prep for unaccepted memory support
From
On 7/29/22 07:01, Tom Lendacky wrote:
> diff --git a/arch/x86/kernel/sev.c b/arch/x86/kernel/sev.c
> index c05f0124c410..1f7f6205c4f6 100644
> --- a/arch/x86/kernel/sev.c
> +++ b/arch/x86/kernel/sev.c
> @@ -104,6 +104,15 @@ struct sev_es_runtime_data {
> * is currently unsupported in SEV-ES guests.
> */
> unsigned long dr7;
> +
> + /*
> + * Page State Change structure for use when accepting memory or when
> + * changing page state. Interrupts are disabled when using the structure
> + * but an NMI could still be raised, so use a flag to indicate when the
> + * structure is in use and use the MSR protocol in these cases.
> + */
> + struct snp_psc_desc psc_desc;
> + bool psc_active;
> };

This thing:

struct snp_psc_desc {
struct psc_hdr hdr;
struct psc_entry entries[VMGEXIT_PSC_MAX_ENTRY];
} __packed;

is 16k, right? Being per-cpu, this might eat up a MB or two of memory
on a big server?

Considering that runtime acceptance is already single-threaded[1] *and*
there's a fallback method, why not just have a single copy of this
guarded by a single lock?

1.
https://lore.kernel.org/all/20220614120231.48165-10-kirill.shutemov@linux.intel.com/

\
 
 \ /
  Last update: 2022-07-29 16:18    [W:1.477 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site