Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1610916pxa; Sun, 16 Aug 2020 04:56:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEFydNuguuf1DYOUpscvd0ROYopQdB4y1k5JCDWx9nlszvUHU8TF7KkxxOrsTJW9VQSYuM X-Received: by 2002:a17:907:408c:: with SMTP id nt20mr10290430ejb.503.1597579004719; Sun, 16 Aug 2020 04:56:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597579004; cv=none; d=google.com; s=arc-20160816; b=zMrveQ6Vx8p4fUWfHM5OIepDoJ8pyNGhtIKtcVLQr57IQlXSDt6v52Gd3wN5gpsO67 6d/rhICcqDBcx+VzmbdZUjuIHStqUsSf6z0xhaYmYVxNtJNM6srDixk8B8v7KV61uLD8 3OwkRbsXqg88+6h3w+EGi7EvL/F5+lwJbJ4OMFpemKtzPZoyQwx3n2ywcuP2iXYyfOTQ UPWW433XYz6aQcyE+nzZbxRhvy1JzVAUFzRyuTXOXrgN13WEfwz4HAdLse2kMefiq+gt 6BSNj77oaeP+1cyGpBh6giGv6JXuSbrGFN7Y5SPAjt7OGrJRPSWO61Bx0f4SWyuP8b7A BNew== 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=vdeFolz54S0qQkKk6HM9/kh8B5+wcpI8HQoAZlCYNWk=; b=Ho5VakwNfq4fKcQkAZfB9nAxoFaXw7ajoOr9FLcklIDv5V0IiFCPEPaCVWjMBg8hnf UMDV4Y5is2oXPLzRKdcaocUFbqLe1O/Msd78tZSIHIwrOvyy0iYpFzLKw9aSA5d0+JY3 qEl8vVSBl7iVgHAs+2uDbrJiNdppBKn1GGANsg4XWh93aJZFMIXXJf18D4aowNvbylJG IY9yDpEBj09gtINcY4+6JeK4MpnwOcKsqKPTq1AWVafnj2dINxIi+RqMlisT0WtqYYnb jiGUUoONxz+wN3i6oLyInxNXo6iWVuPj4UHbYvSnvrNPtiHiRbijxuCp0FudRk5AbB6E zfdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AHZrxLVV; 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 b17si8752400edy.99.2020.08.16.04.56.22; Sun, 16 Aug 2020 04:56:44 -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=AHZrxLVV; 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 S1729152AbgHPJhy (ORCPT + 99 others); Sun, 16 Aug 2020 05:37:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726278AbgHPJht (ORCPT ); Sun, 16 Aug 2020 05:37:49 -0400 Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC3FFC061786 for ; Sun, 16 Aug 2020 02:37:49 -0700 (PDT) Received: by mail-oi1-x242.google.com with SMTP id l204so12233179oib.3 for ; Sun, 16 Aug 2020 02:37:49 -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=vdeFolz54S0qQkKk6HM9/kh8B5+wcpI8HQoAZlCYNWk=; b=AHZrxLVV24TyadXoffwqmI0BdAYIP7udTzaHqoU59+6ye8Uwfx6Z4iB/RR3srIsg8q UNsvKIBoSAZrObDUfxG0V7Lrt6+ObL6KhqM8+kNwxl/xJO3sGIj3lCzzFleQiKFX8RdT mMtU+IJ/yGm/QY5ihtJhwx2fFzPzQv7fW8FKR8WfHf2mAREGXrfe9X31w1kxxlmRFUDx wbxKlwSqJJNByLmxH/e6Mm+D6ZdUVAeZugeiJ5R7wbeU4oIiGVRPQnQCxQkiRQAweHWf CymZvtxRG84L8y1v+UHHtYMzYjKB0fEjbsotpXEN8RuQqg63VKop7b9xOUMLJgQmLm2f jXUQ== 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=vdeFolz54S0qQkKk6HM9/kh8B5+wcpI8HQoAZlCYNWk=; b=UK4v3tYSJDgX+EXA5ehZBKcwyatMOvndiU6KpLEOKQCF3tGPeaahjIiispaBRAbXG9 ym2jc5oeFU+RUagSTVqsJFwNgyKKFgHuULGC5f0C5DXxNO9O906NFVRn1ulpO8EDROhV IouBNPT80S/++qv4Cn7kvyuybU2niIIvSGo7j3FGnHSbxCEs4+a9en42duS90z9nZZV1 AtxRazHy6zgYg4PU6uPOrFs8TuWKYVU9YmhgWeRE++sGM4GfUzirSOiX0k6jzXtkv6lU kkMP5kI0n3itMRicxBCayldbUBTBXN/Q2qYdQioj5+qf/elDm22QqKLF5w9iZj8l/u4I DydA== X-Gm-Message-State: AOAM531QGybRxdq1vIXQFg5uO1ZBqu/fjuVUvwzaSYuY05xS76BdVu6E tqLV1j7jmUpgb7xGlkPG5SZikjN22c4YQnT251k= X-Received: by 2002:aca:724f:: with SMTP id p76mr6348374oic.35.1597570669063; Sun, 16 Aug 2020 02:37:49 -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: Sun, 16 Aug 2020 11:37:37 +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 GCC toolchain simply ignores if kaslr_64.o has __force_order means the build ends up successfully whereas LLVM toolchain and IAS breaks and the build stops and needs explicitly commit df6d4f9db79c1a5d6f48b59db35ccd1e9ff9adfc ("x86/boot/compressed: Don't declare __force_order in kaslr_64.c") reverted to fix this. With the revert GCC toolchain is also fine. Maybe it is good to revert that commit? This is with [1]: diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h index 59a3e13204c3..e1c19c5ecd5e 100644 --- a/arch/x86/include/asm/special_insns.h +++ b/arch/x86/include/asm/special_insns.h @@ -17,7 +17,7 @@ * all loads stores around it, which can hurt performance. Solution is to * use a variable and mimic reads and writes to it to enforce serialization */ -extern unsigned long __force_order; +extern unsigned long __force_order __weak; void native_write_cr0(unsigned long val); ...and the patchset of "x86/boot: Remove run-time relocations from compressed kernel" applied [3]. More details in [4]. - Sedat - References: [1] https://github.com/ClangBuiltLinux/linux/issues/1120#issuecomment-674182703 [2] https://git.kernel.org/linus/df6d4f9db79c1a5d6f48b59db35ccd1e9ff9adfc [3] https://lore.kernel.org/patchwork/project/lkml/list/?series=456251 [4] https://github.com/ClangBuiltLinux/linux/issues/1120#issuecomment-674502114