Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp277767pxy; Wed, 5 May 2021 01:50:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxn84O+djgXe86ickaY208arI8ZV5hAEfuiEMn7Lovj//Q3vquPGb9C8BeibSzBhZd/Vxy9 X-Received: by 2002:aa7:d915:: with SMTP id a21mr32073331edr.357.1620204635548; Wed, 05 May 2021 01:50:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620204635; cv=none; d=google.com; s=arc-20160816; b=wJJsZTvdMhGpTN0EFPdzo1uRrty7EL2tNyh0PuVQ9Tna5LSsfT4iA0pnpt/pHcd8QW QHO/5p3NWqKDeuAVwqzEQW/PYYYo8D6wIUnjdvVW2lMN1ZAklN3H6QYyp50WUgH1Av77 oAQhGK7T9SiqEGaWU8pQP399o7cE1jWtTkLM/SBmrlQOkvy64w9m6GXKXgtMdvT6ebEm WU06XmKsFFUk0uXgPWqlei1ByJPvkzv/Z2TOwx/xWXn9fm3tNHjRlbA8CJd2w8d7oZGA l2dNYfyNJKoP/44Tu+xgE4tqJpjkAj82+4Hbz2zUPhpYBEJtNku70ImkWQsFllSOs7+D 8gDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=6w0Bb3Czs0gInUDdwXdHMW1FO2dptIM9rJNDSEArh34=; b=SS+hmyGzeR1tDLQN1RvwlK/jigs5XIkoDQGcNZzqV/0OE9pG4EFf+oDlu6vwAacH29 rZ1r6n88a/eU6Sjt1STJXOyDrCbKF73vwWW77qsnH0TnSH7R5U2AUU0nPjIytzlNH2WL N8Y38X4MKTwEK9iBfXbU0xib+tL0QiKn05a0yDhpLWST7FMhHa1CoSESr8KqzAWO9vHN AA6UyoTka/pU663U1KFk5L8JDRGm/WrBdTgb5LivxFf/TF1j68t08fnmkNDJaFO5FRMG WIjdzeEaiHMT+OTa2Kvxl5M+3TJahJ7xehwbKMzILQRAWb/NTUGFrG4pGBOJuIUQ4hXQ kI+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Hyskt2HX; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i18si4737468ejz.122.2021.05.05.01.50.11; Wed, 05 May 2021 01:50:35 -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=@redhat.com header.s=mimecast20190719 header.b=Hyskt2HX; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231993AbhEEIrz (ORCPT + 99 others); Wed, 5 May 2021 04:47:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32319 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231430AbhEEIry (ORCPT ); Wed, 5 May 2021 04:47:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620204417; 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=Hyskt2HXDzf9mJ4C7lrysiO3AWyuT1NIm3DM0AgheSFZVi2tddkUZsZOCculGfmC8Mqv6l 4UPK2YswgbKUbhjkq3mraTiY+99+EscEWx2T8HThf4n/6HBmdYKSEINXDbnzDEY/tz+80l jF1hHxw2qQJjG3cfgQQVFsHLv049vwk= 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-kernel@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