On 15.03.2024 18:52, Matthew Barnes wrote:
> Last Branch Record and Bus Lock Detect both belong to the same MSR.
> 
> The same mechanism that restores LBR also restores BLD.
> 
> Therefore, the name of the feature that enables this mechanism should
> reflect restoring the MSR, instead of one field.
> 
> No functional change.
> 
> Signed-off-by: Matthew Barnes <[email protected]>

So this in part is what I asked about in reply to patch 1. However,
afaict the order of patches wants flipping and ...

> @@ -2129,10 +2129,10 @@ void percpu_traps_init(void)
>              return;
>          }
>  
> -        setup_force_cpu_cap(X86_FEATURE_XEN_LBR);
> +        setup_force_cpu_cap(X86_FEATURE_XEN_MSR_DEBUGCTL);

... besides here you also want to engage the feature when using BLD
(in the other patch, once that comes comes on top of this one).

>      }
>  
> -    if ( cpu_has_xen_lbr )
> +    if ( cpu_has_xen_msr_debugctl )
>      {
>          host_msr_debugctl |= IA32_DEBUGCTLMSR_LBR;
>          wrmsrl(MSR_IA32_DEBUGCTLMSR, host_msr_debugctl);

This can't be quite right - LBR shouldn't be enabled without the
respective command line option present.

And btw - I don't think there's a need for the _msr_ infix in the new
names you use.

Jan

Reply via email to