Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp176439lqp; Sun, 9 Jun 2024 23:34:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVX9y3yohPp+pVFZnNjDCTdNDGvEMeQ+fNqSkpk3BSRbqLuEJq0yI1WjmBu4X731zHaznCyQ1rNbqDB9vJt2VcDhp9okLkdJNBamW9rbA== X-Google-Smtp-Source: AGHT+IHiQhY4P5CObctPRiGuwVFBvjZqr/WSBuJPAC/+CAlwW7p46ei4ekwMqUJpv11n4oSXy0DD X-Received: by 2002:a81:8d4e:0:b0:62c:c641:f98c with SMTP id 00721157ae682-62cd55ed796mr80422597b3.22.1718001252589; Sun, 09 Jun 2024 23:34:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718001252; cv=pass; d=google.com; s=arc-20160816; b=CgS+ZBsj+dclM66o6eolJb/CIpwkXA2nOHZkv2/g/9VK+KBAU8TYy3DaGdJ7qaMsiC g+VNnrr7vYKMY14Lt/v7Rh1B39480WJmXW+N0q0gFTqiE6dQpp4cKQZSajHGSA+HmtC/ LFJIa81+8Axw0vRLYf94zFLWiPrKNnP4dlzkAah2tQ4wOEvyC+/V5rVMmkHThxZWWt1D dKzl3aaKgX1ylMT+gisqQ7HrJQVm41smSPRiKNeWKXNk30RSZcChEcHHCAsAx6PWRFmk DWHNjBAut9i0nVSqny8uzCRRavxLBxKHG98Frt/V/iMuYSPGIl18SPfWsO4X+hxS52QU 1DHA== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=9gK6zqTgKpjlACg4h6HavLGiLDLBpp/UYAUaHXrcTgs=; fh=y4MCSENQsOl6Xus9fzvYLBOp7HwNZ1xYuX4fh5e7yeE=; b=paJzkpWHsHVyN072o2TpDTbT+b+QnqId29vhTZJGBirZ8/iDY6Qgpu5RS8AIErTiKQ hLjksWEr0l6lqJjpIqq5Ym6HDikNoJmm31TOf4C5hkV1X1ICmP06rnE/D16aS6HZZscX S3r8alKzb1LMm3RvrT0Do6q35p6PGWiDzu2hSv1YaGN/F35rLdAN+DtYli76EhN200co WM6y8p/rWSwCS+d4DWp73ym83Hu0L/897ziEf20IYUSxKXjbcfQbbv+E6IIImK398Ndy lMqQOaYKNbZ7Ms7mhQGmdZ7+u42vjurI9n7kXXm9jxFBKeG4+WT9jEk8Ce1h3DGHtYls XnHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EEamhiTa; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-207741-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207741-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 6a1803df08f44-6b06cd9a508si49919526d6.468.2024.06.09.23.34.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 23:34:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207741-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=@gmail.com header.s=20230601 header.b=EEamhiTa; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-207741-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207741-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 4CF7A1C203B0 for ; Mon, 10 Jun 2024 06:34:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 02B51208B8; Mon, 10 Jun 2024 06:33:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EEamhiTa" Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 6F64E628 for ; Mon, 10 Jun 2024 06:33:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718001207; cv=none; b=l1HOoRj4CM32Wm94xatQ9ahOUQNokXScq4jg/mKQR8dSq+nlmd5LlYilXLumm0Q11U3cnrNuyawmJTRuLHXlpP6zYO4RbKzXU6o++QEyEjo+YBpjfkvWgVy2ArK3j1oHHpK4Vz+ACvxFRmnoO6ntcOi8WjI4ETLLGIlrUhnYqZI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718001207; c=relaxed/simple; bh=3GEEKaNRr4/oruHtaq3+7nIuJ2iAjEYceDiAt+oneM0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Cpegnbpr0rZqyZpq0MhjKn+PASbCaSkYxdyLFH+m7ceOpB9SPB01T3NKHBcTb4P0eP9MNTWHmuKLRX84LJWabu8K1/imVtBDmlkInnvx6MllI0EERq2e8SYFCTRA6A3D4hD/jBqZw8WxPthCVue29mDg/BTAN4ItFidIc1480Zg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EEamhiTa; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-42121d27861so35072255e9.0 for ; Sun, 09 Jun 2024 23:33:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718001204; x=1718606004; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9gK6zqTgKpjlACg4h6HavLGiLDLBpp/UYAUaHXrcTgs=; b=EEamhiTagPFDS+1bisWHhNaToQxgVJqFNDomud43LYa/dRBMIw3T527JVtYO0RwUBF G3EyDE2Hspvnn4jvfcYXGWG066WFfM5ADbQ4FvHh7c4A1VbsVpPEcg3vGNeDoc36xu2q 4GhwK7Lipco5YUBP3aemcv9fxtsdN9EdLVaFWTbPbvWCreYpU3ZgSEGq+UyBnzVDReK9 gfH1biiQXPYZfqfrdjkzoEeY1NVKOphgaQXi7v2bf/9W0P5hJDNqoK4Y5arBonF/uQZp kst9w5No6NZ4ckcBfbPq5sECZyNjPpMSQ5Nedd9t8S1M8SLEKzmZx4ji3DiZ6k0cXD9W vXkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718001204; x=1718606004; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9gK6zqTgKpjlACg4h6HavLGiLDLBpp/UYAUaHXrcTgs=; b=mxR49CAcx3hMwNs4hDjkwhRWtXGTaQ1zUkpe+8n9/LrEOUKx0cVYYlE1mz+grV5zAw 8uaWiIp8qnir+xeKXLuYnPvQdxML5WfHpTQg9RG+aUjY86XbViYwAkTjVk0j7T0kYAfU 6cckaqZII/1zxSi834r/1tWnoX7odhtBCyXG6/n1tY+wi1PhtTPxmbF5ErO6Q1ns+moN g7wIfR+Dg9ejOw7WXX59Six20ENX7b8vcr0fuLGyqOWRYc37tjgn1cUXJkpCvAdLhTb3 llG8YSrEmw5w2jsiTTICDvSOh5AT1ePmpfJzeFpoZzIszrMjbhU1QQN9QQKQUdRIsY5i lWMg== X-Forwarded-Encrypted: i=1; AJvYcCUAmonBAsLIJpYB1j3BMqxq9LrohoAQ3zwcsHiwBTbIUFgrCrAdDVGpqYxKCUedJJy/yxxF+FOd7RzVYtOOGp7amVzZ/S+weUKDhoBy X-Gm-Message-State: AOJu0YzcXe63rmFwXl4Eb3kBxezMMcnl3hOzLx2w49C2uWQTBInCUTS8 9pynqiIkJdZ24/xyIsKfKCPc8TcMiSlBC2jCxG4uSzKQ441l+BMN X-Received: by 2002:a05:600c:154a:b0:421:7e88:821 with SMTP id 5b1f17b1804b1-4217e883770mr30775375e9.32.1718001203532; Sun, 09 Jun 2024 23:33:23 -0700 (PDT) Received: from fedora.iskraemeco.si ([193.77.86.250]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-421e91c47b4sm15246425e9.35.2024.06.09.23.33.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 23:33:23 -0700 (PDT) From: Uros Bizjak To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Uros Bizjak , Nathan Chancellor , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Nick Desaulniers , Bill Wendling , Justin Stitt Subject: [PATCH RESEND -tip] x86/percpu: Fix "multiple identical address spaces specified for type" clang warning Date: Mon, 10 Jun 2024 08:32:52 +0200 Message-ID: <20240610063310.4498-1-ubizjak@gmail.com> X-Mailer: git-send-email 2.45.2 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 clang build with named address spaces enabled currently fails with: error: multiple identical address spaces specified for type [-Werror,-Wduplicate-decl-specifier] The warning is emitted when accessing const_pcpu_hot structure, which is already declared in __seg_gs named address space. Use specialized accessor for __raw_cpu_read_const() instead, avoiding redeclaring __seg_gs named address space via __raw_cpu_read(). Signed-off-by: Uros Bizjak Acked-by: Nathan Chancellor Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: Nick Desaulniers Cc: Bill Wendling Cc: Justin Stitt --- arch/x86/include/asm/percpu.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index c55a79d5feae..aeea5c8a17de 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h @@ -160,7 +160,10 @@ do { \ *(qual __my_cpu_type(pcp) *)__my_cpu_ptr(&(pcp)) = (val); \ } while (0) -#define __raw_cpu_read_const(pcp) __raw_cpu_read(, , pcp) +#define __raw_cpu_read_const(pcp) \ +({ \ + *(typeof(pcp) *)(__force uintptr_t)(&(pcp)); \ +}) #else /* !CONFIG_USE_X86_SEG_SUPPORT: */ -- 2.45.2