Re: [PATCH] x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area.

2019-09-16 Thread Dave Hansen
On 9/16/19 10:14 AM, Steve Wahl wrote: > I'm intending to add something like this in the next version: > > /* > * Only the region occupied by the kernel image has so far been checked > against > * the table of usable memory regions provided by the firmware, so > * invalidate pages outside

Re: [PATCH] x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area.

2019-09-16 Thread Steve Wahl
On Mon, Sep 16, 2019 at 07:25:48AM -0700, Dave Hansen wrote: > On 9/16/19 2:00 AM, Kirill A. Shutemov wrote: > >>> I think we also need to make it clear that this is workaround for a broken > >>> hardware: speculative execution must not trigger a halt. > >> I think the word broken is a bit loaded

Re: [PATCH] x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area.

2019-09-16 Thread Steve Wahl
On Mon, Sep 16, 2019 at 12:00:58PM +0300, Kirill A. Shutemov wrote: > On Fri, Sep 13, 2019 at 10:14:15AM -0500, Steve Wahl wrote: > > On Thu, Sep 12, 2019 at 01:19:17PM +0300, Kirill A. Shutemov wrote: > > > On Wed, Sep 11, 2019 at 03:08:35PM -0500, Steve Wahl wrote: > > > > Thank you for your

Re: [PATCH] x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area.

2019-09-16 Thread Dave Hansen
On 9/16/19 2:00 AM, Kirill A. Shutemov wrote: >>> I think we also need to make it clear that this is workaround for a broken >>> hardware: speculative execution must not trigger a halt. >> I think the word broken is a bit loaded here. According to the UEFI >> spec (version 2.8, page 167),

Re: [PATCH] x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area.

2019-09-16 Thread Kirill A. Shutemov
On Fri, Sep 13, 2019 at 10:14:15AM -0500, Steve Wahl wrote: > On Thu, Sep 12, 2019 at 01:19:17PM +0300, Kirill A. Shutemov wrote: > > On Wed, Sep 11, 2019 at 03:08:35PM -0500, Steve Wahl wrote: > > > Thank you for your time looking into this with me! > > > > With all this explanation the original

Re: [PATCH] x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area.

2019-09-13 Thread Steve Wahl
On Thu, Sep 12, 2019 at 01:19:17PM +0300, Kirill A. Shutemov wrote: > On Wed, Sep 11, 2019 at 03:08:35PM -0500, Steve Wahl wrote: > > Thank you for your time looking into this with me! > > With all this explanation the original patch looks sane to me. > > But I would like to see more information

Re: [PATCH] x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area.

2019-09-12 Thread Kirill A. Shutemov
On Wed, Sep 11, 2019 at 03:08:35PM -0500, Steve Wahl wrote: > Thank you for your time looking into this with me! With all this explanation the original patch looks sane to me. But I would like to see more information from this thread in the commit message and some comments in the code on why

Re: [PATCH] x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area.

2019-09-11 Thread Steve Wahl
On Wed, Sep 11, 2019 at 03:28:56AM +0300, Kirill A. Shutemov wrote: > On Tue, Sep 10, 2019 at 09:28:10AM -0500, Steve Wahl wrote: > > On Mon, Sep 09, 2019 at 11:14:14AM +0300, Kirill A. Shutemov wrote: > > > On Fri, Sep 06, 2019 at 04:29:50PM -0500, Steve Wahl wrote: > > > > ... > > > > The answer

Re: [PATCH] x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area.

2019-09-10 Thread Kirill A. Shutemov
On Tue, Sep 10, 2019 at 09:28:10AM -0500, Steve Wahl wrote: > On Mon, Sep 09, 2019 at 11:14:14AM +0300, Kirill A. Shutemov wrote: > > On Fri, Sep 06, 2019 at 04:29:50PM -0500, Steve Wahl wrote: > > > ... > > > The answer is to invalidate the pages of this table outside the > > > address range

Re: [PATCH] x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area.

2019-09-10 Thread Steve Wahl
On Tue, Sep 10, 2019 at 08:18:15AM +0200, Ingo Molnar wrote: > > * Kirill A. Shutemov wrote: > > > On Fri, Sep 06, 2019 at 04:29:50PM -0500, Steve Wahl wrote: > > > Our hardware (UV aka Superdome Flex) has address ranges marked > > > reserved by the BIOS. These ranges can cause the system to

Re: [PATCH] x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area.

2019-09-10 Thread Steve Wahl
On Mon, Sep 09, 2019 at 11:14:14AM +0300, Kirill A. Shutemov wrote: > On Fri, Sep 06, 2019 at 04:29:50PM -0500, Steve Wahl wrote: > > ... > > The answer is to invalidate the pages of this table outside the > > address range occupied by the kernel before the page table is > > activated. This patch

Re: [PATCH] x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area.

2019-09-10 Thread Ingo Molnar
* Kirill A. Shutemov wrote: > On Fri, Sep 06, 2019 at 04:29:50PM -0500, Steve Wahl wrote: > > Our hardware (UV aka Superdome Flex) has address ranges marked > > reserved by the BIOS. These ranges can cause the system to halt if > > accessed. > > > > During kernel initialization, the processor

Re: [PATCH] x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area.

2019-09-09 Thread Kirill A. Shutemov
On Fri, Sep 06, 2019 at 04:29:50PM -0500, Steve Wahl wrote: > Our hardware (UV aka Superdome Flex) has address ranges marked > reserved by the BIOS. These ranges can cause the system to halt if > accessed. > > During kernel initialization, the processor was speculating into > reserved memory

[PATCH] x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area.

2019-09-06 Thread Steve Wahl
Our hardware (UV aka Superdome Flex) has address ranges marked reserved by the BIOS. These ranges can cause the system to halt if accessed. During kernel initialization, the processor was speculating into reserved memory causing system halts. The processor speculation is enabled because the