lkml.org 
[lkml]   [2021]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 03/13] x86/HV: Add new hvcall guest address host visibility support
From
Date
On 7/29/21 8:02 AM, Tianyu Lan wrote:
>>
>
> There is x86_hyper_type to identify hypervisor type and we may check
> this variable after checking X86_FEATURE_HYPERVISOR.
>
> static inline bool hv_is_isolation_supported(void)
> {
>     if (!cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
>         return 0;
>
>         if (x86_hyper_type != X86_HYPER_MS_HYPERV)
>                 return 0;
>
>     // out of line function call:
>     return __hv_is_isolation_supported();
> }   

Looks fine. You just might want to use this existing helper:

static inline bool hypervisor_is_type(enum x86_hypervisor_type type)
{
return x86_hyper_type == type;
}

\
 
 \ /
  Last update: 2021-07-29 18:08    [W:0.148 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site