Re: [RFC PATCH 3/4] PCI/TSM: Derive the coherent-range IPA from CXL

From: Ankit Agrawal

Date: Tue Oct 20 2026 - 05:11:18 EST


Thanks for the review!

>> @@ -904,6 +904,41 @@ int pci_tsm_doe_transfer(struct pci_dev *pdev, u8 type, const void *req,
>>  }
>>  EXPORT_SYMBOL_GPL(pci_tsm_doe_transfer);
>> 
>> +#ifdef CONFIG_CXL_RESET
>
> May want to move this to a header. Having KCONFIG ifdefs in .c is typically not preferred.

Yeah, will move it.

>
> Also I do wonder if we want to put this code behind CONFIG_CXL_RESET. There's dependency of being able to run the reset stuff for a type2 device before passthrough > to user space. But the attestation code is not part of reset code. Maybe putting it behind a different kconfig symbol with dependency on CONFIG_CXL_RESET?

Agreed, better to use a separate symbol like PCI_TSM_CXL_COHERENT and
make it dependent on CXL_RESET.

>> +static int pci_tsm_coherent_range(struct pci_dev *pdev, u64 *out_base,
>> +                               u64 *out_size)
>
> pci_tsm_retrieve_coherent_range()? Also, why not just pass in a 'struct range'?

Makes sense, will use struct range in v2.

>
> DJ