@@ -362,12 +362,12 @@ void prepare_vmcs(struct vmx_pages *vmx, void *guest_rip, void *guest_rsp)
362362 init_vmcs_guest_state (guest_rip , guest_rsp );
363363}
364364
365- static void nested_create_pte (struct kvm_vm * vm ,
366- struct eptPageTableEntry * pte ,
367- uint64_t nested_paddr ,
368- uint64_t paddr ,
369- int current_level ,
370- int target_level )
365+ static void tdp_create_pte (struct kvm_vm * vm ,
366+ struct eptPageTableEntry * pte ,
367+ uint64_t nested_paddr ,
368+ uint64_t paddr ,
369+ int current_level ,
370+ int target_level )
371371{
372372 if (!pte -> readable ) {
373373 pte -> writable = true;
@@ -394,8 +394,8 @@ static void nested_create_pte(struct kvm_vm *vm,
394394}
395395
396396
397- void __nested_pg_map (struct vmx_pages * vmx , struct kvm_vm * vm ,
398- uint64_t nested_paddr , uint64_t paddr , int target_level )
397+ void __tdp_pg_map (struct vmx_pages * vmx , struct kvm_vm * vm ,
398+ uint64_t nested_paddr , uint64_t paddr , int target_level )
399399{
400400 const uint64_t page_size = PG_LEVEL_SIZE (target_level );
401401 struct eptPageTableEntry * pt = vmx -> eptp_hva , * pte ;
@@ -428,7 +428,7 @@ void __nested_pg_map(struct vmx_pages *vmx, struct kvm_vm *vm,
428428 index = (nested_paddr >> PG_LEVEL_SHIFT (level )) & 0x1ffu ;
429429 pte = & pt [index ];
430430
431- nested_create_pte (vm , pte , nested_paddr , paddr , level , target_level );
431+ tdp_create_pte (vm , pte , nested_paddr , paddr , level , target_level );
432432
433433 if (pte -> page_size )
434434 break ;
@@ -445,10 +445,10 @@ void __nested_pg_map(struct vmx_pages *vmx, struct kvm_vm *vm,
445445
446446}
447447
448- void nested_pg_map (struct vmx_pages * vmx , struct kvm_vm * vm ,
449- uint64_t nested_paddr , uint64_t paddr )
448+ void tdp_pg_map (struct vmx_pages * vmx , struct kvm_vm * vm ,
449+ uint64_t nested_paddr , uint64_t paddr )
450450{
451- __nested_pg_map (vmx , vm , nested_paddr , paddr , PG_LEVEL_4K );
451+ __tdp_pg_map (vmx , vm , nested_paddr , paddr , PG_LEVEL_4K );
452452}
453453
454454/*
@@ -468,8 +468,8 @@ void nested_pg_map(struct vmx_pages *vmx, struct kvm_vm *vm,
468468 * Within the VM given by vm, creates a nested guest translation for the
469469 * page range starting at nested_paddr to the page range starting at paddr.
470470 */
471- void __nested_map (struct vmx_pages * vmx , struct kvm_vm * vm ,
472- uint64_t nested_paddr , uint64_t paddr , uint64_t size ,
471+ void __tdp_map (struct vmx_pages * vmx , struct kvm_vm * vm ,
472+ uint64_t nested_paddr , uint64_t paddr , uint64_t size ,
473473 int level )
474474{
475475 size_t page_size = PG_LEVEL_SIZE (level );
@@ -479,23 +479,23 @@ void __nested_map(struct vmx_pages *vmx, struct kvm_vm *vm,
479479 TEST_ASSERT (paddr + size > paddr , "Paddr overflow" );
480480
481481 while (npages -- ) {
482- __nested_pg_map (vmx , vm , nested_paddr , paddr , level );
482+ __tdp_pg_map (vmx , vm , nested_paddr , paddr , level );
483483 nested_paddr += page_size ;
484484 paddr += page_size ;
485485 }
486486}
487487
488- void nested_map (struct vmx_pages * vmx , struct kvm_vm * vm ,
489- uint64_t nested_paddr , uint64_t paddr , uint64_t size )
488+ void tdp_map (struct vmx_pages * vmx , struct kvm_vm * vm ,
489+ uint64_t nested_paddr , uint64_t paddr , uint64_t size )
490490{
491- __nested_map (vmx , vm , nested_paddr , paddr , size , PG_LEVEL_4K );
491+ __tdp_map (vmx , vm , nested_paddr , paddr , size , PG_LEVEL_4K );
492492}
493493
494494/* Prepare an identity extended page table that maps all the
495495 * physical pages in VM.
496496 */
497- void nested_identity_map_default_memslots (struct vmx_pages * vmx ,
498- struct kvm_vm * vm )
497+ void tdp_identity_map_default_memslots (struct vmx_pages * vmx ,
498+ struct kvm_vm * vm )
499499{
500500 uint32_t s , memslot = 0 ;
501501 sparsebit_idx_t i , last ;
@@ -512,18 +512,16 @@ void nested_identity_map_default_memslots(struct vmx_pages *vmx,
512512 if (i > last )
513513 break ;
514514
515- nested_map (vmx , vm ,
516- (uint64_t )i << vm -> page_shift ,
517- (uint64_t )i << vm -> page_shift ,
518- 1 << vm -> page_shift );
515+ tdp_map (vmx , vm , (uint64_t )i << vm -> page_shift ,
516+ (uint64_t )i << vm -> page_shift , 1 << vm -> page_shift );
519517 }
520518}
521519
522520/* Identity map a region with 1GiB Pages. */
523- void nested_identity_map_1g (struct vmx_pages * vmx , struct kvm_vm * vm ,
521+ void tdp_identity_map_1g (struct vmx_pages * vmx , struct kvm_vm * vm ,
524522 uint64_t addr , uint64_t size )
525523{
526- __nested_map (vmx , vm , addr , addr , size , PG_LEVEL_1G );
524+ __tdp_map (vmx , vm , addr , addr , size , PG_LEVEL_1G );
527525}
528526
529527bool kvm_cpu_has_ept (void )
0 commit comments