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=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 B021CC433DB for ; Tue, 9 Feb 2021 15:46:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 807D464DD9 for ; Tue, 9 Feb 2021 15:46:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232491AbhBIPp4 (ORCPT ); Tue, 9 Feb 2021 10:45:56 -0500 Received: from mx2.suse.de ([195.135.220.15]:49660 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232561AbhBIPpt (ORCPT ); Tue, 9 Feb 2021 10:45:49 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 990B3AD57; Tue, 9 Feb 2021 15:45:07 +0000 (UTC) Date: Tue, 9 Feb 2021 16:45:07 +0100 (CET) From: Miroslav Benes To: Peter Zijlstra cc: Josh Poimboeuf , Thomas Gleixner , Nick Desaulniers , Julien Thierry , Kees Cook , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/3] objtool: Support the stack swizzle In-Reply-To: <20210209091600.075402197@infradead.org> Message-ID: References: <20210209091600.075402197@infradead.org> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 9 Feb 2021, Peter Zijlstra wrote: > Hi! > > Implement objtool support for the x86_64 stack swizzle pattern. > > This means we can use the minial stack swizzle: > > mov %rsp, (%[tos]) > mov %[tos], %rsp > ... > pop %rsp > > from inline asm, with arbitrary stack setup. The ORC data for the Top-of-Stack > will use the SP_INDIRECT CFA base. In order for this to work, SP_INDIRECT needs > to first dereference and then add the offset to find the next frame. > > Therefore we need to change SP_INDIRECT (which is currently unused) to mean: > (%rsp) + offset. > > Changes since v1 include: > > - removed the !callee saved reg restriction by using the vals[] array > over the regs[] array. > > - per the above, removed the patches creating the regs[] scratch space. > > - more comments. > > - rebased to tip/objtool/core I haven't tested it, but it all looks good to me. Reviewed-by: Miroslav Benes M