Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2240435ybk; Mon, 11 May 2020 15:56:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4Jy46Ggk6Fp7R/JQb9PGVOsGD89I4C/u3NUzk0yZ6Ly2pSx25Dwcit3icyovhuOyJsflS X-Received: by 2002:a50:fd04:: with SMTP id i4mr372773eds.43.1589237789296; Mon, 11 May 2020 15:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589237789; cv=none; d=google.com; s=arc-20160816; b=b31oDqJk3GW7CkmYCVGRC1pgijgIvb0rGGCuLFYkr8AI5sUW05r+Hm8sG79EdJMP2T jm752EqFNnsV9ddptHoFYxXwxvMghyBlsZpf8JD7M/w1VcyyOcPH1F/FRIyT6tI/f/rT O2TRk2ZKePXfRZGRBZwpUnw0Zfg9nA5pIZvsGdIkMV+lhJWsuOu0fOnBnCi1iUGdCB+B T9vtUU0x2JlZKprThdDiPKU/whgIkawt7ZrtPKhfy32PJTc6VEUB+b9VsoSojm/Anzte MVgsApMiifGrReptnLNYTfi/sexeUxLaVdaIDR8z2OjlBnpf+rLisAoucyVnLv1euT90 0xkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=GPqPt+LvpyhigCOhSWJiaFTaWdPgFw1mAm/F4h69auc=; b=Mfdh5jyRaxVRWxg+xRq6w0U0hpF84w8k4Bvf3L+LDD1Mg9MW76QipAU3f2yd9oO7iT Xq5x+9mfN7YF0tNiLFHezpvX7Ep4g2omv46X2JSTGvvMBpZtIO1KU3gSMKw2J+tvd4gb FtBqYHGQgdnay1q2q93zSo/WOGbShEknUoSqI15XfTNhtc3qcQFCz5Ax76ylyuYNaY8G DxMbHiuAXkwZMTP8Zzur80O6d4c25UAPPtQgWFas+chbP008bY59dg2Dehy71YYkW5ff q7+hgIdS/42ERpa2mNupDO7DFcT4wIFsUbochuLr4X9oa189Mk1XpDHQmOlRhIb1dIFc SLEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uftKWEI+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f4si4938019ejb.362.2020.05.11.15.56.06; Mon, 11 May 2020 15:56:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uftKWEI+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727858AbgEKWyM (ORCPT + 99 others); Mon, 11 May 2020 18:54:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725828AbgEKWyL (ORCPT ); Mon, 11 May 2020 18:54:11 -0400 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAC6AC061A0C for ; Mon, 11 May 2020 15:54:11 -0700 (PDT) Received: by mail-il1-x142.google.com with SMTP id c18so10403084ile.5 for ; Mon, 11 May 2020 15:54:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GPqPt+LvpyhigCOhSWJiaFTaWdPgFw1mAm/F4h69auc=; b=uftKWEI+n9GZB7RWezlifiB8sDtRPtbEmmq8HWPjeWwJ/cRYg2pl5241xRCuo4BSo8 YIt7mTpu+MNAxKxfMKwf0r6TzoEGEEnbPoaBNwHaqdxlo5SJT8ToQPemoR0rJKzVBak9 EYGunad7teqx3hUoYD2jU8JiGxklWqYQyidGtANjKQGDeQH4tuTrjI1RHN0rN85y52tZ 7/qRpGbRDFCotBApI6/NmVBtyvlKxAkIVbboat/cdWxDZk4URHiTOvmLYPtC2BE79xzq xxeinuSye7EkIV2qSaFvgnxdAg+wgP1/WufaWIeRM1foOzSfUHWd+I9AAjAsBESWOhHt Jbuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GPqPt+LvpyhigCOhSWJiaFTaWdPgFw1mAm/F4h69auc=; b=Z/agDtt3XTVzz77J3fVuU4bv/SWRGoy0P6gdmfS0KAe0pLgK32ShbApJy27ro4znOP QkXaC7eVf8bmu+IrDFwpx+E79FqthTd0H5RHCcFe/4Oe5CeBR46gxytlVgHTI+uJ/fy1 fC+p0hWR3dfxEN+3L78/rbqtCn3AYehs3kEeKC7w1IwdKq/p4Lu8Evw+1OBTXR4orHL2 Yytgpas2993ZyYjbqbvOhlwhM4+13b937DLQu13f0qL4OhbQiqqmi+9rFFHuV3RFgWxR hDFreUMr0td4TmwIHHSEKpgcm+c7iKGvb2q1Y9i1sDSTizhoWrWq5mGQWGIPk995aVmb iEgQ== X-Gm-Message-State: AGi0PuarTGSSWvvTd6zhRb6pA/gdBRwxv3TRbImz9KnrsnOnba+FC/Nm /Tbr3sKfuSHJTL0z2jhHiJon0fCEoYW9YbTMXw== X-Received: by 2002:a92:bf06:: with SMTP id z6mr17283577ilh.191.1589237651050; Mon, 11 May 2020 15:54:11 -0700 (PDT) MIME-Version: 1.0 References: <20200504230309.237398-1-ndesaulniers@google.com> In-Reply-To: From: Brian Gerst Date: Mon, 11 May 2020 18:54:00 -0400 Message-ID: Subject: Re: [PATCH] x86: support i386 with Clang To: Nick Desaulniers Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , David Woodhouse , Arnd Bergmann , Linus Torvalds , Dmitry Golovin , Dennis Zhou , Tejun Heo , Christoph Lameter , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , Al Viro , Josh Poimboeuf , Masami Hiramatsu , Peter Zijlstra , LKML , clang-built-linux Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 11, 2020 at 3:34 PM Brian Gerst wrote: > > On Mon, May 11, 2020 at 2:46 PM Nick Desaulniers > wrote: > > > > On Mon, May 11, 2020 at 11:09 AM Brian Gerst wrote: > > > This looks like the same issue that we just discussed for bitops.h. > > > Add the "b" operand size modifier to force it to use the 8-bit > > > register names (and probably also needs the "w" modifier in the 16-bit > > > case). > > > > While it does feel familiar, it is slightly different. > > https://godbolt.org/z/Rme4Zg > > That case was both compilers validating the inline asm, yet generating > > assembly that the assembler would choke on. This case is validation > > in the front end failing. > > > long long ret; > > switch (sizeof(ret)) { > > case 1: > > asm ("movb $5, %0" : "=q" (ret)); > > break; > > case 8:; > > } > > So if the issue here is that the output variable type is long long, > what code is using a 64-bit percpu variable on a 32-bit kernel? Can > you give a specific file that fails to build with Clang? If Clang is > choking on it it may be silently miscompiling on GCC. On further investigation, 64-bit percpu operations fall back to the generic code on x86-32, so there is no problem with miscompiling here. On a side note from looking at the preprocessed output of the percpu macros: they generate a ton of extra dead code because the core macros also have a switch on data size. I will take a stab at cleaning that up. -- Brian Gerst