[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d27e42a8-b2af-f922-4cea-b1ddaa2a0af0@intel.com>
Date: Fri, 29 Jul 2022 07:18:02 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Tom Lendacky <thomas.lendacky@....com>,
linux-kernel@...r.kernel.org, x86@...nel.org
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"Kirill A. Shutemov" <kirill@...temov.name>,
"H. Peter Anvin" <hpa@...or.com>,
Michael Roth <michael.roth@....com>,
Joerg Roedel <jroedel@...e.de>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v1 1/2] x86/sev: Use per-CPU PSC structure in prep for
unaccepted memory support
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/
Powered by blists - more mailing lists