Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp802489rwb; Tue, 4 Oct 2022 10:47:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4uY49YL/TbZe8dSpGPeGH0BVkeiJg9XtViMIop0B9cpL6CbM109L+SNFOxhIvQOwP97X7Z X-Received: by 2002:a62:1791:0:b0:562:2298:b33c with SMTP id 139-20020a621791000000b005622298b33cmr96671pfx.25.1664905675849; Tue, 04 Oct 2022 10:47:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664905675; cv=none; d=google.com; s=arc-20160816; b=oCW6jhkeeAWrvW1ppkCe9AD+dJKhNTzFgxAE51xIBOPJs3iBzSqgYRPuZArwIZHVUj Cc6zL1XiRVj85SwlDw5622mL64vFS8nxnktGgk1RYEoN/jQEJrtmqrgwxUWReBDdTBBO ebG8FL9+mKZ+i+D0rJC9azILKJChmsN5AJcxYsvsct9WR0WFD7nil7j5+Y9yU4HbMqY6 FAWyOD0NstDCWxPNoR+QYdaZtL7VuKXIO2pf3iS4FOsXlJ+KyJA9G9XDca4PTlJJtDJn QVI3beU+cL4a4lbiXDeoOw2Y9gIURSFYRR498Cw4jXIN6M94cF13jgOnVElCk5/gHnoI /pZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature; bh=iCclXyzGDSOsDp/jWf3iu9k3kQ7Bf1MCEhe5TKQX0sU=; b=Nqk6qydz9O15I03m2zgj+DI3cwic03ruMzs6ropnFJYYjEZQDE1AVCS+dl+j82uuKw 940BbF7VHLPRquM/1tp0737buF1AMnZqijUh6xNljdiHMO3/YJipdHniAhMkkNN5gdgG H8/mvLJ3Af59HSYEUNwSd595OphhHZVyV9YAWGDr3TwUwrxvLDrntiGyBB6Cif42TI3Y P1JtoI1wZqK4tz21PK+2jmmLvWLO2n0tIP/pZhsRelzDXvGRxNjFwh9uTq+8J+ud89+T zyqObwzEeZqzYX6cQxcC58wZFStN5CybuseZ293lJh43JPKIwVsWQZR+Ci9BIog8zg9J +zNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nzaqJjOC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o21-20020a635a15000000b0043a345c65f3si13525527pgb.755.2022.10.04.10.47.40; Tue, 04 Oct 2022 10:47:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nzaqJjOC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230128AbiJDRfv (ORCPT + 99 others); Tue, 4 Oct 2022 13:35:51 -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 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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