Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp1283418iof; Tue, 7 Jun 2022 02:26:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0dA/o7Tl0cSnyitc98lxPpcWcUqgtQMakQKLWNSBMzCvgCUv5/1gVVHuwMlDuAlZc9J9U X-Received: by 2002:a17:906:d555:b0:70a:c0f6:6d2e with SMTP id cr21-20020a170906d55500b0070ac0f66d2emr24315200ejc.3.1654594008832; Tue, 07 Jun 2022 02:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654594008; cv=none; d=google.com; s=arc-20160816; b=ekQf6vYCP2wgZcC6EDwVpMDMhvoqV+7+qmFuoh8JzVmwqu0xmIgL4XLWI726+t95SD ezbt95jtkb03grukXoSfU8C2LGwdgsijZFVS2Gx4mUmagAedbRrdbFyyw+adS3oMGg78 M3ogg2dkL+ztUqlJWRXTVmjuheh+9jjDDeFicUyhmMTvjPNRCJyiEgV1Kz9t7ceW11vY a+6HZkY0Ql0SDLehBwsqgHWkf7e8VPvv5ECYcrASbu+kHvmvq13f9M9md4DTxUxueKAU eKam/VmM6HuG3zJFbfxgwYjtdKLVn/dtWp4zOu8ftvUNEmcO5NXfV+Tedl0c13p7uaOR vsrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=OVcwc2sHusOOh0nu9Pt06N+s8Xx2ijJaFMUsraj325k=; b=HONoaxwlSa1D/Xy6sIEQOrZl9pJCfUzn1gPqqlrZWUWtSLJdE6HHS9IHTK/BJmCShP VJOoaIvIrzJWesB/zBXO4668sLPvlN7g2bvde3ewMtLpizx2M06aChG7EeB6Cngd1J2x x/2ajUFQmg4yvD0TSURTRl5J6ilSg8gG8Tpz9NUdXFLOejvvEJt3PLY6G4tIHtCnC6Qa qQMFNgrccPsdY34/ma4OgGm4m9YMGED3y20Dj3sfsdYK4R/i75evJrSwT85BcMMdNJSq Hxu61Y6+8lqzHOYU9xwUSvofhrpA3oaCcrDvboiMLutE2ugcmvCNWS0CCjLErdERSArz At2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Vl6ZhlLa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hu9-20020a170907a08900b006fef8adb675si892050ejc.953.2022.06.07.02.26.21; Tue, 07 Jun 2022 02:26:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Vl6ZhlLa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231853AbiFFV5q (ORCPT + 99 others); Mon, 6 Jun 2022 17:57:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231645AbiFFV5p (ORCPT ); Mon, 6 Jun 2022 17:57:45 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30833532F0 for ; Mon, 6 Jun 2022 14:57:44 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id y196so13792685pfb.6 for ; Mon, 06 Jun 2022 14:57:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OVcwc2sHusOOh0nu9Pt06N+s8Xx2ijJaFMUsraj325k=; b=Vl6ZhlLa66LkHCjy57MVpd00ciLWPXkcoPC2OwQw++69ENr9/ERRDcHAE8hWh9qyG7 iCM7q+pu9vVi7jXS0NOEsdjvFV63N8GHH3GYq+8tR3FYS+ft/+ycx0kP0Gvf72Ie6U6s fuQ+x76yrZmJZ1ddUzUF8UlSc/SRZ8I7j0LzxyT0eC39+N29h7Zh5QK4rgrUQu2V99F+ 6CgzaUdLDxLA7crr+JPw2g71MdChCAIhFTwC+uyBHUxZt99E6HD7Z/oaadKtpm1/vk+O iWVVCYdfRRdX/fcyw4tHIOXoCw6ADMwhd8mh/+f398ZURQS85tv2B1MLyMh30gGDKcQk ubmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OVcwc2sHusOOh0nu9Pt06N+s8Xx2ijJaFMUsraj325k=; b=CX8gJduiLpbtuN7+eKCi6cu2yPYPspXB6nI9emwBgawZ+eXzZ0C8oHSIOI9DsO9Bia cp+g72SVg2YrWyfiVNFCnsO1TrxDP+VdguNJzY3aCs4TqYVo6hrOOcxfbCiV3iL9nA8Y 8tdpWn/Xo4kg85L77nHGz9YHZKYfyHc/G2f/2U4a6+hdSbndelwINkdHngn6LM/amTBX M/5GnvpZyY47pkNAjbjNdSSt1BmcHMv6+hLGgQIhyHSssgDRglUeWZvzvQ/qBXt5+Uo7 hhbJCxDrUT696nEJQ1krsdE6aD7Be4Mhm3bzfsJ7QJHEO2qHEUTWagvSvbz9XKOTZSCF TylA== X-Gm-Message-State: AOAM532jRz6h6YDidfiIGnLcV/TlUEJjBMCGfruLlXg1V1ccRS4AMOAe gQojUfFqB/FxRtgwltMu8FpUKCtZrEHEDv1imbZAGZauIpA= X-Received: by 2002:a63:24a:0:b0:3fc:52a9:b5d6 with SMTP id 71-20020a63024a000000b003fc52a9b5d6mr22439371pgc.132.1654552663428; Mon, 06 Jun 2022 14:57:43 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Mauro Rossi Date: Mon, 6 Jun 2022 23:57:31 +0200 Message-ID: Subject: Re: arch/x86/entry/entry: RFC on recent kernels building error with llvm 11.0.2 internal assembler To: Nick Desaulniers Cc: Nathan Chancellor , luto@kernel.org, Chih-Wei Huang , Linux Kernel Mailing List , clang-built-linux Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 4, 2022 at 12:13 AM Nick Desaulniers wrote: > > On Wed, Jun 1, 2022 at 5:57 AM Mauro Rossi wrote: > > > > On Wed, Jun 1, 2022 at 12:09 AM Nick Desaulniers > > wrote: > > > > > > As Nathan noted, I messed up the commit "ANDROID: x86: entry: work > > > around LLVM_IAS=1 bug in LSL". Please see: > > > https://android-review.googlesource.com/c/kernel/common/+/1521061 > > > https://android-review.googlesource.com/c/kernel/common/+/1560152/ > > > > > > If you're using an older toolchain, you'll need just the first. If > > > you're using a newer toolchain, you'll need BOTH (or none, including > > > dropping "ANDROID: x86: entry: work around LLVM_IAS=1 bug in LSL"). > > > > Thanks Nick, > > > > I had already applied the squashed commit composed of "ANDROID: x86: > > entry: work around LLVM_IAS=1 bug in LSL" (the one using .quad) and > > "ANDROID: x86: entry: fix LSL open coding", so I have already: > > > > .macro LOAD_CPU_AND_NODE_SEG_LIMIT reg:req > > movq $__CPUNODE_SEG, \reg > > +#ifdef __clang__ > > +.long 0xc0030f48 > > LGTM > > > +#else > > lsl \reg, \reg > > +#endif > > .endm > > > > > > So in principle my kernel image should boot when built with LLVM_IAS=1 > > but to my surprise all my systems (Sony VAIO i7, Intel NUC DN2820FYKH > > with Celeron D2830, Athlon 200GE) are affected by hard reboot when > > executing the kernel image > > Might need more info. Do they boot when LLVM_IAS=0 is explicitly set > with your command line invocation of make? i.e. `make LLVM=1 > LLVM_IAS=0 ...`? Can you launch these kernels in qemu? Yes, kernel 5.17 and 5.18 built with LLVM=1 LLVM_IAS=0 do not cause instantaneus hard reboot and proceed in the boot stages The complete list of make variables Ihave used is as follows: LLVM=1 LLVM_IAS=0 \ CC=$(abspath $(LLVM_PREBUILTS_PATH)/clang) \ LD=$(abspath $(LLVM_PREBUILTS_PATH)/ld.lld) \ AR=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-ar) \ NM=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-nm) \ OBJCOPY=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-objcopy) \ OBJDUMP=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-objdump) \ READELF=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-readelf) \ OBJSIZE=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-size) \ STRIP=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-strip) \ HOSTCC=$(abspath $(LLVM_PREBUILTS_PATH)/clang) \ HOSTCXX=$(abspath $(LLVM_PREBUILTS_PATH)/clang++) \ HOSTLD=$(abspath $(LLVM_PREBUILTS_PATH)/ld.lld) \ HOSTLDFLAGS=-fuse-ld=lld \ HOSTAR=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-ar) > > > > > I'm trying to understand how to build (and boot) with LLVM_IAS=1 and > > using clang 11.0.2 shipped with AOSP Android 11 > > I think this combo should work; we are testing x86_64 with mainline > https://github.com/ClangBuiltLinux/continuous-integration2/blob/95b9a12cad31675118d61c26d0b541fa4e3c8f09/generator.yml#L1694 > > Could be something in your .config files though. > -- > Thanks, > ~Nick Desaulniers