lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 27 Aug 2020 11:36:49 +0200
From:   Borislav Petkov <bp@...en8.de>
To:     Joerg Roedel <joro@...tes.org>
Cc:     x86@...nel.org, Joerg Roedel <jroedel@...e.de>, hpa@...or.com,
        Andy Lutomirski <luto@...nel.org>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Jiri Slaby <jslaby@...e.cz>,
        Dan Williams <dan.j.williams@...el.com>,
        Tom Lendacky <thomas.lendacky@....com>,
        Juergen Gross <jgross@...e.com>,
        Kees Cook <keescook@...omium.org>,
        David Rientjes <rientjes@...gle.com>,
        Cfir Cohen <cfir@...gle.com>,
        Erdem Aktas <erdemaktas@...gle.com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Mike Stunes <mstunes@...are.com>,
        Sean Christopherson <sean.j.christopherson@...el.com>,
        Martin Radev <martin.b.radev@...il.com>,
        linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH v6 20/76] x86/boot/compressed/64: Call
 set_sev_encryption_mask earlier

On Mon, Aug 24, 2020 at 10:54:15AM +0200, Joerg Roedel wrote:

Just minor style issues to be fixed by committer or in case you have to
send a new version:

Subject: Re: [PATCH v6 20/76] x86/boot/compressed/64: Call set_sev_encryption_mask earlier

set_sev_encryption_mask() <- it is a function.

> From: Joerg Roedel <jroedel@...e.de>
> 
> Call set_sev_encryption_mask() while still on the stage 1 #VC-handler,
> because the stage 2 handler needs our own page-tables to be set up, to

"... needs the kernel's own page tables to be set up... "

"we" is almost always ambiguous and should be avoided by formulating the
commit message in passive voice.

> which calling set_sev_encryption_mask() is a prerequisite.
> 
> Signed-off-by: Joerg Roedel <jroedel@...e.de>
> Link: https://lore.kernel.org/r/20200724160336.5435-20-joro@8bytes.org
> ---
>  arch/x86/boot/compressed/head_64.S      | 8 +++++++-
>  arch/x86/boot/compressed/ident_map_64.c | 3 ---
>  2 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
> index 013b29921836..c7fcf60cbd08 100644
> --- a/arch/x86/boot/compressed/head_64.S
> +++ b/arch/x86/boot/compressed/head_64.S
> @@ -533,9 +533,15 @@ SYM_FUNC_START_LOCAL_NOALIGN(.Lrelocated)
>  	rep	stosq
>  
>  /*
> - * Load stage2 IDT and switch to our own page-table
> + * If running as an SEV guest, the encryption mask is required in the
> + * page-table setup code below. When the guest also has SEV-ES enabled
> + * set_sev_encryption_mask() will cause #VC exceptions, but the stage2
> + * handler can't map its GHCB because the page-table is not set up yet.
> + * So set up the encryption mask here while still on the stage1 #VC
> + * handler. Then load stage2 IDT and switch to our own page-table.

	... to the kernel's own page table."

-- 
Regards/Gruss,
    Boris.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ