File tree Expand file tree Collapse file tree 4 files changed +11
-14
lines changed Expand file tree Collapse file tree 4 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,11 @@ static int hardware_detect_support(void)
227
227
return - ENODEV ;
228
228
}
229
229
230
+ if (!cpu_has_cap (X86_FEATURE_PAGE1GB )) {
231
+ pr_fatal ("%s, not support 1GB page\n" , __func__ );
232
+ return - ENODEV ;
233
+ }
234
+
230
235
if (!cpu_has_cap (X86_FEATURE_VMX )) {
231
236
pr_fatal ("%s, vmx not supported\n" , __func__ );
232
237
return - ENODEV ;
Original file line number Diff line number Diff line change @@ -131,6 +131,11 @@ int check_vmx_mmu_cap(void)
131
131
return - ENODEV ;
132
132
}
133
133
134
+ if (!cpu_has_vmx_ept_cap (VMX_EPT_1GB_PAGE )) {
135
+ pr_fatal ("%s, ept not support 1GB large page\n" , __func__ );
136
+ return - ENODEV ;
137
+ }
138
+
134
139
return 0 ;
135
140
}
136
141
@@ -187,18 +192,6 @@ void invept(struct vcpu *vcpu)
187
192
}
188
193
}
189
194
190
- bool check_mmu_1gb_support (enum _page_table_type page_table_type )
191
- {
192
- bool status = false;
193
-
194
- if (page_table_type == PTT_EPT ) {
195
- status = cpu_has_vmx_ept_cap (VMX_EPT_1GB_PAGE );
196
- } else {
197
- status = cpu_has_cap (X86_FEATURE_PAGE1GB );
198
- }
199
- return status ;
200
- }
201
-
202
195
uint64_t get_paging_pml4 (void )
203
196
{
204
197
/* Return address to caller */
Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ int general_sw_loader(struct vm *vm, struct vcpu *vcpu)
197
197
* reserving. Current strategy is "total_mem_size in Giga -
198
198
* remained 1G pages" for reserving.
199
199
*/
200
- if (is_vm0 (vm ) && check_mmu_1gb_support ( PTT_PRIMARY ) ) {
200
+ if (is_vm0 (vm )) {
201
201
int32_t reserving_1g_pages ;
202
202
203
203
#ifdef CONFIG_REMAIN_1G_PAGES
Original file line number Diff line number Diff line change @@ -287,7 +287,6 @@ static inline void mem_write64(void *addr, uint64_t data)
287
287
}
288
288
289
289
uint64_t get_paging_pml4 (void );
290
- bool check_mmu_1gb_support (enum _page_table_type page_table_type );
291
290
void * alloc_paging_struct (void );
292
291
void free_paging_struct (void * ptr );
293
292
void enable_paging (uint64_t pml4_base_addr );
You can’t perform that action at this time.
0 commit comments