From patchwork Wed Aug 28 08:54:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1977688 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WtysG1QbGz1yfn for ; Wed, 28 Aug 2024 18:54:42 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sjERl-0006wd-U8; Wed, 28 Aug 2024 08:54:33 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sjERj-0006vh-6l for kernel-team@lists.ubuntu.com; Wed, 28 Aug 2024 08:54:31 +0000 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id F005A3F1E5 for ; Wed, 28 Aug 2024 08:54:30 +0000 (UTC) Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3718a4d3a82so3326149f8f.2 for ; Wed, 28 Aug 2024 01:54:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724835270; x=1725440070; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NURo4D7IJVRxgUy0yj5Ri8v9DZfLEox/fl26yfyt0b4=; b=v4iNh97Au999Ekm6dYhDf/oOMaBfkMv8aIepFmNgblufxA917vU2eG3y0cX+5J/Xxg /lYXbfTRqUHyiNRR/iWTum3FdySl6e1OSD4QV04OdR+5mGpgatyqY3Q5HG89zFBoyp2p XyrIubjINdYJjScfE1sFEadZe8lVhUGwJ2oGSuthB/DP7tfRhLz9mB8w6uL4ZqA1CVKS oQImRFpHyb3f2fWwGTQhPMEkFQqT3ShHY1CWI1naNnNRJlq/6CfoXiTgbxQO2CyCaiM7 Xm96FLtYpI3QvJiH+49kaxtokBhwJHNmp4IQInHm/08m+P2m62drCchWa/EJtO8JFw0x v/mw== X-Gm-Message-State: AOJu0YxKmudA9l+MrS5+uTVExVVtEJ1IPUFo59te4ylpL/rqQ6v3/9gb V14+iSMIFg689akLWe77oFDRZS56m2RxJyWXCkqyaIzBXowDK31HdPeX1vQYM49Jo/FdoboBXej i6xAvuD6AA8gksBwLZyfTdyP0XXSxSC87Km8v4jSD3MIcov8UPNWmjkd6v2TlAIO2mE9WdpDSIz L/sVWB90tQjg== X-Received: by 2002:adf:e410:0:b0:367:94a7:12c8 with SMTP id ffacd0b85a97d-37311841ba3mr9891645f8f.6.1724835270423; Wed, 28 Aug 2024 01:54:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGCjnKFOo6c1yYVpxTXYoW17zpU5RSQjmajifylT9CJMHP8WtsbuIUjMPFxnLUqTuKpBJhkIQ== X-Received: by 2002:adf:e410:0:b0:367:94a7:12c8 with SMTP id ffacd0b85a97d-37311841ba3mr9891625f8f.6.1724835269703; Wed, 28 Aug 2024 01:54:29 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37308110040sm15024174f8f.12.2024.08.28.01.54.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2024 01:54:29 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [SRU][N][PATCH 1/3] drm/amdgpu/pptable: convert some variable sized arrays to [] style Date: Wed, 28 Aug 2024 10:54:24 +0200 Message-ID: <20240828085426.3071048-2-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240828085426.3071048-1-juerg.haefliger@canonical.com> References: <20240828085426.3071048-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Alex Deucher BugLink: https://bugs.launchpad.net/bugs/2078041 Replace [1] with []. Silences UBSAN warnings. Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2039926 Acked-by: Christian König Signed-off-by: Alex Deucher (cherry picked from commit 693d4e8861a53607b9468062f984b7c469840b48) Signed-off-by: Juerg Haefliger --- drivers/gpu/drm/amd/include/pptable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/include/pptable.h b/drivers/gpu/drm/amd/include/pptable.h index 5aac8d545bdc..5077c2ce4469 100644 --- a/drivers/gpu/drm/amd/include/pptable.h +++ b/drivers/gpu/drm/amd/include/pptable.h @@ -658,7 +658,7 @@ typedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Record typedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Table{ UCHAR numEntries; - ATOM_PPLIB_SAMClk_Voltage_Limit_Record entries[1]; + ATOM_PPLIB_SAMClk_Voltage_Limit_Record entries[]; }ATOM_PPLIB_SAMClk_Voltage_Limit_Table; typedef struct _ATOM_PPLIB_SAMU_Table From patchwork Wed Aug 28 08:54:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1977689 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WtysH2FYbz1yfn for ; Wed, 28 Aug 2024 18:54:43 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sjERo-0006xv-6w; Wed, 28 Aug 2024 08:54:36 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sjERl-0006wJ-GN for kernel-team@lists.ubuntu.com; Wed, 28 Aug 2024 08:54:33 +0000 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id BA5B53F1E5 for ; Wed, 28 Aug 2024 08:54:32 +0000 (UTC) Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4280291f739so58680665e9.3 for ; Wed, 28 Aug 2024 01:54:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724835272; x=1725440072; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hBSOKGY0j3dn3pgnoGMa8zD6DrAOVK5EiP9Lb6nrKmw=; b=Zpvd0SD6k+CSn0IPTEPe7mEOXXuNOn/PN3pyGo8B5cE70OVpixBekoGz/U3xyiXrKe gR0JFUmnTo8fs0i1jgPhfLXZqVi9UINk7Dh77B/zaVuUGLnYY/T0izUAbsar9W73O1eP kuqdcFqDzQs/Psn+9WGaFZ5kDf7xjW6fSzVEgWutqsPtx0RsRkpCMiibuD4Sr9/dfebW I/BKujYBWWxLbP2TXRDELyKubxlx9iNfbQRsz/+ZmmdZNc+W6Kfe4nGoD40hNzGzjd7f 6IPlWGLZXIzbOAD2ZOKWNwsoVXV5Nlm+yBeuU41IBjWsoVTLvduZ6D5vhMAX2jpOJB0N O3kg== X-Gm-Message-State: AOJu0Yyb1nilgdRstKfsD8gQGQlwgWlHczOmRetfOLsZNXllLO+kYfhW FNB7lZ4jWP0XGSdjF97ikaeqIiUW2EZ4EiKzHscSh7v/t/1w3rL+OtazoueqHbsk+ZillLFazdb 3Iw9nNSB3cxs0y84c+1Qtx7igj9JSIDGDQ8N7CswgfxLFNae0XH0IKs/Z1dH15n9Qqnq//IZwnP IatoQD5k31ww== X-Received: by 2002:a05:600c:4fd3:b0:426:62a0:eb6b with SMTP id 5b1f17b1804b1-42acc8de98bmr109843325e9.13.1724835272176; Wed, 28 Aug 2024 01:54:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGKfgpoZWjr4zXw6XfH/fkt2r1dHfCWIpJGyfiARRnAnj0jx1I7QPvB2t1PMRW/MI+RqT42aQ== X-Received: by 2002:a05:600c:4fd3:b0:426:62a0:eb6b with SMTP id 5b1f17b1804b1-42acc8de98bmr109842975e9.13.1724835270991; Wed, 28 Aug 2024 01:54:30 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42baa08d9f9sm2408685e9.32.2024.08.28.01.54.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2024 01:54:30 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [SRU][N][PATCH 2/3] drm/amdgpu: convert some variable sized arrays to [] style Date: Wed, 28 Aug 2024 10:54:25 +0200 Message-ID: <20240828085426.3071048-3-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240828085426.3071048-1-juerg.haefliger@canonical.com> References: <20240828085426.3071048-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Alex Deucher BugLink: https://bugs.launchpad.net/bugs/2078041 Replace [1] with []. Silences UBSAN warnings. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3107 Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher (cherry picked from commit 4953be13bebb3e6c9dffcfe0714de553155cac90) Signed-off-by: Juerg Haefliger --- drivers/gpu/drm/amd/include/pptable.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/include/pptable.h b/drivers/gpu/drm/amd/include/pptable.h index 5077c2ce4469..2e8e6c9875f6 100644 --- a/drivers/gpu/drm/amd/include/pptable.h +++ b/drivers/gpu/drm/amd/include/pptable.h @@ -491,7 +491,7 @@ typedef struct _ClockInfoArray{ //sizeof(ATOM_PPLIB_CLOCK_INFO) UCHAR ucEntrySize; - UCHAR clockInfo[1]; + UCHAR clockInfo[]; }ClockInfoArray; typedef struct _NonClockInfoArray{ @@ -501,7 +501,7 @@ typedef struct _NonClockInfoArray{ //sizeof(ATOM_PPLIB_NONCLOCK_INFO) UCHAR ucEntrySize; - ATOM_PPLIB_NONCLOCK_INFO nonClockInfo[1]; + ATOM_PPLIB_NONCLOCK_INFO nonClockInfo[]; }NonClockInfoArray; typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Record From patchwork Wed Aug 28 08:54:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1977690 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WtysJ340Zz1yfn for ; Wed, 28 Aug 2024 18:54:44 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sjERo-0006yC-Ea; Wed, 28 Aug 2024 08:54:36 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sjERm-0006wa-Hl for kernel-team@lists.ubuntu.com; Wed, 28 Aug 2024 08:54:34 +0000 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 95C493F6C2 for ; Wed, 28 Aug 2024 08:54:33 +0000 (UTC) Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3718bf7d54aso3972842f8f.1 for ; Wed, 28 Aug 2024 01:54:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724835273; x=1725440073; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IbOsYRezVSEQzo9NQfDWJcwfIMpFO9azoW3Z3FcMuDw=; b=mfVjd10+7y7cYDwe0kWJFY8Eoyyc5BqIVSyZXzJlwcy+tYtj0o8EsADWyHOeSqQWlk Wf3UMfkLnzjiWk7MU2YSKdsvvFxvPvuMpSdXYvHoqvJ9BUC1URzmKpB6Upo8LWLK+pBM ECSjLAfRKzQNrgUHDGvCKlxz1KKAG9UsuYxAHdhlmYKFCWhof8nW7JrdiV3dIR+HB76Q 7a2qEWZs0JX6tY9XkXCx6RGaJ+rGP9J9L0B/10n0aMqVpZIQqSowtk03tameKgIlGMSe 4S5G3c5sm8ABs1ck4lqCENdeDk7/ixE3YGrLGFUuoobaSWaHmwpl4y9jzCKeWaid54nl sY5g== X-Gm-Message-State: AOJu0YxWspsFNkGSMUbSeGmVkf+7NcfOJcBp8aKTILMRKGMdlyq9ABTg 8KBemNktiTPhnQqqYvbnIsidKgd8wV77BHk5dDfXahmbvCTCeNJmow/AQZabo0fiu32kMlMhdL2 awsNsa3drGJn/vgPBjCCbVcug9EF2kBfJdt7inu+Vk1sLkTe1ZIIJCVRiTjER99DDqyV+1D4+zz SYabAjVyOogg== X-Received: by 2002:adf:ef84:0:b0:367:98e6:2a1b with SMTP id ffacd0b85a97d-3749680ae5emr932899f8f.4.1724835273047; Wed, 28 Aug 2024 01:54:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLLvaiqQInxQ6foe8QOZ/Zduup3u67NtTTZv8Zu1uJtUvzBYwdZeGL1m1LgNFJdpQ34MVTfQ== X-Received: by 2002:adf:ef84:0:b0:367:98e6:2a1b with SMTP id ffacd0b85a97d-3749680ae5emr932876f8f.4.1724835272286; Wed, 28 Aug 2024 01:54:32 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ba6396516sm14350265e9.4.2024.08.28.01.54.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2024 01:54:31 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [SRU][N][PATCH 3/3] drm/amdgpu/pptable: Fix UBSAN array-index-out-of-bounds Date: Wed, 28 Aug 2024 10:54:26 +0200 Message-ID: <20240828085426.3071048-4-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240828085426.3071048-1-juerg.haefliger@canonical.com> References: <20240828085426.3071048-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Tasos Sahanidis BugLink: https://bugs.launchpad.net/bugs/2078041 Flexible arrays used [1] instead of []. Replace the former with the latter to resolve multiple UBSAN warnings observed on boot with a BONAIRE card. In addition, use the __counted_by attribute where possible to hint the length of the arrays to the compiler and any sanitizers. Signed-off-by: Tasos Sahanidis Signed-off-by: Alex Deucher (cherry picked from commit 98f9e5ea474d834eed2e1fb163ef3ab956ef8205) Signed-off-by: Juerg Haefliger --- drivers/gpu/drm/amd/include/pptable.h | 91 ++++++++++++++------------- 1 file changed, 49 insertions(+), 42 deletions(-) diff --git a/drivers/gpu/drm/amd/include/pptable.h b/drivers/gpu/drm/amd/include/pptable.h index 2e8e6c9875f6..f83ace2d7ec3 100644 --- a/drivers/gpu/drm/amd/include/pptable.h +++ b/drivers/gpu/drm/amd/include/pptable.h @@ -477,31 +477,30 @@ typedef struct _ATOM_PPLIB_STATE_V2 } ATOM_PPLIB_STATE_V2; typedef struct _StateArray{ - //how many states we have - UCHAR ucNumEntries; - - ATOM_PPLIB_STATE_V2 states[1]; + //how many states we have + UCHAR ucNumEntries; + + ATOM_PPLIB_STATE_V2 states[] /* __counted_by(ucNumEntries) */; }StateArray; typedef struct _ClockInfoArray{ - //how many clock levels we have - UCHAR ucNumEntries; - - //sizeof(ATOM_PPLIB_CLOCK_INFO) - UCHAR ucEntrySize; - - UCHAR clockInfo[]; + //how many clock levels we have + UCHAR ucNumEntries; + + //sizeof(ATOM_PPLIB_CLOCK_INFO) + UCHAR ucEntrySize; + + UCHAR clockInfo[]; }ClockInfoArray; typedef struct _NonClockInfoArray{ + //how many non-clock levels we have. normally should be same as number of states + UCHAR ucNumEntries; + //sizeof(ATOM_PPLIB_NONCLOCK_INFO) + UCHAR ucEntrySize; - //how many non-clock levels we have. normally should be same as number of states - UCHAR ucNumEntries; - //sizeof(ATOM_PPLIB_NONCLOCK_INFO) - UCHAR ucEntrySize; - - ATOM_PPLIB_NONCLOCK_INFO nonClockInfo[]; + ATOM_PPLIB_NONCLOCK_INFO nonClockInfo[] __counted_by(ucNumEntries); }NonClockInfoArray; typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Record @@ -513,8 +512,10 @@ typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Record typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Table { - UCHAR ucNumEntries; // Number of entries. - ATOM_PPLIB_Clock_Voltage_Dependency_Record entries[1]; // Dynamically allocate entries. + // Number of entries. + UCHAR ucNumEntries; + // Dynamically allocate entries. + ATOM_PPLIB_Clock_Voltage_Dependency_Record entries[] __counted_by(ucNumEntries); }ATOM_PPLIB_Clock_Voltage_Dependency_Table; typedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Record @@ -529,8 +530,10 @@ typedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Record typedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Table { - UCHAR ucNumEntries; // Number of entries. - ATOM_PPLIB_Clock_Voltage_Limit_Record entries[1]; // Dynamically allocate entries. + // Number of entries. + UCHAR ucNumEntries; + // Dynamically allocate entries. + ATOM_PPLIB_Clock_Voltage_Limit_Record entries[] __counted_by(ucNumEntries); }ATOM_PPLIB_Clock_Voltage_Limit_Table; union _ATOM_PPLIB_CAC_Leakage_Record @@ -553,8 +556,10 @@ typedef union _ATOM_PPLIB_CAC_Leakage_Record ATOM_PPLIB_CAC_Leakage_Record; typedef struct _ATOM_PPLIB_CAC_Leakage_Table { - UCHAR ucNumEntries; // Number of entries. - ATOM_PPLIB_CAC_Leakage_Record entries[1]; // Dynamically allocate entries. + // Number of entries. + UCHAR ucNumEntries; + // Dynamically allocate entries. + ATOM_PPLIB_CAC_Leakage_Record entries[] __counted_by(ucNumEntries); }ATOM_PPLIB_CAC_Leakage_Table; typedef struct _ATOM_PPLIB_PhaseSheddingLimits_Record @@ -568,8 +573,10 @@ typedef struct _ATOM_PPLIB_PhaseSheddingLimits_Record typedef struct _ATOM_PPLIB_PhaseSheddingLimits_Table { - UCHAR ucNumEntries; // Number of entries. - ATOM_PPLIB_PhaseSheddingLimits_Record entries[1]; // Dynamically allocate entries. + // Number of entries. + UCHAR ucNumEntries; + // Dynamically allocate entries. + ATOM_PPLIB_PhaseSheddingLimits_Record entries[] __counted_by(ucNumEntries); }ATOM_PPLIB_PhaseSheddingLimits_Table; typedef struct _VCEClockInfo{ @@ -580,8 +587,8 @@ typedef struct _VCEClockInfo{ }VCEClockInfo; typedef struct _VCEClockInfoArray{ - UCHAR ucNumEntries; - VCEClockInfo entries[1]; + UCHAR ucNumEntries; + VCEClockInfo entries[] __counted_by(ucNumEntries); }VCEClockInfoArray; typedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record @@ -592,8 +599,8 @@ typedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record typedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table { - UCHAR numEntries; - ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record entries[1]; + UCHAR numEntries; + ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record entries[] __counted_by(numEntries); }ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table; typedef struct _ATOM_PPLIB_VCE_State_Record @@ -604,8 +611,8 @@ typedef struct _ATOM_PPLIB_VCE_State_Record typedef struct _ATOM_PPLIB_VCE_State_Table { - UCHAR numEntries; - ATOM_PPLIB_VCE_State_Record entries[1]; + UCHAR numEntries; + ATOM_PPLIB_VCE_State_Record entries[] __counted_by(numEntries); }ATOM_PPLIB_VCE_State_Table; @@ -626,8 +633,8 @@ typedef struct _UVDClockInfo{ }UVDClockInfo; typedef struct _UVDClockInfoArray{ - UCHAR ucNumEntries; - UVDClockInfo entries[1]; + UCHAR ucNumEntries; + UVDClockInfo entries[] __counted_by(ucNumEntries); }UVDClockInfoArray; typedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record @@ -638,8 +645,8 @@ typedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record typedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table { - UCHAR numEntries; - ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record entries[1]; + UCHAR numEntries; + ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record entries[] __counted_by(numEntries); }ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table; typedef struct _ATOM_PPLIB_UVD_Table @@ -657,8 +664,8 @@ typedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Record }ATOM_PPLIB_SAMClk_Voltage_Limit_Record; typedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Table{ - UCHAR numEntries; - ATOM_PPLIB_SAMClk_Voltage_Limit_Record entries[]; + UCHAR numEntries; + ATOM_PPLIB_SAMClk_Voltage_Limit_Record entries[] __counted_by(numEntries); }ATOM_PPLIB_SAMClk_Voltage_Limit_Table; typedef struct _ATOM_PPLIB_SAMU_Table @@ -675,8 +682,8 @@ typedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Record }ATOM_PPLIB_ACPClk_Voltage_Limit_Record; typedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Table{ - UCHAR numEntries; - ATOM_PPLIB_ACPClk_Voltage_Limit_Record entries[1]; + UCHAR numEntries; + ATOM_PPLIB_ACPClk_Voltage_Limit_Record entries[] __counted_by(numEntries); }ATOM_PPLIB_ACPClk_Voltage_Limit_Table; typedef struct _ATOM_PPLIB_ACP_Table @@ -743,9 +750,9 @@ typedef struct ATOM_PPLIB_VQ_Budgeting_Record{ } ATOM_PPLIB_VQ_Budgeting_Record; typedef struct ATOM_PPLIB_VQ_Budgeting_Table { - UCHAR revid; - UCHAR numEntries; - ATOM_PPLIB_VQ_Budgeting_Record entries[1]; + UCHAR revid; + UCHAR numEntries; + ATOM_PPLIB_VQ_Budgeting_Record entries[] __counted_by(numEntries); } ATOM_PPLIB_VQ_Budgeting_Table; #pragma pack()