Received: by 10.192.165.156 with SMTP id m28csp237961imm; Tue, 10 Apr 2018 20:39:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+hFejye/+Y61kZHtltoKUIgz+UjcRuu34ah6wRj3AYN5j3yKNdzKmRrWhiRnKex0BBW6BT X-Received: by 2002:a17:902:7004:: with SMTP id y4-v6mr3175431plk.3.1523417988900; Tue, 10 Apr 2018 20:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523417988; cv=none; d=google.com; s=arc-20160816; b=H+Cd/VabGHMD+nME00Lgd/3AtWOVMWGUGUS7YlNvRvLDuBFZfx0PCmCNGlqXqYqHfT ZLR0+fDrmADgJQYThKNUInU48egZuX9PHVGBNRYYYzguUs4a31u5IECos4gfBgOobscR INy7CdaJ9rPNEiJDZtxhvsB2Rxgs1DZps/t3G3bJvrZhUEk4wijuHcowyCntO4qalg8Z O/y4XXnT8qtAYF3ryR6T5GoBz2Axrr6fQQXNbHbS7gu7s6dX3cyJiSOcmsyMY0/7oBov QTssFO9MaqioFjxU0R4Ei+Gib62gNsPRAxm3R52q7VAr7HfSS9uV71R2tU9nf3CNOAE5 YV1w== 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=vjfMdQW2qqANENkY55bBcrTsKlYRfZRl/r97fU0VU4w=; b=DUsxHZNQRv0E3WQ05AJ5CgsWzBHjeYiG7b49sQfue0+nG5XwDmnE2BX+7pV0GxGhRL lZbJD6DfH45y33xQaukAm5HONPdYGgdTQkWTK4X36IKo8rSJ+AQBvKC/ytF6IJOdizwf dHgdEzk0h5l4wI31Y4vpSGj1aOHJqkj2D0uc0SlzEh2O0JNihY9Lqx/zae0zQ/THLD1Z Rg35+Sj94H6eUNfqhcJabOT18cOPfkGwrz1OTwX2H+M6vXr4N5aUMpt2WuLGpAZdhPXT SwZJXq8pwkhFjRIQpeo5QwqbVGTTwTYxfMz946CNfan3Pzb2H+CcgFBaki8WslGffP/o 8OCA== 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 z62si137064pfb.305.2018.04.10.20.39.12; Tue, 10 Apr 2018 20:39:48 -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 S1752948AbeDKBC4 (ORCPT + 99 others); Tue, 10 Apr 2018 21:02:56 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:33611 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752594AbeDKBCy (ORCPT ); Tue, 10 Apr 2018 21:02:54 -0400 Received: by mail-pg0-f67.google.com with SMTP id i194so15597pgd.0 for ; Tue, 10 Apr 2018 18:02:54 -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=vjfMdQW2qqANENkY55bBcrTsKlYRfZRl/r97fU0VU4w=; b=KPdCibSJfL7NReUXkkHVerZeOKZoVbBwu8ykKvlXtZCHsMnHCcCLhzn02AiVcKnT/j pYpCUS5n8potrSAwuxgXd9h5VapO4KvwBK9iZNuEBsrERI6Dnfrq8ALEDf8MywMFw5ff DJw9GXgdVyC9Xmw3xRKqiX2Qd0aSLVRiD2fqxOWAIVPE1K68gYj3u8FHnqk051oHrP3p /Jkj6EWaM4DMcCBDdmGfCBjqHERrsyFuF5ITbiKNiV3wcqbL5QyCWJTbaQw0WBFfGX29 Z4z4uc0cJyc6FxgzizIozEWwgb9UQ2YNEonCctqoA/2ldAFh/0u6nkNkCEdiBBvIkTZZ V3FA== X-Gm-Message-State: ALQs6tB9BpZFZUB/e/y6tPS+aYc2ycUlGPep8sNFdONiN/gxEYEyv0K1 Spm6A1XbBUsCxeT49svt6hV1xw== X-Received: by 10.99.146.83 with SMTP id s19mr1894588pgn.104.1523408574356; Tue, 10 Apr 2018 18:02:54 -0700 (PDT) Received: from labbott-redhat.redhat.com ([2601:602:9802:a8dc:4eb2:6dae:ab32:e5b0]) by smtp.gmail.com with ESMTPSA id e87sm8238339pfd.136.2018.04.10.18.02.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Apr 2018 18:02:53 -0700 (PDT) From: Laura Abbott To: Oded Gabbay , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "David (ChunMing) Zhou" , Felix Kuehling Cc: Laura Abbott , David Airlie , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Kees Cook Subject: [PATCHv2] drm/amdkfd: Remove vla Date: Tue, 10 Apr 2018 18:02:43 -0700 Message-Id: <20180411010243.17771-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. Switch to a constant value that covers all hardware. [1] https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Laura Abbott --- v2: Switch to a larger size to account for other hardware --- drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c b/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c index 035c351f47c5..c3a5a80e31ae 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c @@ -139,10 +139,12 @@ static void interrupt_wq(struct work_struct *work) { struct kfd_dev *dev = container_of(work, struct kfd_dev, interrupt_work); + uint32_t ih_ring_entry[8]; - uint32_t ih_ring_entry[DIV_ROUND_UP( - dev->device_info->ih_ring_entry_size, - sizeof(uint32_t))]; + if (dev->device_info->ih_ring_entry_size > (8 * sizeof(uint32_t))) { + dev_err(kfd_chardev(), "Ring entry too small\n"); + return; + } while (dequeue_ih_ring_entry(dev, ih_ring_entry)) dev->device_info->event_interrupt_class->interrupt_wq(dev, -- 2.14.3