Received: by 10.223.185.116 with SMTP id b49csp7653091wrg; Thu, 1 Mar 2018 08:51:41 -0800 (PST) X-Google-Smtp-Source: AG47ELttQRpIqJriLMccjgJIG7NBNMv86pcu+kenky8J/mUns71GUyivALc8wGxepcE5RThSRCq1 X-Received: by 2002:a17:902:7009:: with SMTP id y9-v6mr2452873plk.395.1519923101699; Thu, 01 Mar 2018 08:51:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519923101; cv=none; d=google.com; s=arc-20160816; b=HCk4ZIdVuXp417KYWDnHgo9VvgnrB3A0RrS2SoQrL6NfWrXDJxaw/ahNIaBo0wVwN6 8+rguz0KC6udZW8TjHguKcnEs7gSlycvjJNzbxIw8qAYvM6x1wjU/WDIdIAAfrHMGSGq 9xUBDZ50M2AEwYpXau0f5BAh/hX+/3BmcF/1lNro1eD12BPaUgNnvjWqvuBvk56lvoYw lkKzrcfhSgFABsSY6zY4PgyApUNu7N5BC78dK5TohWu2Z/9qaZ6W64NNsCFFfn3+xruR X33+M6kF6+u3CbEzJs28Wnt7TP9i5ViuvJSypRd8j/E5yh3nhyEy6oZuZvaIlhtxEZqr zENA== 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:arc-authentication-results; bh=/NBnnsH6aC49uqtRSFdV32ymaemQbSrXL07KK5SpuC4=; b=y468u39wbrwPung0vCYxPjyzX00NLtSrqujBoHV2YJ+2e9PDRJmXLiXeO61jUVSe2l QWP3qgtOVw5dDvilppdAFIvuDNjka3xrSa5zXJaUXFxHxNXECde3bblxpFa3I59bE30R a15aZthAjICl8aMAP72P7iNYM9EsNPatJWk9hM1G3G5xz3mL6Hs1M3Lu0cFfRP9LpSPn llLpctXdCo22RgnX5nXdyXoZXhZ1dUJOJxe9sgbnTn5TRwe1ewLImGlTe7LX38hFVRmT KxqKzfB/Eo28h8co88UT7PcHxBkuNuNd/bZV5liHCvko+sgLZVGdd4uk0YbtmfU+fx53 wzGA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m16-v6si3318687pls.471.2018.03.01.08.51.26; Thu, 01 Mar 2018 08:51:41 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033105AbeCAQuZ (ORCPT + 99 others); Thu, 1 Mar 2018 11:50:25 -0500 Received: from mx2.suse.de ([195.135.220.15]:47471 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033003AbeCAQuY (ORCPT ); Thu, 1 Mar 2018 11:50:24 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 31458B664; Thu, 1 Mar 2018 16:50:22 +0000 (UTC) Date: Thu, 1 Mar 2018 17:50:19 +0100 From: Joerg Roedel To: Waiman Long Cc: Joerg Roedel , 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 Subject: Re: [PATCH 12/31] x86/entry/32: Add PTI cr3 switch to non-NMI entry/exit points Message-ID: <20180301165019.kuynvb6fkcwdpxjx@suse.de> References: <1518168340-9392-1-git-send-email-joro@8bytes.org> <1518168340-9392-13-git-send-email-joro@8bytes.org> <20180301133430.wda4qesqhxnww7d6@8bytes.org> <2ae8b01f-844b-b8b1-3198-5db70c3e083b@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2ae8b01f-844b-b8b1-3198-5db70c3e083b@redhat.com> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 01, 2018 at 09:33:11AM -0500, Waiman Long wrote: > On 03/01/2018 08:34 AM, Joerg Roedel wrote: > I think that should fix the issue of debug exception from userspace. > > One thing that I am not certain about is whether debug exception can > happen even if the IF flag is cleared. If it can, debug exception should > be handled like NMI as the state of the CR3 can be indeterminate if the > exception happens in the entry/exit code. I am actually not 100% sure where it can happen, from the code it can happen from anywhere, except when we are running on an espfix stack. So I am not sure we need the same complex handling NMIs need wrt. to switching the cr3s. Joerg