Re: [PATCH Part1 RFC v2 11/20] x86/compressed: Add helper for validating pages in the decompression stage
From: Borislav Petkov
Date: Tue May 25 2021 - 06:20:37 EST
On Thu, May 20, 2021 at 01:05:15PM -0500, Brijesh Singh wrote:
> Maybe I am missing something, the statement above was executed for
> either set or clr but the page shared need to happen only for clr. So,
> from code readability point I kept it outside of that if().
>
> Otherwise we may have to do something like.
>
> ...
>
> if ((set | clr) & _PAGE_EN) {
>
> if (clr)
>
> snp_set_page_shared(pte_pfn(*ptep) << PAGE_SHIFT);
>
> }
>
> I am okay with above is the preferred approach.
Yes pls, because it keeps the _PAGE_ENC handling together in one
statement.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette