Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3504778lqp; Tue, 26 Mar 2024 10:51:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXPJbwldwVSxE+KFgRZdBLZ+TzFPq3aVBw4vzht0kLBcIC6t0xP8Ni/cw6k6yXMuG9pJdeMI8QClEEGcThxriuJGLynvP2tBgmPPAQu7w== X-Google-Smtp-Source: AGHT+IHzK1+X1RWAblFnYpN06P+5o9XUtwdCU6q25G8M2K/KMCuEUdjriuUwGMzBDNbDWIpV6OXQ X-Received: by 2002:a05:6830:1dbb:b0:6e6:75fb:74a3 with SMTP id z27-20020a0568301dbb00b006e675fb74a3mr12350599oti.14.1711475482282; Tue, 26 Mar 2024 10:51:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711475482; cv=pass; d=google.com; s=arc-20160816; b=txu/CMwVWf+ja4foTJamChUcGLb8WCPg01dv8xkpDU0peJUWwzKCnIyvvwx9aKKkaF xBjp0IHA40D1PFq0ix0ISdgteWJF9qZQ+yT1diRRq5e5k/eFcAQKF2BAmz0+LVTmd3bV fo3U1d0ez2VSPAAJJHaYk7u2kxUJh1NTkoaHFvy6I25WniyYgNcVtyiXxEooa4WA6nv+ qIUaeBheQrf388YmNI7sr0XAMqN+icqElLiShXmfxPt6lRdWB8tes0aIft9Qwrw7q6bS R+iomKe3ST0rJR3kh4JUewu0PMRs2S9QcspG0ZN2NKWzV/UwiKFX0SGcx2EoluumZIWw jY0g== 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=OInvw2pLCNL9a/HYNNz1Jd3xF0ugYHZTriTHSuVCyz0=; fh=+R7NYsGdpFdHR4Eu/mAiAlfKAXZdiIbSIzwiWMQialY=; b=nNuCefAZ7IUB9mxG7ajISNhoB43+5yVGp8GXgfErNuoSwsZk43adDWpqNHy1cVIpT2 KD0VzKGeNGq+6M40C37dEbMC88EX0l/n/NSZBszMCfgjoxArLH91hxlrzb3ORSYpAEXT +iRxJ24bZ1Dv3vjo8o4kqvqhIZ0g8L7Sd7D4VUaUOMF0TDm27YBQpSIk6zaXSs5jw624 Zm6YkUenEX+5Yz9HwO8AO6CrCHbxVcrq/aLrYS1nHzY5jqgKMto3VTNtyqovvWG5zO+I fNJ98ENS0HT1+4FG0RkvYSgRe/hoxNlAxIZL7hQ5ancXZtRCbvwVGgj5qMKbcqT3HeHy Yuvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LYcK9D3h; 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-119630-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119630-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id n23-20020ae9c317000000b00789c65bc24bsi7923050qkg.724.2024.03.26.10.51.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 10:51:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-119630-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LYcK9D3h; 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-119630-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119630-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 04CF01C66512 for ; Tue, 26 Mar 2024 17:51:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 78B9C8624C; Tue, 26 Mar 2024 17:50:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LYcK9D3h" 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 000401CFB5 for ; Tue, 26 Mar 2024 17:50:44 +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=1711475446; cv=none; b=nMvsI941XNezLnVJ4Eh58nWOjFfpKjKfq0QAnngwAonvaExsTkeo3saTGLsFm25c2xCut+jkMK3+UCRdgacKaJptaYSe56b88FeP5PL2XqQzSYyZaNzv+VVRAmSK1YuKAfyPer7QJJKky/tzGCWteIn50PicZEdjURKRO66ErQk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711475446; c=relaxed/simple; bh=ZgKMK8xswTHSw8bkndycLMlEayJd2LqASlPalDvSrvU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GjRX7+A7Tkm9ZFtiAv9qgFfeH92iT+6TEEXtni4dOftpUUmQE5XHpCs+U7ZRWGWD5+66GYWYuHIS04NsJaemGAW/9PRZXuPGmciATUaasz6HeI3Dt+1u/p80/6IVSmbx2uKB9p/ONAjw5cMxG+0F8oJbL9soPSEWgJne+tXxZDc= 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=LYcK9D3h; 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=1711475443; 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=OInvw2pLCNL9a/HYNNz1Jd3xF0ugYHZTriTHSuVCyz0=; b=LYcK9D3hQSBwcHlpFLwIkA/5lFgs9u5beLs9ms55EArzbVCAcVf7aw3RMefCYL5buGqDgg TSLxihvW45QMCv/nTEZTnNx0ojBzLpaiTS8Gx2hkz2CaQn4iWqyYN+5IH7wTRdMB0Dkxyp V+e5Jhbj+5WM5E32CWagq7usKo9rK8s= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-404-mmcdDO0QN_iUXDYzsWu3UQ-1; Tue, 26 Mar 2024 13:50:35 -0400 X-MC-Unique: mmcdDO0QN_iUXDYzsWu3UQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6C4A438035A9; Tue, 26 Mar 2024 17:50:34 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.68]) by smtp.corp.redhat.com (Postfix) with SMTP id BB232C66106; Tue, 26 Mar 2024 17:50:31 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 26 Mar 2024 18:49:10 +0100 (CET) Date: Tue, 26 Mar 2024 18:49:03 +0100 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 1/1] headers/deps: x86/fpu: Make task_struct::thread constant size Message-ID: <20240326174903.GA4539@redhat.com> References: <20240320131908.2708438-1-mingo@kernel.org> <20240320131908.2708438-2-mingo@kernel.org> 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: <20240320131908.2708438-2-mingo@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 On 03/20, Ingo Molnar wrote: > > --- a/arch/x86/kernel/fpu/init.c > +++ b/arch/x86/kernel/fpu/init.c > @@ -38,7 +38,7 @@ static void fpu__init_cpu_generic(void) > /* Flush out any pending x87 state: */ > #ifdef CONFIG_MATH_EMULATION > if (!boot_cpu_has(X86_FEATURE_FPU)) > - fpstate_init_soft(¤t->thread.fpu.fpstate->regs.soft); > + fpstate_init_soft(current->thread.fpu->fpstate->regs.soft); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Typo? it should be ¤t->thread.fpu->fpstate->regs.soft > +static struct fpu x86_init_fpu __read_mostly; > + > static void __init fpu__init_system_early_generic(void) > { > + { > + int this_cpu = smp_processor_id(); > + > + fpstate_reset(&x86_init_fpu); > + current->thread.fpu = &x86_init_fpu; > + per_cpu(fpu_fpregs_owner_ctx, this_cpu) = &x86_init_fpu; > + x86_init_fpu.last_cpu = this_cpu; > + } Can't x86_init_fpu be declared inside the block above? > void __init fpu__init_system(void) > { > - fpstate_reset(¤t->thread.fpu); > fpu__init_system_early_generic(); > + fpstate_reset(current->thread.fpu); It seems that fpstate_reset(current->thread.fpu) is not needed after the change in fpu__init_system_early_generic() above. Oleg.