Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751319AbeACW1U (ORCPT + 1 other); Wed, 3 Jan 2018 17:27:20 -0500 Received: from mga03.intel.com ([134.134.136.65]:8481 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751029AbeACW1T (ORCPT ); Wed, 3 Jan 2018 17:27:19 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,504,1508828400"; d="scan'208";a="163973373" Subject: Re: CONFIG_PAGE_TABLE_ISOLATION=y on x86_64 causes gcc to segfault when building x86_32 binaries To: Andy Lutomirski , Thomas Gleixner References: <20180103123723.1dd26828@abudhabi.paradoxon.rec> <20180103143036.60e592eb@abudhabi.paradoxon.rec> Cc: Lars Wendler , LKML , X86 ML , Borislav Betkov , Peter Zijlstra , Greg KH , Laura Abbott , Boris Ostrovsky , Juergen Gross From: Dave Hansen Message-ID: Date: Wed, 3 Jan 2018 14:27:17 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 01/03/2018 02:14 PM, Andy Lutomirski wrote: > + /* Use %rsp as scratch reg. User ESP is stashed in r8 */ > + SWITCH_TO_KERNEL_CR3 scratch_reg=%rsp > + > + /* Switch to the kernel stack */ > movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp The stack is unreadable at this point without the CR3 switch. > What's the issue that this is fixing? Users doing 32-bit SYSCALLs on the CPUs that support them double fault since they end up with an %rsp that they can't access.