Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1483832lqg; Sun, 3 Mar 2024 12:24:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUgivvpI+KAjBe5AiJiR/GaxKaZoFzt/yRVhce+GLHE1V/WBGvnQs5t4t3GH8wZpu7afAC+nFBXsVvapOGJPnQLO0GqPa2iED9WE1L6zQ== X-Google-Smtp-Source: AGHT+IGBqMr/Vsh7x0M+qygrhQR2n7fGpH4POHT0qVxnn9YSXG3PulQNmY5+1nL62Dm4jQHBGB4c X-Received: by 2002:a50:9503:0:b0:567:17df:697b with SMTP id u3-20020a509503000000b0056717df697bmr2162192eda.18.1709497464052; Sun, 03 Mar 2024 12:24:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709497464; cv=pass; d=google.com; s=arc-20160816; b=jkt00vTELYfglzNTX98J7DcfNnQPBuhll0jlNJFpwCrT9cx69q3lu3xGhtnpWukY58 CMO/L4yC635+On6WOc1aVc4fVGg50BImr8aPWwL5q9XUpqes8utAW7a0VXfwu6AeTosN gWP++JPM/+e8rxJfhDQu+BMWb3gZmqb4V0Mh88+aTbZlyWFtO9Yet4xcVcm9Ikceg0vO yjxG23bVATZ4SiUlXTv2sZ/VQAq/ZaxU/vAoSx19zumCZSlec69eHkFmp/NRKVaIjz7P muwMbJKawngeoi2hc7r4994zPxCJEtXhaJZUKh70wIjYqxwn6mlIDdyejn2G6O9zXD8/ Zr+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=wKfsyUf3DPHLb5+bNe7is8QSZZffVwOf6cpgOfSIHKM=; fh=UqPHiw7YJkBY9bA0sv6udLN9gKUHtJEheYVCJQX9ufA=; b=PdKZmY8QZK8XH2ApCOFMnOTSIDugTlqYGCuSWPKKyA1XQFjDQBllpkaCecxnbSI4ch 1oNk93I7fqSa+NvxqecDLG2LAGlcinataropCM3mNOQz9uHAeY1L303HbCWsKZmk69Ip EpG2ll+xxgJ5vLmSCPVsWF5K+XNXlSCJXCJjXea33BpdFJA8jUnQwC1ZCpcl++jJ0XhF WhUiIaEMTmnkyiJl09wt7YZO0OMHZr+06ePQfWBMELavj0wiwrbgJ5Kre+lk3fRGNz79 3RXhLzV3rL7q4vPrQHnZNZlfUv00KUZHGw9JSGglwhRQ42Czn9lR/C4NcD80m2pjJjF7 qQYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eOnNaB5g; 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-89897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g25-20020a50d5d9000000b005665e0d9350si3208239edj.388.2024.03.03.12.24.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 12:24:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eOnNaB5g; 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-89897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89897-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 am.mirrors.kernel.org (Postfix) with ESMTPS id C53F71F211BD for ; Sun, 3 Mar 2024 20:24:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD19879DC2; Sun, 3 Mar 2024 20:24:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eOnNaB5g" Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (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 55BE11EEF9; Sun, 3 Mar 2024 20:24:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709497455; cv=none; b=e0Mk4Z9AAMEWSQ2q6tvDMlQsuiuh2zKAjmlwYudJSv0fvS+eVp11AdcAdndX2Rni0JSj98ChR1oElk6Rkq0F5Kl72KxZ6CmPB+lfSgV+JN2MJI1c2enXDC3rN58K6W5buDRFWvTWw79zB6wQoLpOS7jcA0W0fxlbCq1Ls695J8c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709497455; c=relaxed/simple; bh=wKfsyUf3DPHLb5+bNe7is8QSZZffVwOf6cpgOfSIHKM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=FmgiIGFndpuuLi/FBubxPVbZZ/imiA3/AR4eQSnZyCexRJQt2rdYKdhLt/xmRj60b2W4rwbq/OKdxFyztYcXSrLwPkMfTzd8BcZIuyrTxd2gyrYigQaFOtXzgUQwoQnvRZgz+5NwBBqJ3g7zR7Fr3ZXFkyV2ZK6M+NxDed4lHIM= 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=eOnNaB5g; arc=none smtp.client-ip=209.85.208.175 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-lj1-f175.google.com with SMTP id 38308e7fff4ca-2d28464c554so51009101fa.3; Sun, 03 Mar 2024 12:24:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709497452; x=1710102252; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wKfsyUf3DPHLb5+bNe7is8QSZZffVwOf6cpgOfSIHKM=; b=eOnNaB5gwSKF+yAULC+bYkT1Qo9k1XYun7DX4jCjUMlV4Si3UocihWUWc2mkVpYl0i /UpASdJxhrgJR7qgX5ydHKUfvRflhZly3e8jsNDkLteQCO8Y5xGHC3yrVNsAKVxCqT1S S4S7wOvX0ilDxkoiWdz0fOZmu7vKcz+uySpf1V8OcQDZL/Sf9IRL2HE85/PNKefuFI2w m5ALkwIzpTRzcf6+1Sd6yCYNZgTlkXZCOBEhRbBypNctIn5EeuBMQUPfOWNuDIbTVy8p cVlXwyBXUi7HAJUxzEOexYCgWNdboK6xnG/eiND9tIcg/n0ItMrLdkUGh1xKLQS8Mtdp Filg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709497452; x=1710102252; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wKfsyUf3DPHLb5+bNe7is8QSZZffVwOf6cpgOfSIHKM=; b=Y2vHn+6toLa7gLsv3HFE4+qtUVjFvlcx/oQ7Sncle+vT3E/2MYAQ+rpQrxAAEJApo7 jHbOBVK+9JU0on6SJg96VbpOhqHOUZ+SzSQIxYK+s7Q3eFDiCkazABJsPTLrbK74+teK 3A5jjIA2obaJLUO1/h/3BNpzqRtWOyh8PZIXXQsgZ17Lj+XAlJWeMDxOzt3LdB8BNGZY o9WDiDyOZOh6y+JE8YM+JhGXVEc3tq52rqlwbzmV361OiWN4ueyhwucj9vT9k1NtR06Q h9drYzhK33oGgWHKPCE872VqLb+TNSYj/Vo4wtKC1CaaLC7qA56cwFRL/cU/aiEVdI67 POWA== X-Forwarded-Encrypted: i=1; AJvYcCVqRTGyJr7LWXNm1a+R7PgvZ79yLHoTg6HyUtqXHve+Lo1sCoWOaoOpY63GlTpgtZV5SW7G74Tpeb9wjZdJAM6BkMT3zRDEOBMxxL1FAhLk8ukGr4kKvP53KrRjAubVv4TuB4nWalD2Bdav X-Gm-Message-State: AOJu0YwnMgZHyjmI+CsuaGzmFnv9FcVZaOUR9/+whpcvLkDa+e19GMh8 hV4GluwcMvD3BNsHg1flk2ILuTDnVobl/7Q8n7+KfrZSyV6qyEDg8cGVsuNkDiaZ1f8St6AQBQq j0eGxgzpOpliXA6lR2t56Uu2wLVUaAOb7aE0= X-Received: by 2002:a2e:824f:0:b0:2d2:a19a:8625 with SMTP id j15-20020a2e824f000000b002d2a19a8625mr5046603ljh.40.1709497452384; Sun, 03 Mar 2024 12:24:12 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <202403020457.RCJoQ3ts-lkp@intel.com> <87edctwr6y.ffs@tglx> <87a5nhwpus.ffs@tglx> <87y1b0vp8m.ffs@tglx> <87sf18vdsq.ffs@tglx> <87le70uwf0.ffs@tglx> <87edcruvja.ffs@tglx> <87bk7vuldh.ffs@tglx> In-Reply-To: From: Uros Bizjak Date: Sun, 3 Mar 2024 21:24:00 +0100 Message-ID: Subject: Re: arch/x86/include/asm/processor.h:698:16: sparse: sparse: incorrect type in initializer (different address spaces) To: Thomas Gleixner Cc: Linus Torvalds , kernel test robot , oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Arjan van de Ven , x86@kernel.org, Luc Van Oostenryck , Sparse Mailing-list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Mar 3, 2024 at 9:21=E2=80=AFPM Uros Bizjak wrot= e: > > On Sun, Mar 3, 2024 at 9:10=E2=80=AFPM Thomas Gleixner wrote: > > > > On Sun, Mar 03 2024 at 20:03, Uros Bizjak wrote: > > > On Sun, Mar 3, 2024 at 5:31=E2=80=AFPM Thomas Gleixner wrote: > > >> I did not follow the __set_gs work closely, so I don't know whether = Uros > > >> ever tried to actually mark the per CPU variable __set_gs right away= , > > >> which would obviously catch the above 'foo' nonsense. > > > > > > No, because [1]: > > > > > > "gcc does not provide a way to remove segment qualifiers, which is ne= eded > > > to use typeof() to create local instances of the per-cpu variable. Fo= r > > > this reason, do not use the segment qualifier for per-cpu variables, = and > > > do casting using the segment qualifier instead." > > > > Right. I just figured that out myself when playing with it in user > > space. > > > > That's so sad because it would provide us compiler based __percpu > > validation. > > Unfortunately, the c compiler can't strip qualifiers, so typeof() is > of limited use also when const and volatile qualifiers are used. > Perhaps some extension could be introduced to c standard to provide an > unqualified type, e.g. typeof_unqual(). Oh, there is one in C23 [1]. [1] https://en.cppreference.com/w/c/language/typeof Uros.