lkml.org 
[lkml]   [2020]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 43/75] x86/sev-es: Setup per-cpu GHCBs for the runtime handler
On Tue, Apr 28, 2020 at 05:16:53PM +0200, Joerg Roedel wrote:
> @@ -198,6 +210,48 @@ static bool __init sev_es_setup_ghcb(void)
> return true;
> }
>
> +static void __init sev_es_alloc_runtime_data(int cpu)
> +{
> + struct sev_es_runtime_data *data;
> +
> + data = memblock_alloc(sizeof(*data), PAGE_SIZE);
> + if (!data)
> + panic("Can't allocate SEV-ES runtime data");
> +
> + per_cpu(runtime_data, cpu) = data;
> +}
> +
> +static void __init sev_es_init_ghcb(int cpu)

Since those are static functions, I'd drop the "sev_es_" prefix from the
name for better readability. Because otherwise the whole file is a sea
of "sev_es_"-prefixed identifiers which you need to read until the end
to know what they are.

> +{
> + struct sev_es_runtime_data *data;
> + int err;
> +
> + data = per_cpu(runtime_data, cpu);
> +
> + err = early_set_memory_decrypted((unsigned long)&data->ghcb_page,
> + sizeof(data->ghcb_page));
> + if (err)
> + panic("Can not map GHCBs unencrypted");

"Error mapping ..."

> +
> + memset(&data->ghcb_page, 0, sizeof(data->ghcb_page));
> +}

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette

\
 
 \ /
  Last update: 2020-05-22 10:34    [W:0.353 / U:2.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site