Received: by 10.223.185.116 with SMTP id b49csp7341730wrg; Thu, 1 Mar 2018 04:06:16 -0800 (PST) X-Google-Smtp-Source: AG47ELtwuCjHCoXe4h1G/vE4Qv2pALRXrEhXNHmTbRGJL5aiTDG4L6PtyfHZe1oZJNvdjOZD5i5c X-Received: by 10.98.27.10 with SMTP id b10mr1713010pfb.121.1519905976078; Thu, 01 Mar 2018 04:06:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519905976; cv=none; d=google.com; s=arc-20160816; b=RRZgIUB+IaQeg6IW5ZiK+RVpTjtiIzjxYE9FAhC+LSJrb1Ac6Bc1mTxxTlrJXGrXvk BZqBXaf66l6gcAdqsJzLAmmjwqLwceUz5jJakhew94C22s0LYIOnlVeYHMlYU3F7IdMz NUyKRq0L05a7xSapul6WHOjW5FWEohlQ8yCeO85M4ljERA8eeUIX42gpI5GnqnFT02ll rjKsTyic0/YcL0PRT8Uq6+P4VscrK6RGob0TgmsWJRldYQAs82aXneoRcmi7VVKTdlN/ RgwNV5aY+Fxwdk3+qbXwPNhsQU09qIuhf7SqJfP0M8sZ7yUq/IGplShKjX5r/GGlzfnp 2dog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=2nhz6guC/zvzqvTI90jFxnHZfx6V27TYaQyfyu7o/oA=; b=oiliZERKRr6qwf4MJpUAkMxye0jwtiWSAHz4O2ABsaLJm03bt5lUMWWYLsI06redtg MF8frTdljLluzJHYLhawwSm4h/C4tCYz9SswnPuhnm6RxPVGCzYd5vty6bAkWfl71hgz 2iK5IUEJsYeEFQI6r/Q3mX7RxHtyOBlYWqDR9TBxsc10mcFRPHkXftz0rQxOh+D8qe66 E55JmRVeJo0B+mJybopb0qNvU9pTI7ZlU2FtLYgOa3qUCdbF9bAHIXWAaV6zd0JCFfxd Zvq5MukKucHueci0EofEYmSiaB+nRTvFLELUVsDqx/X0bGpyajreo5GMhT98KEnEge0D Huzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=pgeQ3yWL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m13si2383531pgd.641.2018.03.01.04.06.00; Thu, 01 Mar 2018 04:06:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=pgeQ3yWL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967920AbeCAMDc (ORCPT + 99 others); Thu, 1 Mar 2018 07:03:32 -0500 Received: from 8bytes.org ([81.169.241.247]:60264 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967839AbeCAMDa (ORCPT ); Thu, 1 Mar 2018 07:03:30 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id 8D9511D5; Thu, 1 Mar 2018 13:03:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1519905806; bh=ez9EMTxZGSWLCzI3yEdWKAv/QO7MkXLMW3YH4x3kt6w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pgeQ3yWLQp5x50SjpWFcA87K/yKOaRyDwxzO7I5U7mULZ6tVDZwYNgtpKXC5g3YSs /cItEeSUwX46WLrtVYBSBwbLCg/4yCITj4kYWugpOjqtaP5PEQdQJj3UD4n+lEW70o N17DLD0H8B5DJ5PX8dWO/cNmOLJM3mqbnDP59REz5qDJo2mBLL+gkkyxnwGszuF76V 2fcLg50/oEG4riciVdejF2Ewm2ak9GERGCLf5zCcxCcnz4762Xx/ljrDnkw8Hr+OBF uoQd58nwLoEsib+2S9AUPP3e9oCTHMT0Vh9vBr/JgrrtWEfiTZ4KtIvT91xPLvhwWm 15xjjD6bHGydg== Date: Thu, 1 Mar 2018 13:03:26 +0100 From: Joerg Roedel To: Waiman Long Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds , Andy Lutomirski , Dave Hansen , Josh Poimboeuf , Juergen Gross , Peter Zijlstra , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , Brian Gerst , David Laight , Denys Vlasenko , Eduardo Valentin , Greg KH , Will Deacon , aliguori@amazon.com, daniel.gruss@iaik.tugraz.at, hughd@google.com, keescook@google.com, Andrea Arcangeli , Waiman Long , Pavel Machek , jroedel@suse.de Subject: Re: [PATCH 12/31] x86/entry/32: Add PTI cr3 switch to non-NMI entry/exit points Message-ID: <20180301120326.GN16484@8bytes.org> References: <1518168340-9392-1-git-send-email-joro@8bytes.org> <1518168340-9392-13-git-send-email-joro@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 27, 2018 at 02:18:36PM -0500, Waiman Long wrote: > On 02/09/2018 04:25 AM, Joerg Roedel wrote: > > SAVE_ALL > > ENCODE_FRAME_POINTER > > + > > + /* Make sure we are running on kernel cr3 */ > > + SWITCH_TO_KERNEL_CR3 scratch_reg=%eax > > + > > xorl %edx, %edx # error code 0 > > movl %esp, %eax # pt_regs pointer > > > > The debug exception calls ret_from_exception on exit. If coming from > userspace, the C function prepare_exit_to_usermode() will be called. > With the PTI-32 code, it means that function will be called with the > entry stack instead of the task stack. This can be problematic as macro > like current won't work anymore. This is not different from before, no? The debug handler already can be entered on entry stack before this patch-set. Joerg