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=-6.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 14CAAC55ABD for ; Fri, 13 Nov 2020 20:26:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 77E3920825 for ; Fri, 13 Nov 2020 20:26:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nV89d4Wm"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="SBgav/T3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 77E3920825 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3x8ZhS24nkDyFLdWdHhu4fZ7BteJLXE9ffqvMEN3+DI=; b=nV89d4WmjEIY0WKzU09g8eZbn 20qHtlDxwpOU90HoVCP2ijea/VuAYQbmAU81CNNLyumpLHx1Ad6MH6/IRAEzFI1GB6ScY39AOZbWC DKxnSQUT0k9b/mF1ZNh1ogpyQD+pKd4jG0PCoN7LXfH+G+hbGiA1VLU1OWA//gzqSlsZh/ls3+x88 QYO3h8Gvz40TnOETir4fOpXXqwNirAwHO0QxWn4gkdiD0zoMfnJhst2hGkdK40hHfCYbVLkq0pLTB R1Qva/EI6Lt0GFkixJWI4vEXTpM7E6rCEySnUCCr15aLQQVBcCxA5DU7ol2HSKenUaBKS2NPc79oR ypXGoYb9w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdfcn-0004lV-1I; Fri, 13 Nov 2020 20:24:49 +0000 Received: from mail-ua1-x941.google.com ([2607:f8b0:4864:20::941]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdfck-0004kS-Cf for linux-arm-kernel@lists.infradead.org; Fri, 13 Nov 2020 20:24:47 +0000 Received: by mail-ua1-x941.google.com with SMTP id v16so3396657uat.9 for ; Fri, 13 Nov 2020 12:24:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mU6UeGOfRQMRJwnHmGX5EKrd3fAZtibGBHai3RFBnJQ=; b=SBgav/T3VzzEtf+XcGk0y2urSrYRSMZdZ/BSprOQYF07imi1ADQ6+bP8NVgkFIS13j c29etEZPIosU9Ccq+aDvjNmW4gtV+RXjaLR5/iYKTteik7fkjmDnPZ3rLCzlNv2EYSEP /f9Rq5iUQR0o7S1G9L2SZCAv7mAGSkXEUI5hN3rLrtsdHgPlxnpAG0v3MFSAKPbkQrae WLoVYBLPEP79v4Y7OA8gXbcs08GtIihODPoDAmO+6mtoQqiccreuY2GcpYzaDeYkNLlF n1WMuVFyGng50eB9Mmqa/6aQz5eygw2tOZp8M/jD01KJFVb5k1ymIpwXFEcj8xVZxzyy nZxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mU6UeGOfRQMRJwnHmGX5EKrd3fAZtibGBHai3RFBnJQ=; b=ShAqDb6ANHt7ONcUdxLRQ2Z/qqbsHD9+CeLVrEdRTkJ7h/J0+cJStGI1SI6ekPnfxI 9WrnmuKAWR8d65sbPyioMh3iRF2aMM64sAxyvbbhUKOpAtRENI+33WwRF2F5Gl6u8UcK NU903i+nrZS3kqvEh1STr9nKUClFdwic+WtOCYwD+q5LxtkOb9cFw2m0E+dV8uG7axYi K3hUYJvqWSnKIo34KXMC9xo6YD+oa4TdcTvTPvW0n6LCXVDU1uGmD0xlK2RqRW0pZwn/ +hgOlc+MsKIM1r2hs/fk2EQYrQOGabKZNOPxgdFS+Y4nw5J7CXGhstNcWUwVNuIXoadf uM4w== X-Gm-Message-State: AOAM532RJczaF2hSMlKnnZHZJ1tiTSoQb5s1dvItXzMDEPM6+O7YRQGr Q93m7gnNVHks7bcvf9ZQHxYw1s6WXrEN7kdyp1HCgA== X-Google-Smtp-Source: ABdhPJxQo6DF9jUnA2YJFoBq8ll7fJYetoimM/TRDoFpxZhBeNyAnbeYafJONZ4hmtReCz/v9xa11p0ayWmu2zwdpXo= X-Received: by 2002:ab0:6156:: with SMTP id w22mr2653091uan.122.1605299084290; Fri, 13 Nov 2020 12:24:44 -0800 (PST) MIME-Version: 1.0 References: <20201020185217.ilg6w5l7ujau2246@treble> <20201021085606.GZ2628@hirez.programming.kicks-ass.net> <20201023173617.GA3021099@google.com> <20201110022924.tekltjo25wtrao7z@treble> <20201110174606.mp5m33lgqksks4mt@treble> <20201113195408.atbpjizijnhuinzy@treble> In-Reply-To: <20201113195408.atbpjizijnhuinzy@treble> From: Sami Tolvanen Date: Fri, 13 Nov 2020 12:24:32 -0800 Message-ID: Subject: Re: [PATCH v6 22/25] x86/asm: annotate indirect jumps To: Josh Poimboeuf X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201113_152446_525074_24363830 X-CRM114-Status: GOOD ( 22.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch , Kees Cook , "Paul E. McKenney" , Jann Horn , Peter Zijlstra , Greg Kroah-Hartman , Masahiro Yamada , the arch/x86 maintainers , Nick Desaulniers , kernel list , Steven Rostedt , linux-kbuild , clang-built-linux , linux-pci@vger.kernel.org, Kernel Hardening , Will Deacon , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Nov 13, 2020 at 11:54 AM Josh Poimboeuf wrote: > > 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. Do you have CONFIG_XEN enabled? I can reproduce this on ToT master as follows: $ git rev-parse HEAD 585e5b17b92dead8a3aca4e3c9876fbca5f7e0ba $ make defconfig && \ ./scripts/config -e HYPERVISOR_GUEST -e PARAVIRT -e XEN && \ make olddefconfig && \ make -j110 ... $ ./tools/objtool/objtool check -arfld vmlinux.o 2>&1 | grep secondary vmlinux.o: warning: objtool: __startup_secondary_64()+0x2: return with modified stack frame > Is it fixed by adding cpu_bringup_and_idle() to global_noreturns[] in > tools/objtool/check.c? No, that didn't fix the warning. Here's what I tested: diff --git a/tools/objtool/check.c b/tools/objtool/check.c index c6ab44543c92..f1f65f5688cf 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -156,6 +156,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func, "machine_real_restart", "rewind_stack_do_exit", "kunit_try_catch_throw", + "cpu_bringup_and_idle", }; if (!func) Sami _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel