Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp517809pxy; Wed, 5 May 2021 07:40:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/R+5u7XLDo94o+4BaJkeqT4lMqsQO9QEZzsT/wZ6Es5JWwewagJaP8800qzARw35guIWv X-Received: by 2002:aa7:9a41:0:b029:28e:761b:4bb7 with SMTP id x1-20020aa79a410000b029028e761b4bb7mr18923855pfj.48.1620225649571; Wed, 05 May 2021 07:40:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620225649; cv=none; d=google.com; s=arc-20160816; b=AjjvM+C8uy/FyYBMEjPIZe/hVmR5HOvhqJ2YMZJLooyIPKLs+bML9tjpxjzjWW4mfT xuj8HjZjfXXiF5gSEvh64r6al0F+v7fzA/gQg1EEbpSHsAveVlcj/lfRc1sESTsueHfl eDD/pgZCD4FSc5EiAY/xhdPLxPibczuA4R9HMjPlV93u5TxOQkSNGrrnScFMpaNfi+DE ScvTQkANIfuC9HXOz2ADilNH3kRPGlNc7n0TsshBN02PfBQ+JK8cOcMtTiwC5P1H/0gZ a8S+dlh0sqOo6UHgdjvze4hiMvz9UX1xqED08ihApLChs6i43Ibi2PFO2HV2GvAe1aoD yD1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=nEnEAGHwpT6yoB5Cv9ZtE1W+PvQkGyJt1jDZAuWMeJY=; b=qatZ8S6AVt2OPXP3T+W58BlyxOIWq096rjNR3oBQeXHo3Vw7++wa0VLhz4Hha/u80a W+b5g98ae6Wao4q84XRJoTMnRmmq0aISHIAx1O8XSemzYH1qeuk5nUsYnJdzRRjhEy5N TiX6etP1KKVBDfsSREbEYmsH+USK3t3G7oQimQnjwSSlz6BJC1UbQMoXuv5ZNozg6b73 JyA/iZoBcHJSAzJ9LXzxi1s7m8nv1CSjKB15VZhfnn8qT/vvmw32RbmZD/gG+jaX+gUa kqUwpTopOdlNHk3W0iqbdVP1rCDOSb83HV1PdcTqWu7USH08zjxzdHYvo6rLvkl+NQz6 2m/g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fv9si261390pjb.0.2021.05.05.07.40.36; Wed, 05 May 2021 07:40:49 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232262AbhEEOkd (ORCPT + 99 others); Wed, 5 May 2021 10:40:33 -0400 Received: from mga17.intel.com ([192.55.52.151]:34880 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232919AbhEEOk2 (ORCPT ); Wed, 5 May 2021 10:40:28 -0400 IronPort-SDR: tdB2uNvJ/LXe4g5ar1Jk+fo2Yfm2nilJV1NtUNs/ol8IFVnxILxymWNGMlpYnmAKIa4aIzbLuK C1GSTEFKAVjg== X-IronPort-AV: E=McAfee;i="6200,9189,9975"; a="178448126" X-IronPort-AV: E=Sophos;i="5.82,275,1613462400"; d="scan'208";a="178448126" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2021 07:39:18 -0700 IronPort-SDR: XZ5IviLdQ+f5E/oFWIhUWRCETarxu2IT6+vdkaoRWdNqeR70mAw4TbIuWIyugPAw1K96F2pgUI udlZyCaz0lFw== X-IronPort-AV: E=Sophos;i="5.82,275,1613462400"; d="scan'208";a="406570372" Received: from tassilo.jf.intel.com ([10.54.74.11]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2021 07:39:18 -0700 Date: Wed, 5 May 2021 07:39:16 -0700 From: Andi Kleen To: Florian Weimer Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, Andi Kleen , linux-toolchains@vger.kernel.org Subject: Re: [PATCH] sched: Work around undefined behavior in sched class checking Message-ID: <20210505143916.GS4032392@tassilo.jf.intel.com> References: <20210505033945.1282851-1-ak@linux.intel.com> <875yzxh8j8.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <875yzxh8j8.fsf@oldenburg.str.redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Context: > > > > Obviously, GCC doesn't do this in general. We've seen it in other cases before, that's why RELOC_HIDE exists. A classic case was __pa_symbol() That dates back nearly two decades at this point. > Would you please provide a > minimal test case? You can only reproduce it with a LTO build because it needs knowledge between different translation units for this specific case. But gcc will totally do the optimization even without LTO if it can prove the same inside a single TU. If you want to reproduce it you can use my tree here git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc lto-5.12-3 and revert the fix. The kernel will not boot. -Andi