File tree Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 116
116
/* Recommend using the newer ExProcessorMasks interface */
117
117
#define HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED BIT(11)
118
118
119
+ /* Indicates that the hypervisor is nested within a Hyper-V partition. */
120
+ #define HV_X64_HYPERV_NESTED BIT(12)
121
+
119
122
/* Recommend using enlightened VMCS */
120
123
#define HV_X64_ENLIGHTENED_VMCS_RECOMMENDED BIT(14)
121
124
Original file line number Diff line number Diff line change 37
37
38
38
/* Is Linux running as the root partition? */
39
39
bool hv_root_partition ;
40
+ /* Is Linux running on nested Microsoft Hypervisor */
41
+ bool hv_nested ;
40
42
struct ms_hyperv_info ms_hyperv ;
41
43
42
44
#if IS_ENABLED (CONFIG_HYPERV )
@@ -301,6 +303,11 @@ static void __init ms_hyperv_init_platform(void)
301
303
pr_info ("Hyper-V: running as root partition\n" );
302
304
}
303
305
306
+ if (ms_hyperv .hints & HV_X64_HYPERV_NESTED ) {
307
+ hv_nested = true;
308
+ pr_info ("Hyper-V: running on a nested hypervisor\n" );
309
+ }
310
+
304
311
/*
305
312
* Extract host information.
306
313
*/
Original file line number Diff line number Diff line change 25
25
#include <asm/mshyperv.h>
26
26
27
27
/*
28
- * hv_root_partition and ms_hyperv are defined here with other Hyper-V
29
- * specific globals so they are shared across all architectures and are
28
+ * hv_root_partition, ms_hyperv and hv_nested are defined here with other
29
+ * Hyper-V specific globals so they are shared across all architectures and are
30
30
* built only when CONFIG_HYPERV is defined. But on x86,
31
31
* ms_hyperv_init_platform() is built even when CONFIG_HYPERV is not
32
- * defined, and it uses these two variables. So mark them as __weak
32
+ * defined, and it uses these three variables. So mark them as __weak
33
33
* here, allowing for an overriding definition in the module containing
34
34
* ms_hyperv_init_platform().
35
35
*/
36
36
bool __weak hv_root_partition ;
37
37
EXPORT_SYMBOL_GPL (hv_root_partition );
38
38
39
+ bool __weak hv_nested ;
40
+ EXPORT_SYMBOL_GPL (hv_nested );
41
+
39
42
struct ms_hyperv_info __weak ms_hyperv ;
40
43
EXPORT_SYMBOL_GPL (ms_hyperv );
41
44
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ struct ms_hyperv_info {
48
48
u64 shared_gpa_boundary ;
49
49
};
50
50
extern struct ms_hyperv_info ms_hyperv ;
51
+ extern bool hv_nested ;
51
52
52
53
extern void * __percpu * hyperv_pcpu_input_arg ;
53
54
extern void * __percpu * hyperv_pcpu_output_arg ;
You can’t perform that action at this time.
0 commit comments