Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp314087imm; Sat, 14 Jul 2018 01:02:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcqpQQ7XsOdmSGksTWKCCu18l75Kc8Rq9/VA41mDm+/gleD/Zd89lBd7tSPHsmSGc67TOWH X-Received: by 2002:a63:3e0a:: with SMTP id l10-v6mr8935689pga.355.1531555373808; Sat, 14 Jul 2018 01:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531555373; cv=none; d=google.com; s=arc-20160816; b=ISi0RJ1Vb4dstiiatT3ivfukxyhGisJS6cmZR7Z/F8elCvjI66edOJ+I8OCzj623gn 3RAddDCs4CCR2dbW57ijgdbjHC3F4S1HCtc2tfRUPJDnGC9NJECmGozQBlqYpPtabTVR UPMISYaRZCMR2qodfWxswbIqPUnOys7tU1LjnA3/xQe1Mc3yracsdsz6FK53xT1bwRni U8ZEpbmJ1Zv7FiLI7GKJQ5zhGsPIb/xEH+ZIXRmIeLKL4BMB5HVaUT/yML8lnDKQ8A/k a+q1/EZTGKsHkaXPFTyiMJ+8yEDS9oLbjnPhyERCLPOSNxQgFEUOo4DZeWmPxj58JNuL TimQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=iQc7lsS40PGpgfdm1mY/A8B89xTMrlCWouNHkbRFc7A=; b=auQgIxEW3ld2srPiADYLHlMJzfSHFy0h3Hp6GcdBWJxaVZkZMeqCQmGSlKKBsF+GEP HVI74SmxzDK98mvNvTN7F6VIUsFaluK66/RQh9gwyAcM3uI1xRJtSuss5J+L4WCdEEhG 3haNJFKsTWaX5AS/fSCluuutkRVyAxUPtp8etzVAFAytsUzdW6WCY2otilYrKkTi595d TcQMpeFMKkatx7RYGO2wDCp+Gcss/csqyXrJLxb0YdMMu6/mnsTCubRNmv/T5UtPV6e4 hnJqqXqgv2HCXE/LXhZVkBCb4ie/yXTAVRgmygJs7sjqP/K3ov7qYueB2y+eHNptW61W eaWQ== 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 n24-v6si25280514pgb.665.2018.07.14.01.02.39; Sat, 14 Jul 2018 01:02:53 -0700 (PDT) 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 S1726527AbeGNIUS (ORCPT + 99 others); Sat, 14 Jul 2018 04:20:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:51916 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726025AbeGNIUS (ORCPT ); Sat, 14 Jul 2018 04:20:18 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BD1E9AD9E; Sat, 14 Jul 2018 08:02:03 +0000 (UTC) Date: Sat, 14 Jul 2018 10:01:59 +0200 From: Joerg Roedel To: Andy Lutomirski Cc: Andy Lutomirski , Joerg Roedel , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , X86 ML , LKML , Linux-MM , Linus Torvalds , 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 , "Liguori, Anthony" , Daniel Gruss , Hugh Dickins , Kees Cook , Andrea Arcangeli , Waiman Long , Pavel Machek , "David H . Gutteridge" Subject: Re: [PATCH 10/39] x86/entry/32: Handle Entry from Kernel-Mode on Entry-Stack Message-ID: <20180714080159.hqp36q7fxzb2ktlq@suse.de> References: <1531308586-29340-1-git-send-email-joro@8bytes.org> <1531308586-29340-11-git-send-email-joro@8bytes.org> <20180714052110.cobtew6rms23ih37@suse.de> <7AB4F269-E0E8-4290-A764-69D8605467E8@amacapital.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7AB4F269-E0E8-4290-A764-69D8605467E8@amacapital.net> 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 Fri, Jul 13, 2018 at 11:26:54PM -0700, Andy Lutomirski wrote: > > So based on that, I did the above because the entry-stack is a per-cpu > > data structure and I am not sure that we always return from the exception > > on the same CPU where we got it. Therefore the path is called > > PARANOID_... :) > > But we should just be able to IRET and end up right back on the entry > stack where we were when we got interrupted. Yeah, but using another CPUs entry-stack is a bad idea, no? Especially since the owning CPU might have overwritten our content there already. > On x86_64, we *definitely* can’t schedule in NMI, MCE, or #DB because > we’re on a percpu stack. Are you *sure* we need this patch? I am sure we need this patch, but not 100% sure that we really can change CPUs in this path. We are not only talking about NMI, #MC and #DB, but also about #GP and every other exception that can happen while writing segments registers or on iret. With this implementation we are on the safe side for this unlikely slow-path. Regards, Joerg