[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e4692a3e-40da-c504-d1a1-b7231a5673ca@intel.com>
Date: Tue, 24 Sep 2019 13:15:07 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Steve Wahl <steve.wahl@....com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
Juergen Gross <jgross@...e.com>,
"Kirill A. Shutemov" <kirill@...temov.name>,
Brijesh Singh <brijesh.singh@....com>,
Jordan Borgner <mail@...dan-borgner.de>,
Feng Tang <feng.tang@...el.com>, linux-kernel@...r.kernel.org,
Chao Fan <fanc.fnst@...fujitsu.com>,
Zhenzhong Duan <zhenzhong.duan@...cle.com>,
Baoquan He <bhe@...hat.com>, russ.anderson@....com,
dimitri.sivanich@....com, mike.travis@....com
Subject: Re: [PATCH v2 1/2] x86/boot/64: Make level2_kernel_pgt pages invalid
outside kernel area.
On 9/24/19 1:04 PM, Steve Wahl wrote:
> Given that, would you feel better with A) the way I have it, B) your
> rewrite, or C) with an inline comment for each part of the loop:
>
> pmd = fixup_pointer(level2_kernel_pgt, physaddr);
>
> /* invalidate pages before the kernel image */
> for (i = 0; i < pmd_index((unsigned long)_text); i++)
> pmd[i] &= ~_PAGE_PRESENT;
>
> /* fixup pages that are part of the kernel image */
> for (; i <= pmd_index((unsigned long)_end); i++)
> if (pmd[i] & _PAGE_PRESENT)
> pmd[i] += load_delta;
>
> /* invalidate pages after the kernel image */
> for (; i < PTRS_PER_PMD; i++)
> pmd[i] &= ~_PAGE_PRESENT;
I don't feel super strongly either way, but I'd prefer doing B or C over
nothing.
Powered by blists - more mailing lists