lkml.org 
[lkml]   [2020]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/5] x86/boot/compressed/64: Introduce sev_status
On Wed, Oct 21, 2020 at 02:39:34PM +0200, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
>
> Introduce sev_status and initialize it together with sme_me_mask to have
> an indicator which SEV features are enabled.
>
> Signed-off-by: Joerg Roedel <jroedel@suse.de>
> ---
> arch/x86/boot/compressed/mem_encrypt.S | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/boot/compressed/mem_encrypt.S b/arch/x86/boot/compressed/mem_encrypt.S
> index dd07e7b41b11..2192b3bd78d8 100644
> --- a/arch/x86/boot/compressed/mem_encrypt.S
> +++ b/arch/x86/boot/compressed/mem_encrypt.S
> @@ -81,6 +81,13 @@ SYM_FUNC_START(set_sev_encryption_mask)
>
> bts %rax, sme_me_mask(%rip) /* Create the encryption mask */
>
> + /* Read sev_status */
> + movl $MSR_AMD64_SEV, %ecx
> + rdmsr
> + shlq $32, %rdx
> + orq %rdx, %rax
> + movq %rax, sev_status(%rip)

A couple of lines above you call get_sev_encryption_bit() which already
reads MSR_AMD64_SEV. Why not set sev_status there too instead of reading
that MSR again here?

It can read that MSR once and use sev_status(%rip) from then on to avoid
reading that MSR multiple times...

--
Regards/Gruss,
Boris.

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

\
 
 \ /
  Last update: 2020-10-26 19:27    [W:0.137 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site