Re: [PATCH v3 06/11] KVM: SVM: Add new intercept vector in vmcb_control_area

Jim Mattson
2020-07-29T21:23:53Z

On Tue, Jul 28, 2020 at 4:38 PM Babu Moger <babu.moger@amd.com> wrote:
>
> The new intercept bits have been added in vmcb control area to support
> few more interceptions. Here are the some of them.
> - INTERCEPT_INVLPGB,
> - INTERCEPT_INVLPGB_ILLEGAL,
> - INTERCEPT_INVPCID,
> - INTERCEPT_MCOMMIT,
> - INTERCEPT_TLBSYNC,
>
> Add new intercept vector in vmcb_control_area to support these instructions.
> Also update kvm_nested_vmrun trace function to support the new addition.
>
> AMD documentation for these instructions is available at "AMD64
> Architecture Programmer’s Manual Volume 2: System Programming, Pub. 24593
> Rev. 3.34(or later)"
>
> The documentation can be obtained at the links below:
> Link: https://www.amd.com/system/files/TechDocs/24593.pdf
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537
>
> Signed-off-by: Babu Moger <babu.moger@amd.com>
> ---

> @@ -16,6 +16,7 @@ enum vector_offset {
> EXCEPTION_VECTOR,
> INTERCEPT_VECTOR_3,
> INTERCEPT_VECTOR_4,
> + INTERCEPT_VECTOR_5,
> MAX_VECTORS,
> };

Is this enumeration actually adding any value?
vmcb->control.intercepts[INTERCEPT_VECTOR_5] doesn't seem in any way
"better" than just vmcb->control.intercepts[5].

Reviewed-by: Jim Mattson <jmattson@google.com>