Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1301337pxa; Sat, 15 Aug 2020 15:02:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUW+zsNItPzZb/scYarLmRuwxoZkE0yY90MN0ew22zi2mWXqcN4DWmUj69hAQcm1LmDBEq X-Received: by 2002:a17:906:29d5:: with SMTP id y21mr8161985eje.131.1597528960880; Sat, 15 Aug 2020 15:02:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597528960; cv=none; d=google.com; s=arc-20160816; b=aQC1sHkDLpQ1w7ky8xDj7hAEuf/C6AASEMjPvszDrXjNST4nQbwlHN52MSew4mWDPB Pm2LTp4k9hb+K/tHw2HZ+zXaKAhJ+g6/9uLoGOpyukduT3a2MXXIlFq6wqa2go3AH80+ hrGk/GA3dkNh/l/zqZgxmJqfaqAy3FUruV4Hxh5X6MqI0x1n8BsXX6bYweBJN+6TVQNj WG4ofqTj6rAAig0ANR+k7+oAR0Ut0fbi1SNqVfzxv/kizKxrMdRT+W4A5Xk4O1S+Txqw XKtIvP0HOblnp5ua94EQ/mG9d6Z/0Vu7VyDWWO5j44U070umTRUKtwqxbCQvYMQnV8dt MePw== 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 :reply-to:in-reply-to:references:mime-version:dkim-signature; bh=5ZdA3YbzFyuiBEZEvu/DHmwuAZEanF9AbrLkGxCCiGY=; b=IASwtQ91OfdckXZm1yiJpgJVRhX29UJuUyi8RM4M5Zno+maa1hhPldb8usZ0ch64Uj EBcgMePVe9gqZ1xjOuJbI59aOUTDMp/cPK804Y4QmCwXeBuxUI2zB72OrYPkw0X8ZIBh 1HS9ncdRl0OQ9RKxsIpdPPw23wXfMGyu7dba/wovBYNy9cYzZX/ymCJSQOKjzU/WbX3V BjNBSKj91hm5bZg/1t5tFDqIi2KOs0i2Nm3XxcVKPxAb8OtCM+vc6/dNKkxJCQocNeX1 OoKt7jj/Isrj8A+kRzAWSK+Q6s0vwFZz3WTiV+Oz3cjT6nfRq01MxGMwc9RGIp73CYHs FxVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="XiE/mrB9"; 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 a10si7759086ejc.348.2020.08.15.15.02.18; Sat, 15 Aug 2020 15:02:40 -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="XiE/mrB9"; 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 S1729679AbgHOWAk (ORCPT + 99 others); Sat, 15 Aug 2020 18:00:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728829AbgHOVvf (ORCPT ); Sat, 15 Aug 2020 17:51:35 -0400 Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D630FC03B3CB for ; Sat, 15 Aug 2020 01:23:48 -0700 (PDT) Received: by mail-ot1-x343.google.com with SMTP id t7so9480458otp.0 for ; Sat, 15 Aug 2020 01:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=5ZdA3YbzFyuiBEZEvu/DHmwuAZEanF9AbrLkGxCCiGY=; b=XiE/mrB9nNyL6m6Ayayjly1A/Rz+rKewJb7JYlLNaP1ST+WCAr/70G4ZKh3/NWgUUr ddOiWE1MmCAw37YZR+CxBupx59x4N2hN53GkPpFvSmmZPXu1CO0yqV27scq3IKgSToum /gp3utKXhE4jp4VJ6vTIyC5RVcOTfDF0McJfykHautJxpGuOdMklwG+PB1vyABAJ4INt Y/zIK5JuxgwP0doj6Lob2OmS0nMDR7CCmi4ZYc6ac9hmVYrKtkcxwaEiuTcT3Pmkg5Us wFBLQStuX7Z7C80zX0Vu0zsHgnbQTCKFHG4WtZrD78/XbGNOlWjHoaSoOSsqprmEmTTU f0nA== 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:reply-to :from:date:message-id:subject:to:cc; bh=5ZdA3YbzFyuiBEZEvu/DHmwuAZEanF9AbrLkGxCCiGY=; b=JNvSCFD2c7GGK5D2S06pwnvpoZ7s5KFEe+21OqH4zhxXlCP2Ot/6oXuRbT1dpVw9iS M5eATcyFOF1IXRfO4LpQdNzbuQGk2zALHqYcbUnqZImjZXH7t3WyqzEhcY59NMYhTQSo OMkgy2ChkRXfUkT4uwDBm9kPEuH55AhhogFVtWVkifriC7tr9I++jo1amOMFRh055b+B 5j/oGn58r61djaztTEinY4r1EaTV3Vj4PkzQkABuHpn1wPo1iByjawzvxzsVTrt4FLuN gsZ0vvvqHaoxiLfjV4qUAdM8wNT/QZB2JBdqepi3RvWBzMNLGp1GCTfeTvEBHlgXk415 gCXg== X-Gm-Message-State: AOAM532PSkji7h3DH3nP+02AXD8mm6P1EnJsgs7EEjkHP7w0VlhOP4tl HxGD5CkBpS8HSCF8vYFed9ycWz2uJ3kg6OFM628= X-Received: by 2002:a9d:48d:: with SMTP id 13mr4914607otm.9.1597479828223; Sat, 15 Aug 2020 01:23:48 -0700 (PDT) MIME-Version: 1.0 References: <20200527135329.1172644-1-arnd@arndb.de> In-Reply-To: Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Sat, 15 Aug 2020 10:23:36 +0200 Message-ID: Subject: Re: [PATCH] x86: work around clang IAS bug referencing __force_order To: Nick Desaulniers Cc: Arnd Bergmann , Peter Collingbourne , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , "Kirill A. Shutemov" , Zhenzhong Duan , Kees Cook , Peter Zijlstra , Juergen Gross , Andy Lutomirski , Andrew Cooper , 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 Sat, Aug 15, 2020 at 5:28 AM Sedat Dilek wrote: > > On Sat, Aug 15, 2020 at 2:27 AM Nick Desaulniers > wrote: > > > > On Fri, Aug 14, 2020 at 3:57 PM Nick Desaulniers > > wrote: > > > > > > On Fri, Aug 14, 2020 at 2:19 PM Sedat Dilek wrote: > > > > > > > > On Fri, Aug 14, 2020 at 7:29 PM Sedat Dilek wrote: > > > > > > > > > > Thanks for the proposal. > > > > > > > > > > I have adapted it to fit my patchset against Linux v5.8. > > > > > > > > > > Both Debian's GCC-10 and a snapshot version of LLVM toolchain > > > > > v11.0.0-rc1+ seems to be OK. > > > > > > > > > > > > > Yupp, OK. > > > > > > > > I was able to boot FreeDOS 1.2 VM in VirtualBox GUI. > > > > > > Hi Sedat, > > > Apologies, but it's not clear to me precisely which patch you tested. > > > Can you please confirm whether you tested: > > > 1. Arnd's patch that started this thread. > > > 2. My proposed diff adding -fno-addrsig to CFLAGS_powernow-k6.o. > > > 3. My proposed diff removing __force_order from the kernel. > > > > > > I'm hoping you were referring to testing 3., but it's not clear to me. > > > > Ah, sorry, I missed your comment on github: > > https://github.com/ClangBuiltLinux/linux/issues/1120#issuecomment-674282107 > > > > Ok, I will look at more disassembly next week and hopefully have a > > patch ready, with your tested by tag. > > > > Sorry for not being precise - I tested with solution (3.). > Later I added the diff I used as mentioned in your above comment. > > See [1]: > > > In a 2nd run building with a selfmade clang-11 and LLVM "bin"utils is fine, too. > > I cannot say much to older versions of GCC and/or LLVM/Clang if > removing "__force_order" works fine. > > Another (4.) solution: > Sami tried successfully by adding "__weak" declaration with > CONFIG_LKDTM=m (see [2]). > I am OK if this works, too. > > Please, see my attachments. > > - Sedat - > > [1] https://github.com/ClangBuiltLinux/linux/issues/1120#issuecomment-674340760 > [2] https://github.com/ClangBuiltLinux/linux/issues/1120#issuecomment-674182703 Unfortunately, the diff from Sami does not work together with Arvind's patchset... x86/boot: Remove run-time relocations from compressed kernel ...which got included in recently. I see the following: ld.lld-11 -m elf_x86_64 -pie --no-dynamic-linker -T arch/x86/boot/compressed/vmlinux.lds arch/x86/boot/compressed/kernel_info.o arch/x86/boot/compressed/head_64.o arch/x86/boot/compressed/misc.o arch/x86/boot/compressed/string.o arch/x86/boot/compressed/cmdline.o arch/x86/boot/compressed/error.o arch/x86/boot/compressed/piggy.o arch/x86/boot/compressed/cpuflags.o arch/x86/boot/compressed/early_serial_console.o arch/x86/boot/compressed/kaslr.o arch/x86/boot/compressed/kaslr_64.o arch/x86/boot/compressed/mem_encrypt.o arch/x86/boot/compressed/pgtable_64.o arch/x86/boot/compressed/acpi.o arch/x86/boot/compressed/efi_thunk_64.o drivers/firmware/efi/libstub/lib.a -o arch/x86/boot/compressed/vmlinux ld.lld-11: error: Unexpected GOT entries detected! ld.lld-11: error: Unexpected run-time relocations detected! ld.lld-11: error: Unexpected GOT entries detected! ld.lld-11: error: Unexpected run-time relocations detected! make[5]: *** [arch/x86/boot/compressed/Makefile:91: arch/x86/boot/compressed/vmlinux] Error 1 When you need further informations, please let me know. - Sedat - [1] https://github.com/ClangBuiltLinux/linux/issues/1120#issuecomment-674182703