Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp133975lqe; Thu, 4 Apr 2024 01:48:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUsoU5yBR3N0IeHx3z3Q5qYP3tkPk4oSO2cbBkmJApzOyX+VlCx9cBUCaiBj7C9ftJ/VeTEmh1skka6+AyNs8U/XRpbJLajJusnxAmUhw== X-Google-Smtp-Source: AGHT+IFEQ3PSA1ErYkgxFmANUVieqK4CBMXzQNYND0d7evZC4fELqx63NMp9go9DY7Vvn/ZG7PzQ X-Received: by 2002:a50:99db:0:b0:56b:9f82:4a40 with SMTP id n27-20020a5099db000000b0056b9f824a40mr1266905edb.11.1712220531561; Thu, 04 Apr 2024 01:48:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712220531; cv=pass; d=google.com; s=arc-20160816; b=HyTLU/l/KwhuuDig/55cfVLcl86y+3natV0axKbUhAg5RyzLu8f1oSvykjyKeioklq aml1KozZi+6uIcAMZ87nkcNuOLVAo2xAqbHkiGGGqs4U6cy60aei8tcC9FwFhx+2fSII Cp/uLGDmclUzEnudj+fmdUd7NFUKoIdFm8OAuPoUeXIirBVSRNPQFJtifEamSLZAoQD8 kqemmEsHayMUT4xLHRwXm94XsLbGwL6Uej48r0IhzdQEL8bh7mJC/xBQBXhNTsHG0QnC TlsHFsL1k2zLr1ZjPvee0ABkGYK7Fnl7A7U2/5AgkXZVZE77HSKwZ99NSURfMiZBukvu L1oQ== 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:sender:dkim-signature; bh=201J+X1AYkvpNmreLpHZ+lzNZ8LWCQdS27PNve8BW0Y=; fh=S3n5c3xHVG+83DikeFZmljPeJxaPSF9b/gp2cV5y+v4=; b=ei0+SCYzB3zTi15BHQbBMu+tDD7FX21HR7Qs70xWUJQ+eJedGfUVH27nGIgTQkSisK C7Qv0kZ4Hrfk5IVbJrb3UMWVscsR0uVuWDAnRu7oPgLz+kDag+vMy0snrdRvhYJQJL0x LIGblRW0ZjRmM4+n/CKmqEqp8PpB9a66Enbd5sGfqm7vOmcuO8f7eGXTeW9FD/Z7A+WJ /GAMKXKMrO+EQII0xBkohT7hRhZIPumEgm2hci6rNNawdKfFVcgQOGo6LUUnRSfIl6wz VPKZeJR0D6GJN1vq35g/vuD8Z+U7OL7XcTpSP593DE939b9XjTOWJcAjZgP5yPODtXyk rrhA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FUqZnihh; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-131132-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131132-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 p15-20020a05640243cf00b0056c24dfd782si7731144edc.687.2024.04.04.01.48.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 01:48:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131132-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=FUqZnihh; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-131132-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131132-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 2095C1F20CD5 for ; Thu, 4 Apr 2024 08:48:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 183187173C; Thu, 4 Apr 2024 08:48:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FUqZnihh" Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (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 540867175F for ; Thu, 4 Apr 2024 08:48:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712220509; cv=none; b=kqN2AIayhXTO53eBekZTzR1puZrAxkpmrPpaFRtHmfVxf7TL1fSFGNK06+WOhiDJ26o/lhSFPAE2ZxSpjg3sF+V/279cGkonANyzABQGbD+EFDgz0FwsuRf/r7uAHyHorkbcVPSF3YZz7DaMxBpULN05mHPMBexdT0bUmW3j8C0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712220509; c=relaxed/simple; bh=VAWm0UzP0DuDy5F1x5kFPa1dBtbP9phKW4djgHUapw8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CA2jZT1MBrQVDo0Kw/OynvqqLwpRa/auzvxDnvoP/GP/VnIjVY5et/YhOe47qgmD0wIemhJ+vVI5o/hPzDJCFT3hfdruKd0IBNJ6dI6yMoSDlPLjhFwVyKM560fqSwVrlTnEVGqijTVGVJZ91Uk8zZurFUBRoLGi0UgwleD5Fj4= 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=FUqZnihh; arc=none smtp.client-ip=209.85.208.176 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-lj1-f176.google.com with SMTP id 38308e7fff4ca-2d23114b19dso8147611fa.3 for ; Thu, 04 Apr 2024 01:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712220505; x=1712825305; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=201J+X1AYkvpNmreLpHZ+lzNZ8LWCQdS27PNve8BW0Y=; b=FUqZnihheGopBLSod5/xdE32m/5mTjMhJONTXs8EBKRsH5w3bmR6ZaqOoboV1F3MXs ZeDk8ud3562LIUYlNbDy0dQ6fvr7/VT8idRqN01n27WUaSYMnDgvZKELbGVk1I5kPJa1 S3xn3J6k1nv0AUXLqJneLEOVdHpUM0LltpVg9Fk5eIDGiZh2h+cL987Jm1RoWsO1aXV4 p0NQ2HhK6SHSfv90bbihSBjjYJfiBtN6arhqEgI1EgCZwPFjG7F+Y4RDye8FblUEPogX w82yRTcfjpNk+TMWcJrRTS7FFo5WSBfLgWkfNKo7OpAQEo79ALSmb4TI7ui0YLAC4FPw gKhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712220505; x=1712825305; h=in-reply-to: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=201J+X1AYkvpNmreLpHZ+lzNZ8LWCQdS27PNve8BW0Y=; b=T1TtfHyFjdfHOIBoxGhcyi2OOxJ4V2oniUUwQX88pBAzgmjdvfMX0woDapDquSC/aI SFiWXDjT1+kj5vw9SQ7Joy/RrcjbuQHloTzYrsZm1hIHpnPGP8SP3Zu+LPpJQ5ER/jp3 zkEhUsjXPzuCIgRnNOngzPiG6ZcUMTqKLKWyCHefhNXzwDUk3D2dA3Tm2w5rinK6GXwD jdyZkyH5uLP8uWYN/RJFGyMZhC0bVBNxLK1QcnkP5zqhRLZiFEUbCiWuBL7EyTgy5I+E up1Gvn+Z83Mj82Z4ZTW5npl93VhcbcTnfFy5KAjXLTdjHlSkSrLV88yxM/GHul13GsnN 53DQ== X-Forwarded-Encrypted: i=1; AJvYcCVfSHfz36uWB3ak/95fIiaE2tfbO7S5Nbdm8w2Vwu+ATs5YF7ITltTeHbRgNL/pfJ6+87PpYAuFkGP5FHM3TL7WZ3sHOKJakh2I4LKf X-Gm-Message-State: AOJu0YwPxEADD082YL/Dqhyp7BG4T2QRjXLeXSVmCeUdGZ20aY0u3QwZ 4fVxsuufQsAglPZPew4CgcG/4NMITF8E/RCklXcIei4k8lwFIT/I X-Received: by 2002:a2e:9a9a:0:b0:2d4:3d86:54e2 with SMTP id p26-20020a2e9a9a000000b002d43d8654e2mr1465676lji.27.1712220505083; Thu, 04 Apr 2024 01:48:25 -0700 (PDT) Received: from gmail.com (84-236-113-97.pool.digikabel.hu. [84.236.113.97]) by smtp.gmail.com with ESMTPSA id hi23-20020a05600c535700b004146a1bf590sm1850034wmb.32.2024.04.04.01.48.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 01:48:24 -0700 (PDT) Sender: Ingo Molnar Date: Thu, 4 Apr 2024 10:48:22 +0200 From: Ingo Molnar To: Uros Bizjak Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Andy Lutomirski , Brian Gerst , Denys Vlasenko , "H . Peter Anvin" , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Josh Poimboeuf Subject: Re: [PATCH] x86/percpu: Fix and improve x86_this_cpu_test_bit() and friends Message-ID: References: <20240403144648.3885-1-ubizjak@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=us-ascii Content-Disposition: inline In-Reply-To: <20240403144648.3885-1-ubizjak@gmail.com> * Uros Bizjak wrote: > Fix x86_this_cpu_variable_test_bit(), which is implemented with > wrong asm template, where argument 2 (count argument) is considered > as percpu variable. However, x86_this_cpu_test_bit() is currently > used exclusively with constant bit number argument, so the called > x86_this_cpu_variable_test_bit() function is never instantiated. > The fix introduces named assembler operands to prevent this kind > of errors. > > Also rewrite the whole family of x86_this_cpu_test_bit() functions > as macros, so standard __my_cpu_var() and raw_cpu_read() macros > can be used on percpu variables. This approach considerably > simplifies implementation of functions and also introduces standard > checks on accessed percpu variables. > > No functional changes intended. Could you please split this into at least two patches? Hint: 'also' in a changelog paragraph is an indicator of a new patch being justified, in like 80% of the cases. :-) Thanks, Ingo