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=-3.9 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 0E090C4363A for ; Wed, 21 Oct 2020 18:30:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 776242245B for ; Wed, 21 Oct 2020 18:30:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OFLlnPeA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438821AbgJUSac (ORCPT ); Wed, 21 Oct 2020 14:30:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32221 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406149AbgJUSac (ORCPT ); Wed, 21 Oct 2020 14:30:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603305030; 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=SWk1HmGPS11z1lVFpxCdMWGo2d19IWvUVpCVt8eeJUo=; b=OFLlnPeAlHnJTTd7/PLn//KYjTDJOutsgkxcdF6fs2hxVobCxPyewMt+5R9P6xWh8q+8tb B8FJwS/gYBw/C51XL+a8PgWDDHiOVfg7gNnjCR24rSC/EAIr2GO+x+XayR38+8BAy5/03I bNedSn76EEMwH0NNzLRN4aGPI1NMmm8= 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-267-ts4ydIjKNra8FmPa6CjVIA-1; Wed, 21 Oct 2020 14:30:26 -0400 X-MC-Unique: ts4ydIjKNra8FmPa6CjVIA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 51CD0101962B; Wed, 21 Oct 2020 18:30:24 +0000 (UTC) Received: from treble (ovpn-117-195.rdu2.redhat.com [10.10.117.195]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 912706EF42; Wed, 21 Oct 2020 18:30:14 +0000 (UTC) Date: Wed, 21 Oct 2020 13:30:09 -0500 From: Josh Poimboeuf To: Peter Zijlstra Cc: Sami Tolvanen , Jann Horn , the arch/x86 maintainers , Masahiro Yamada , Steven Rostedt , Will Deacon , Greg Kroah-Hartman , "Paul E. McKenney" , Kees Cook , Nick Desaulniers , clang-built-linux , Kernel Hardening , linux-arch , Linux ARM , linux-kbuild , kernel list , linux-pci@vger.kernel.org Subject: Re: [PATCH v6 22/25] x86/asm: annotate indirect jumps Message-ID: <20201021183009.qbvhz7hsrm46vksn@treble> References: <20201013003203.4168817-1-samitolvanen@google.com> <20201013003203.4168817-23-samitolvanen@google.com> <20201015102216.GB2611@hirez.programming.kicks-ass.net> <20201015203942.f3kwcohcwwa6lagd@treble> <20201020185217.ilg6w5l7ujau2246@treble> <20201021095133.GA2628@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201021095133.GA2628@hirez.programming.kicks-ass.net> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org On Wed, Oct 21, 2020 at 11:51:33AM +0200, Peter Zijlstra wrote: > On Tue, Oct 20, 2020 at 01:52:17PM -0500, Josh Poimboeuf wrote: > > > arch/x86/lib/retpoline.S: > > > __x86_retpoline_rdi()+0x10: return with modified stack frame > > > __x86_retpoline_rdi()+0x0: stack state mismatch: cfa1=7+32 cfa2=7+8 > > > __x86_retpoline_rdi()+0x0: stack state mismatch: cfa1=7+32 cfa2=-1+0 > > > > Is this with upstream? I thought we fixed that with > > UNWIND_HINT_RET_OFFSET. > > I can't reproduce this one either; but I do get different warnings: > > gcc (Debian 10.2.0-13) 10.2.0, x86_64-defconfig: > > defconfig-build/vmlinux.o: warning: objtool: __x86_indirect_thunk_rax() falls through to next function __x86_retpoline_rax() > defconfig-build/vmlinux.o: warning: objtool: .altinstr_replacement+0x1063: (branch) > defconfig-build/vmlinux.o: warning: objtool: __x86_indirect_thunk_rax()+0x0: (alt) > defconfig-build/vmlinux.o: warning: objtool: __x86_indirect_thunk_rax()+0x0: <=== (sym) > > (for every single register, not just rax) > > Which is daft as well, because the retpoline.o run is clean. It also > doesn't make sense because __x86_retpoline_rax isn't in fact STT_FUNC, > so WTH ?! It is STT_FUNC: SYM_FUNC_START_NOALIGN(__x86_retpoline_\reg) $ readelf -s vmlinux.o |grep __x86_retpoline_rax 129749: 0000000000000005 17 FUNC GLOBAL DEFAULT 39 __x86_retpoline_rax -- Josh