Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2155718ybk; Mon, 11 May 2020 13:20:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOi/HjKmre+Xmm1nxtxBUTzlkL+JdkYc0Gai1/ATX35l5c09NxLQzIjV8Rxj2r8NyAubVT X-Received: by 2002:aa7:d284:: with SMTP id w4mr2248297edq.223.1589228449668; Mon, 11 May 2020 13:20:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589228449; cv=none; d=google.com; s=arc-20160816; b=ltm7Cd7ZyTgZ0MG82r9OBip5XdMex0162JwU6N0sW2WBtB1XziS7dck5ioWQPACI/e ll81CbzCMZLjYG+kLVGo5Y2IXfI/NCZCJfhBiGw5dPEq8TeDT58Sf7RI2NVgUjQLBOKI DHFw1mbOSLA1mvT2eOMDhbgdGpjCzAC2/8OvpHtv2AkZqjxoEmHRTP1a8qV7K5wIo35t ti8idu3a1lW7ITX6QhdXeMj2WVceskJ/tPu17CnTNft/nSJcGtDT7lcAjewh3iQXIOhF ndgxAQ0yJP9b338Ul0rbwWzl9v3g2C7DLcEwMPmv08TScfDHji8UZcdAa7UEcan/2tml Q1Uw== 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=+m8sVUgc8aPcmghox0D5Tb+emn0mp6DYOcFERI7ISpQ=; b=y0GEomjJiNYg6VS1pI30kfsSWWPXIH9ZJNpUrqQjWsSGN/PXs3ardKwjk6Jv05/CD0 aBBCOQES99gLbd/tERCquqepwTd03eO0KvpdSaabB28fWCxnN3xDwHwidY3+zzBoPo+P u7PKL1pL2DMAt3fBo5/6rxaeLFbfTlcyP5JoAlHm5PazyR7514weVbcwNohDN9USt8Lw Ys69TVeoHmufBeZXJPyXBn2ouhHFr03ipQD3pvmelimERfu/GCZ8Vc7unCWa3c3DSTyT DRC7L+dmz2VEVGe1y/kqM52sD612yqiedbATPxXDchfugoyRgsWMABrINUqrUHUI8tfn 9lBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ciEjpD2Y; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a18si6976359ejy.194.2020.05.11.13.20.26; Mon, 11 May 2020 13:20:49 -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=@google.com header.s=20161025 header.b=ciEjpD2Y; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731540AbgEKUS3 (ORCPT + 99 others); Mon, 11 May 2020 16:18:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727873AbgEKUS3 (ORCPT ); Mon, 11 May 2020 16:18:29 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FF58C061A0C for ; Mon, 11 May 2020 13:18:29 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id b8so5049035pgi.11 for ; Mon, 11 May 2020 13:18:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+m8sVUgc8aPcmghox0D5Tb+emn0mp6DYOcFERI7ISpQ=; b=ciEjpD2YdDzSCTfHuoXy/3ajnn9CSNdCqZ1psuhJVatGZygL37Iuh+7h7Ai7PCiWG2 Qh8Y438cE71v4/X/mh79hbmj/ZkPw8NVPzyrb1IubcctyM/7hfKld+4HzfBsGkIvLaQH NV2NEZYROQEWIajvRJF7j9kvd/oYzwEP6mc6YsFgb5fV8sT0HK3U/OgEZF9vA3iPHNvb iE817v59mM347GZ6KKbaZDnOPEngKh9Cxs8THlYMc+L0F1T+vmJ61cofOHZKuGyDvS+7 yWQ1wX0FGX88oV2bQFJGfpC1+A7c/fOuk4k2NSpJPWu5aHq4YM5q98QuJPcBaHe/RpT4 6pqw== 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=+m8sVUgc8aPcmghox0D5Tb+emn0mp6DYOcFERI7ISpQ=; b=Fzpjmx7vZ8yPq4RrKRQLZh+5zag1BhDmZ5YFho1fAUOOEYJKQZFQmk2fZ2cny9X2kn IOINYAKsaUeXu28D7gdplOPdZAtZJTWFeTD4w+/H+T32Tuk2tzJrrRUd4T7OKzl6fF2B VChC7FcESQJ1K8C2Va4fqF8IbHG5fhclkMLbjGHfdnsLwqfXzu8eoPhud00sB7lwf7ZG trEngi3tfgGNURv9XuCiPsbkXQ6jWzUgHVdOMGM8QQZ+8Bj5ycg7csBshf+hT99R3KnD DQvyjtB/uZx6FRSYxb3kifLJIQZcGnKtwmZyIrCRW6QIkCBof+4VHN14W/ZutMvvk2mb xbKw== X-Gm-Message-State: AGi0PuYMhXGllTxIfhrDVu92zdPSxGMelYqjhjxchkE7wXuhUsPgx3yT lHBI2veINLG1Dlvv5wVH0/lgFGFrVg0v1RDEPIVxtQ== X-Received: by 2002:aa7:8084:: with SMTP id v4mr15521498pff.39.1589228308658; Mon, 11 May 2020 13:18:28 -0700 (PDT) MIME-Version: 1.0 References: <20200504230309.237398-1-ndesaulniers@google.com> In-Reply-To: From: Nick Desaulniers Date: Mon, 11 May 2020 13:18:15 -0700 Message-ID: Subject: Re: [PATCH] x86: support i386 with Clang To: Brian Gerst 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 12: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. I'm not sure that's the case. Applying this patch, undoing the hunk in percpu_from_op() we get tons of errors. Looking at one: kernel/events/core.c:8679:8: error: invalid output size for constraint '=q' ./include/linux/percpu-defs.h:446:2: note: expanded from macro '__this_cpu_read' raw_cpu_read(pcp); \ ^ ... There's nothing wrong with this line, it's reading a percpu u64 into a local u64. The error comes from validating the inline asm in the dead branch. -- Thanks, ~Nick Desaulniers