On Wed, Feb 15, 2023 at 04:56:48PM -0800, Ira Weiny wrote: > Lukas Wunner wrote: > > Jonathan notes that cxl_cdat_get_length() and cxl_cdat_read_table() > > allocate 32 dwords for the DOE response even though it may be smaller. > > > > In the case of cxl_cdat_get_length(), only the second dword of the > > response is of interest (it contains the length). So reduce the > > allocation to 2 dwords and let DOE discard the remainder. > > > > In the case of cxl_cdat_read_table(), a correctly sized allocation for > > the full CDAT already exists. Let DOE write each table entry directly > > into that allocation. There's a snag in that the table entry is > > preceded by a Table Access Response Header (1 dword). > > Where is this 'Table Access Response Header' defined? CXL r3.0 table 8-14 (sec 8.1.11.1, page 399). I'll amend the commit message with a reference to the spec. Thanks, Lukas