[PATCH v3 64/75] x86/sev-es: Cache CPUID results for improved performance

Joerg Roedel
Fri, 12 Jun 2020 09:12:11 -0000

On Tue, Apr 28, 2020 at 05:17:14PM +0200, Joerg Roedel
wrote:
> From: Mike Stunes <mstunes at vmware.com>
>
> To avoid a future VMEXIT for a subsequent CPUID function, cache the
> results returned by CPUID into an xarray.
>
>  [tl: coding standard changes, register zero extension]
>
> Signed-off-by: Mike Stunes <mstunes at vmware.com>
> Signed-off-by: Tom Lendacky <thomas.lendacky at amd.com>
> [ jroedel at suse.de: - Wrapped cache handling into
vc_handle_cpuid_cached()
>                    - Used lower_32_bits() where applicable
> 		   - Moved cache_index out of struct es_em_ctxt ]
> Co-developed-by: Joerg Roedel <jroedel at suse.de>
> Signed-off-by: Joerg Roedel <jroedel at suse.de>
> ---
>  arch/x86/kernel/sev-es-shared.c |  12 ++--
>  arch/x86/kernel/sev-es.c        | 119 +++++++++++++++++++++++++++++++-
>  2 files changed, 124 insertions(+), 7 deletions(-)

Okay, following the discussion, I am dropping this patch for now. We can
revisit CPUID caching later when we have a better justification.

Regards,

	Joerg