Re: [PATCH v11 44/46] KVM: selftests: evmcs_test: Introduce L2 TLB flush test

From: Vitaly Kuznetsov
Date: Fri Oct 21 2022 - 10:51:08 EST


Sean Christopherson <seanjc@xxxxxxxxxx> writes:

> On Tue, Oct 04, 2022, Vitaly Kuznetsov wrote:

...

>>
>> + /* L2 TLB flush setup */
>> + current_evmcs->partition_assist_page = hv_pages->partition_assist_gpa;
>> + current_evmcs->hv_enlightenments_control.nested_flush_hypercall = 1;
>> + current_evmcs->hv_vm_id = 1;
>> + current_evmcs->hv_vp_id = 1;
>> + current_vp_assist->nested_control.features.directhypercall = 1;
>> + *(u32 *)(hv_pages->partition_assist) = 0;
>> +
>> GUEST_ASSERT(!vmlaunch());
>
> Pre-existing code, but would it make sense to add an assert here to verify L2
> exited due to an NMI? Feel free to ignore this for now if it's not straightforward,
> this series is plenty big :-)
>

Well, simple

+ GUEST_ASSERT_EQ(vmreadz(VM_EXIT_REASON), EXIT_REASON_EXCEPTION_NMI);
+ GUEST_ASSERT_EQ((vmreadz(VM_EXIT_INTR_INFO) & 0xff), NMI_VECTOR);

seems to be working (passing) so why not :-)

--
Vitaly