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=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 2F940C4742C for ; Fri, 13 Nov 2020 22:55:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB5372225B for ; Fri, 13 Nov 2020 22:55:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="E/DaHCUs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726230AbgKMWyr (ORCPT ); Fri, 13 Nov 2020 17:54:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726182AbgKMWyq (ORCPT ); Fri, 13 Nov 2020 17:54:46 -0500 Received: from mail-vk1-xa43.google.com (mail-vk1-xa43.google.com [IPv6:2607:f8b0:4864:20::a43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37AA7C0617A7 for ; Fri, 13 Nov 2020 14:54:45 -0800 (PST) Received: by mail-vk1-xa43.google.com with SMTP id i62so2477307vkb.7 for ; Fri, 13 Nov 2020 14:54: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=x7PN1px9ytV6KoYCs0MN8nIig7IfEqAMiUFMKSdwj8o=; b=E/DaHCUsxm9boUEUHR77XASfe1K99YXKl7duBooJylavKxm0tOGa/ZPK6xjyi2fAmj OYWDrTJOnFXwWt5S1pKJ6s8UxL+U3rZbepSwCXbZJRMhsO/oaNcGV6l2VgGjr5evZtSz yye6NpoiB+nakm0oK6uQ3sQViWHFOTTwEdtfu1R5mD/VgZzVhriCR2Y85MJT5y8nazB0 NR1BZldS24JnVXgr+Ovb7PrDJwr+3Atcw4eToXXk9DLqZMzDtjrCymZ+KKaYr49Oz2wG 03mdefjS8C7FER66kGpwiyb+EPHalvUWh8ADfLZXcOqSslaUx80S/cRhipC8ekjXSqmD cGOQ== 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=x7PN1px9ytV6KoYCs0MN8nIig7IfEqAMiUFMKSdwj8o=; b=jxAtVuaa1mu2sEt+Inveaz+gmZJpRJuu+ANY4opfWo5f//sk57wlqT++k/gax2nEdJ SqatXwrg/oWNNSDLmoKwZr9GlJvL9ENJ+2oDYgAlEADlueunuJZiT1hdK7NyLR/cctY0 9whIBUjAA1k5RvwRa1NTv2NPydonR2w55nxarYOS4hC2JV2Z3mt4pQMPfTqTKzLZM1lg UyW+/agdK/C4cvrhsNKUUduaRvJN+4bAuEpvbPqzQ3BY47oCARVZnDWLy9CVnncLnrEF XUlG5+0lkIgXQ+PInNvt2s7w6kw5N6fyn2RBYPUGrYp0jcixXoUjWnoQLIEuXEIcE/qt CRqQ== X-Gm-Message-State: AOAM531RuNykLyDZMyapleX0avi38p5ba5u8JWQIZJ8aMWuhCbgzA1lM JGrrNHFzhHsMLVKaj8vIdx+N5NPmnX/z9fcrV1E4Bg== X-Google-Smtp-Source: ABdhPJygwOP2IUwJzonbqdQUEI4r2KfzeUcxt3t9CVTdz7Ir0TADwtgbrh1R8/xsj+WLPbsqPnxXtDMz7YsGC5N32I8= X-Received: by 2002:a1f:3655:: with SMTP id d82mr3109788vka.22.1605308083978; Fri, 13 Nov 2020 14:54:43 -0800 (PST) MIME-Version: 1.0 References: <20201021085606.GZ2628@hirez.programming.kicks-ass.net> <20201023173617.GA3021099@google.com> <20201110022924.tekltjo25wtrao7z@treble> <20201110174606.mp5m33lgqksks4mt@treble> <20201113195408.atbpjizijnhuinzy@treble> <20201113223412.inono2ekrs7ky7rm@treble> In-Reply-To: <20201113223412.inono2ekrs7ky7rm@treble> From: Sami Tolvanen Date: Fri, 13 Nov 2020 14:54:32 -0800 Message-ID: Subject: Re: [PATCH v6 22/25] x86/asm: annotate indirect jumps To: Josh Poimboeuf 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Fri, Nov 13, 2020 at 2:34 PM Josh Poimboeuf wrote: > > On Fri, Nov 13, 2020 at 12:24:32PM -0800, Sami Tolvanen wrote: > > > 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: > > I think this fixes it: > > From: Josh Poimboeuf > Subject: [PATCH] x86/xen: Fix objtool vmlinux.o validation of xen hypercalls > > Objtool vmlinux.o validation is showing warnings like the following: > > # tools/objtool/objtool check -barfld vmlinux.o > vmlinux.o: warning: objtool: __startup_secondary_64()+0x2: return with modified stack frame > vmlinux.o: warning: objtool: xen_hypercall_set_trap_table()+0x0: <=== (sym) > > Objtool falls through all the empty hypercall text and gets confused > when it encounters the first real function afterwards. The empty unwind > hints in the hypercalls aren't working for some reason. Replace them > with a more straightforward use of STACK_FRAME_NON_STANDARD. > > Reported-by: Sami Tolvanen > Signed-off-by: Josh Poimboeuf > --- > arch/x86/xen/xen-head.S | 9 ++++----- > include/linux/objtool.h | 8 ++++++++ > 2 files changed, 12 insertions(+), 5 deletions(-) Confirmed, this fixes the warning, also in LTO builds. Thanks! Tested-by: Sami Tolvanen Sami