Received: by 10.192.165.156 with SMTP id m28csp1194312imm; Fri, 13 Apr 2018 15:13:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx48SCZk1tlNtaVmtbqnykAkHrcS2FK21uEZDpuYVITues/rMMfXo2xnRRGjBJ/Z7K0CRe+4L X-Received: by 10.99.119.79 with SMTP id s76mr5311219pgc.291.1523657609691; Fri, 13 Apr 2018 15:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523657609; cv=none; d=google.com; s=arc-20160816; b=iWoSpLhKpsFlFQYjFkxLP4FbGQY42U8l6m78KSE1EGpqqdb37NtjPGlzY/U/9p1a9s OJOTRiT1eez6Bxltr1/ingmNw19n3oDlopxZv5uvcXi8nkVSV+O9JeZQ93gSyjXZY4K6 uutuzNP7TLxGctpzu8wY2xig0IdJlESq8fsfy4gUEzHksHBMu5iyJqBPrZMmzPC6S/2E NLpnWFgx2MvBwTNLmgeW2ab5TVy7RW8OtKkdxpPx3ph0DkGYdczPi3L2cw0iQWyInWpO 8FzTqHB/tq7ATdozVT2sFxcDJ3PLMLIBlcyJlMoQsLG8fABEzk5MWRrpPMHPl3WsoyqN YlUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=2/8HjuS2UQuxTlH6dZp1Oqp/dVN0PDHwDYfzQSzjByY=; b=X9Pv5Etkt8RW+dzURg+PHwkSyVEoerfzKXhDK+PR8b8fk9k9OdT2Ihuf02FwUxS5xb XHxw/nfStVXijhY1vkj6MRS4pfhCx/VrXe7Xz/LR5Cxb8uDpxcCMATqhViiPnwJRAKeU eeN7dqe3twvdxEFEByIiIPuKskVbPGqSWXR5rabfVA6DCYW9xsual7g2etg0eu1KLmG/ pmqThqzJ3UYTxLeGjmky2EnkjQuQ1vhu4XqkJ/I0PQpG+P7us9RNaxWIcXd2oV58FR+V w7REhyIyl+Dv3RwSoxFANfjcfu+XuVOz43DnIIX5rG0DCXaAB9WH97g/gUmHMUbypAu+ +Haw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k18si1412517pgt.174.2018.04.13.15.13.15; Fri, 13 Apr 2018 15:13:29 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752574AbeDMWMD (ORCPT + 99 others); Fri, 13 Apr 2018 18:12:03 -0400 Received: from mail-ot0-f196.google.com ([74.125.82.196]:44600 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752464AbeDMWMC (ORCPT ); Fri, 13 Apr 2018 18:12:02 -0400 Received: by mail-ot0-f196.google.com with SMTP id p33-v6so11467552otp.11 for ; Fri, 13 Apr 2018 15:12:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2/8HjuS2UQuxTlH6dZp1Oqp/dVN0PDHwDYfzQSzjByY=; b=b7XH2stYPCP5HSM64BqRBuFYxTLRfhcs1Hn3geXi7h1bqEVTsTj2q+BR14TamBKE3Y 1RtfPyiHUR50TquWFNqXrjcgs1RuvsDT9Q7ul6q0PgxkWeiq3D9GI4OCkrbi2r/gFu4M JGlC1+FSQ5rRtPsVb+ubx85yWJFv8ZDXTIOIVP/5r6C4A2gfSu1+TX8euK1qGyTjk8V+ LjJbXV9Y3ljVLZcYpwnW8vL3M3B4quIVVhKPwKCMSQdO7724FjNfNb4RlmXr2he7Ye94 6z1yGAmqkP/rYjUN7hWyKuzEF0rhddWMjfB+piU8Nw+kmzgPB2PslI3SDFfHDSJBjPcA cvPA== X-Gm-Message-State: ALQs6tC/CBAktSakJ8zkwP1+fP67FLwHFEwgk3fLMEiX0og6yMfIdnYX oCz3fKYCRDhZxRBWyvEidPNDrg== X-Received: by 2002:a9d:733:: with SMTP id 48-v6mr4554187ote.19.1523657521363; Fri, 13 Apr 2018 15:12:01 -0700 (PDT) Received: from labbott-redhat.redhat.com ([2601:602:9802:a8dc::ce63]) by smtp.gmail.com with ESMTPSA id g137-v6sm4463425oib.44.2018.04.13.15.11.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Apr 2018 15:12:00 -0700 (PDT) From: Laura Abbott To: Boris Ostrovsky , Juergen Gross Cc: Laura Abbott , 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: [PATCH] x86/xen: Remove use of VLAs Date: Fri, 13 Apr 2018 15:11:46 -0700 Message-Id: <20180413221146.28476-1-labbott@redhat.com> X-Mailer: git-send-email 2.14.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; /* -- 2.14.3