Re: [kvm-unit-tests PATCH v4 2/2] x86: nSVM: Add support for VNMI test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sean,

On 4/6/2023 2:21 AM, Sean Christopherson wrote:
> From: Santosh Shukla <santosh.shukla@xxxxxxx>
> 
> Add a VNMI test case to test Virtual NMI in a nested environment,
> The test covers the Virtual NMI (VNMI) delivery.
> 
> Signed-off-by: Santosh Shukla <santosh.shukla@xxxxxxx>
> [sean: reuse pieces of NMI test framework, fix formatting issues]
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>

Tested on Genoa system, Test passed, Thank-you!.,

Renaming comment inline -

> ---
>  lib/x86/processor.h |  1 +
>  x86/svm.c           |  5 +++
>  x86/svm.h           |  8 +++++
>  x86/svm_tests.c     | 78 +++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 92 insertions(+)
> 
> diff --git a/lib/x86/processor.h b/lib/x86/processor.h
> index 3d58ef72..3802c1e2 100644
> --- a/lib/x86/processor.h
> +++ b/lib/x86/processor.h
> @@ -267,6 +267,7 @@ static inline bool is_intel(void)
>  #define X86_FEATURE_PAUSEFILTER		(CPUID(0x8000000A, 0, EDX, 10))
>  #define X86_FEATURE_PFTHRESHOLD		(CPUID(0x8000000A, 0, EDX, 12))
>  #define	X86_FEATURE_VGIF		(CPUID(0x8000000A, 0, EDX, 16))
> +#define X86_FEATURE_V_NMI               (CPUID(0x8000000A, 0, EDX, 25))

s/X86_FEATURE_V_NMI/X86_FEATURE_VNMI

>  #define	X86_FEATURE_AMD_PMU_V2		(CPUID(0x80000022, 0, EAX, 0))
>  
>  static inline bool this_cpu_has(u64 feature)
> diff --git a/x86/svm.c b/x86/svm.c
> index ba435b4a..022a0fde 100644
> --- a/x86/svm.c
> +++ b/x86/svm.c
> @@ -99,6 +99,11 @@ bool npt_supported(void)
>  	return this_cpu_has(X86_FEATURE_NPT);
>  }
>  
> +bool vnmi_supported(void)
> +{
> +       return this_cpu_has(X86_FEATURE_V_NMI);

ditto..

Thanks,
Santosh



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux