From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36A4AC433F5 for ; Tue, 4 Oct 2022 17:36:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230155AbiJDRfw (ORCPT ); Tue, 4 Oct 2022 13:35:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229893AbiJDRew (ORCPT ); Tue, 4 Oct 2022 13:34:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8B10219F; Tue, 4 Oct 2022 10:34:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9B702B81B62; Tue, 4 Oct 2022 17:34:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A185C433B5; Tue, 4 Oct 2022 17:34:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664904876; bh=xt+VIL6t43fmPXkuNJgq0nQY3LruRYVH4BY+ZSzLhRc=; h=In-Reply-To:References:Date:From:To:Cc:Subject:From; b=nzaqJjOCiwWaWsQpttWO/rlBNk/BRHEz1C9+S63QfcYZgC0/ey9PfIeyL4HvjIGZZ lT/q/x6cIgtMHXFXVB5p/y6T8fbeh6c5BM43YHWRrqi7xMQcKBX2tzz11WZqrpd5uc srwkDrpWcoFnUoZHAwhjvjp4+BARCIHR/dJQWjR93+0qm6GN0DFvIJQEGMFfsfp4vO /NUmvg22Ioz8TATXH+zcTSPlWh0vmd7YDP+Kbho1vOVlrCcAJF+kPfwO/CycaKdlpd SLMieSpbVdHniXgDQsnMeP/OrelgMqUXbkj/a8e7D+iQxy6R2/muyM00f3pSxFbW/O i3nX1m1ezebuw== Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id A20C327C0054; Tue, 4 Oct 2022 13:34:33 -0400 (EDT) Received: from imap48 ([10.202.2.98]) by compute2.internal (MEProxy); Tue, 04 Oct 2022 13:34:33 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeiuddguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdet nhguhicunfhuthhomhhirhhskhhifdcuoehluhhtoheskhgvrhhnvghlrdhorhhgqeenuc ggtffrrghtthgvrhhnpedvhfeuvddthfdufffhkeekffetgffhledtleegffetheeugeej ffduhefgteeihfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpegrnhguhidomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudduiedu keehieefvddqvdeifeduieeitdekqdhluhhtoheppehkvghrnhgvlhdrohhrgheslhhinh hugidrlhhuthhordhush X-ME-Proxy: Feedback-ID: ieff94742:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 32F2E31A0062; Tue, 4 Oct 2022 13:34:33 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1015-gaf7d526680-fm-20220929.001-gaf7d5266 Mime-Version: 1.0 Message-Id: <40484dc2-8da3-486d-9c53-02ae23a50fbb@app.fastmail.com> In-Reply-To: <20221003222133.20948-8-aliraza@bu.edu> References: <20221003222133.20948-1-aliraza@bu.edu> <20221003222133.20948-8-aliraza@bu.edu> Date: Tue, 04 Oct 2022 10:34:12 -0700 From: "Andy Lutomirski" To: "Ali Raza" , "Linux Kernel Mailing List" Cc: "Jonathan Corbet" , masahiroy@kernel.org, michal.lkml@markovi.net, "Nick Desaulniers" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , "H. Peter Anvin" , "Eric W. Biederman" , "Kees Cook" , "Peter Zijlstra (Intel)" , "Al Viro" , "Arnd Bergmann" , juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, "Steven Rostedt" , "Ben Segall" , mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, "Paolo Bonzini" , jpoimboe@kernel.org, linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, "the arch/x86 maintainers" , rjones@redhat.com, munsoner@bu.edu, tommyu@bu.edu, drepper@redhat.com, lwoodman@redhat.com, mboydmcse@gmail.com, okrieg@bu.edu, rmancuso@bu.edu Subject: Re: [RFC UKL 07/10] x86/signal: Adjust signal handler register values and return frame Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 3, 2022, at 3:21 PM, Ali Raza wrote: > For a UKL thread, returning to a signal handler is not done with iret or > sysret. This means we need to adjust the way the return stack frame is > handled for these threads. When constructing the signal frame, we leave > the previous frame in place because we will return to it from the signal > handler. We also leave space for pushing eflags and the return address. > UKL threads will only use the __KERNEL_DS value in the ss register and 0xC3 > in the cs register. This is unclear. Are you taking about returning from the kernel fault code *to* the signal handler or are you talking about returning *from* the user signal hander to the user code that was running when the signal happened? In any case, I don't see what this has to do with iret or sysret. Surely UKL can use a sigreturn() just like regular Linux. The part where a UKL thread has permission to return to a CPL0 context should be a separate patch. --Andy