[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMj1kXH7tfQ_jWQczBnYrsyrELWDisw=tYmyJzcHYqTi57U-5A@mail.gmail.com>
Date: Tue, 2 Sep 2025 15:50:27 +0200
From: Ard Biesheuvel <ardb@...nel.org>
To: Borislav Petkov <bp@...en8.de>
Cc: Ard Biesheuvel <ardb+git@...gle.com>, linux-kernel@...r.kernel.org,
linux-efi@...r.kernel.org, x86@...nel.org, Ingo Molnar <mingo@...nel.org>,
Kevin Loughlin <kevinloughlin@...gle.com>, Tom Lendacky <thomas.lendacky@....com>,
Josh Poimboeuf <jpoimboe@...nel.org>, Peter Zijlstra <peterz@...radead.org>,
Nikunj A Dadhania <nikunj@....com>
Subject: Re: [PATCH v7 10/22] x86/boot: Drop redundant RMPADJUST in SEV SVSM
presence check
On Tue, 2 Sept 2025 at 14:02, Borislav Petkov <bp@...en8.de> wrote:
>
> On Thu, Aug 28, 2025 at 12:22:13PM +0200, Ard Biesheuvel wrote:
> > - /*
> > - * Running at VMPL0 is not required if an SVSM is present and the hypervisor
> > - * supports the required SVSM GHCB events.
> > - */
> > - if (ret &&
> > - !(snp_vmpl && (hv_features & GHCB_HV_FT_SNP_MULTI_VMPL)))
> > + if (snp_vmpl > 0 && !(hv_features & GHCB_HV_FT_SNP_MULTI_VMPL))
>
> Yeah, it is unsigned:
>
> diff --git a/arch/x86/boot/compressed/sev.c b/arch/x86/boot/compressed/sev.c
> index 973ca206794a..808211b09424 100644
> --- a/arch/x86/boot/compressed/sev.c
> +++ b/arch/x86/boot/compressed/sev.c
> @@ -415,7 +415,7 @@ void sev_enable(struct boot_params *bp)
> * Running at VMPL0 is required unless an SVSM is present and
> * the hypervisor supports the required SVSM GHCB events.
> */
> - if (snp_vmpl > 0 && !(hv_features & GHCB_HV_FT_SNP_MULTI_VMPL))
> + if (snp_vmpl && !(hv_features & GHCB_HV_FT_SNP_MULTI_VMPL))
> sev_es_terminate(SEV_TERM_SET_LINUX, GHCB_TERM_NOT_VMPL0);
> }
>
Why is that better?
Powered by blists - more mailing lists