Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751873AbeAQCs1 (ORCPT + 1 other); Tue, 16 Jan 2018 21:48:27 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:53768 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750830AbeAQCs0 (ORCPT ); Tue, 16 Jan 2018 21:48:26 -0500 Subject: Re: [PATCH 02/16] x86/entry/32: Enter the kernel via trampoline stack To: Joerg Roedel , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" Cc: 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 References: <1516120619-1159-1-git-send-email-joro@8bytes.org> <1516120619-1159-3-git-send-email-joro@8bytes.org> From: Boris Ostrovsky Message-ID: <476d7100-2414-d09e-abf1-5aa4d369a3b7@oracle.com> Date: Tue, 16 Jan 2018 21:47:06 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1516120619-1159-3-git-send-email-joro@8bytes.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8776 signatures=668653 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=741 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801170038 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 01/16/2018 11:36 AM, Joerg Roedel wrote: > > /* > + * Switch from the entry-trampline stack to the kernel stack of the > + * running task. > + * > + * nr_regs is the number of dwords to push from the entry stack to the > + * task stack. If it is > 0 it expects an irq frame at the bottom of the > + * stack. > + * > + * check_user != 0 it will add a check to only switch stacks if the > + * kernel entry was from user-space. > + */ > +.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. -boris