Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2005409lqz; Tue, 2 Apr 2024 04:43:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWVXdp8/ySrFysF8Ac8iSFAEnKDh2QDMdW5sTGOAYB6YqBxYjd/E+/iLGBv8AjbPPD+XLcYL36/4BtoNjqxVDZ0hNfPjDPdsZD8vJRoOA== X-Google-Smtp-Source: AGHT+IFPB0y8wEtsmW9CNtR4kCGJij7eGirUzWjErVS+a7Ap5m7LktdJ3c5OdhR5pj5gVioNdY/z X-Received: by 2002:a17:902:da8c:b0:1e0:d09d:ea59 with SMTP id j12-20020a170902da8c00b001e0d09dea59mr17991329plx.31.1712058203100; Tue, 02 Apr 2024 04:43:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712058203; cv=pass; d=google.com; s=arc-20160816; b=DyF/nsjDpi8fr0iz+bJOaRpODfN0bCwCrDw8zqlCVSc9L3Wsn0nDGI1gOYpDOB3w8X 156XH7BeYEf1T1rkHywoX7M60J0CR2n9vHoXRl0SpQw1AkTWwcTb0YX5ETYBpm+ZN8KW 8iBEYpSd+LehL4LWeKi8f0ghgLtiyjO6ymAtzDYsokJYsdCJbwAOQOJM9x+P4uSAUmH9 YUjrFAxTo/KeenXileLbNyqgk7jLfsnu4wkJn6v1b1TQXBkJLVpQnS1ZuTq95i8fHzGb 5Bp/pvK6kSDm9J1gFRJOSO9zUSXyXLFAkGhXAO/lOjOVZ92uET6agR/NK1mYYYyiEWJ8 DuPQ== 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=wfh9sdADz/bkMRKMGA3whYn+hr88GJ3D+Zq/YxNJhsk=; fh=Z/cQ3M93CB5CaKGED785p49ao+gDOFfDA35q1Pm4H5o=; b=N8sTQumhVyhHzmdVCi+I9fv7GrNtu9p4P8zGUeSZPaOu5ZYuilHgiuBqXsLflhu0vL k9ldhPKbYHnzhLSy1gRu4fATfPZJDOvJMDr40hZjrzI3Fv7TxUys+2k+cZpVx/bFwRiY WCs+zqH9DRF9zaTA0bbx+rMfWzxG7NagaZKneMtE3qD+4enBVikG5ieXtps0hxIH73MH /qe0g1sFEIcdZsapzPEv8FmKol9QtTseD+AEsmpPejwevk/qidoVYCbFLEuLC1JFJzX+ uomNjUdOh/yerYR5HDa4am1LPtFCbYeStaravlfR7Zc8fPk3IDkwLD5kQvKh3cnftYEB 5OKg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hKXZCc0t; 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-127874-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127874-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x7-20020a170902ec8700b001dee8339b9bsi11490987plg.24.2024.04.02.04.43.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 04:43:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127874-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hKXZCc0t; 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-127874-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127874-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id AE6B928630E for ; Tue, 2 Apr 2024 11:43:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 542BD69945; Tue, 2 Apr 2024 11:43:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hKXZCc0t" Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (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 B10412032C; Tue, 2 Apr 2024 11:43:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712058196; cv=none; b=CJC9H1adWXjWmw5rkyxmH/C72/lLY3uGh+PVm1m6hfHNm5uyyxunB3jb4QofOT2m7hBrj/7Jua7pmG1s4YCOEj+6xdOWQVcANSelLU04rCq7TnGnlMjtSPi9U+pjdOZJeU3ZzA7Iz02euuF5/FsuI64dwp3FAtXzStkdJQcJLko= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712058196; c=relaxed/simple; bh=wfh9sdADz/bkMRKMGA3whYn+hr88GJ3D+Zq/YxNJhsk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Pyufxuymcf3wU+agYEV78iXxwOBD8WsObFb+pe7oMGMJocaf6g5knoJEcJUn8E7UAy1iEit+i1zQmcUdNAc4bfISLN8hJh/Xe9tB/vYY79bmBVyQmBUGm6K8cN2ipIKX8qsr903fIoe4FFhmHK8mbm/WmGgumeUWXkvt8jCA8UE= 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=hKXZCc0t; arc=none smtp.client-ip=209.85.208.169 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-f169.google.com with SMTP id 38308e7fff4ca-2d80baf621eso31992451fa.1; Tue, 02 Apr 2024 04:43:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712058193; x=1712662993; 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=wfh9sdADz/bkMRKMGA3whYn+hr88GJ3D+Zq/YxNJhsk=; b=hKXZCc0tQNtMYBw2U6B3BDHsI8YoIv8aGK4TYW+2P6AarNaWssprfB5FMggn+6XhCQ 5H6cOxVZTy3th16LG/vH9y3My61ol1xt2o4UCEiyr+luHOxGvgAINst33VkGIXn6CuCc rLbWThQGTWqFpYM68SSLvOKC4ZT7RSAX/jLitd7Thin0NLLuKA2BNhnejme7on4W//6b JhrbtZf56L48ygv5cTZ8t4AX6iBLGeP2Ky+lhDIoSMnoasoTCwkvm+4JKWkdF/xE9Zdu t1SqVT2jBRbemPFh9+ZF4l2II8TMaIP8zJUZX1AfdDulVl1gpO8GqSZM5JJ6b+dP9Vb5 qc1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712058193; x=1712662993; 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=wfh9sdADz/bkMRKMGA3whYn+hr88GJ3D+Zq/YxNJhsk=; b=kHGMUcclIqxaf6A+DSW3MrG6/LrVOPApiAP6noOJpZhuOnh462lt/uvzBRa7h2XV+L 3dkOSGE9st1wPKa6ORFaG2JmCu46QwJR+vcl2uitrSRjuUsLvPDQs2p0cC21jctUJlHH ZDCngLR8/z3r1ZaUN+dLzVvoHR1z/81ZFT7mJ07DqWEsyPyPgrMUR0F3FaiuQVcHztur Cp1UwGKI63cRY0aDiMkIF7aqvu9Dwkq0mo+B4ljea16Dd4PVp5C3gxMV7C+QDfidy4H7 tj1juUBy7BPL7zvDTTqmVdimdvphqqu+kXZd5kyv7d7BLdgxkO5V5wEk04+mYaOPr5rX VXaQ== X-Forwarded-Encrypted: i=1; AJvYcCVxtNDeKGZU7K06TzZl8/WzV5gBWDi/AeBLA6UC76BvxIQ1AJAaZ3NvYXJkSnp07EpxhRFXCLDjC53cWpwdLxlJd7ivgbBx/TrpuvoykZvlxzCMvW3YcCGUVv9O41XuuhISNyJiWkFB5jgJ X-Gm-Message-State: AOJu0YyGh+KbTJ0aCBGUZgtZKWYx3ryalIgf6HUzTpBjbuIyX9+DlTWs Eq+SvOv2sLf5BwYv0gyBU0SoQDN1J6D10IohzgUTs4ol0ie1aUYr6vk12NVEtRNdAM5Jb5k7NKP JeFFuYoNxEEzVTOPjP0zsBgqyX+c= X-Received: by 2002:a2e:7a13:0:b0:2d4:2958:6daf with SMTP id v19-20020a2e7a13000000b002d429586dafmr7478985ljc.20.1712058192551; Tue, 02 Apr 2024 04:43:12 -0700 (PDT) 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> <87bk7ux4e9.ffs@tglx> <878r2ywk3k.ffs@tglx> In-Reply-To: <878r2ywk3k.ffs@tglx> From: Uros Bizjak Date: Tue, 2 Apr 2024 13:43:00 +0200 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 , "Paul E. McKenney" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 4, 2024 at 8:07=E2=80=AFAM Thomas Gleixner = wrote: > > On Mon, Mar 04 2024 at 06:42, Uros Bizjak wrote: > > > On Mon, Mar 4, 2024 at 12:49=E2=80=AFAM Thomas Gleixner wrote: > >> > >> On Sun, Mar 03 2024 at 21:24, Uros Bizjak wrote: > >> > On Sun, Mar 3, 2024 at 9:21=E2=80=AFPM Uros Bizjak wrote: > >> >> On Sun, Mar 3, 2024 at 9:10=E2=80=AFPM Thomas Gleixner wrote: > >> >> > That's so sad because it would provide us compiler based __percpu > >> >> > validation. > >> >> > >> >> Unfortunately, the c compiler can't strip qualifiers, so typeof() i= s > >> >> 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]. > >> > >> Yes. I found it right after ranting. > >> > >> gcc >=3D 14 and clang >=3D 16 have support for it of course only when = adding > >> -std=3Dc2x to the command line. > >> > >> Sigh. The name space qualifiers are non standard and then the thing > >> which makes them more useful is hidden behind a standard. > > > > With GCC, you can use __typeof_unqual__ (please note underscores) > > without -std=3Dc2x [1]: > > > > "... Alternate spelling __typeof_unqual__ is available in all C modes > > and provides non-atomic unqualified version of what __typeof__ > > operator returns..." > > > > Please also see the example in my last post. It can be compiled without= -std=3D... > > With gcc >=3D 14. Not so with clang... Please note that clang-17.0.6 currently fails to compile kernel with named address spaces [1]. So perhaps kernel can use __typeof_unqual__ (available without -std=3Dc2x) in the hope that clang implements __typeof_unqual__ in one of its next releases, following the examples of GCC [2] and MSVC[3]. [1] https://lore.kernel.org/lkml/20240320173758.GA3017166@dev-arch.thelio-3= 990X/ [2] https://gcc.gnu.org/onlinedocs/gcc/Typeof.html [3] https://learn.microsoft.com/en-us/cpp/c-language/typeof-unqual-c?view= =3Dmsvc-170 Uros.