Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp449233lqr; Wed, 5 Jun 2024 10:28:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV8RII7Js/tfYxdehPJ/IA72oeXbftRf5zrmTrQn/3lJzACDhe8blptad4hbE46RI0u9j3PU227+uKdV94Lc8O6qiBPC8QUgqk4kUm3Mg== X-Google-Smtp-Source: AGHT+IHhR03BS1+ZiYXVEaEPY8/Y+14+Ls0rVjbnuyg+ms3LQxJaO30+thwJNMRdlOKer2+Hb6b1 X-Received: by 2002:a17:906:2590:b0:a68:2d37:fb5a with SMTP id a640c23a62f3a-a699f36365bmr263456166b.4.1717608512659; Wed, 05 Jun 2024 10:28:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717608512; cv=pass; d=google.com; s=arc-20160816; b=okDjgFtTE/bT7UGeRAwAESX8nwNx/VTn1qHtataSCXJdjRnBpas084K6PauUkKj9jm UtvUB6tQkILTuz9I1gdodx0M/O9ss2M6Iq7cAySXLFeDsIW/WtiraYTmaM88l4cvTYNp auIBXeviHm+ct4ESU+1Q85Gp6mAVpPm5qEXnYcFcM6xAneDq3p7yBlp/RZbhoPFDtp86 VEXL2+CQkS5X7z4ewJfdWIm/oWmh9R+QQEc5fB8moLytYrZmhzf/83dkH2zTEXsanjk+ dWDybWSwHaDNbvrT+vX4san4qbasj58Tl/QJuqD+PqtuFTWAh4p9rXsixEmSr4Mc2H4V mOrQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=PJRw7eSxoA2KEV9jozZythLGW5dH+2O7MsCsi/2+KsA=; fh=lFHjCJIMe3lsH3oFH0qaBmkV+AIiMPOfS3n91RjrC48=; b=g0YABsK7tIDMZQGMg2MkHS8mHDdHl9XL7WUnhxa60CnvtK753Q6GUFn2fsGUZIB2p5 uSESRZx8uEJ1oKb7DApzxv/BBr9eyG3l9gvJekv23ugzOZgEzGFBOgRU0Ag7m7gpCWhl LOEwEhhpRI7MgynjojQ7WSWPiuNU+qGPbm4tbn/n9lwsNBhVVDaGBqZmRVXJkKBMGOku 25+MaAp310FnwM6Hhi+Ila5ssC8Kl5yrfpYiBD8i5yMy6uESloK7JHewWC52DxVt+K2D yVDWBlHLsPEDrCwJdJliFgsk6HKkcR2RN4k1dJAhRoe+rynE/Un7KqmxhLknXmDnTdng jm3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QLW96YGG; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-202975-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202975-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a68cd3f0857si432919666b.734.2024.06.05.10.28.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 10:28:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202975-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QLW96YGG; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-202975-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202975-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 51BDF1F240A8 for ; Wed, 5 Jun 2024 17:28:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B04D13A3E7; Wed, 5 Jun 2024 17:28:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="QLW96YGG" Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4647D17559 for ; Wed, 5 Jun 2024 17:28:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717608505; cv=none; b=TNevjmlWj2ktl2t3aMhh4gynLgzJx7VZoNLgaU8B3SloTVBf8ufsjcUR/ERCdIjT0W+UWn7hfh+nBQV30Ja4P7rKMkv4n44riKCUAZmiD5hXYGNIkLorio8WOHueVF8r1h0c3gWizG7ctEMT9q66435akGHkSk5vth8AsIZK50w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717608505; c=relaxed/simple; bh=XP6tkOFd0C072GwY8agXH+2tb4jHU3NoYBT8an63N8g=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ua95+N8NY2F5FFmdrBWiTOo5NnmuNFyY7KXfLu1AuqGX03DwUpwRIjYiaLaC6h2hS+0ZTvf9FuZvQMdAVh9hRUm6pD6OJ8Emi2oGS6VKBmcJ6PiJz0CqvDj8cprEku557UX8ghllJJPvzkejt78uU7DHjdt14kLxGDTJn88AhaE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=QLW96YGG; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a68f10171bdso13725766b.0 for ; Wed, 05 Jun 2024 10:28:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1717608501; x=1718213301; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PJRw7eSxoA2KEV9jozZythLGW5dH+2O7MsCsi/2+KsA=; b=QLW96YGG+UxI95xSyWdSS0SjIAAO+lzGx6ymOjEXIAeilgYgvjZn724BY+sY5KCXeu rGVJ0VqgD6c3oSftp9a+fcXs+NY2LVLVnNqaeAIaNmvvx7Yi7OmrYjjYMHmk03rJ/vFo 3KDAFzSEeYPlc+qcdjm1DcJqkKC5JzOMp9myc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717608501; x=1718213301; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PJRw7eSxoA2KEV9jozZythLGW5dH+2O7MsCsi/2+KsA=; b=WNI76AIG6xk0tCn6rM2cxeNKYe1Ua/4XPeBETtj52EWfo8MECLL5ldvyJiMQ7Vqgqs tLoaTjAaYXfp8fjc20IPNOaJKpf6z04ZQVdx7lVVtCMytaDUIQiMVA2mdgo5eHChMrCg LK+gQf+a0NLjYdQimS03Ak+gDEjuGA+CExWFFmZ6RB6FfCw8lE60ZMwosKWCZI+H91pA p2UZks9RZcr9cObHUhCpLhKIn6uHvcO2nMmBil4MgKCKkgqGUwlBtGyu1qRgroKai4Vw OFlPf7nTv8eK3C2cElIYkU/hoJrQGBNih2nSJoidQOG3+GMhOTRQIzNPHHfZa0mvkFcO VY+w== X-Forwarded-Encrypted: i=1; AJvYcCV0yE8yMg+Jg/JvB1lPTWRrXYhWsC5WY9npDMVIT2eQw6SiiacsURBZEWSgfx4wEyB6t1FqPav37+iGVPBpZqwUjprk+1kwL0ku+kuJ X-Gm-Message-State: AOJu0YzZWW+/RiRGGZybks8BwWgTT3cvvTt0Gsf/qLVF80RrxJfaqLLi PUJU9Pk5G3zZ57L/JIsI7rZBaovw33Twp4YMXBYiTklN+T5uEl+MCVWVg1QQXPhTeh2wEDYF6FY 1/W3KSVXx X-Received: by 2002:a17:907:bb84:b0:a59:c23d:85ce with SMTP id a640c23a62f3a-a69a000e2bcmr252024866b.51.1717608501382; Wed, 05 Jun 2024 10:28:21 -0700 (PDT) Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com. [209.85.218.49]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a68cc45cea7sm619236066b.51.2024.06.05.10.28.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Jun 2024 10:28:20 -0700 (PDT) Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a68c8b90c85so8446566b.2 for ; Wed, 05 Jun 2024 10:28:20 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVz6CG0Uqbetq9/W2iDQPksHvj3H1jJ7NMcQCB1MEso2Qv+q/SKiqN3Us08XbpTmgcRTL8rkoWX6X+pWq6kKildBsWnTSBNt4osOFVH X-Received: by 2002:a17:906:2b9b:b0:a59:b02a:90da with SMTP id a640c23a62f3a-a69a002af78mr237486266b.68.1717608500241; Wed, 05 Jun 2024 10:28:20 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240605083557.2051480-1-mingo@kernel.org> <20240605083557.2051480-4-mingo@kernel.org> <20240605141733.GC25006@redhat.com> <20240605162610.GF25006@redhat.com> In-Reply-To: <20240605162610.GF25006@redhat.com> From: Linus Torvalds Date: Wed, 5 Jun 2024 10:28:03 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/3] x86/fpu: Remove init_task FPU state dependencies, add debugging warning To: Oleg Nesterov Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Andy Lutomirski , Andrew Morton , Dave Hansen , Peter Zijlstra , Borislav Petkov , "H . Peter Anvin" , Thomas Gleixner , Uros Bizjak Content-Type: text/plain; charset="UTF-8" On Wed, 5 Jun 2024 at 09:27, Oleg Nesterov wrote: > > Yes, but kernel_fpu_begin() never does save_fpregs_to_fpstate() if > current->flags & PF_KTHREAD ? Ahh, and init_thread does have PF_KTHREAD. Ok, looks fine to me, except I think the commit message should be cleared up. The whole sentence about "But the init task isn't supposed to be using the FPU in any case ..." is just simply not true. It should be more along the lines of "kernel threads don't need an FPU save area, because their FPU use is not preemptible or reentrant and they don't return to user space". Linus