Re: [PATCH v2 09/15] cxl: define a driver interface for HPA free space enumaration

Jonathan Cameron
2024-08-28T11:26:24Z

On Wed, 28 Aug 2024 11:41:11 +0100
Alejandro Lucero Palau <alucerop@amd.com> wrote:

> On 8/4/24 18:57, Jonathan Cameron wrote:
> > + }
> >> + return 0;
> >> +}
> >> +
> >> +/**
> >> + * cxl_get_hpa_freespace - find a root decoder with free capacity per constraints
> >> + * @endpoint: an endpoint that is mapped by the returned decoder
> >> + * @interleave_ways: number of entries in @host_bridges
> >> + * @flags: CXL_DECODER_F flags for selecting RAM vs PMEM, and HDM-H vs HDM-D[B]
> >> + * @max: output parameter of bytes available in the returned decoder
> > @available_size
> > or something along those lines. I'd expect max to be the end address of the available
> > region
>
>
> No really. The code looks for the biggest free hole in the HPA.
> Returning available size does not help except from informing about the
> "internal fragmentation".

I worded that badly. Intent was that to me 'max' == maximum address, not maximum available
contiguous range. max_hole or max_avail_contig maybe?

>