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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C1B6C47086 for ; Tue, 25 May 2021 20:24:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 06E6D613CD for ; Tue, 25 May 2021 20:24:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233182AbhEYUZb (ORCPT ); Tue, 25 May 2021 16:25:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232744AbhEYUZa (ORCPT ); Tue, 25 May 2021 16:25:30 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63BF6C061756 for ; Tue, 25 May 2021 13:23:59 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id o8so39929576ljp.0 for ; Tue, 25 May 2021 13:23:59 -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=hj6Q582YLSyCLF0bnaerXxki+Pd33TZxYnZYraN74n4=; b=TnoK4xpXhETtWOipxAfkDY7xnLfXT0gia75k9ZmZywXVjOgGc0J/k3EO98XDyldCR6 mzyFCfuCIxdpqJ3tuAfdR9ieAxsWs4ecGpBxIH4fK5glh/G/Ezx78utwePLlMDxRkjJA fBhkAcKsA248MrkdVA84JGLbR4TOj/3J1u1IM= 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=hj6Q582YLSyCLF0bnaerXxki+Pd33TZxYnZYraN74n4=; b=OrNtXSshQCyc/m8RAf2/28nDCDlopOPmPy+dcfesWzZaVoKL5udxfSn8k8ZmrDjtr+ f1baJRX6Su7Qprp5tNBTtInwab7/jMRg10y1AvQFosZX2cwA5tBE1UcuR1/P3Zp0M3+O Y26V11qnU7M22kwia7xNEagJkJdZgPesqrhq0UVhBSJYZrfQEotMX5ZPF+XaCULSXsya ZtI6Y9Fkz41ubDOIXyqmiBtxGKJDLVJRYZGr6IGA+z/4UtQCXB6IhR8kY1YXBpqKGD5M fBVJ3aWC5ZsowZDQdS6BS1RST/qCk1gyAbxs1wt8nRR90ImYjXMupJm62tYu+7rn3GNK PIKg== X-Gm-Message-State: AOAM532kFF7U8BpxAmWbcUJZuXJt2MbNXlJL3VC+TsADVIqDfahj1G97 Y24xSuv60BFArRNirZnJ2gMF87tKZtCBhjzRJ1s= X-Google-Smtp-Source: ABdhPJyHmI4vwHTbPJSKh3B6Ix3AbBTBU1zXjzIgsQVbFQFQSS4ZfqdiABbz1xXmqI19LpdVB43tXg== X-Received: by 2002:a2e:b819:: with SMTP id u25mr21496984ljo.182.1621974237342; Tue, 25 May 2021 13:23:57 -0700 (PDT) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com. [209.85.208.178]) by smtp.gmail.com with ESMTPSA id h16sm2194178ljb.128.2021.05.25.13.23.56 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 May 2021 13:23:56 -0700 (PDT) Received: by mail-lj1-f178.google.com with SMTP id w7so26490667lji.6 for ; Tue, 25 May 2021 13:23:56 -0700 (PDT) X-Received: by 2002:a05:651c:8f:: with SMTP id 15mr23160163ljq.220.1621974235838; Tue, 25 May 2021 13:23:55 -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> <59ea3b5a-d7b3-b62e-cc83-1f32a83c4ac2@kernel.dk> <17471c9fec18765449ef3a5a4cddc23561b97f52.camel@trillion01.com> <3df541c3-728c-c63d-eaeb-a4c382e01f0b@kernel.dk> <4390e9fb839ebc0581083fc4fa7a82606432c0c0.camel@trillion01.com> In-Reply-To: From: Linus Torvalds Date: Tue, 25 May 2021 10:23:39 -1000 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: Olivier Langlois Cc: Jens Axboe , Stefan Metzmacher , Thomas Gleixner , Andy Lutomirski , Linux Kernel Mailing List , io-uring , "the arch/x86 maintainers" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Tue, May 25, 2021 at 9:40 AM Olivier Langlois wrote: > > If I look in the create_io_thread() function, I can see that CLONE_VM > isn't set... That would indeed be horribly buggy, but I'm not seeing it: .flags = ((lower_32_bits(flags) | CLONE_VM | CLONE_UNTRACED) & ~CSIGNAL), Yeah, it has that odd "first create 'flags' without the CLONE_VM, but that is only used for that lower_32_bits(flags) thing, and then we explicitly add CLONE_VM in there in the actual kernel_clone_args. It's because of how 'kernel_thread()' is written (that has historical reasons), and the oddity is copied from there. Linus