• Ilpo Järvinen's avatar
    selftests/resctrl: Get domain id from cache id · 345e8abe
    Ilpo Järvinen authored
    Domain id is acquired differently depending on CPU. AMD tests use id
    from L3 cache, whereas CPUs from other vendors base the id on topology
    package id. In order to support L2 CAT test, this has to be
    generalized.
    
    The driver side code seems to get the domain ids from cache ids so the
    approach used by the AMD branch seems to match the kernel-side code. It
    will also work with L2 domain IDs as long as the cache level is
    generalized.
    
    Using the topology id was always fragile due to mismatch with the
    kernel-side way to acquire the domain id. It got incorrect domain id,
    e.g., when Cluster-on-Die (CoD) is enabled for CPU (but CoD is not well
    suited for resctrl in the first place so it has not been a big issue if
    tests don't work correctly with it).
    
    Taking all the above into account, generalize acquiring the domain id
    by taking it from the cache id and do not hard-code the cache level.
    Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Reviewed-by: default avatarReinette Chatre <reinette.chatre@intel.com>
    Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
    345e8abe
resctrl_val.c 21.7 KB