From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752209AbeAQJCm (ORCPT + 1 other); Wed, 17 Jan 2018 04:02:42 -0500 Received: from 8bytes.org ([81.169.241.247]:53818 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750794AbeAQJCj (ORCPT ); Wed, 17 Jan 2018 04:02:39 -0500 Date: Wed, 17 Jan 2018 10:02:38 +0100 From: Joerg Roedel To: Boris Ostrovsky 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 , 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 , jroedel@suse.de Subject: Re: [PATCH 02/16] x86/entry/32: Enter the kernel via trampoline stack Message-ID: <20180117090238.GH28161@8bytes.org> References: <1516120619-1159-1-git-send-email-joro@8bytes.org> <1516120619-1159-3-git-send-email-joro@8bytes.org> <476d7100-2414-d09e-abf1-5aa4d369a3b7@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <476d7100-2414-d09e-abf1-5aa4d369a3b7@oracle.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Hi Boris, thanks for testing this :) On Tue, Jan 16, 2018 at 09:47:06PM -0500, Boris Ostrovsky wrote: > On 01/16/2018 11:36 AM, Joerg Roedel wrote: > >+.macro SWITCH_TO_KERNEL_STACK nr_regs=0 check_user=0 > > > This (and next patch's SWITCH_TO_ENTRY_STACK) need X86_FEATURE_PTI check. > > With those macros fixed I was able to boot 32-bit Xen PV guest. Hmm, on bare metal the stack switch happens regardless of the X86_FEATURE_PTI feature being set, because we always program tss.sp0 with the systenter stack. How is the kernel entry stack setup on xen-pv? I think something is missing there instead. Regards, Joerg From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk0-f70.google.com (mail-vk0-f70.google.com [209.85.213.70]) by kanga.kvack.org (Postfix) with ESMTP id 641796B0277 for ; Fri, 19 Jan 2018 10:30:07 -0500 (EST) Received: by mail-vk0-f70.google.com with SMTP id k20so1055655vki.11 for ; Fri, 19 Jan 2018 07:30:07 -0800 (PST) Received: from theia.8bytes.org (8bytes.org. [81.169.241.247]) by mx.google.com with ESMTPS id z32si2814228edc.87.2018.01.17.01.02.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jan 2018 01:02:39 -0800 (PST) Date: Wed, 17 Jan 2018 10:02:38 +0100 From: Joerg Roedel Subject: Re: [PATCH 02/16] x86/entry/32: Enter the kernel via trampoline stack Message-ID: <20180117090238.GH28161@8bytes.org> References: <1516120619-1159-1-git-send-email-joro@8bytes.org> <1516120619-1159-3-git-send-email-joro@8bytes.org> <476d7100-2414-d09e-abf1-5aa4d369a3b7@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <476d7100-2414-d09e-abf1-5aa4d369a3b7@oracle.com> Sender: owner-linux-mm@kvack.org List-ID: To: Boris Ostrovsky 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 , 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 , jroedel@suse.de Hi Boris, thanks for testing this :) On Tue, Jan 16, 2018 at 09:47:06PM -0500, Boris Ostrovsky wrote: > On 01/16/2018 11:36 AM, Joerg Roedel wrote: > >+.macro SWITCH_TO_KERNEL_STACK nr_regs=0 check_user=0 > > > This (and next patch's SWITCH_TO_ENTRY_STACK) need X86_FEATURE_PTI check. > > With those macros fixed I was able to boot 32-bit Xen PV guest. Hmm, on bare metal the stack switch happens regardless of the X86_FEATURE_PTI feature being set, because we always program tss.sp0 with the systenter stack. How is the kernel entry stack setup on xen-pv? I think something is missing there instead. Regards, Joerg -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org