Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2982372rdb; Mon, 4 Dec 2023 13:04:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IEWTPwhMC126eRpLSnt1FTW03N7W90aCGOP7L86IgwiRHxwJ7HNo1SNKjK/QS55q7LSe6Xl X-Received: by 2002:a17:90a:2f63:b0:286:9464:1bcd with SMTP id s90-20020a17090a2f6300b0028694641bcdmr175447pjd.43.1701723843788; Mon, 04 Dec 2023 13:04:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701723843; cv=none; d=google.com; s=arc-20160816; b=QuS6NS2D+KX0ogTlr4mLrn11TxaOSKRlW3D1XuSBStiZ6O6Tk492FgDE8XBQvLyjRC /NNHGnWH28rWy8WlG+aafyKMdkw8XzioA0mrD77PFqkQu402LhZjjDNPy6wa1kxtBHxo BOjp6QseJp31L/AZNfEqpwvcPxzflTEFoh5kvvXj7kRB6Zo/MvP0mx6R+M2lq5W/7t9Y oBEjhsXnvx5bTsG+c/47lu5ZVmIzpAVENTNKiUMxbUCf6atyhR/FugceF4vdHnrkObMK as/ctni3lqKonU1LrEUQt5LR/Z1QgBhzYl25T+xs6EJAr3z5riS3XX+rPErm94SU4OG7 8yjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VebkBDMF/S+hhLyx5vGUP5fSN93fqMXIrRDSIFqms58=; fh=eT/FVScr/FrB7Yz0vd2aeE6XY+DR20lSUL6JA/x1p68=; b=sPVKHT+E/cA59r3jLm8RLiY/qHC+sHsQ7wVu9yCLaw8PQy+5PlGFGi30EPLSh9Y+Ml Q/9EJUd1UDVmc7P4yX1YoQVEx56jWH5E1uQPC3MdLrEplGqQW13UD9GbSfDEhOxhE16j RuwBGCXwpLNXRAQ46Vy+CWMRmSp8aWWSPD/LOVmkHM31dSuGSknzTuifFqSxdHZ04xya 3FQCGYARHRcPxo9QA097m5DMcVFjRf/97eJ0Pl4rF1zPvUUJl/VhHV/wWiEs1Q1mAhWQ EIDbMgkUxmxUdJFQgG9ymp2WlW4V9pnn57pkNA5xIrpLyrAYMy2ZHnlPG6BlDDWw18D3 8J/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fh0ncSOR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id z61-20020a17090a6d4300b00286baae8345si1799948pjj.159.2023.12.04.13.04.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 13:04:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fh0ncSOR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 1BEDA80AA269; Mon, 4 Dec 2023 13:04:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233879AbjLDVD2 (ORCPT + 99 others); Mon, 4 Dec 2023 16:03:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233728AbjLDVD0 (ORCPT ); Mon, 4 Dec 2023 16:03:26 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB6D8D7 for ; Mon, 4 Dec 2023 13:03:32 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40c0a074e71so15771845e9.1 for ; Mon, 04 Dec 2023 13:03:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701723811; x=1702328611; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VebkBDMF/S+hhLyx5vGUP5fSN93fqMXIrRDSIFqms58=; b=fh0ncSORLsag1xlHHoBu+ZbyKpj7QgvX/lsMosTSiRmT5z/B1Wy0TyBEVcjybxhNnV xHhab3heY/XiYgUndWUU7v41oW2JZJKPM6J9mly5+4jiOeANkTNZrNEKfS7G3kPZHQnP ZVBsUm93hM4aGkCx8MqBjC37Oz6TlBlYdL9fnipKrmWLZ5/0IIvxrlGaoN1HkISOFTXb b9bSpSu7uBZK/33tY2XKblKqxotMsBKV8R1Lqq8675sh/2Fx88qoH9lIMcf8+9jlBZ1k 657MShICYZpxCUfAq2DOrDSYFldq90GWRKtzlbBZN+cVXRWTKCio5IRtDYpDXFh/Hdup pZ4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701723811; x=1702328611; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VebkBDMF/S+hhLyx5vGUP5fSN93fqMXIrRDSIFqms58=; b=Iq/9G+Sy+iWK8ArOthDddVTkeBLbodQt2OVVzZkHIDhnBMZ0rHf/8XA2/6KziMNxc0 m5FYYfP6ZUvUzPPGUB+Lb07oTnOIERqZQjR7k1qV812Kzgi+ffLxVNhzDBJ3LCOtqN/y XuIIEmCVQpo81CGYJAIDwYvcTtnRDwFoAr8hxZDhseD1pnoKDsCzm7/Qugm+p0Blydbv bo378CJBJQk5iY3gGyYdAzR70pwhemsWYTW7ZPf9lblsL6Gub5/yvslBuEi30e7JlcMV ren86KDhBKo03Z5tNoGTPhEWZoSdeJoanPeIWhTRmuR1BL3tKsBkUX4wc8SY7IsD9FRo 3fJg== X-Gm-Message-State: AOJu0YwqPBNcFKy2wO6PnFn9F+AiFOvhTT/LEBcHzNQ9dWwqwCIFqpwe XZgFPrJMtp+Ftl29m0WH2Cw= X-Received: by 2002:a05:600c:4fce:b0:40b:5e22:983 with SMTP id o14-20020a05600c4fce00b0040b5e220983mr3576905wmq.114.1701723811205; Mon, 04 Dec 2023 13:03:31 -0800 (PST) Received: from localhost.localdomain ([46.248.82.114]) by smtp.gmail.com with ESMTPSA id b18-20020a05600c4e1200b0040c08567bbfsm7414815wmq.17.2023.12.04.13.03.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 13:03:30 -0800 (PST) From: Uros Bizjak To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Uros Bizjak , kernel test robot , Luc Van Oostenryck , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Subject: [PATCH -tip v3 3/3] x86/percpu: Avoid sparse warning with cast to named address space Date: Mon, 4 Dec 2023 22:02:31 +0100 Message-ID: <20231204210320.114429-3-ubizjak@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231204210320.114429-1-ubizjak@gmail.com> References: <20231204210320.114429-1-ubizjak@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 04 Dec 2023 13:04:01 -0800 (PST) Teach sparse about __seg_fs and __seg_gs named address space qualifiers to to avoid warnings about unexpected keyword at the end of cast operator. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310080853.UhMe5iWa-lkp@intel.com/ Cc: Luc Van Oostenryck Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Signed-off-by: Uros Bizjak --- v3: Teach sparse about __seg_gs and __seg_fs qualifiers instead of removing these qualifiers when __CHECKER__ is defined. --- arch/x86/include/asm/percpu.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index 3859abad19ec..e56a37886143 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h @@ -36,6 +36,11 @@ #ifdef CONFIG_CC_HAS_NAMED_AS +#ifdef __CHECKER__ +#define __seg_gs __attribute__((address_space(__seg_gs))) +#define __seg_fs __attribute__((address_space(__seg_fs))) +#endif + #ifdef CONFIG_X86_64 #define __percpu_seg_override __seg_gs #else -- 2.42.0