From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E908FC433B4 for ; Wed, 5 May 2021 08:46:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C8ED613B3 for ; Wed, 5 May 2021 08:46:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231923AbhEEIrx (ORCPT ); Wed, 5 May 2021 04:47:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31333 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231430AbhEEIrw (ORCPT ); Wed, 5 May 2021 04:47:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620204416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6w0Bb3Czs0gInUDdwXdHMW1FO2dptIM9rJNDSEArh34=; b=EmLBNDmyXMwpotWBp198cVEXvNINg7PTVWEoq6lGx+1beL/RDbwZPM3sxA96pcFZuMcA9W KBsD06ClG9obZP6hc1/ck2vFkCXvgq0rrFZOVbvAxgySWtLt58QTY2acsSMak7OUhR8oGY kwlvt3VPkPirGTZQleRXAAI/s9SVJc8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-23-gvhEjeE1NAaPGBU99XZX9g-1; Wed, 05 May 2021 04:46:54 -0400 X-MC-Unique: gvhEjeE1NAaPGBU99XZX9g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0DE378049CB; Wed, 5 May 2021 08:46:53 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-137.ams2.redhat.com [10.36.112.137]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5FE045B4A6; Wed, 5 May 2021 08:46:51 +0000 (UTC) From: Florian Weimer To: Peter Zijlstra Cc: Andi Kleen , linux-kernel@vger.kernel.org, Andi Kleen , linux-toolchains@vger.kernel.org Subject: Re: [PATCH] sched: Work around undefined behavior in sched class checking References: <20210505033945.1282851-1-ak@linux.intel.com> Date: Wed, 05 May 2021 10:47:07 +0200 In-Reply-To: (Peter Zijlstra's message of "Wed, 5 May 2021 08:46:19 +0200") Message-ID: <875yzxh8j8.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org * Peter Zijlstra: > On Tue, May 04, 2021 at 08:39:45PM -0700, Andi Kleen wrote: >> From: Andi Kleen >> >> The scheduler initialization code checks that the scheduling >> classes are consecutive in memory by comparing the end >> addresses with the next address. >> >> Technically in ISO C comparing symbol addresseses outside different objects >> is undefined. With LTO gcc 10 tries to exploits this and creates an >> unconditional BUG_ON in the scheduler initialization, resulting >> in a boot hang. >> >> Use RELOC_HIDE to make this work. This hides the symbols from gcc, >> so the optimizer won't make these assumption. I also split >> the BUG_ONs in multiple. > > Urgh, that insanity again :/ Can't we pretty please get a GCC flag to > disable that? Context: Obviously, GCC doesn't do this in general. Would you please provide a minimal test case? Thanks, Florian