Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1505007lqt; Sat, 8 Jun 2024 00:32:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW6byaSFXsE/swGv+hIXSVsaYf2iz7InG0wWyNs0hAw0uy09YRW1jKctnqM1XVCak3W0khgNxHxMjbxpBzgmthu++RRYt++zf0RlNsVRw== X-Google-Smtp-Source: AGHT+IGFMMW5efrlCbHCtpUEJOvPc/q1UNv3yeIKzmbkQntvS1FpY/YMrMyR356VleQ/AORTVGW0 X-Received: by 2002:a50:ccc7:0:b0:57a:1aa8:b4ad with SMTP id 4fb4d7f45d1cf-57c50850425mr3478026a12.6.1717831950063; Sat, 08 Jun 2024 00:32:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717831950; cv=pass; d=google.com; s=arc-20160816; b=noh5w03Swx/yKkMwbv162Sk4wl76mtAzLEMTFSBmhFs7V1Z0ITAnHKkT5Jlr5mtuk7 kgkbSn6+rrGW5Bz8zbFHSOX5ko3rLxznYHE/BDSzWHTDWE50kFFXqly1qf1lkiiAQiSm 5FSQh/MCJ7UDQXAu+RtBb1Smt+c2tMYAVrToXh7XwdliwGeFavUVfJfjjzXoOYzIvsn/ Awr860mC4t44vWZhSxcwK98jVc/h63P+Ul/UrcYMQ73PURkpYGDavL1JLudReT4fCOC/ 9ms5LsBFy2nrO75fDzXh9XIFfIuXHnaZkvwiRtAPrc9Bh8aYyyiJiWv0o3fsi+K63p7u DJhQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:sender:dkim-signature; bh=/pI8EtYru5hEm3wWcZ31Y1A8dIAXFghS5t8weDUhvo0=; fh=ZrHbDSiANSBCmvivbV48JgZ35KGtehFV6ZNj4vR8U9I=; b=zLS4Poj9JtU2+qJz2+rLidcvg1qSAuhdnhLaDVGDGdb12VAqgq6t204GD28qk2m3Al Q4Gd8ACAtFTieV3A/cvTNdEvspVLBjHPgaCm8em0uFpuRgwaSOAIDdKet4Di6ijWKnS9 mB6HHG2crjtWii8/mNOs98ZddcQMxts4LqbK1F7X1vBIBc4dXwY6d2NRwapFsd84xPCk J6u3cDMrfMLnm0VHv1Rh31SRXPaxSkKJR+YsHJy6B661PKoNyIlpgtioXP0scfgYhTC0 ucdodKcThmuoTtVIuNBDwd7ZmLADDscWt6MOmrFa2MY3vZjJRJTyjD41n5ekMUogxuW0 1e3Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FI6qxPwl; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-206924-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206924-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae26162csi2494283a12.528.2024.06.08.00.32.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jun 2024 00:32:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206924-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=@gmail.com header.s=20230601 header.b=FI6qxPwl; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-206924-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206924-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 C22A01F22BB5 for ; Sat, 8 Jun 2024 07:32:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 69C00176AD9; Sat, 8 Jun 2024 07:32:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FI6qxPwl" 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 065D717BAF for ; Sat, 8 Jun 2024 07:32:17 +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=1717831939; cv=none; b=rjZoT5V75rbUdqxwhOO34T/jXsttclR2QMgWEwTmADtByMLiQcYXcC8dRgU2eR5KEVIbfHHUvNZJhBuzvltyXzkQC7gmRSGobV0yzaaYjbVnQTiVaRkcMfOphmAx+EwB8s12xEiMLz1RUrqNykk8MHBrogGyREHBbvrg+zGIoTg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717831939; c=relaxed/simple; bh=rwMiy+Ds8GGaENRlmuBExRRS//ZscoQv/UZrrNuC59A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SgJD1gejs3u8QlklJO+FbgaI5Z4tik9BEkwjCwYSb3WSS7z9fV0KsKOvGmjPcHLaRtZsvUNRVcB+Myz0pTENohllt/BDer75t3kguhmi+WsXTGsbSWAxNIwqiTWvPX3qciAT/bO4kjle8am+o4CelpnWYT9S2p3xwMpj9KlkziI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FI6qxPwl; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a691bbb7031so369458266b.1 for ; Sat, 08 Jun 2024 00:32:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717831936; x=1718436736; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=/pI8EtYru5hEm3wWcZ31Y1A8dIAXFghS5t8weDUhvo0=; b=FI6qxPwldO915IRRhGiLTVZOadeGS4h+HeCEKQ0pyth6wofMRkfd1c19E/kw0b4GpV Gy8ZXa1BJVgmXtrsj0yRcBgBky8IMJpKNJsW+RvCmeId38TxPDY8VzdGdOZ0npUSDFh3 Nw81DR4HDu2GlPom6Bv/5vQT35bH11EvplHJajpI7b6W7WeiXkA/C7X2vhf4WYk6n62T N2Sf7oROGMtRPmEq9j8cVLi/bLGX987JRrD11aTA9lK8g0SUzgkJ9dxRKMUkseRho/tT gTiR7CSL0QjPzvKhYhM3iBzKM8zlTqkrQMyLm1EOx7YNwCNOyFijS10t+FCkU88qlgxw CCoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717831936; x=1718436736; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/pI8EtYru5hEm3wWcZ31Y1A8dIAXFghS5t8weDUhvo0=; b=O3Nci8FgVJ7fRVXjxLV374Jb3gI+klWdU2HG8GgfT+X/oOk095XMWRTxcTdURonjmG IohSQcP3JDzXustz2nonBnqer+12ZfMkMhZXMKt+X7EKZ6yQVvnt8bIuDulgYvfFtWFe EkwVraL+UZ2A/amfWLqp0ZjzOT9WsGuWHAIuA2cpV950Y0JkskZuLECuJ73AKFuxzAHr sKSpe73pk3mvMHW72JjOKukedlmTkighgbwCMSn32+/wbBicCSjFjJ07a/4DrrfbtOJh 2f5a4wZjGTsP+SZTVDtjI0UuBeGQ6P0me5iXGYY4or27ZpI6ko6skvYw7s/oHUp9gcsc 3lJQ== X-Gm-Message-State: AOJu0YwFOIscZuuk6c59d9qk3yftuENHZtdjxW/wZV6oOepF+3Qvsg0U 57qgRq6orRkrBjCzszSfd9KRqXzhF2uDHsE5BSKIUFZtu2qwQxU6K92qusOZ X-Received: by 2002:a17:907:6d03:b0:a6e:fb3c:4b59 with SMTP id a640c23a62f3a-a6efb3c4cd6mr109071266b.77.1717831936095; Sat, 08 Jun 2024 00:32:16 -0700 (PDT) Received: from kepler.. (1F2EF20A.nat.pool.telekom.hu. [31.46.242.10]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6efe5262cdsm61350466b.117.2024.06.08.00.32.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jun 2024 00:32:15 -0700 (PDT) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Andy Lutomirski , Andrew Morton , Dave Hansen , Peter Zijlstra , Borislav Petkov , Brian Gerst , "H . Peter Anvin" , Linus Torvalds , Oleg Nesterov , Thomas Gleixner , Uros Bizjak Subject: [PATCH 1/9] x86/fpu: Introduce the x86_task_fpu() helper method Date: Sat, 8 Jun 2024 09:31:26 +0200 Message-ID: <20240608073134.264210-2-mingo@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240608073134.264210-1-mingo@kernel.org> References: <20240608073134.264210-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The per-task FPU context/save area is allocated right next to task_struct, currently in a variable-size array via task_struct::thread.fpu[], but we plan to fully hide it from the C type scope. Introduce the x86_task_fpu() accessor that gets to the FPU context pointer explicitly from the task pointer. Right now this is a simple (task)->thread.fpu wrapper. Signed-off-by: Ingo Molnar --- arch/x86/include/asm/processor.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index cb4f6c513c48..35aa8f652964 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -511,6 +511,8 @@ struct thread_struct { */ }; +#define x86_task_fpu(task) (&(task)->thread.fpu) + extern void fpu_thread_struct_whitelist(unsigned long *offset, unsigned long *size); static inline void arch_thread_struct_whitelist(unsigned long *offset, -- 2.43.0