On 28/09/20 14:42, Kang, Luwei wrote: >> No, if a feature cannot be emulated, that means it cannot be >> enabled unless it matches the host. That's generally not a problem >> since Intel PT is usually used only with "-cpu host". >> > The limitation of LIP in qemu will mask off the Intel PT in KVM guest > even with "-cpu host". e.g. This bit will be set in SnowRidge HW and > later.
I agree that QEMU would have to learn about LIP. Unlike this patch, however, x86_cpu_filter_features would have to fail if host LIP != guest LIP. That is, something like (ecx_0 & INTEL_PT_IP_LIP)) != (env->features[INTEL_PT_ECX_0] & INTEL_PT_IP_LIP) where "intel-pt-lip" would be a feature in env->features[INTEL_PT_ECX_0]. > How about "-cpu cpu_model, +intel-pt" use case? The current value of > Intel PT CPUID is a constant. Can we make the ICX CPUID as basic > inforation(LIP is 0) and using "+intel-pt-lip" to make Intel PT work > on the CPU which LIP is 1 on the host? As you mentioned before, Intel > PT cannot be enabled in guest unless it matches the host. Yes, this would work. Paolo