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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9447AC433F5 for ; Tue, 22 Mar 2022 09:15:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231492AbiCVJQ3 (ORCPT ); Tue, 22 Mar 2022 05:16:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232324AbiCVJQ3 (ORCPT ); Tue, 22 Mar 2022 05:16:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CB3C29CA2; Tue, 22 Mar 2022 02:15:02 -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 ED727B81C59; Tue, 22 Mar 2022 09:15:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DAFAC340EC; Tue, 22 Mar 2022 09:14:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647940499; bh=WINthaWEckUg/sw0H371TWwDWslpgqf/pcyy3jLtdrQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=h/RXRssYXgvARgN2tqZnMmbKhZfNUhhZWVQKzU8xjhO87aHYUFM3tcIRPXZF8evcm 1mK/I8kWc0EAdCnLT3NiqCQJBfeFzQg11c8DfWEoCrH9FdSJi8HmBmzPar6XP/gTB2 hCw6V1Jm0XjMMaBMOPN/JxUTCbTxYPiYghuG+N2A73r7GHGk+5DIOAMCGjypmQLe77 qyTAuReggOQs4z4ROUD7dzuBzceoZ/0i0KFfrQ1dok37VXAObaZ9aZ47fkSYkE2ZKj vgCqXYTd7eZr+RMue4/vAhlduhz8Gb8ljm7eby0lrwjm4eDPBFbLnJG0AyNiZYoWDW cfVM15bijCA4A== Date: Tue, 22 Mar 2022 18:14:54 +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 , 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: <20220322181454.659b15269d8c2e2348f19ba1@kernel.org> In-Reply-To: References: <20220321140327.777f9554@canb.auug.org.au> <20220322143136.0e78366c3521b54b7b9385b8@kernel.org> 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 Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org On Tue, 22 Mar 2022 09:08:22 +0100 Peter Zijlstra wrote: > On Tue, Mar 22, 2022 at 02:31:36PM +0900, Masami Hiramatsu wrote: > > > > 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? > > It creates pt_regs on the stack, so the trampolines do: > > push $arch_rethook_trampoline > push %rsp > pushf > sub $24, %rsp /* cs, ip, orig_ax */ > push %rdi > ... > push %r15 > > That means that if anybody looks at regs->ss, it'll find > $arch_rethook_trampoline, which isn't a valid segment descriptor, or am > I just really bad at counting today? Ah, got it. It seems that the ss was skipped from the beginning, and no one argued that. > I'm thinking you want a copy of __KERNEL_DS in that stack slot, not a > function pointer. The function pointer is for unwinding stack which involves the kretprobe. Anyway, I can add a slot for ss if it is neeeded. But if it always be __KERNEL_DS, is it worth to save it? Thank you, -- Masami Hiramatsu