Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1261418lfc; Wed, 1 Jun 2022 13:25:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvcYXdpgXKD15Z7svVKLRZkkbPyDxxRGwlm3xv4t8xopEAKxkOOLriV4JR0/veJtMaBOYb X-Received: by 2002:a17:90a:1b61:b0:1e2:c247:bf5e with SMTP id q88-20020a17090a1b6100b001e2c247bf5emr1220243pjq.68.1654115148732; Wed, 01 Jun 2022 13:25:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654115148; cv=none; d=google.com; s=arc-20160816; b=pG1O5p/jo+i5rhyBCOWonkNdufEe/TlxjSK9P06RbbDGDVnm6VBl9EJEHNY5Fq5eJL q/PzBOl78xGjwiGSTUJs4vvK2nehE9SkjB5C6IYuiSE1B2v7hFfychzb+Hr5RDajDRDd z2PH/8c6bPZes64LXT9+vUJc6ksSwVNzIb7LvPN4Fw5ewcrbqVsjwEOyA5geitJFYxKg 64KiI1e2mScelUoSJfQCiwFEWw0c/dMNqs3UOdsC0LBKQUR/Loo7t3JXN7mMsvL3WVOb E5KRYcRjvprh+sDVSxVwX6deaHAlKkxYVoG9i9dqOjltfyt+Tc0UiGt0198hfd+1DcXc HiTw== 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=zWlLDjn8/4W4ntBv+o1Od3JuYjF6btG4WNnGzsI36yw=; b=v0qfNtvJ4FYvoulTSpAnTqhCYptg3xhzxDr9LomSrhsXg141SaSOM2kNnsdfugyd6O Qj9dAmxel0mKn5uMe8IO1MDT8L7SSlT8j35kWMOWJa+DVWmOrKQU13vqPpyrbWrmj8TW U7CweP6K4IQX7UepUL5aFQYopCwHYjyjvUbnrYJSNeaL+AxINDXGGGN5oR9oJWGFbHiU 2ypGnrFKc0fddAmHntbkOKJ1UsSgMvGTXLAH8LJ0DitzhR5OdCCF5tIVKeX63H3Nlw5L qv8PvgDn/47YbahrC5oN+bciGRhk3+Gs6fvuDO5ph2nFJZd5WNtuG5S9sqvgiNBr8Af7 gv7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=IKHI2dej; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id r18-20020a635d12000000b003816043eecesi3310897pgb.195.2022.06.01.13.25.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 13:25:48 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=IKHI2dej; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8931B10634B; Wed, 1 Jun 2022 12:37:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348318AbiEaWJF (ORCPT + 99 others); Tue, 31 May 2022 18:09:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231700AbiEaWJE (ORCPT ); Tue, 31 May 2022 18:09:04 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD865712D8 for ; Tue, 31 May 2022 15:09:03 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id t13so62202ljd.6 for ; Tue, 31 May 2022 15:09:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zWlLDjn8/4W4ntBv+o1Od3JuYjF6btG4WNnGzsI36yw=; b=IKHI2dejgyftlbdjsFTfFoHITHjSnAOxwD9js1qS/uigKcj4u5cGgok7Ag+LU8zORl RaHiVTb+Xwe22KqNgHFGLScZZ3g6ilQ8ixj7JPTr3zWVKEhTJxeCQromJdVWCN+XfgXI rmo5eGSG/SYDUrRqN1Z4i+CQEbsmG9AnvLDhan0NfPTfHVug47UBQUpVsGxwL1VIphI/ QTaGk2e30dGTx7a2vs6E4J6m4ILskPXAps/SlkyyPBuVY9VLNO3kTx9SpNe4tiyRMbmc bmJ+KTYruA8wOBE+Em7qoAwYwFuG1HqXMu1R7gbxqBAltkKtQpLA/XIxexKOAMVHT4n2 9vXA== 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=zWlLDjn8/4W4ntBv+o1Od3JuYjF6btG4WNnGzsI36yw=; b=33LdkbQynFYjkwn/ev6uIRyHw0qXfpOw16I9BfIBlGV7sldkwPNAuwuDT55oAHqUen UXME3VQUs9JNDPtJg9lQ89ccHeee7CsKkIeV1jz+mdCYwqKKswQuSFSWq/rjQ4VrCX6E O9Ca339O8Fq3HjLDqzWwWFog7fOrrs+KIO3EmaSDDMBewMQhSfTkp7uu/IbwFHW1g85o kYvFLzXR6t9uWffwqqy5PYr6m7cfcEly0XP4ONujch56uLkxBCB43k0u8x0p2BRB5xDm m5WRdsFQ0LRT8TKbeP7E5/owsGeM0mypy9yiwYM0tRmkivHS0Hh17XKyFNqW/8Tv7M7+ chNw== X-Gm-Message-State: AOAM5336viQEF24bM3c2EKAaW6GctpuEyEzPnMffV9etsA788sFEEuyy TAfcIP+goccPngqlf7TMzozDfOOvI1uk/q92gA5jyg== X-Received: by 2002:a2e:6d12:0:b0:253:e3b9:a56e with SMTP id i18-20020a2e6d12000000b00253e3b9a56emr28977673ljc.103.1654034941643; Tue, 31 May 2022 15:09:01 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nick Desaulniers Date: Tue, 31 May 2022 15:08:50 -0700 Message-ID: Subject: Re: arch/x86/entry/entry: RFC on recent kernels building error with llvm 11.0.2 internal assembler To: Mauro Rossi 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=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 Sun, May 29, 2022 at 10:52 AM Mauro Rossi wrote: > > > > On Mon, May 9, 2022 at 2:07 AM Nathan Chancellor wrote: >> >> On Sat, May 07, 2022 at 02:19:00PM +0200, Mauro Rossi wrote: >> > > > Alternatively, you could apply the hack that Nick inserted into Android >> > > > for this issue if upgrading your toolchain or turning off the integrated >> > > > assembler is not possible: >> > > > >> > > > https://android.googlesource.com/kernel/common/+/e58f084735b8abf744d61083b92172ee23d45aae >> > > > >> > > > I really do not mean to sound dismissive or rude, I apologize if it >> > > > comes off that way, but we have worked quite hard to avoid inserting >> > > > unnecessary workarounds, as they are ultimately technical debt that can >> > > > be hard to manage over the long term. >> > > > >> > > > Cheers, >> > > > Nathan >> > > >> > > Thanks a lot Nathan >> > > >> > > It is definitely the clang version 11.0.x which is not updated in aosp >> > > Android 11 production tags >> > > >> > > I will use Nick's workaround which works since only lsl %rax, %rax is >> > > currently happening >> > > >> > > Many thanks, problem solved >> > >> > Hello, >> > I'm back again because I was assuming that Nick's workaround was working ok, >> > but I have found that ARCH=x86_64 i.e. 64bit built kernel is causing >> > an immediate hard reboot at initrd execution, >> > just after hitting [ENTER] at grub/efi menu. >> >> It looks like there was a follow up fix for that workaround, maybe that >> resolves this issue as well? >> >> https://android.googlesource.com/kernel/common/+/cc7f7a84191f5defc2ea4633eeea4acb4486b549 >> >> > ARCh=x86 i.e. 32bit kernel binary is not affected, but is Nick's >> > workaround targeting 32 bit kernel builds? >> >> No, the file that the build error originates from (entry_64.S) is only >> built on x86_64. >> >> > How do aosp android-mailine kernels avoid this instantaneous hard reboot issue? >> >> That hack was reverted once the toolchain was upgraded: >> >> https://android.googlesource.com/kernel/common/+/ff0216d09fd31802537f2d1702ec2f3e9be73aa3 >> https://android.googlesource.com/kernel/common/+/3c2c8d8f7f2639e319212d10cb8df5bd13098dae >> >> Cheers, >> Nathan > > > Hello, > > sorry i still have the issue when building with hack "ANDROID: x86: entry: work around LLVM_IAS=1 bug in LSL" > I'd just like to understand why I get instant reboot in 64bit kernel built with LLVM_IAS=1 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"). > > I searched for the places where #include "calling.h" is used > > utente@utente-3TB:~/r-x86_kernel/kernel$ grep -r \#include\ \"calling > arch/x86/entry/thunk_64.S:#include "calling.h" > arch/x86/entry/entry_32.S:#include "calling.h" > arch/x86/entry/entry_64_compat.S:#include "calling.h" > arch/x86/entry/entry_64.S:#include "calling.h" > > Probably the hardcoding done in the hack is impacting some other asm target built in 64 bit kernel and causes a wrong X86 instruction , is there a way to refine the #if to avoid that problem while still building with LLVM_IAS=1 ? > > Thanks for the info > Mauro > > -- Thanks, ~Nick Desaulniers