From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 52EE71048925 for ; Sat, 28 Feb 2026 01:02:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8EEB810E1D6; Sat, 28 Feb 2026 01:02:33 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=collabora.com header.i=deborah.brouwer@collabora.com header.b="cJSwERid"; dkim-atps=neutral Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9711F10E1D6 for ; Sat, 28 Feb 2026 01:02:32 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1772240549; cv=none; d=zohomail.com; s=zohoarc; b=IipEJmUGwY0aCabxq07pbN6CG3MBk6/szyjGX/48F93CbWsKSbcLwC6M/vrJlodCoPRTekw45ARma0IG48D5jCLcmCb/6jNP3ZcWPOUDKJd+k0QKfrRiHMx4yncjt3OVVToZBpPhO2UCj8Re/kOHttKCox7uNRN9wmWOlBGkcv4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772240549; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=NKcv8U7yv7haXw4cyreomqHFxGh7Vb4URM0L0PdLoPw=; b=mXixYith2rbNV/pWD6VCnJLVOZJ9JTbyDkbt4qyNv6vg2qkPxiYcxVsJWpF9fwbKjzX0rFtW1tOGtxesEZOPbAfku2yO1bEe4CPoOMiJyJn6CkKOB/bGuNCPM1KPDRq9AuXhLC/NiO3zyuK6SWJifJLgMzFoRSyRtPpGOJ/IXEI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=deborah.brouwer@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1772240549; s=zohomail; d=collabora.com; i=deborah.brouwer@collabora.com; h=Date:Date:From:From:To:To:Cc:Cc:Subject:Subject:Message-ID:References:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:Message-Id:Reply-To; bh=NKcv8U7yv7haXw4cyreomqHFxGh7Vb4URM0L0PdLoPw=; b=cJSwERid3wHNHkbXYZO5MgHFBU2+CtjjN2bvhktyH/TShY8BaV37GB2V5EzsL3X9 /Oug58w7BggbBRgzvDiChDurGiOoqU9lY6/YES2ZR5gZqvULc4Vany3PW6IMfPiWs/C ciTuTFWcHjFMPoNZ6RpFMJ2ozZuiiE48Ejk5dWeo= Received: by mx.zohomail.com with SMTPS id 177224054890469.89106924609871; Fri, 27 Feb 2026 17:02:28 -0800 (PST) Date: Fri, 27 Feb 2026 17:02:28 -0800 From: Deborah Brouwer To: Alice Ryhl Cc: dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org, daniel.almeida@collabora.com, boris.brezillon@collabora.com, beata.michalska@arm.com, lyude@redhat.com Subject: Re: [PATCH 12/12] drm/tyr: add firmware loading and MCU boot support Message-ID: References: <20260212013713.304343-1-deborah.brouwer@collabora.com> <20260212013713.304343-13-deborah.brouwer@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Sat, Feb 21, 2026 at 11:25:00AM +0000, Alice Ryhl wrote: > On Wed, Feb 11, 2026 at 05:37:13PM -0800, Deborah Brouwer wrote: > > Add firmware loading and management for the Mali CSF GPU. This introduces > > the fw module that loads the Mali GPU firmware binary, parses it into > > sections, and maps those sections into the MCU VM at the required > > virtual addresses. > > > > On probe, the firmware is loaded, its sections are mapped and populated, > > the MCU VM is activated, and the MCU is booted. > > > > Co-developed-by: Boris Brezillon > > Signed-off-by: Boris Brezillon > > Signed-off-by: Deborah Brouwer > > > +/// Loaded firmware with sections mapped into MCU VM. > > +pub(crate) struct Firmware { > > + /// Platform device reference (needed to access the MCU JOB_IRQ registers). > > + pdev: ARef, > > + > > + /// Iomem need to access registers. > > + iomem: Arc>, > > + > > + /// MCU VM. > > + vm: Arc, > > + > > + /// List of firmware sections. > > + #[expect(dead_code)] > > + sections: KVec>, > > Why the box? Hm I don’t actually remember why we originally needed KBox, but we don’t need the section addresses to stay stable anymore so I’ll remove it. > > > + let section_start = parsed.data_range.start as usize; > > + let section_end = parsed.data_range.end as usize; > > + let mut data = KVec::new(); > > + data.extend_from_slice(&fw.data()[section_start..section_end], GFP_KERNEL)?; > > Could this access be out of bounds? Yes, that could go out of bounds. I’ll add a defensive bounds check and return EINVAL if the range is invalid. > > Alice