Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3151215pxy; Mon, 3 May 2021 16:49:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4HdyLnqCvR8xJvJWN+i9s2KC9tK3wW+ZzvmOnrr5BusNXVAQSnYIfZCgHfiKepU6vHBll X-Received: by 2002:a62:16c9:0:b029:24b:a41e:cd6 with SMTP id 192-20020a6216c90000b029024ba41e0cd6mr21395524pfw.52.1620085754417; Mon, 03 May 2021 16:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620085754; cv=none; d=google.com; s=arc-20160816; b=GTKF5X4FujbcQtYgtke2bjaV45uHvI/CksjxY2P5GFYjkv9NWVlF1QgErm5nE1Frnm CcltPEr7W9v0bnNomJuxwNFfatmhlsnWYc/XN8Te58UnixCvFVlEzmrZPTduSLTD8YYD MEKKaMcPjbVo9ZLI4Bh6z1CwFTGcITFIT2OXhEX8d+ILyN3Sh7pYGwkMlYCP7JBMx+69 Kn/TpPx1UMNqJcFo6QVNyfXZOtCvDLjPziZZEFfyVwdI6pMCme5hU03ZuBEqADy4SSR8 NhAXxRkIFdB95M4EP/jWDjyhRrB4clko079jp5Eh05Q0QsFPOj2M6Jf6/9iiAm/Kk2L7 i1gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=8cxTD+RC9r0CXS9dr55V7a29XytNEKtivWFE6svy/UU=; b=KGr0YClCcbi8KQ6S8TWUdWA2tPUJDl0yPxefhcooB3a1v6I7cqcURmuU4Z7QN8pb2z rdjllNP8WgnVSIa9GByuC1/fm/TBjShwPsvbdKClcrUzyDQXqdR8Ko6tcsa7uMz5nyaW e6rZquSfDDbtnn2T3fdVTmkQk/5/lEcJ2JIKdjKhZrDhlPKPs7OaKAf5V5KD0grQtYzJ fD/ZNpXyFB86MNqyXMYmWm/pZfcKWwUUlYtOMYPzXib/0yt9f74ppQNi8Iux5d7PuILB Q55JnWOx0FplZs/hd/IIdJxT+xj6v2rkdVjzgUEa05SEFmyxgJCU1jc0frxuz1R4uPUL /++A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=KrSrP6H1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bg16si1156344pjb.44.2021.05.03.16.49.01; Mon, 03 May 2021 16:49:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=KrSrP6H1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229602AbhECXtW (ORCPT + 99 others); Mon, 3 May 2021 19:49:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229499AbhECXtV (ORCPT ); Mon, 3 May 2021 19:49:21 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEFF6C061574 for ; Mon, 3 May 2021 16:48:26 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id v6so8964227ljj.5 for ; Mon, 03 May 2021 16:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8cxTD+RC9r0CXS9dr55V7a29XytNEKtivWFE6svy/UU=; b=KrSrP6H1kg0Ou7qIlA2hC/fEOBjjQfOdxSm1qFRBv7hG/LVf94xY1oTR/3v8qlxSNU Y5cJkh+yGLgafUhxEeFCJZpZ0CpYr0JoegHkOpGzvdxEaFsNlt8k0Dih/m8mzHTSjesG XgRhnzhg3g7Qy7Lf0CH85Q//wk+LxtHK1uwqw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8cxTD+RC9r0CXS9dr55V7a29XytNEKtivWFE6svy/UU=; b=Vj/G2qgXrxQer2jhDN0As4fQYzZ4HT8QaUTKULDPyEWlk+r78pniz/U95Bu6p6tJTq 2FsPl/bfqh35wvY5hgE5t+jC/KnAU/HVDksNlq11e03HgpA4/jVAqcSw+uOn7os+QF3F y81zs4VzavTmwAYHdCbYVGepEQCwv3aUyZ0Gs+o2kO7yHkH/FDOtnSHx7dnJ1kGkoasa DZInRQo59HEOB5HveSv4ifvRz3RM5TrNI9q1Mkp5DoWdlaYcw/M27Hv3QGNSnT3V3HpR YkiULvcdJkWBUIYNIldvpeLgZ5eF05fHr6qPkh8eHomex/JrNLA9JOkvEDnb8GoaL0dP GyoQ== X-Gm-Message-State: AOAM530gEU+D4NMj+FxbW87I+7oq+V9Y6Yo6zafjv/c4dirstSiDC+23 mFqe30IrCu0u8gr7YvQKwdYbDpl19Qb9VCG6 X-Received: by 2002:a2e:93c4:: with SMTP id p4mr14810863ljh.367.1620085704983; Mon, 03 May 2021 16:48:24 -0700 (PDT) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com. [209.85.208.172]) by smtp.gmail.com with ESMTPSA id a4sm96567lfs.130.2021.05.03.16.48.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 May 2021 16:48:23 -0700 (PDT) Received: by mail-lj1-f172.google.com with SMTP id u20so8916561lja.13 for ; Mon, 03 May 2021 16:48:23 -0700 (PDT) X-Received: by 2002:a05:651c:3de:: with SMTP id f30mr344166ljp.251.1620085703543; Mon, 03 May 2021 16:48:23 -0700 (PDT) MIME-Version: 1.0 References: <8735v3ex3h.ffs@nanos.tec.linutronix.de> <3C41339D-29A2-4AB1-958F-19DB0A92D8D7@amacapital.net> <8735v3jujv.ffs@nanos.tec.linutronix.de> <12710fda-1732-ee55-9ac1-0df9882aa71b@samba.org> In-Reply-To: <12710fda-1732-ee55-9ac1-0df9882aa71b@samba.org> From: Linus Torvalds Date: Mon, 3 May 2021 16:48:07 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] io_thread/x86: don't reset 'cs', 'ss', 'ds' and 'es' registers for io_threads To: Stefan Metzmacher Cc: Thomas Gleixner , Andy Lutomirski , Jens Axboe , Linux Kernel Mailing List , io-uring , "the arch/x86 maintainers" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 3, 2021 at 4:27 PM Stefan Metzmacher wrote: > > If I remember correctly gdb showed bogus addresses for the backtraces of the io_threads, > as some regs where not cleared. Yeah, so that patch will make the IO thread have the user stack pointer point to the original user stack, but that stack will obviously be used by the original thread which means that it will contain random stuff on it. Doing a childregs->sp = 0; is probably a good idea for that PF_IO_WORKER case, since it really doesn't have - or need - a user stack. Of course, it doesn't really have - or need - any of the other user registers either, but once you fill in the segment stuff to make gdb happy, you might as well fill it all in using the same code that the regular case does. Linus