Received: by 10.213.65.68 with SMTP id h4csp29861imn; Tue, 27 Mar 2018 20:56:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/ZtXg6iqnI0L3nbEa/1G/loCmifpr7vHW+ODnl1lJ5ydPDtJLlNuszihAMKi9I7JtS5kfG X-Received: by 2002:a17:902:a5c5:: with SMTP id t5-v6mr2082883plq.244.1522209391790; Tue, 27 Mar 2018 20:56:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522209391; cv=none; d=google.com; s=arc-20160816; b=By45SjkdYgc42IZE4m0pytVTZ60TeKmDGkQDK+sc9+eq5ZaXRZXQFOVATQznPZYQRJ PVpah8Tc5fsvz5QaLeg36EAL/4HikkDVO3sb2DRrwQ8Xgl/J7n8NMog0CysC+C9q4KTL Lmr0Lceu/kXZbIt2bC4nTPqjKjmdlkzcqcxU5V9eb+Lb8vlqjF1cDXb/fGCTNl5GxGRW Ceg/AyUMpmknsXe81O6QuYBS4mkWpkZoPAVHWTCwuDGy/v7AeIrlJ8nVuXsZ0JMOCs8Y OPGc9R7mxWRe6KNsoEhEv3ekyGyIxVP8/LvKUNvW/7k/Dx1i3v9Riu4xZeKzt9bpi1yj w5Tw== 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:arc-authentication-results; bh=P+YRrXWK2NEUA5teq4JXvI/Bw2UKYbokWKnBOVYQ/gg=; b=G0M4VxUJZZ5ixf/RnJ1+v9W+iZ/r0H5EJUvQNeHysv6XHvwF2WkLap5PBx/o0FpIKu EsR+1I+lfnS8x9ob/dxUmKfXkRdu+dTcQ0Eqy9lKRMmbaMnjHkKTGSJq7SUXR/W2EYA+ BiMhJp6+IfcDj/5z4mpD2HWO4F+7i1+dSkEtzCl3mr38ndm4TaR7D78hmZqzjWVHCaw1 6YP4kJ1fGopxf8yGFWrZrU6ug79cJlSnrsMK8DyzNuc+2UQ+bQk1PDOxFtv/vAX2om3j zrdxwenNxNykUAlGdr8N6bjeF7FMTisz8RE2kF3B+Mk0opSZAVZTBP6rSOn00dKB5Uv+ RPWg== ARC-Authentication-Results: i=1; mx.google.com; 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 s5-v6si2731128plp.28.2018.03.27.20.55.54; Tue, 27 Mar 2018 20:56:31 -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; 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 S1752584AbeC1Dy7 (ORCPT + 99 others); Tue, 27 Mar 2018 23:54:59 -0400 Received: from bmailout2.hostsharing.net ([83.223.90.240]:46637 "EHLO bmailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752082AbeC1Dy6 (ORCPT ); Tue, 27 Mar 2018 23:54:58 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout2.hostsharing.net (Postfix) with ESMTPS id 0F8ED2800B1C8; Wed, 28 Mar 2018 05:54:56 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id A2CF04184E; Wed, 28 Mar 2018 05:54:55 +0200 (CEST) Date: Wed, 28 Mar 2018 05:54:55 +0200 From: Lukas Wunner To: Laura Abbott Cc: Rasmus Villemoes , Linus Walleij , Kees Cook , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Mathias Duckeck , Nandor Han , Semi Malinen , Patrice Chotard Subject: Re: [PATCH 1/4] gpio: Remove VLA from gpiolib Message-ID: <20180328035455.GA18149@wunner.de> References: <20180310001021.6437-1-labbott@redhat.com> <20180310001021.6437-2-labbott@redhat.com> <20180317082509.GA2579@wunner.de> <20180318142327.GA23761@wunner.de> 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 Tue, Mar 27, 2018 at 05:37:18PM -0700, Laura Abbott wrote: > On 03/18/2018 07:23 AM, Lukas Wunner wrote: > > Actually, scratch that. If ngpio is usually smallish, we can just > > allocate reasonably sized space for mask and bits on the stack, > > and fall back to the kcalloc slowpath only if chip->ngpio exceeds > > that limit. Basically the below (likewise compile-tested only), > > this is on top of Laura's patch, could be squashed together. > > Let me know what you think, thanks. > > > > It seems like there's general consensus this is okay so I'm going > to fold it into the next version. If not, we can discuss again. Yes, feel free to squash into your original patch with my S-o-b, keep your authorship. You may want to raise FASTPATH_NGPIO to something like 384, 448 or 512 to accommodate for the Intel chips Andy mentioned. It's kind of a "640k should be enough for everyone" thing but I'd expect the performance impact of the extra bytes on the stack / memsetting them to zero to be absolutely negligible. Thanks! Lukas