Re: [PATCH 3/5] cxl: Separate coherence from target type
From: Dan Williams
Date: Thu Oct 17 2024 - 18:25:50 EST
Huang Ying wrote:
> Previously, target type (expander or accelerator) and
> coherence (HOSTONLY (HDM-H) or DEV (HDM-D/DB)) are synonym. So
> current kernel uses target type to designate coherence too. However,
> it's possible for expanders to use HDM-DB now. So, the patch
> separates coherence from target type.
>
> Accordingly, the patch sets the HOSTONLY field of decoder ctrl
> register (CXL_HDM_DECODER0_CTRL_HOSTONLY) according to the coherence
> instead of the target type.
>
> Because we cannot determine the coherence of decoders via target type,
> the patch lets accelerator/expander device drivers specify coherence
> explicitly via newly added coherence field in struct cxl_dev_state.
>
> The coherence of each end points in a region needs to be same. So,
> the patch records the coherence of the first added end point in struct
> region. Then, it checks whether the coherence of all other end points
> is same.
The target type is the coherence type, I am not sure what is motivating
this separation?
The decoder must match the mode of window it is joining because both
HDM-D and HDM-DB speak a different protocol than HDM.