Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2509969pxp; Mon, 21 Mar 2022 23:04:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzj/5U6Ir3rLAgMBq6kuKYewuYe5keajJuKxGawkRZI3QuFAQZeGO+4ruTAdWH+ivWGJBQi X-Received: by 2002:a65:530b:0:b0:382:b21d:82eb with SMTP id m11-20020a65530b000000b00382b21d82ebmr3170569pgq.215.1647929043140; Mon, 21 Mar 2022 23:04:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647929043; cv=none; d=google.com; s=arc-20160816; b=EtRfljUeksSDEd9N9tjU4HOHMbggMF6oftNFEdmukr5UAEA8FAulbVq0KpC7UXpe20 l5xMmmXrdXNcgGJAi1c005O66cw/nIDI83RppFQ9bC3LacBYywZF5InnT72/aj38lVlM AmsrtIgjSo73HnzkGBbO6ZEpOTpWnbfsYcFMpmF4XJ0dwiFZA2q7zjb9h2wWYdrIB3eR 53RIwmm890H7aKjlxzvW8MmAp9S8jXSo6WI3c+uQB/UW+8gtIlEfQ6tL+Mec7FxZAE1u 7hP7XMGjlSKFHn7If8L2kFcy1EbOse2NfSQ0xImKY/VZMSzlfLPE6sI1QpK2kAj9Q6wn eS0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=t+AWIMPcXMNnQKYjbngESxFoEtEZ8sbNKz+aKPEJsOU=; b=AFOp2XEGhZMinE3+5YYg4TjlyY0uTzqdsBpUwwWZkPlt2MVOtut0u9ToqZD/5S+AZQ UxRoDWE1WOxZKKIw0qWPdMxUO+hAtjNbNjhsQJMFlPrVg17hyPa+OrNxnpJLwGPYnX8e 40CUEuqmPCgZ1BdhDBEFUa1C4GpWFmiJaMXg8IMwCDOR7nKpAiAa/khH8qYkjHkTLhwd e+RD5ACIzWD1uz2DADJti8a//o6kCqE0WJza/R2qtxes0T3o+jRw2q+Pkkf7Zux4lbf2 VOx16SsUgayus4VzIMOwxoqOKLvEkrkpMGIIyb3xU7n0P20Hd+Q1SRuPlVTV1czugWit SMYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dZ631HIN; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d15-20020a170902b70f00b00153b2d16473si12025023pls.123.2022.03.21.23.04.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 23:04:03 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dZ631HIN; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 003FA11C0C; Mon, 21 Mar 2022 22:31:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236749AbiCVFdU (ORCPT + 99 others); Tue, 22 Mar 2022 01:33:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236720AbiCVFdM (ORCPT ); Tue, 22 Mar 2022 01:33:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23B25381; Mon, 21 Mar 2022 22:31:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C1EE7B81B87; Tue, 22 Mar 2022 05:31:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AAEFC340EC; Tue, 22 Mar 2022 05:31:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647927102; bh=S9IobCk2/SCUxMjhrXXqR93XhKqnu26qc3N4ltVvvR8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dZ631HINBxUbJBtm1PoeSI+QIhyE67UmFHGhDNIFKBnRUXqxap8EQa3cEzRAT4dy4 zzIb1x4Aot4BfF+a5L9Lrq7JRK0rfjlztcarqmFrwhvPc4G7S3T3AamX7scHq/3d2u HawIzWz2EFVrh7SrZsNd2EH+nseru+R8rR6oooEa/yUzOiGpt4rfPV2eynh5MDBlYQ lXSJzL7RKasm9PqW6anjXReLsPrJ3iTURw4IEMWYZA5fZt5/uCIKvS9O/kJfv5pyOy cHTTBwbadm0svfYtNcCquc6UfXmlTTmsM75YTGmYtkGzUYqUJckEFNNGtNEUVUp9aw vzXRbtCHt76UQ== Date: Tue, 22 Mar 2022 14:31:36 +0900 From: Masami Hiramatsu To: Peter Zijlstra Cc: Stephen Rothwell , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Linux Kernel Mailing List , Linux Next Mailing List , mhiramat@kernel.org, rostedt@goodmis.org, ast@kernel.org, hjl.tools@gmail.com, rick.p.edgecombe@intel.com, rppt@kernel.org, linux-toolchains@vger.kernel.org, Andrew.Cooper3@citrix.com, ndesaulniers@google.com Subject: Re: linux-next: build warnings after merge of the tip tree Message-Id: <20220322143136.0e78366c3521b54b7b9385b8@kernel.org> In-Reply-To: References: <20220321140327.777f9554@canb.auug.org.au> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 21 Mar 2022 17:48:54 +0100 Peter Zijlstra wrote: > On Mon, Mar 21, 2022 at 02:04:05PM +0100, Peter Zijlstra wrote: > > On Mon, Mar 21, 2022 at 01:55:49PM +0100, Peter Zijlstra wrote: > > > On Mon, Mar 21, 2022 at 02:03:27PM +1100, Stephen Rothwell wrote: > > > > Hi all, > > > > > > > > After merging the tip tree, today's linux-next build (x864 allmodconfig) > > > > produced these new warnings: > > > > > > > > vmlinux.o: warning: objtool: arch_rethook_prepare()+0x55: relocation to !ENDBR: arch_rethook_trampoline+0x0 > > > > vmlinux.o: warning: objtool: arch_rethook_trampoline_callback()+0x3e: relocation to !ENDBR: arch_rethook_trampoline+0x0 > > > > vmlinux.o: warning: objtool: unwind_next_frame()+0x93e: relocation to !ENDBR: arch_rethook_trampoline+0x0 > > > > vmlinux.o: warning: objtool: unwind_next_frame()+0x5f2: relocation to !ENDBR: arch_rethook_trampoline+0x0 > > > > vmlinux.o: warning: objtool: unwind_next_frame()+0x4a7: relocation to !ENDBR: arch_rethook_trampoline+0x0 > > > > vmlinux.o: warning: objtool: __rethook_find_ret_addr()+0x81: relocation to !ENDBR: arch_rethook_trampoline+0x0 > > > > vmlinux.o: warning: objtool: __rethook_find_ret_addr()+0x90: relocation to !ENDBR: arch_rethook_trampoline+0x0 > > > > vmlinux.o: warning: objtool: rethook_trampoline_handler()+0x8c: relocation to !ENDBR: arch_rethook_trampoline+0x0 > > > > vmlinux.o: warning: objtool: rethook_trampoline_handler()+0x9b: relocation to !ENDBR: arch_rethook_trampoline+0x0 > > > > > > Hurmph, lemme go figure out where that code comes from, I've not seen > > > those. > > > > Ahh, something tracing. I'll go do some patches on top of it. > > The below gets rid of the objtool warnings. Yes, I confirmed that. > > But I still think it's fairly terrible to get a (flawed) carbon copy of > the kretprobe code. Indeed. I would like to replace the trampoline code of kretprobe with rethook, eventually. There is no reason why we keep the clone. (But I need more arch maintainers help for that, there are too many archs implemented kretprobes) > Also, I think both should fix regs->ss. I'm not sure this part. Since the return trampoline should run in the same context of the called function, isn't ss same there too? Thank you, > > --- > diff --git a/arch/x86/kernel/rethook.c b/arch/x86/kernel/rethook.c > index f0f2f0608282..227a1890a984 100644 > --- a/arch/x86/kernel/rethook.c > +++ b/arch/x86/kernel/rethook.c > @@ -20,6 +20,7 @@ asm( > ".type arch_rethook_trampoline, @function\n" > "arch_rethook_trampoline:\n" > #ifdef CONFIG_X86_64 > + ANNOTATE_NOENDBR > /* Push a fake return address to tell the unwinder it's a kretprobe. */ > " pushq $arch_rethook_trampoline\n" > UNWIND_HINT_FUNC > @@ -48,7 +49,7 @@ asm( > " addl $4, %esp\n" > " popfl\n" > #endif > - " ret\n" > + ASM_RET > ".size arch_rethook_trampoline, .-arch_rethook_trampoline\n" > ); > NOKPROBE_SYMBOL(arch_rethook_trampoline); -- Masami Hiramatsu