On 09.07.2024 07:54, Sergiy Kibrik wrote: > As we now have SVM/VMX config options for enabling/disabling these features > completely in the build, we need some build-time checks to ensure that vmx/svm > code can be used and things compile. Macros cpu_has_{svm,vmx} used to be doing > such checks at runtime, however they do not check if SVM/VMX support is > enabled in the build. > > Also cpu_has_{svm,vmx} can potentially be called from non-{VMX,SVM} build > yet running on {VMX,SVM}-enabled CPU, so would correctly indicate that VMX/SVM > is indeed supported by CPU, but code to drive it can't be used. > > New routines using_{vmx,svm}() indicate that both CPU _and_ build provide > corresponding technology support, while cpu_has_{vmx,svm} still remains for > informational runtime purpose, just as their naming suggests. > > These new helpers are used right away in several sites, namely guard calls to > start_nested_{svm,vmx} and start_{svm,vmx} to fix a build when VMX=n or SVM=n. > > Signed-off-by: Sergiy Kibrik <sergiy_kib...@epam.com>
Reviewed-by: Jan Beulich <jbeul...@suse.com>