From patchwork Thu Apr 17 14:49:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 14055714 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 CC055C369B2 for ; Thu, 17 Apr 2025 14:49:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B05610EB34; Thu, 17 Apr 2025 14:49:13 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="h5E8ejFf"; dkim-atps=neutral Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3FD4710EB35 for ; Thu, 17 Apr 2025 14:49:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1744901350; bh=dSQ6JwRqZqHHWvBDJpGLoUVsg/VZhOn2dq7MaYW0y9s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h5E8ejFfngJG1UF3r64a7qQtMc1eO2iyVMcHt91OKCsPn7gQYEl0xvDag6UwZH34F fmIaDlqVeW9MS09f50iYr1+30GneKc9pVVH53Rc5n6ZsnHfJja+BiZSwpErPmGDxo9 7x/u35NvW6vhH0vQoIrAexKRSjh6Y2AO5xcJk36Y1mlFYA4aGva+m2DyH9MIQYDdaU qwEoeR1ZS2zZX7sDV6XwsW+Ask15j7j4thkCsFBMC5YgmXWrNU+Jpo6ZfjpKVBJkIW XDGG6+Wt42+ifN4JImoWqNLzN0nPDwRNhiyVhXnbrKyouxApt5xcauilQHE0OiMA8R DxccSElN7jgnA== Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by bali.collaboradmins.com (Postfix) with ESMTPSA id 3433017E09AB; Thu, 17 Apr 2025 16:49:10 +0200 (CEST) From: Boris Brezillon To: Boris Brezillon , Steven Price , Liviu Dudau , =?utf-8?q?Adri=C3=A1n_Larumbe?= Cc: dri-devel@lists.freedesktop.org, kernel@collabora.com Subject: [PATCH v2 1/2] drm/panthor: Add missing explicit padding in drm_panthor_gpu_info Date: Thu, 17 Apr 2025 16:49:06 +0200 Message-ID: <20250417144907.3679831-2-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250417144907.3679831-1-boris.brezillon@collabora.com> References: <20250417144907.3679831-1-boris.brezillon@collabora.com> MIME-Version: 1.0 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" drm_panthor_gpu_info::shader_present is currently automatically offset by 4 byte to meet Arm's 32-bit/64-bit field alignment rules, but those constraints don't stand on 32-bit x86 and cause a mismatch when running an x86 binary in a user emulated environment like FEX. It's also generally agreed that uAPIs should explicitly pad their struct fields, which we originally intended to do, but a mistake slipped through during the submission process, leading drm_panthor_gpu_info::shader_present to be misaligned. This uAPI change doesn't break any of the existing users of panthor which are either arm32 or arm64 where the 64-bit alignment of u64 fields is already enforced a the compiler level. Changes in v2: - Rename the garbage field into pad0 and adjust the comment accordingly - Add Liviu's R-b Fixes: 0f25e493a246 ("drm/panthor: Add uAPI") Signed-off-by: Boris Brezillon Acked-by: Liviu Dudau Reviewed-by: Steven Price --- include/uapi/drm/panthor_drm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/uapi/drm/panthor_drm.h b/include/uapi/drm/panthor_drm.h index 97e2c4510e69..dbb907eae443 100644 --- a/include/uapi/drm/panthor_drm.h +++ b/include/uapi/drm/panthor_drm.h @@ -293,6 +293,9 @@ struct drm_panthor_gpu_info { /** @as_present: Bitmask encoding the number of address-space exposed by the MMU. */ __u32 as_present; + /** @pad0: MBZ. */ + __u32 pad0; + /** @shader_present: Bitmask encoding the shader cores exposed by the GPU. */ __u64 shader_present;