Received: by 10.192.165.156 with SMTP id m28csp494439imm; Wed, 11 Apr 2018 02:35:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+hWYCicuf29C3NM2ZK37HE4/QhbJONQZ1/WNKiUoTouRdMXbWfCYCw6oXXK/UXlUBfp6Oh X-Received: by 10.99.37.70 with SMTP id l67mr2983418pgl.106.1523439316738; Wed, 11 Apr 2018 02:35:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523439316; cv=none; d=google.com; s=arc-20160816; b=bUOCx99MJ/oSxRjgQvEpfU5vmrotiAX9l2UMbJ6X21GRIuCLsT/85efA8sElcwVBdg nSJVRPHjIRup6MiOSaZh4sr1jgFaHFjvqrnuOBIYxIw81Dk10Ro7OLsaJpVClTfMh4GY d9cXDwDrHzr1BRJiEFvY2uBa4p0klvy0RMdOFiXdrtPT/MOofyI8KCXavN6LGV87s3wg XMPxkEyk1c7/rhRd+JdQhwzBbQ0+w3xpkAewlZJl+zTpAiv3cDS3f0C9laFtFfCvfgaF jqNPuPOFmKswTYJo7HD694XyQkQjSuyZzpPhc8VfRF5X8vpm7Q3QBeA1/cvMwOBnNC58 omwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:reply-to:dkim-signature :arc-authentication-results; bh=J9qF3+MhHuEihjN+RUAEfbv6Qwn95siolUU6nnnCKSY=; b=OTf9gsY9+nMxgNRiReNShG6gF5mFN1EaCQM22WRMGFA6B6/rEAd42/i3apz1Lr4Oxq q3EfdVQoQfPRC5XMtUwuDRrM0s6smlAjnTBw6CvTTXJqkLW7QjR1z3eXz1Nc+669arrR yHxj+NlSkposZwoRtUDY6A1G1y3AvSK/gyxWUbjVbn6OdoC5FML5WWCuNuq3f4AQOBVG zEODnuXiDZMBmMfm7lBHCb6Maokly+C0vYh9tVgks/ou2Yo2wn4ZKYI5HqAn3QXy3IRX Wi2KXZ2hqO4+5VquBUcKDTd1KGkal2PwzYA/z4Xz5Ekiukc2HE3Wq4CwO7jwObqzy5oS JgBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iEkl0ZBL; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10si537012pff.124.2018.04.11.02.34.39; Wed, 11 Apr 2018 02:35:16 -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=@gmail.com header.s=20161025 header.b=iEkl0ZBL; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752302AbeDKJan (ORCPT + 99 others); Wed, 11 Apr 2018 05:30:43 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:37881 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751668AbeDKJal (ORCPT ); Wed, 11 Apr 2018 05:30:41 -0400 Received: by mail-wm0-f65.google.com with SMTP id r131so2517074wmb.2 for ; Wed, 11 Apr 2018 02:30:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=reply-to:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=J9qF3+MhHuEihjN+RUAEfbv6Qwn95siolUU6nnnCKSY=; b=iEkl0ZBLk4ZGdx4xRjXjx1CLHekei0kqhZCE0E+vfhM3EpzhyUB9bRfqk1TSOwpaXy UDgPVSbGbXeZob7j4yEjaOG42GBGePp2Whq2q/elF9OAdfoEQNSwVYMYSl59cOhoKgI3 MnuNqPQ6OYS8ZmQ0C3Wt8v1dYoO+z+FWRKm8zJ9IeGjBAfKUdWWoyTXzje9iskIAgdi2 W0LvAbreTysAXXHN6y+qPkMdhMkmnCYBKH2uf60wawyROsHcTPlYWCgvBNnkMze9g2z3 r46CjeHvFI2O/QDpKDyh1qS8FE81nx4l9ftTuCAVT2AI3LPQ7bq/oWn76OX8Qsq05Yz5 2KGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=J9qF3+MhHuEihjN+RUAEfbv6Qwn95siolUU6nnnCKSY=; b=LCbyedPJOAsnEZb54Y1VO14S0CwNOJarev1+rb/Kf20j67onRBjGV5BhahhypsIsV2 ZSCyByGMjUtKXf8rVFJGBpnX9vYfg8dkGhAN/IvJlpCS+CMwUYIi/5lpT+2jZZydMbPj iLpi6jFtbzV7l0duIRUUaBqJFzZ4kpJmmN9h3lVuopqfmaPDSOMO1DFTxiGNmOXne0Zm N0UJYkJboHXfxcEpYBD73ee0gUc8q3BVGzzrrceiReeYAxD26iMfrEIEt1qRXSNE5/4R du6uco2PW08vvGQVD01hT0+3whhMO3/35lkgxslZjUH8Kbo94hYR4jw6DrGRuPASY8kB 07iw== X-Gm-Message-State: ALQs6tDk2qkrTtukvTX26t1Z8a/rAbKdCHallQvml+WPt8AmDddZFzTk vV2vTodCXQcHjYGXrW16svXK5M51 X-Received: by 10.28.173.4 with SMTP id w4mr2157314wme.54.1523439040258; Wed, 11 Apr 2018 02:30:40 -0700 (PDT) Received: from ?IPv6:2a02:908:1257:4460:1ab8:55c1:a639:6740? ([2a02:908:1257:4460:1ab8:55c1:a639:6740]) by smtp.gmail.com with ESMTPSA id 11sm968789wmd.1.2018.04.11.02.30.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Apr 2018 02:30:39 -0700 (PDT) Reply-To: christian.koenig@amd.com Subject: Re: [PATCHv2] drm/amdkfd: Remove vla To: Laura Abbott , Oded Gabbay , Alex Deucher , =?UTF-8?Q?Christian_K=c3=b6nig?= , "David (ChunMing) Zhou" , Felix Kuehling Cc: Kees Cook , kernel-hardening@lists.openwall.com, David Airlie , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org References: <20180411010243.17771-1-labbott@redhat.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: <5444bdd3-e97f-043e-9032-1a072bcca85d@gmail.com> Date: Wed, 11 Apr 2018 11:30:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180411010243.17771-1-labbott@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 11.04.2018 um 03:02 schrieb Laura Abbott: > 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 It would be nicer to have a define for that somewhere. Anyway the patch is Acked-by: Christian König for now. Regards, Christian. > --- > 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,