Received: by 10.192.165.156 with SMTP id m28csp528773imm; Mon, 16 Apr 2018 04:40:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx49J1w1Wqma7idmBSGlpN4D1bEWhKn8ADF3eFUzOkomlVgICyzPwono3bsElhi/xR8y3NJBy X-Received: by 2002:a17:902:b2c7:: with SMTP id x7-v6mr15181808plw.124.1523878827684; Mon, 16 Apr 2018 04:40:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523878827; cv=none; d=google.com; s=arc-20160816; b=VELNgCXDZQjIor/a7vxvzdlXQyilFBkidQn7K5V6G/IHj2nq6GJ18kuUWwOrh7WvDm Nro7kQ6ACY4DijiBBFE4WplcpIoO3wcFWHiEg5nv1kp0tkrZ/8O7NtFxir4B8tonNKhH +/8YJAAdFPGC7AV4Dxcf2MRdvmpBCUuaqn5dshAW9IxhRnY93K0usfrkB1xKpZNCVJ2z iERtxdapOdA2fQvZyWdsskqh+L7uXSeyX2tx2yilOA4bQddq2gmUV3avgG3OrZ/xe+KQ OoEiJr/IyYFuS41GWJ/MmuxuZo2HQmeJC92rkr0fAIUYztpoDt1vG8r051ZzyYjU/179 l+zA== 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:arc-authentication-results; bh=tHLVbh7OfgkyX/fwEdPPeyWW9h8PuXa79SBPQId2mkY=; b=FsDeZlqarWfMivvtzWbxHD691s/t6sHrWNTrwBrdLBifWQbx0yCZB2VGiut6BQUy5a 9PVRzh6CBN5b1caMDvoQi23ho+QZ3tpgq0t1/RVLEFlr9csFZbr6r+3nG6Vt5kl9Kpcx VcAc6sZAjDrPlO+KISx0Hf96gn9j26EcaT4498qxfUbdW8/3SAd3JRhj4dsnjhQ8nWeA rJljAB8mu43nRoEmDjzkeXObSk3xMPuXLq58+0q4xUgMMvtE1Z8rCO5wA2ubOfntTgGa etVpC32Ii3fS2nEirXuPZuOKDQJUtL2ZIYhaaDrDsUOR1LcLIOBo2AydgGwh73vRN+17 qq9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Ws+RLAXO; 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 a59-v6si11753128plc.370.2018.04.16.04.40.13; Mon, 16 Apr 2018 04:40:27 -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=fail header.i=@gmail.com header.s=20161025 header.b=Ws+RLAXO; 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 S1754727AbeDPJkm (ORCPT + 99 others); Mon, 16 Apr 2018 05:40:42 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:37326 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754285AbeDPJkL (ORCPT ); Mon, 16 Apr 2018 05:40:11 -0400 Received: by mail-wr0-f193.google.com with SMTP id l49so24045358wrl.4 for ; Mon, 16 Apr 2018 02:40:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=tHLVbh7OfgkyX/fwEdPPeyWW9h8PuXa79SBPQId2mkY=; b=Ws+RLAXOzYadvfXJDgJ07LlNTmQwjDXgjx8qLf7FoYesZfDNBVdijN76Lo4wOn9OL6 uUveBohOcK1DZbacCkTYZ+nqyDfZ6ZCPLGfq1LfjMYTuVjko+8voY+ACru0dE8rRHlcH WSqRJ/XIlO8dqA1SDIUNaHUv+jpmd7rsORpmuqMs9NoLWNGf35QWRr/JqPZ3TvdrBZU/ 3mvBOL01SBh1m4MKPhOQfqCVLyToVUu5odoS4TRQQvASnRvJFpPZmRuiLgv/zZ07zh+W N1hRHbZpdxiBCYRfHGNG9CPAaQSvqHYaq/2NR2w9EJ07+WMNDnwapWPrSBX8n9GRiaEy mUZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=tHLVbh7OfgkyX/fwEdPPeyWW9h8PuXa79SBPQId2mkY=; b=p82c5hIOZiRrpNk1nYPPGLtb9tWsB1c6A3Bgm0AaUECso74taWH9W23ALNHgNj4ev1 Hjj8K2VGIH8lmf/wWHFnGAHB8DGxUhultipVbhKBKsKrPJZjVnQWfh4QzT/3qnck76Oj ND488bcioI+wlq7+yUObMVW2S+826370LLyEZSrWnmzqXjSZMl5IQ7f5GUu+35hMJ7ts +7DtK8J+hDgvRi71ZrwINkCpjaO+2DCHLhDcL72dLaMsF4NrSMAiy8sgrSfFNyJ72lOt RWpRwUJj0oFkqsZZkwU5BG9qNk7zOFkJx+SUDnvU/+/ii32GJEYD+9htg8gEDQCOSmml LGcg== X-Gm-Message-State: ALQs6tAxkxkz4XPOSkBr48eGVth2baZNi7RbGg/+AMz5HPLocv5Kdqv9 MCH8zKLqAewt8q91b2ksFVM= X-Received: by 10.223.147.167 with SMTP id 36mr7043464wrp.31.1523871610643; Mon, 16 Apr 2018 02:40:10 -0700 (PDT) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id v74sm8052720wmv.48.2018.04.16.02.40.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Apr 2018 02:40:09 -0700 (PDT) Date: Mon, 16 Apr 2018 11:40:07 +0200 From: Ingo Molnar To: Laura Abbott Cc: Boris Ostrovsky , Juergen Gross , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: Re: [PATCH] x86/xen: Remove use of VLAs Message-ID: <20180416094007.diuobump2qxraybx@gmail.com> References: <20180413221146.28476-1-labbott@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180413221146.28476-1-labbott@redhat.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Laura Abbott wrote: > There's an ongoing effort to remove VLAs[1] from the kernel to eventually > turn on -Wvla. The few VLAs in use have an upper bound based on a size > of 64K. This doesn't produce an excessively large stack so just switch > the upper bound. > > [1] https://lkml.org/lkml/2018/3/7/621 > > Signed-off-by: Laura Abbott > --- > arch/x86/xen/enlighten_pv.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c > index c36d23aa6c35..d96a5a535cbb 100644 > --- a/arch/x86/xen/enlighten_pv.c > +++ b/arch/x86/xen/enlighten_pv.c > @@ -421,8 +421,7 @@ static void xen_load_gdt(const struct desc_ptr *dtr) > { > unsigned long va = dtr->address; > unsigned int size = dtr->size + 1; > - unsigned pages = DIV_ROUND_UP(size, PAGE_SIZE); > - unsigned long frames[pages]; > + unsigned long frames[DIV_ROUND_UP(SZ_64K, PAGE_SIZE)]; > int f; > > /* > @@ -470,8 +469,7 @@ static void __init xen_load_gdt_boot(const struct desc_ptr *dtr) > { > unsigned long va = dtr->address; > unsigned int size = dtr->size + 1; > - unsigned pages = DIV_ROUND_UP(size, PAGE_SIZE); > - unsigned long frames[pages]; > + unsigned long frames[DIV_ROUND_UP(SZ_64K, PAGE_SIZE)]; > int f; Reviewed-by: Ingo Molnar Thanks, Ingo