Hi Xiaoyao, > First, it's not a good practice that values in env->features[] cannot be > directly used for guest CPUID in void cpu_x86_cpuid(), but require further > adjustment there. env->features[] are supposed to be finalized at cpu > realization, so that after it env->features[] is reliable. > > Second, there is one dependency entry relates to CPUID_EXT_PDCM in > feature_dependencies[]. QEMU needs to get correct value of > CPUID_EXT_PDCM in env->features[] to ensure applying the dependencies > correctly.
I agree that this is a very good idea, especially since PDCM has a dependency entry. "pmu" is totally a property rather than a feature bit, which makes the dependency relationships in the code complex. Therefore, I think it's worth having a series to clarify the dependencies of pmu as much as possible. I remember Dapeng/Zide also have fixes for pmu dependencies, and if possible, I could help you combine this series with others' cleanups. Additionally, I think patch 1 and patch 2 can be merged together. Do you agree? Thanks, Zhao