From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x227X7u3iWCYb9muxAK52nb/turhJhqYcXHT/H5gWcwXiw1T8wYqnGwVY6d99Urh0sI4IJDM/ ARC-Seal: i=1; a=rsa-sha256; t=1516615879; cv=none; d=google.com; s=arc-20160816; b=Qm74sgv3ypthSSRoEyeoYzrCi+QhFAfR9dMR360Up2Rag9QkZD9csaOUNOfvi3g+Ae wV5zut+cd+ot/pq1ngwv+xTqUgNtnRQO9FptMWYLE369Qsx+YlFgi39VuugbWtMHZrsk JPkwlaAXmGwOb6vcJoNCMLKnYbUKBO00elh4oZJcCbrWmlDrO7wesAhj9omIkMSUZBpk bPdMNrm+3oqcj1svk2M58wBaPqZMYGJ9a5VpVj++o0CVaC+6KuxbxYpq/MFsz5eDcRQR qpEytsfzEazvwf+Qj8gCttzEldkGX3A3aonhl2iTYlH1TmYnGuCqSoJGOCci74PM9OJy 1JFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=46w380x51MVtJzVIxV+bguOZAFgzsuGlD5FF4lWni7Q=; b=eAYE8EY6OuFOD2RESwqZp7lbYY09IkjsvAy6Mv6a0AVNU9yiaNdZNoq5SjKXKqivWs lqB19c5maQiHH9NB0dH+beAEJ/6GboKHRGzQnYATr9nld4oMkdy8k+pGF5adJ+s023YI jbdArjdGbb9fLhR2USqnZJHFmSxzkbqRdFIuf48MtJ7GNjAoF0wVgcCi3cl7G67Ks4Jw 6sfbeIrENemOP0p30DXtAUU99En1i2YywL0yVKjPIqBScU8AlDVGBjcDcVRCblsv+Kuy 7GknazSegIud9PgSD2+lt8LIlGv8/UIz8cwp1QrUhb25va9Ja+AR3dCnv3xF6TKukDv/ +4xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=dDbWKEcQ; spf=pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) smtp.mailfrom=joro@8bytes.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=dDbWKEcQ; spf=pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) smtp.mailfrom=joro@8bytes.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Date: Mon, 22 Jan 2018 11:11:18 +0100 From: Joerg Roedel To: Andy Lutomirski Cc: 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 , Joerg Roedel Subject: Re: [PATCH 02/16] x86/entry/32: Enter the kernel via trampoline stack Message-ID: <20180122101118.GG28161@8bytes.org> References: <1516120619-1159-1-git-send-email-joro@8bytes.org> <1516120619-1159-3-git-send-email-joro@8bytes.org> <20180117091853.GI28161@8bytes.org> <20180119095523.GY28161@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) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1589767841589420443?= X-GMAIL-MSGID: =?utf-8?q?1590287012268686829?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: Hey Andy, On Fri, Jan 19, 2018 at 08:30:33AM -0800, Andy Lutomirski wrote: > I meant that we could have sp0 have a genuinely constant value per > cpu. That means that the entry trampoline ends up with RIP, etc in a > different place depending on whether VM was in use, but the entry > trampoline code should be able to handle that. sp1 would have a value > that varies by task, but it could just point to the top of the stack > instead of being changed depending on whether VM is in use. Instead, > the entry trampoline would offset the registers as needed to keep > pt_regs in the right place. > > I think you already figured all of that out, though :) Yes, and after looking a while into it, it would make a nice cleanup for the entry code. On the other side, it would change the layout for the in-kernel 'struct pt_regs', so that the user-visible pt_regs ends up with a different layout than the one we use in the the kernel. This can certainly be all worked out, but it makes this nice entry-code cleanup not so nice and clean anymore. At least the work required to make it work without breaking user-space is not in the scope of this patch-set. Regards, Joerg