diff options
author | Robert Richter <rrichter@amd.com> | 2024-02-16 16:58:43 +0100 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2024-03-12 23:52:29 -0700 |
commit | e0c818e00443ce4a704519d85a21e3c14179e3a6 (patch) | |
tree | e6c92ec123c81c99429be4cda41f08183be3308d /security/loadpin | |
parent | ec8ffff3a9f86435996f71299ce729126a7ac8a2 (diff) | |
download | linux-stable-e0c818e00443ce4a704519d85a21e3c14179e3a6.tar.gz linux-stable-e0c818e00443ce4a704519d85a21e3c14179e3a6.tar.bz2 linux-stable-e0c818e00443ce4a704519d85a21e3c14179e3a6.zip |
cxl/pci: Get rid of pointer arithmetic reading CDAT table
Reading the CDAT table using DOE requires a Table Access Response
Header in addition to the CDAT entry. In current implementation this
has caused offsets with sizeof(__le32) to the actual buffers. This led
to hardly readable code and even bugs. E.g., see fix of devm_kfree()
in read_cdat_data():
commit c65efe3685f5 ("cxl/cdat: Free correct buffer on checksum error")
Rework code to avoid calculations with sizeof(__le32). Introduce
struct cdat_doe_rsp for this which contains the Table Access Response
Header and a variable payload size for various data structures
afterwards to access the CDAT table and its CDAT Data Structures
without recalculating buffer offsets.
Cc: Lukas Wunner <lukas@wunner.de>
Cc: Fan Ni <nifan.cxl@gmail.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Robert Richter <rrichter@amd.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20240216155844.406996-3-rrichter@amd.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'security/loadpin')
0 files changed, 0 insertions, 0 deletions