Ignore:
Timestamp:
May 17, 2019, 9:27:04 AM (5 years ago)
Author:
alain
Message:

Remove the "giant" rwlock protecting the GPT, and
use the GPT_LOCKED attribute in each PTE to prevent
concurrent modifications of one GPT entry.
The version number has been incremented to 2.1.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/tsar_mips32/core/hal_vmm.c

    r625 r629  
    8181    uint32_t ppn  = cxy << 20;   
    8282
    83     // register PTE1  in slot[0] of kernel GPT
    84     error = hal_gpt_set_pte( XPTR( cxy , gpt ) , 0 , attr , ppn );
    85 
    86     if( error )
    87     {
    88         printk("\n[PANIC] in %s : cannot initialize kernel GPT in cluster %x\n",
    89         __FUNCTION__ , cxy );
    90         hal_core_sleep();
    91     }
     83    // set PT1[0]
     84    hal_gpt_set_pte( XPTR( cxy , gpt ) , 0 , attr , ppn );
    9285
    9386#if DEBUG_HAL_VMM
     
    159152
    160153    // update user GPT : set PTE1 in slot[0]
    161     error = hal_gpt_set_pte( u_gpt_xp , 0 , attr , ppn );
    162 
    163     if( error )
    164     {
    165         printk("\n[ERROR] in %s : cannot update user GPT in cluster %x\n",
    166         __FUNCTION__ , cxy );
    167         return -1;
    168     }
     154    hal_gpt_set_pte( u_gpt_xp , 0 , attr , ppn );
    169155
    170156#if DEBUG_HAL_VMM
     
    220206    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
    221207
    222     // build extended pointers on TXT0 lock, GPT lock and VSL lock
     208    // build extended pointer on TXT0 lock and VSL lock
    223209    xptr_t  txt_lock_xp = XPTR( txt0_cxy  , &txt0_ptr->wait_lock );
    224210    xptr_t  vsl_lock_xp = XPTR( local_cxy , &vmm->vsl_lock );
    225     xptr_t  gpt_lock_xp = XPTR( local_cxy , &vmm->gpt_lock );
    226211
    227212    // get root of vsegs list
     
    230215    // get the locks protecting TXT0, VSL, and GPT
    231216    remote_rwlock_rd_acquire( vsl_lock_xp );
    232     remote_rwlock_rd_acquire( gpt_lock_xp );
    233217    remote_busylock_acquire( txt_lock_xp );
    234218
     
    291275    // release locks
    292276    remote_busylock_release( txt_lock_xp );
    293     remote_rwlock_rd_release( gpt_lock_xp );
    294277    remote_rwlock_rd_release( vsl_lock_xp );
    295278
Note: See TracChangeset for help on using the changeset viewer.