Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp137319imm; Thu, 20 Sep 2018 20:13:51 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdaq94vwID6qy3FzFf4i+fj6mtRfnX7eRk9ahf7o6JU8ap/dvK7sqZkuP7RUMfhNRKWjHzqj X-Received: by 2002:a17:902:8a97:: with SMTP id p23-v6mr41664759plo.21.1537499631375; Thu, 20 Sep 2018 20:13:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537499631; cv=none; d=google.com; s=arc-20160816; b=AEBZDuhR607s4b9KC1MitJGlkrXbopURiqicqpNTYMbkqI2/jPsCr+x6Lh/SmV3EQI RGbwcqO197hxjIe97cZUtIbotiR/qF5zg8xp61NgnxkMoqb/jt8Gu3aH4t0Ud81RyVE1 uiW3I6zkDNY0uRZiBinEWsmGATDn1c8G/HJfafxN+kwSYBBpmU4E8NUml1LBiF0gSwSC 55Vx+tztfgNS2a+cbg7gPndJ8w8YQwLhrPV26jJL6Z4GuuPOqz/+I4P71qLBZnOMFAaB +pmNTA1Q0zoHS+ifMKpeMSQOPlqaxFQJihJ4tz+vgAR0vtmY3CVvvSWRqiAc6yJ8sV7i Jhvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=3j2QySAFHtDQaPPWeq4lDGbGd4vQAVpGQ3t1XKx/6r4=; b=eO00+UYMovPly/hiuVGIUjOInF0d/fQv3/JaMDpe990h4XuX4mqI1IOw2+6YV600A1 Xgrrgc3gIxu8vLf+4hOrGWrLkgsXR+wqSR39Sb50XHnVPuQWKR8X1XWSMCeb70L6wdct 4Rn/ksh0m8SkAOGEaac2k/WDhB8FZia7eSWvg8GWhhkcLotRMlr5VGfccf12f7c5q/LY ev3vzaZe7B7S7YItMZay3NqJgKczAbbPLPu1prJo4zl68326kO09nwaxMSs8VzQP3c6i pSD6dUSd3yGW7mhvAPkSmoNCnxc0O5gRegwbFS3eQvos2ctfTqTor8lmPWq3iS57Yf6k hf9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=5r+QLnhJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s29-v6si24578694pgl.31.2018.09.20.20.13.35; Thu, 20 Sep 2018 20:13:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=5r+QLnhJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389035AbeIUI7q (ORCPT + 99 others); Fri, 21 Sep 2018 04:59:46 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:40761 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725887AbeIUI7p (ORCPT ); Fri, 21 Sep 2018 04:59:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=3j2QySAFHtDQaPPWeq4lDGbGd4vQAVpGQ3t1XKx/6r4=; b=5r+QLnhJV2pW4+RlfEOBlYkA7nVwdnMSWYYVj7IeQU0WwVSBAFGHlbzGeG6AXLtByL5wuIFrn4nQodJYAP3RXnVYq6Fs2Ni99/NIDuivnU4wZShn04VoSYpUL5wyCXnKqh/P0wUvXI7QMhn6DRgUqCqYeID3jBcdiVnt8ua5EbI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1g3BsF-00037K-C0; Fri, 21 Sep 2018 05:12:55 +0200 Date: Fri, 21 Sep 2018 05:12:55 +0200 From: Andrew Lunn To: "Jason A. Donenfeld" Cc: Arnd Bergmann , Ard Biesheuvel , Eric Biggers , LKML , Netdev , Linux Crypto Mailing List , David Miller , Greg Kroah-Hartman , Samuel Neves , Andrew Lutomirski , Jean-Philippe Aumasson Subject: Re: [PATCH net-next v5 02/20] zinc: introduce minimal cryptography library Message-ID: <20180921031255.GB11109@lunn.ch> References: <20180918161646.19105-1-Jason@zx2c4.com> <20180918161646.19105-3-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 21, 2018 at 02:11:43AM +0200, Jason A. Donenfeld wrote: > Hey Arnd, > > On Thu, Sep 20, 2018 at 6:02 PM Arnd Bergmann wrote: > > Right, if you hit a stack requirement like this, it's usually the compiler > > doing something bad, not just using too much stack but also generating > > rather slow object code in the process. It's better to fix the bug by > > optimizing the code to not spill registers to the stack. > > > > In the long run, I'd like to reduce the stack frame size further, so > > best assume that anything over 1024 bytes (on 32-bit) or 1280 bytes > > (on 64-bit) is a bug in the code, and stay below that. > > > > For prototyping, you can just mark the broken functions individually > > by setting the warning limit for a specific function that is known to > > be misoptimized by the compiler (with a comment about which compiler > > and architectures are affected), but not override the limit for the > > entire file. > > Thanks for the explanation. Fortunately in my case, the issues were > trivially fixable to get it under 1024/1280. (By the way, why does > 64-bit have a slightly larger stack frame? To account for 32 pointers > taking double the space or something?) That will be rectified in v6. Hi Jason Do you any stack usage information? A VPN can be at the bottom of some deep stack calls. Swap on NFS over the VPN? If you have one frame of 1K, you might be O.K. But if you have a few of these, i can see there might be issues of overflowing the stack. Andrew