Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1553830lqt; Sat, 8 Jun 2024 03:12:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUM5NdM0ItUQzX6DPlLdePMv4DxQ40ltRnus9jMt2Jhl/BopQAKe782EvuJLuWvNu54c9osBClfdSIbzaxjO5cl769Ulfy92fLseJo1GQ== X-Google-Smtp-Source: AGHT+IHxXi+6Et5sy1//7KvbYvCFi26oBtjIyGfm5gUHefbMbxN/Js5ABn+dO483lIqgB9Kz9Hzy X-Received: by 2002:a17:906:f205:b0:a68:e6d8:3154 with SMTP id a640c23a62f3a-a6cdb9d9da2mr356033666b.71.1717841555520; Sat, 08 Jun 2024 03:12:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717841555; cv=pass; d=google.com; s=arc-20160816; b=pxu28IagFgf1c3E/nX4GldEuVimk5JiZje40cSQ+Q53uPDdVIYOw3hEirmiM9c5owI wOlWXq3ukJ+k8xHrmuT6YIDugbm87DPF7rzaAcDgEEV1VvGks2e77YmzmadnVfkYbeoN Pk9gclOLRJkshL4A/5q8qXDDGI8pimCnuzKdXVxMAYXHbPrMpflgjOr/41atY1/dyyHD MuO9Pb075qp6Xm2hkCIqYD2RUqNPbG8PWkEynCHnWJTuAG9mtPaCCO3uiTEcAdJeULJG IQ9w/wXUOfzkMRsxAtVIfpGpx7nCF9FZHE6izNDw525c2l0Ta6Xk/ZaOqonbnJGwOrBx t0MQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=Zl/wnclW1YLFdnrLABq5Cmz/7fnj1lvtNYBLhZzgvWo=; fh=+R7NYsGdpFdHR4Eu/mAiAlfKAXZdiIbSIzwiWMQialY=; b=RxFrGqH25RA3rGHdmQ6PVqs/Ylerq6FNfvvCeGks7aflIGEEZ/yYVAuUwbayJn4pkP U+/wnoUSrCLME386nwyOteMPbaDDO2q/lIbnoM2P+Pjcpdam4xmm+bwvOCqfNBwZCMgG prO2NKSW665+AOfuiXJgDQoB6rPfWowD7/NGbAp7xaQqZgxPcbkhCcQO4OC/JBLtc/Wk bubDXRsVf9E6gJ3y8sleTBzLucB87PZFeZKcoK8rr9ymr1zcKrQf/rnRXic9AYsMwz+b QSPVJzuvefIzS8JdzEAvCpSxjcZKOgSlgA5tyE+l9sx8i9pDcCEW6XOow54Z2x8qULk6 WzcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eRb+l02+; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-207008-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207008-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6ef7b32631si92209766b.1033.2024.06.08.03.12.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jun 2024 03:12:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207008-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eRb+l02+; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-207008-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207008-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 142D01F229B4 for ; Sat, 8 Jun 2024 10:12:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE95E1779BC; Sat, 8 Jun 2024 10:12:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="eRb+l02+" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36BD6142E9E for ; Sat, 8 Jun 2024 10:12:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717841547; cv=none; b=Z1TQyi7OkXQPu00cn48GheYyBYbgHag44wNculMf9mA+rfV2vCG94Y59RcqwDJyTHHfpyCnJSH1HaXyDcY5S0pgjKyPQa+j/CGryCMY8pedY/xQKqYjkBrB/nnHKfRXajG52RA7xgqOlixQQG88zKjj+7EcH2WFvAp6deLpZcSA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717841547; c=relaxed/simple; bh=Zl/wnclW1YLFdnrLABq5Cmz/7fnj1lvtNYBLhZzgvWo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=emSdP6Y+iNL/Ono+sz/eEgfo98X3kneHESoGmN8Ufye+Pre8++g3cHN1uWdWUg5WZMw0vExHFD3f9/fff+Z+suy+qdK1ZOYPuUJqtI99qE2Hmc6QBMCILenhJd/Vquk9yZK0WGyh1bn+X/5LAHMAtBf1ge7fQHE3w1xHOGwxjf8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=eRb+l02+; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717841545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Zl/wnclW1YLFdnrLABq5Cmz/7fnj1lvtNYBLhZzgvWo=; b=eRb+l02++u/Fjb5gOYhnMtH+iZttky1ux4tg9UICIcdAeso05i/pMlwxpqPXYcv0dBlieG tEDfQk70QE8u7s/79mIbDsk3bZVJTxw+XZWqrSI84WeX2ZcGKykOksz1YWbjga9dIATfGO ZuaVwYoygv8HZSmU9RRlfncBkeiXNqE= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-350-_pXjUw6SMFeoe_EYgWabAA-1; Sat, 08 Jun 2024 06:12:18 -0400 X-MC-Unique: _pXjUw6SMFeoe_EYgWabAA-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3AD491955E7E; Sat, 8 Jun 2024 10:12:16 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.55]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 0EE8F19560AB; Sat, 8 Jun 2024 10:12:11 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sat, 8 Jun 2024 12:10:46 +0200 (CEST) Date: Sat, 8 Jun 2024 12:10:40 +0200 From: Oleg Nesterov To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Andy Lutomirski , Andrew Morton , Dave Hansen , Peter Zijlstra , Borislav Petkov , "H . Peter Anvin" , Linus Torvalds , Thomas Gleixner , Uros Bizjak Subject: Re: [PATCH 2/3] x86/fpu: Remove the thread::fpu pointer Message-ID: <20240608101040.GA7947@redhat.com> References: <20240605083557.2051480-1-mingo@kernel.org> <20240605083557.2051480-3-mingo@kernel.org> <20240605133805.GB25006@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 On 06/08, Ingo Molnar wrote: > > On a third thought, while more readable, this doesn't work in practice with > the current scheme, because x86_task_fpu() gets called on kthreads in > fpu_clone(), which trips up the new debugging code. Yes, yes, I even mentioned this in reply to 3/3. > We could resolve it by special-casing PF_KTHREAD here too, but that weakens > the whole readability argument. I'll leave it as-is for now. Agreed. Note that PF_KTHREAD | PF_USER_WORKER is already a special case in fpu_clone(), see the "if (minimal)" check. We can probably do more changes later, for example I don't even understand why do we need to initialize dst_fpu->fpstate->regs, switch_fpu_return() is only called by arch_exit_to_user_mode_prepare(). Oleg.