Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp437760imm; Wed, 18 Jul 2018 05:00:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf6/ZCnjhy3+rPFbIo3ciPDVnUMA/3c0nVWJ5eHqak/seJtJShsbg9KD87/DgMbtn64Ehbp X-Received: by 2002:a65:550d:: with SMTP id f13-v6mr5654580pgr.340.1531915202060; Wed, 18 Jul 2018 05:00:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531915202; cv=none; d=google.com; s=arc-20160816; b=w9wSfOt7iG8OVKw7qXk9GrhJFTd7eRgRpcqcXaHUCi7tc6x/oBXu8OAx+nXwOK2wRA XAHpEzJ5pK+x9umFkeVJ6xBu8OrPmzaG1l+7Rc1+825IUff4FIiu7qeNM4qTMEWnZ71A AgtW6FAVwYAFhU/iq+X+ZAMlPB+uWLoAExZ3SNGoi8Fl64qmfvNcAPuUh7mrua+Y/sWO 6e0+yHvRIGIrL5XETZaIjWux38CLj18ZJrpS1IptcSyEQNBXvW6Et2gXwk4WUNUpjl+j G4N/xndkpVxLgBb5tEgoGlmwaV068AzsOWGCkoqvgBH8PUer3NgnZC+sl4GUD8zSCCGL XZBg== 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=SlSGktw/SiAvGE8OWA7X0y39t3x2hbG4qlEIXbVWlPw=; b=NQWWmA7eNSHcPD3DevzTFtVF7jXiXtlltiGqrS9tL2VArTU6WMTbBrAC5mJDziD2cA 6CGB7DxWS3Ko2k9rmmCH1b/IDxdjjgAJTLKnBif40PrTiQzxcPgWCvAMFTmyjoH1j7pT jgxQ5nDzrytFKNyswSXz/ZuuXqfkInBU0S2maUdAMww1IDPqrXRG+Jx1mYWBPDXW6yet bh6hJaQp/BZWTkb1vl7DqvO/XylDTIXT6h9zfDoPlAUEui22u+uthdAkOso6C12AX9MM gVzK7KnHzdKq5lXN0oD662LK2RTa7eF3XyH86cyZRB76aAxAHxct+99gHC4DIDXURzPK 0HYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=VDiCTZc0; 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 d37-v6si2998934plb.481.2018.07.18.04.59.47; Wed, 18 Jul 2018 05:00:02 -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; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=VDiCTZc0; 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 S1730315AbeGRMgp (ORCPT + 99 others); Wed, 18 Jul 2018 08:36:45 -0400 Received: from 8bytes.org ([81.169.241.247]:57470 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbeGRMgn (ORCPT ); Wed, 18 Jul 2018 08:36:43 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id B10ED1CF; Wed, 18 Jul 2018 13:59:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1531915145; bh=BhXgtHAWgNGvieIGowV1lasZA1Ej+YMKVlv5jSG/O28=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VDiCTZc0KjybrsmpLWYhA3fv67e3pCkKfbS7jftAQ7YVaP4ftuloG3gn/5ycYFxwj W4BaW1ri/GeJ+VXNT74djyuiPHcGsRFE9Ret0mOvCeBiqVufT/UbTLnZlPWNKLv3Pw Rf+4WMCJlIj8WtjB4LJ2bw6UV3DV2pMyZ17KEEsz/2VTCiL+cNnqxpXA1/43RThNja ftuIrY9yojEFxnH0XZoHGPth8NwdkDjvcg+YpNaYsxY4Kuzcx/fTZAyyB2feb656+W VnYoT3NVD+o8wEAsczlufpOKMENyyrEuJwmmlS0tGvQ/YnhzSWzY167yJHeG1UU084 FJ/OMSn/Z5mPw== Date: Wed, 18 Jul 2018 13:59:05 +0200 From: Joerg Roedel To: Andy Lutomirski Cc: Joerg Roedel , Andy Lutomirski , 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: <20180718115905.GA18541@8bytes.org> 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> <20180714080159.hqp36q7fxzb2ktlq@suse.de> <75BDF04F-9585-438C-AE04-918FBE00A174@amacapital.net> <20180717071545.ojdall7tatbjtfai@suse.de> 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, Jul 17, 2018 at 01:06:11PM -0700, Andy Lutomirski wrote: > Yes, we obviously need to restore the correct cr3. But I really don't > like the code that rewrites the stack frame that we're about to IRET > to, especially when it doesn't seem to serve a purpose. I'd much > rather the code just get its CR3 right and do the IRET and trust that > the frame it's returning to is still there. Okay, I'll give it a try and if it works without the copying we can put that on-top of this patch-set. This also has the benefit that we can revert it later if it causes problems down the road. Regards, Joerg