From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout02.his.huawei.com (canpmsgout02.his.huawei.com [113.46.200.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9A072701C3; Wed, 19 Nov 2025 05:13:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.217 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763529201; cv=none; b=MsIQi9FmBsgjDWTqDF9rdzCyK2NST3Vrh0P9rD1ThkUhBcdlTxuLirMHa1poBO3kBxNniVl3HtgWDdbwNWzhuKd5Vm6A64lyJvVbg29Wcu3V2F7HFDoosoKamx3MyDdxlojru0gvqxsf1t9Enc+U7Hs53mKHMkJZj+RN//wl4vs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763529201; c=relaxed/simple; bh=yy8FaofX98dDgn7bPn7M65cjitpFXHEWiLhIZj8DOZo=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=mVISI7aizSkPEjVeN+0G4P+CFCVyjHgoWVlKlT6J4MoL40guYwkXGAte9CK6j8OlRizQ8pOU6cN72Q65F1rzwZV3ZtbhR8gLNvcxPvWgOdgzbRGfyJ7zRZol20HkFfXSed2glXvnSAlONoNv9sWxtpxEVMxO1NtaU4LzDsbbJSo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=kcHYALnV; arc=none smtp.client-ip=113.46.200.217 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="kcHYALnV" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=QCKYYk/nJB19P+gNWH8tuQy1gyvupyswist/AiEgNgQ=; b=kcHYALnVFMqTqvDB0wrOTz6XWMyevtGJc9y8Y7K6eDWC8uEBd+zOktjuW532AFAGpl3iOQEDN 5gHgabDCIpGeqsk8W3b1xI76aspLJfeFuoCEa7L9VA57i070mDw8TgPT4EMCAaQ3STrU+rA+qIQ PYMGpKDhupqE+joNPZMqnwI= Received: from mail.maildlp.com (unknown [172.19.163.252]) by canpmsgout02.his.huawei.com (SkyGuard) with ESMTPS id 4dB8hd1y4SzcZy1; Wed, 19 Nov 2025 13:11:13 +0800 (CST) Received: from dggpemf500002.china.huawei.com (unknown [7.185.36.57]) by mail.maildlp.com (Postfix) with ESMTPS id 370E6180BD0; Wed, 19 Nov 2025 13:13:15 +0800 (CST) Received: from [10.174.178.247] (10.174.178.247) by dggpemf500002.china.huawei.com (7.185.36.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 19 Nov 2025 13:13:12 +0800 Subject: Re: [PATCH v5 03/34] ACPI / PPTT: Add acpi_pptt_cache_v1_full to use pptt cache as one structure To: Ben Horgan , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , References: <20251117170014.4113754-1-ben.horgan@arm.com> <20251117170014.4113754-4-ben.horgan@arm.com> From: Hanjun Guo Message-ID: <73c55f0e-6c0c-63ec-d2d0-d60b28f8aff7@huawei.com> Date: Wed, 19 Nov 2025 13:13:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20251117170014.4113754-4-ben.horgan@arm.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To dggpemf500002.china.huawei.com (7.185.36.57) On 2025/11/18 0:59, Ben Horgan wrote: > In actbl2.h, acpi_pptt_cache describes the fields in the original > Cache Type Structure. In PPTT table version 3 a new field was added at the > end, cache_id. This is described in acpi_pptt_cache_v1 but rather than > including all v1 fields it just includes this one. > > In lieu of this being fixed in acpica, introduce acpi_pptt_cache_v1_full to > contain all the fields of the Cache Type Structure . Update the existing > code to use this new struct. This simplifies the code and removes a > non-standard use of ACPI_ADD_PTR. > > Signed-off-by: Ben Horgan > --- > I have opened a pull request to acpica to update acpi_pptt_cache_v1 to > include all fields. https://github.com/acpica/acpica/pull/1059 > > Change since v4: > Use fields directly in acpi_pptt_cache_v1_full > Delay the casting > > Changes since v3: > New patch > --- > drivers/acpi/pptt.c | 47 +++++++++++++++++++++++++++++++++++---------- > 1 file changed, 37 insertions(+), 10 deletions(-) > > diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c > index 2856254e29d7..53fde9bd8140 100644 > --- a/drivers/acpi/pptt.c > +++ b/drivers/acpi/pptt.c > @@ -21,6 +21,25 @@ > #include > #include > > +/* > + * The acpi_pptt_cache_v1 in actbl2.h, which is imported from acpica, > + * only contains the cache_id field rather than all the fields of the > + * Cache Type Structure. Use this alternative structure until it is > + * resolved in acpica. > + */ > +struct acpi_pptt_cache_v1_full { > + struct acpi_subtable_header header; > + u16 reserved; > + u32 flags; > + u32 next_level_of_cache; > + u32 size; > + u32 number_of_sets; > + u8 associativity; > + u8 attributes; > + u16 line_size; > + u32 cache_id; > +}; I'm fine with removing this after acpica changes being accepted. Reviewed-by: Hanjun Guo Thanks Hanjun