Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1893768lqa; Tue, 30 Apr 2024 02:21:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWoLm+6hRa7M8wz21JXXMNGhdq++u711BCpFe/FAM08weMzFyBR0AibCXzFiPRxr4nO+77iMJKMg5o/ACnzWdvG0UNs6HWEUuVMELDcSA== X-Google-Smtp-Source: AGHT+IF1YAbX9/SxTzYkqG+64hHKYmpgKwLowlKcqd2qci//InTF8RzZWcJIpNZjn8ljeV1M04ds X-Received: by 2002:a05:6214:d83:b0:6a0:b4f3:d344 with SMTP id e3-20020a0562140d8300b006a0b4f3d344mr12596091qve.35.1714468870633; Tue, 30 Apr 2024 02:21:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714468870; cv=pass; d=google.com; s=arc-20160816; b=KmpFSw8MLaqLxW9l+MLZ/Wu/6AoS1pCCG7e7yGroWhzcHUJpD4CNxZsQKi6/ynWDCb QnocPQQyvC1iotCFNIwbI5QDiD1oboLrHgUQtiNiU4dvp3rdKfBSYhR+olRTdR0/Qg6F p+GcH2nAnsWftYs6gMAdiYsDrwU4X/08U3hhqz3heCQSUtN2pCWh2+05D/GZGR8CW9v2 HX684mayNQhInrpFCA0l1Amdxk/KFIXyRerRMEMeZKyXKKiiQbdRFPdIfFBvv/6JuE0y LS826SAc1hmR0o+mqy7n+9m0fQe4wD5smjdwFr2mMcTKhYvoUYiJtQKU6IE3Fl5CgDUW Uqfg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=xu4688X5LpIa9WsGUbdB5ty/Fonowhlc5KxUVayyEn0=; fh=SqqDQcUx4WuT0U/UZ0+ZsQHE443cyxgS6Et53nSLg0c=; b=sOcKDWGvbR7x4yDHxguL2TFWl6gUSssPdZ3FpS0tS4fbGZwd8PsTb1tMCT+5CLIWJg wCB14MOv+bi2RRfHbNs3Hn9MNtxeFzE7STj2NBAbfcyCdycMkkgMk2Mxr5Of5tHkUbGj Xtz8L9pdEyASFmPuWMhqGJY/jxNTIVykazHZ7TKckBp2Ar0GN2d9Ue6gqDBKpcKRkVV+ U+mshGN5R7DiLRhVxPSbKJhLAN1oyvaLAkOiE9A+bMhHfucE5mPYdevDig421sA6Mkfy onMJpeu3LCJHFVAZCobft6NQWf8kTW4+p8ZZI01GFR39HYoloGD6Ut8M+9VyCrGxvHN5 A2bA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Vn8aMbTO; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-163651-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163651-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ey7-20020a0562140b6700b006a0ca6080desi5379880qvb.140.2024.04.30.02.21.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 02:21:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163651-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=@infradead.org header.s=casper.20170209 header.b=Vn8aMbTO; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-163651-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163651-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5E3071C226AE for ; Tue, 30 Apr 2024 09:21:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 39F581A0AF8; Tue, 30 Apr 2024 09:18:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Vn8aMbTO" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 C57ED12836D; Tue, 30 Apr 2024 09:18:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468730; cv=none; b=oRZdp9b8BNfTwuGc4lGdeX0i3xhdBjdGnojSt1qgdrazL5J5iowd62MIrI45kGAYf0aasE8f/5qwz/qJg3n0jWgEh1fKqmg2fVcG+hXrUZyUwd/wwBfCdryAU0gugoP63oTAm3yxkk/8nfV5d5/JqW4dzzivBDGeqhC73N3p8+8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468730; c=relaxed/simple; bh=xu4688X5LpIa9WsGUbdB5ty/Fonowhlc5KxUVayyEn0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=A2i0wi9HsbThNaa6E8108lFUxIZH7AkfvJ19QPpYWi1tWG7cjpQSSej9C2KpK8th+Fqg3zoS9PdsZF6++hVq2FcDD6ryeqfP73C5v1cTwRgnjeI46b96xxNWEKA+wKztpRUw7p4wWNdaJjFoQJzOr0Xtnavr6FHFc5LmpNR22g4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=Vn8aMbTO; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=xu4688X5LpIa9WsGUbdB5ty/Fonowhlc5KxUVayyEn0=; b=Vn8aMbTOd8x2KVdzx4zx502abC 0ktMguPbT3STkiJJH+4+777WbgZ65KoqqWsk2WT/EuE9hUlfueqcxjDFMQ7+J8wJyDotHw30CVIOc RCqa8aB4lB2dfZ/WR273ADnGoXUuKd1HlgqZTFk90YCigUys4LbTLX1kTzOFAYvljtp/SWvbqluW9 /qaf7TSHDeEqR9NJ58xrV2OKocqbZ4zuCeDK0PIZS+R5BRPxjBxBzYVJNr8ucIIAcNmeG+nutSnqD tSgP166iVlyEUahURv+90me2NJ/BpEAnkg03NRU2o1IGia0t3H+HGspAwh5ra0/Y3qfvoU7knzLN/ tIxHbq3Q==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1jdB-0000000ETrS-2ro4; Tue, 30 Apr 2024 09:18:33 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 5C0DB300684; Tue, 30 Apr 2024 11:18:33 +0200 (CEST) Date: Tue, 30 Apr 2024 11:18:33 +0200 From: Peter Zijlstra To: Kees Cook Cc: Ingo Molnar , Erick Archer , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Thomas Gleixner , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , "Gustavo A. R. Silva" , x86@kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] perf/x86/intel/uncore: Prefer struct_size over open coded arithmetic Message-ID: <20240430091833.GD40213@noisy.programming.kicks-ass.net> References: <202404291013.B21EADD4F@keescook> 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: <202404291013.B21EADD4F@keescook> On Mon, Apr 29, 2024 at 10:18:03AM -0700, Kees Cook wrote: > Peter and Ingo, you seem to traditionally take these changes (via -tip)? > Can you please pick this up? I have been explicitly not taking these things for perf and sched for a while now. As I wrote in that other mail, I detest struct_size(), it obfuscates code for no real benefit afaict.