Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1164363ybt; Tue, 7 Jul 2020 09:08:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPt+U5/zDnBDxQ0yMKjXV/yr9OXjyK98hdduWMZfw65f3UTbLWbr+nZChelYFixzWLTWV1 X-Received: by 2002:a17:906:95d9:: with SMTP id n25mr49537778ejy.437.1594138137375; Tue, 07 Jul 2020 09:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594138137; cv=none; d=google.com; s=arc-20160816; b=Ho2HJ8kTLiGgxDM/0bCoGdl1Jw+w0FF2RamCYh2yBitg2tsaNM+yksmTyBivYgFuqZ 2GsbyXv3IHDx0sTCr+k4uz96gxiLX+lgPi0JbjUQwdTGQQRqOvr0btsrMchI5CN02YRL F98C8+4mDPH8stpbUVwGr6jmcdpqD9qy8ZdSThtzHj4qQ4mIw8vQAoLR6ICPmM8KYYx7 KtilJH4O2XG8MSYt6X6Qp0jGlBlA/2ajT37Rs0ZuW+ysfn/5f/LCGYRCXm6RZVhHhDO5 +T0RSuGeHWAXIclSSSkSa7ieSFmoa3s20opehzbGNr/MTgKJu3L7M1zeoIQkbogKa9Z8 Ly5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=BauIxngYcl8jd5OtL8hzkCrhdMv4YPyYU2tM2gh0/zA=; b=vuthtM2YpyuJXN9UU0yI9qn09zTlrSSjrS1uxVFv4tRpXJuZvCpAT08DHVfGkOivUL O+x1EsKBtPbq6QgWMLvsK5UNcIF0KTG8WqJAabrwceoxUX4EZY2PiGMffSz/PGo/5Q44 4EmvtRqUSXvT8sg7FuhMHHsqv8CWC3Kf2Q97I9a7hIFAxY47IlO6RjzXdKyM2BG8EM4s FgoB4kQiVqqUZ++KmOvHeBiTF7Pfh0oVVn+y+iZYI9DoVO5cesoFOaUK0s9oQ+jTw2Su NE7y3zW19G4RjgP4Jjn0zYAXlLfHn/J9cESFwaICKL68TvHZPU8qaBCnvkPB7dBq/4BQ magQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Kh7nComz; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dh7si14604708edb.531.2020.07.07.09.08.34; Tue, 07 Jul 2020 09:08:57 -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=@google.com header.s=20161025 header.b=Kh7nComz; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728410AbgGGQFj (ORCPT + 99 others); Tue, 7 Jul 2020 12:05:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728194AbgGGQFg (ORCPT ); Tue, 7 Jul 2020 12:05:36 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A17FBC08C5DC for ; Tue, 7 Jul 2020 09:05:36 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id j19so13346646pgm.11 for ; Tue, 07 Jul 2020 09:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=BauIxngYcl8jd5OtL8hzkCrhdMv4YPyYU2tM2gh0/zA=; b=Kh7nComzMNl6xsg1nwO6fTiV+447hKNoK6M36Sv6NGey7FnS2nbTYWy8lHEpSDOcWo 4SZpHdhE0vPOCZrLWLvUJOXmOSR8Gz0owQI+bbcY+s+LsNbCgXfdxmGINNOc3+OKJSEQ 2u6uTR/n4oEx4IA4WPkbLFvCRTsqJQgdkA4/RHz0JUrD5DCmtPUS6lEOlEKwOu+XAqvh gr91UwjGRhE2Bo40UIkl4Z5vIAwl8OKTz32MsAM4e2vgnAlsinZ/e9QSyBdyERrQzk4E y2Omj76am6hjUTfQD5hz2Tiyvs2LsHeHNRlGxwsexsoYrijIaIiXs/D6btrWCA81JdA6 s9vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BauIxngYcl8jd5OtL8hzkCrhdMv4YPyYU2tM2gh0/zA=; b=GYk1GOlvEO7x3nCLmiSgZ8IfpKGOVvxzQRn4wNgdyydmUc3pHBo8K87LD5LQ19xa8b XvVghKmACCp135g403UhUeYkgh56t94Qax2NsmoevBboSMicAnkoWd48TteNCv/IDmMl GItOt3GZq2XzOcVAK8s4GRhJp4V/dnVKzYXwv3uJeMN8hJzyxgrKu3MSrt6VxD6xVnWM ecmo4Kwiu/SUAvJltTW4dOSOkXfEO1L3HQDZp4Py3Crq2WuMovy8PaeO0Aqooy5+JSLM j+pLieGjh6ps90TW9CX+SVVX7UC3LLGARqSbeQRrHNPQCcISvY0G9H8uYjI5ciJyQVss cJYA== X-Gm-Message-State: AOAM531xWY6w+jHTE3blfBQ8bIfqX9HKLIqwHHZpviAsqERU5ncolue0 uoYSdkrkNfxOZR+uBnQwbgQp2w== X-Received: by 2002:a63:5110:: with SMTP id f16mr44344138pgb.377.1594137935802; Tue, 07 Jul 2020 09:05:35 -0700 (PDT) Received: from google.com ([2620:15c:201:2:f693:9fff:fef4:1b6d]) by smtp.gmail.com with ESMTPSA id j17sm1222342pgn.87.2020.07.07.09.05.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 09:05:34 -0700 (PDT) Date: Tue, 7 Jul 2020 09:05:28 -0700 From: Sami Tolvanen To: Masahiro Yamada , Jakub Kicinski Cc: Will Deacon , Greg Kroah-Hartman , "Paul E. McKenney" , Kees Cook , Nick Desaulniers , clang-built-linux , Kernel Hardening , linux-arch , linux-arm-kernel , Linux Kbuild mailing list , Linux Kernel Mailing List , linux-pci@vger.kernel.org, X86 ML Subject: Re: [PATCH 00/22] add support for Clang LTO Message-ID: <20200707160528.GA1300535@google.com> References: <20200624203200.78870-1-samitolvanen@google.com> <20200629232059.GA3787278@google.com> <20200707155107.GA3357035@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200707155107.GA3357035@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 07, 2020 at 08:51:07AM -0700, Sami Tolvanen wrote: > After spending some time debugging this with Nick, it looks like the > error is caused by a recent optimization change in LLVM, which together > with the inlining of ur_load_imm_any into jeq_imm, changes a runtime > check in FIELD_FIT that would always fail, to a compile-time check that > breaks the build. In jeq_imm, we have: > > /* struct bpf_insn: _s32 imm */ > u64 imm = insn->imm; /* sign extend */ > ... > if (imm >> 32) { /* non-zero only if insn->imm is negative */ > /* inlined from ur_load_imm_any */ > u32 __imm = imm >> 32; /* therefore, always 0xffffffff */ > > /* > * __imm has a value known at compile-time, which means > * __builtin_constant_p(__imm) is true and we end up with > * essentially this in __BF_FIELD_CHECK: > */ > if (__builtin_constant_p(__imm) && __imm <= 255) Should be __imm > 255, of course, which means the compiler will generate a call to __compiletime_assert. > Jiong, Jakub, do you see any issues here? (Jiong's email bounced, so removing from the recipient list.) Sami