Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1981486lqp; Sat, 23 Mar 2024 19:25:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV6cTC6Bl2AgbIeOoTRDJ7fD2Vx9NFVYlSgZkojTx9ZaOybFKQTkHj40/s/4cmLOktgjslGCKWaXaFFB559Xj5aB1dFYv8b5NXGEoRV+g== X-Google-Smtp-Source: AGHT+IE4R0U3iF/ddS+t0Z9WenyuBLjo0CnojH7ibnBq4B8gsnVojEWv5ecmzYt0vzxUcdxHK/p9 X-Received: by 2002:a05:6870:5693:b0:229:f251:401c with SMTP id p19-20020a056870569300b00229f251401cmr4371469oao.26.1711247150714; Sat, 23 Mar 2024 19:25:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711247150; cv=pass; d=google.com; s=arc-20160816; b=G/U1p5pWKk30clOc9rtNgoq9036HDgai6GOrSbqa5voaaxA+GEVAfqQxFngpoyYPE8 Q4dVwAU9/t8YPQUKw95dPLWZpURQ7HuiCd3XxIqbrxpxsxqaynVxw7EJaTWcTMJM6NDy oYjn3LZfpCMPA57sFyzAIHCipaIUZiRzwR3pjJWPzE7mSwt4X3/b5NcCmd5Gli1/vaGu E2fU0Sj8wrEz3eBpUQU4j2W2g07QwooNY2RmAu70no+DvxlRdtZiqx32bXktgCeeJ7xY 9T5efHdVNJnzf7UfxwhNzskNABW784ugbsBbMr8rimsL1GklC4wCriY1CGkGi4lTRimV DnIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=hjNxjQJRQ/l7WCeyRyW/5FcOffEjbz9J38JL7rInVM8=; fh=5smBcR6WYxFKGPr9ZbZaQGq2i4om/4cc5laE3qrJjSk=; b=gXnqU6tCrUCq0z/XUXA+GH+lhM7otqpdC8rRBJ9xbv509RxQhUrLsZIMd/KWMzFYZ7 go1X6tN0q+rKvNOyrb9xcad/lbawaCLegFuW3bWIyrUhhmhVMf78symU+hU0VOyZpOaX aRdicl1ovnWbCgNVaJ954aaWhqx3ddlwhW7ei+U6zr7r/2AD+bAf13kA9Gibc1Bn5pNM Hi1H7mlL3g0Y4N3thZsRGfauJRgVOLFcAGLzprn0ML0JkeJ9rgU8N1lFp2gR9s9Ijbzw ZlxKJtgte3H32CrOK67OKpHU2zx8pcP45bL/yPQpv9QiPzu/Siwl17PCOf17EQqVljlR LstQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bG9rclhs; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-112552-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112552-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n36-20020a634d64000000b005d6c2958481si4928414pgl.639.2024.03.23.19.25.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 19:25:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112552-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bG9rclhs; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-112552-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112552-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 584E0281EC0 for ; Sun, 24 Mar 2024 02:25:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB3F74691; Sun, 24 Mar 2024 02:25:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bG9rclhs" Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (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 5BED028F1 for ; Sun, 24 Mar 2024 02:25:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711247144; cv=none; b=lVFLljIBPD5cjrjC88JJK6oCmA0g7DEcrhJn6pr3Cm+B1LeLzMkLCBIKN4/VsVznw3MlYQXHdr/fM6CmqDNv3cKWe7UQXFi9xt3TibLEXEL5Uv/Hznbknu9Xkz08oalaGNmScE007JH1hmNHkqlu3m6U31iqMSfrcXCOBvHfP6U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711247144; c=relaxed/simple; bh=Lf8yoDkOzrlo1LsMbwoX0ZqzqnhmbHCAwtRTnmQiewA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Dj2+keEMxETT6E/YZkjm+o9wrcY1IOmvjRNlcLqw145TB+NiW6RM1xmBdrjEGbcXT6lJ8nxOEQwb/ju8Wt8UZ3HDedC+qjyDcym3+gLSw7V+4i/fU5sVimJZE3+F/Bs2DeQC6v+enuE53aYtfqFlmxY348R6JHBC7E19FADRF8w= 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=bG9rclhs; arc=none smtp.client-ip=209.85.218.52 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-f52.google.com with SMTP id a640c23a62f3a-a470d7f77eeso410644666b.3 for ; Sat, 23 Mar 2024 19:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711247141; x=1711851941; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :from:to:cc:subject:date:message-id:reply-to; bh=hjNxjQJRQ/l7WCeyRyW/5FcOffEjbz9J38JL7rInVM8=; b=bG9rclhsXCVT2cso3Doc++TBF+TzflA9hr/HB+ChzOLQUKI74LSAAajqsw2D6Xqc2N JBodNs41T7+/Jy1t/F2V8zxef81onfDSwc8YxEQdRbgcjZNLw2z6a+V80mNzhGeHDZxK 0cSZkrx+3+4jkiukRQ2zHB2OtkPB68XjCzzuHs5Ithl0MgpAncMFDmeAqEoAxhdjrdV+ JCIsejrcLEIsk8i2MjmfUkJ7JujAbIyhfWvq3dgAu66TbhrTs2xzmflygOPiOeCkjIGB KE2JBRRrgsDt/eULbZ9b1P95NbjWzK4Vz5JbvouMHlBpi3oUDfzTzIXgcxghA83wtRDu q04Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711247141; x=1711851941; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hjNxjQJRQ/l7WCeyRyW/5FcOffEjbz9J38JL7rInVM8=; b=xS/DRFsHJNPVY/Qh/EDEzYASfP5OtKr+lk8zFJWPRplX4ffx/jglbY8pBSN/IlHqAg VKGO3SxHLWVod7qEHMMS573BOVCPVltDqI1fHS3mZAX08J04PrtSqMCIVRYd2h27pxay 9GSUDDPJFS34icmRyOvscoMZ1s76VeEvBVDdFIRUcbZHzRUPQrW3FgrpPuknTdNqAhFr skaInH3ivQLHOAxyZFQ9px6S2q6up0rruFvU3ef1EF8qOMHSvfU7ICfLkY/ZoloFJmH2 O0J/pbFRQItFHBk/YFtNK6RnpO6FU91xR6sm9OvTiAOCsS+DwsN5oYNXZTIhSOqkmz6r /vlQ== X-Forwarded-Encrypted: i=1; AJvYcCUPyKWTf02xGMqmAyThvBzuQ4nRN9LeAo7g8BAitVW1As3Ozl+flnObdQUytP6NYZ0xsTVyc/KVtGAxeZVW3wDXJG5wCOEwOD639PfB X-Gm-Message-State: AOJu0YwD9mpOG080zMdk49IHx0pqZRLVe8i784HAni77Aca/0e40q9X2 B9eXCNUS07GLJln7HJdDDR5AncQSYTGzcBNyrjXSb/cp3GjdOuwbM5/Xu3OvgpY= X-Received: by 2002:a17:906:f194:b0:a46:a662:e56f with SMTP id gs20-20020a170906f19400b00a46a662e56fmr2470442ejb.38.1711247140185; Sat, 23 Mar 2024 19:25:40 -0700 (PDT) Received: from gmail.com (195-38-112-2.pool.digikabel.hu. [195.38.112.2]) by smtp.gmail.com with ESMTPSA id e18-20020a170906c01200b00a472eb53793sm1498478ejz.161.2024.03.23.19.25.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 19:25:39 -0700 (PDT) Sender: Ingo Molnar Date: Sun, 24 Mar 2024 03:25:37 +0100 From: Ingo Molnar To: Uros Bizjak Cc: Brian Gerst , linux-kernel@vger.kernel.org, x86@kernel.org, Thomas Gleixner , Borislav Petkov , "H . Peter Anvin" , David.Laight@aculab.com, Linus Torvalds Subject: Re: [PATCH v4 00/16] x86-64: Stack protector and percpu improvements Message-ID: References: <20240322165233.71698-1-brgerst@gmail.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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: * Uros Bizjak wrote: > On Fri, Mar 22, 2024 at 5:52 PM Brian Gerst wrote: > > > > Currently, x86-64 uses an unusual percpu layout, where the percpu section > > is linked at absolute address 0. The reason behind this is that older GCC > > versions placed the stack protector (if enabled) at a fixed offset from the > > GS segment base. Since the GS segement is also used for percpu variables, > > this forced the current layout. > > > > GCC since version 8.1 supports a configurable location for the stack > > protector value, which allows removal of the restriction on how the percpu > > section is linked. This allows the percpu section to be linked normally, > > like other architectures. In turn, this allows removal of code that was > > needed to support the zero-based percpu section. > > The number of simplifications throughout the code, enabled by this > patch set, is really impressive, and it reflects the number of > workarounds to enable the feature that was originally not designed for > the kernel usage. As noted above, this issue was recognized in the GCC > compiler and the stack protector support was generalized by adding > configurable location for the stack protector value [1,2]. > > The improved stack protector support was implemented in gcc-8.1, > released on May 2, 2018, when linux 4.17 was in development. In light > of this fact, and 5 (soon 6) GCC major releases later, I'd like to ask > if the objtool support to fixup earlier compilers is really necessary. > Please note that years ago x86_32 simply dropped stack protector > support with earlier compilers and IMO, we should follow this example > also with x86_64, because: Ack on raising the minimum version requirement for x86-64 stackprotector to 8.1 or so - this causes no real pain on the distro side: when *this* new kernel of ours is picked by a distro, it almost always goes hand in hand with a compiler version upgrade. We should be careful with fixes marked for -stable backport, but other than that, new improvements like Brian's series are a fair game to tweak compiler version requirements. But please emit a (single) prominent build-time warning if a feature is disabled though, even if there are no functional side-effects, such as for hardening features. In general distro kernel developers & maintainers like seeing the performance (and other) effects of their compiler version choices, but we are not very transparent about this: our fallbacks are way too opaque right now. Thanks, Ingo