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 F1783C47086 for ; Tue, 25 May 2021 20:24:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA581613CD for ; Tue, 25 May 2021 20:24:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233203AbhEYUZc (ORCPT ); Tue, 25 May 2021 16:25:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233048AbhEYUZa (ORCPT ); Tue, 25 May 2021 16:25:30 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CC10C061574 for ; Tue, 25 May 2021 13:23:59 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id j10so47952475lfb.12 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=OgSTEeebqupzzkXwLynK+xZ8IlhwAcjR/IE9Se32RSIYLa5kb++MJxRBQus8T/l7oP QK8EoHVapzxUzPyyFYHR2nz99/5DXbkK/kttT9HtCFdVOWiYM4+90aRe7TWWyZBUVEkr msRWMvkScDcftstHFOtISrjzOQtluxXukfVs7JYJiFB6saXWmTy0/NoQOHKMabaN/6q7 9qmEwmF+09DQE2tghjNECtd0zBNWPXoHEGMEioqCFN45pDatwc8TZB5FP/uOL8uPNkP0 TYLgouYuoTLPrapZo1n99yQMc/ubyWx6VEtGojZ/tVPQ8Ps/X6aryCoFHnz+1/VHLs3S 8Yug== X-Gm-Message-State: AOAM532d66nEXGjxxYSppMcvDc100K934RN0bbF5kLFCJG4lByJPzF8G eJ54BtVia0gDDcKlzjOTpJGXijlhwz9NiBuWSQs= X-Google-Smtp-Source: ABdhPJwVrmzCOEU7l6WB3Ml/mCWNV9DnSpfDGI/YCA1wQgN0CRWvjkamx6UEGxnYdtwmbMhNZqcafg== X-Received: by 2002:a05:6512:234b:: with SMTP id p11mr15520535lfu.102.1621974237033; 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 d7sm2193277lja.112.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 b12so32631442ljp.1 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: linux-kernel@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