Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4803798pxj; Tue, 25 May 2021 17:23:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGHHd+Lvile5xXdsG8di1KdscD9kb6BBwiG8pqO8r3j2+3y4zqlE2ZebY3QADVIzI2kNEG X-Received: by 2002:a05:6638:32a8:: with SMTP id f40mr269959jav.84.1621988596578; Tue, 25 May 2021 17:23:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621988596; cv=none; d=google.com; s=arc-20160816; b=chbPyg/cBF7HzG8HcXNpEGecLw48l+jwitfg5MYt7jJLNBp7b917wj4W7aDYovT0e6 DjMSzc7g+5w4r+SFi3yOd3uMgDV4qdlZXq815YpsExabG1eOCJ+Ia/woat/v2/GnOoee szJ09tkgConYI+V1B53OZAcAL3wkU7g29eh7yzIW30D+dojJyQ0n2mdYvwOOr+Ei9rRn YN0zFz8mM726nY/qPe69RdkkA9ASwN8K2pRIXRW/8Xayjkglbeop/9EqvNS9vDzyKH1F i7eJ9YfQoha4B4RTEs21pPDYdTKkt+7uK3pc/EzWAZtlzKrVQ4P/CCWjMovWSX/0TlyX iYEg== 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=hj6Q582YLSyCLF0bnaerXxki+Pd33TZxYnZYraN74n4=; b=N0exkOGFRkL8jejg+upPRYZko61yLb90pBl56s3NTySTiYrL7CwBskwF9rwpTy0DIz Xavz864WsWNa8h+LYowqgmMjBUen5i24zw0D0q9GoEa7qboePgPuVKPLVMI6r5t6FfGY QULtqalD0wfCFToN2V1SljBoWBs6kLNpLVjqTj48PaKF3KztStQNGr54YzPLT/jIEnfE 05vzGPKMmQ8PNhLBTUNqQvYNkBSO9MbwoC/yEvGPNl2b94N4s3eX4oxlSQn+A4zxgwbc GLnf9kIzBRaiqq+ZxY/NeUv7GedhZAqtaR8zMYtFJK5HamIJ1XfpgPnXS0DL+g3hACgG STpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=TnoK4xpX; 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 u9si20745400jat.83.2021.05.25.17.23.03; Tue, 25 May 2021 17:23:16 -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=TnoK4xpX; 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 S232744AbhEYUZb (ORCPT + 99 others); Tue, 25 May 2021 16:25:31 -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-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