Signed-off-by: Maxim Levitsky <mlevitsk@xxxxxxxxxx> --- lib/x86/svm_lib.h | 5 +++++ x86/svm.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/x86/svm_lib.h b/lib/x86/svm_lib.h index 04910281..2d13b066 100644 --- a/lib/x86/svm_lib.h +++ b/lib/x86/svm_lib.h @@ -4,6 +4,11 @@ #include <x86/svm.h> #include "processor.h" +static inline bool svm_supported(void) +{ + return this_cpu_has(X86_FEATURE_SVM); +} + static inline bool npt_supported(void) { return this_cpu_has(X86_FEATURE_NPT); diff --git a/x86/svm.c b/x86/svm.c index e4e638c7..43791546 100644 --- a/x86/svm.c +++ b/x86/svm.c @@ -343,7 +343,7 @@ int run_svm_tests(int ac, char **av, struct svm_test *svm_tests) ac--; av++; - if (!this_cpu_has(X86_FEATURE_SVM)) { + if (!svm_supported()) { printf("SVM not available\n"); return report_summary(); } -- 2.26.3