On 14/06/2021 16:55, Edwin Torok wrote:
> On Mon, 2021-06-14 at 11:47 +0100, Andrew Cooper wrote:
>> +/*
>> + * Check all TSX MSRs, and in particular that their accessibility
>> matches what
>> + * is expressed in the host CPU policy.
>> + */
>> +static void test_tsx_msrs(void)
>> +{
>> + printf("Testing MSR_TSX_FORCE_ABORT consistency\n");
>> + test_tsx_msr_consistency(
>> + MSR_TSX_FORCE_ABORT, host.cpuid.feat.tsx_force_abort);
>> +
>> + printf("Testing MSR_TSX_CTRL consistency\n");
>> + test_tsx_msr_consistency(
>> + MSR_TSX_CTRL, host.msr.arch_caps.tsx_ctrl);
>> +}
>
> This is great, could we extend the test to all MSRs that Xen knows
> about and are expected to be identical? Particularly
> MSR_SPEC_CTRL, MSR_MCU_OPT_CTRL, and I see some MSRs used for errata
> workarounds like MSR_MCU_OPT_CTRL, possiblye more.
MSR_SPEC_CTRL, no. It's value is influenced by the guest kernel in
context, and we would not expect it to be consistent across the system
at an arbitrary point in time.
MSR_MCU_OPT_CTRL might be a good candidate for a future change, but it's
not related to TSX. (That said, it is actually how I spotted XSA-377).
~Andrew