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 A7444C55ABD for ; Fri, 13 Nov 2020 19:54:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2F6CA22240 for ; Fri, 13 Nov 2020 19:54:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NeS9DVHz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726166AbgKMTyY (ORCPT ); Fri, 13 Nov 2020 14:54:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:22733 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725866AbgKMTyX (ORCPT ); Fri, 13 Nov 2020 14:54:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605297261; 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=yYOZqfS1DftClANj54I945kAOQfBrrvPepHj2JAwlgE=; b=NeS9DVHzmLAdPHOeNRUQD6EDbKFfbZNU6RSnp3XdKpXlVfskFwjtpUjuvBqyNPm5ukC8YS yct8R3ZLUYRtrAXewF7sSt1EyKBcC+26jkeEzVLxtXp/7TjRxm5mc8x2ALTtjsLRi4Zciq ZhFSTqWB1k1T8cFEZy0px/T8ZPH6VHA= 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-192-o3eHZUV6NbaT1cJ-TJ4RWQ-1; Fri, 13 Nov 2020 14:54:18 -0500 X-MC-Unique: o3eHZUV6NbaT1cJ-TJ4RWQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8F5778730A8; Fri, 13 Nov 2020 19:54:15 +0000 (UTC) Received: from treble (ovpn-112-111.rdu2.redhat.com [10.10.112.111]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 54ADF62A16; Fri, 13 Nov 2020 19:54:11 +0000 (UTC) Date: Fri, 13 Nov 2020 13:54:08 -0600 From: Josh Poimboeuf To: Sami Tolvanen Cc: Peter Zijlstra , 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: <20201113195408.atbpjizijnhuinzy@treble> References: <20201020185217.ilg6w5l7ujau2246@treble> <20201021085606.GZ2628@hirez.programming.kicks-ass.net> <20201023173617.GA3021099@google.com> <20201110022924.tekltjo25wtrao7z@treble> <20201110174606.mp5m33lgqksks4mt@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Tue, Nov 10, 2020 at 10:59:55AM -0800, Sami Tolvanen wrote: > On Tue, Nov 10, 2020 at 9:46 AM Josh Poimboeuf wrote: > > > > On Mon, Nov 09, 2020 at 08:29:24PM -0600, Josh Poimboeuf wrote: > > > On Mon, Nov 09, 2020 at 03:11:41PM -0800, Sami Tolvanen wrote: > > > > CONFIG_XEN > > > > > > > > __switch_to_asm()+0x0: undefined stack state > > > > xen_hypercall_set_trap_table()+0x0: <=== (sym) > > > > With your branch + GCC 9 I can recreate all the warnings except this > > one. > > In a gcc build this warning is replaced with a different one: > > vmlinux.o: warning: objtool: __startup_secondary_64()+0x7: return with > modified stack frame > > This just seems to depend on which function is placed right after the > code in xen-head.S. With gcc, the disassembly looks like this: > > 0000000000000000 : > 0: e8 00 00 00 00 callq 5 > 1: R_X86_64_PLT32 cpu_bringup_and_idle-0x4 > 5: e9 f6 0f 00 00 jmpq 1000 > > ... > 0000000000001000 : > ... > ... > 0000000000002000 <__startup_secondary_64>: > > With Clang+LTO, we end up with __switch_to_asm here instead of > __startup_secondary_64. I still don't see this warning for some reason. Is it fixed by adding cpu_bringup_and_idle() to global_noreturns[] in tools/objtool/check.c? -- Josh