Changeset 441 for trunk/kernel/mm


Ignore:
Timestamp:
May 9, 2018, 3:13:56 PM (6 years ago)
Author:
alain
Message:

Fix a bug in rpc_vmm_get_pte_client() function (bad RPC index).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/mm/vmm.c

    r440 r441  
    13951395
    13961396#if DEBUG_VMM_GET_ONE_PPN
    1397 if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
     1397thread_t * this = CURRENT_THREAD;
     1398// if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
     1399if( (vpn == 0x403) && ((local_cxy == 0) || (this->type == THREAD_RPC)) )
    13981400printk("\n[DBG] %s : thread %x enter for vpn = %x / type = %s / index = %d\n",
    1399 __FUNCTION__, CURRENT_THREAD, vpn, vseg_type_str(type), index );
     1401__FUNCTION__, this, vpn, vseg_type_str(type), index );
    14001402#endif
    14011403
     
    14581460
    14591461#if (DEBUG_VMM_GET_ONE_PPN & 0x1)
    1460 if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
     1462if( (vpn == 0x403) && ((local_cxy == 0) || (this->type == THREAD_RPC)) )
     1463// if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
    14611464printk("\n[DBG] %s : thread %x for vpn = %x / elf_offset = %x\n",
    1462 __FUNCTION__, CURRENT_THREAD, vpn, elf_offset );
     1465__FUNCTION__, this, vpn, elf_offset );
    14631466#endif
    14641467
     
    14741477
    14751478#if (DEBUG_VMM_GET_ONE_PPN & 0x1)
    1476 if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
     1479// if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
     1480if( (vpn == 0x403) && ((local_cxy == 0) || (this->type == THREAD_RPC)) )
    14771481printk("\n[DBG] %s : thread%x for vpn = %x / fully in BSS\n",
    1478 __FUNCTION__, CURRENT_THREAD, vpn );
     1482__FUNCTION__, this, vpn );
    14791483#endif
    14801484
     
    14931497
    14941498#if (DEBUG_VMM_GET_ONE_PPN & 0x1)
    1495 if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
     1499// if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
     1500if( (vpn == 0x403) && ((local_cxy == 0) || (this->type == THREAD_RPC)) )
    14961501printk("\n[DBG] %s : thread %x, for vpn = %x / fully in mapper\n",
    1497 __FUNCTION__, CURRENT_THREAD, vpn );
     1502__FUNCTION__, this, vpn );
    14981503#endif
    14991504                if( mapper_cxy == local_cxy )
     
    15241529
    15251530#if (DEBUG_VMM_GET_ONE_PPN & 0x1)
    1526 if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
     1531// if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
     1532if( (vpn == 0x403) && ((local_cxy == 0) || (this->type == THREAD_RPC)) )
    15271533printk("\n[DBG] %s : thread %x for vpn = %x / both mapper & BSS\n"
    15281534"      %d bytes from mapper / %d bytes from BSS\n",
    1529 __FUNCTION__, CURRENT_THREAD, vpn,
     1535__FUNCTION__, this, vpn,
    15301536file_size - offset , offset + CONFIG_PPM_PAGE_SIZE - file_size  );
    15311537#endif
     
    15711577
    15721578#if DEBUG_VMM_GET_ONE_PPN
    1573 if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
     1579// if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
     1580if( (vpn == 0x403) && ((local_cxy == 0) || (this->type == THREAD_RPC)) )
    15741581printk("\n[DBG] %s : thread %x exit for vpn = %x / ppn = %x\n",
    1575 __FUNCTION__ , CURRENT_THREAD , vpn , *ppn );
     1582__FUNCTION__ , this , vpn , *ppn );
    15761583#endif
    15771584
     
    15951602    error_t    error;
    15961603
     1604    thread_t * this  = CURRENT_THREAD;
     1605
    15971606#if DEBUG_VMM_GET_PTE
    1598 uint32_t cycle = (uint32_t)hal_get_cycles();
    1599 if( DEBUG_VMM_GET_PTE < cycle )
     1607uint32_t   cycle = (uint32_t)hal_get_cycles();
     1608// if( DEBUG_VMM_GET_PTE < cycle )
     1609if( (vpn == 0x403) && ((local_cxy == 0) || (this->type == THREAD_RPC)) )
    16001610printk("\n[DBG] %s : thread %x enter / vpn %x / process %x / cow %d / cycle %d\n",
    1601 __FUNCTION__ , CURRENT_THREAD , vpn , process->pid , cow , cycle );
     1611__FUNCTION__ , this , vpn , process->pid , cow , cycle );
    16021612#endif
    16031613
     
    16131623    assert( (vseg != NULL) , __FUNCTION__,
    16141624    "vseg undefined / vpn %x / thread %x / process %x / core[%x,%d] / cycle %d\n",
    1615     vpn, CURRENT_THREAD, process->pid, local_cxy, CURRENT_THREAD->core->lid,
     1625    vpn, this, process->pid, local_cxy, this->core->lid,
    16161626    (uint32_t)hal_get_cycles() );
    16171627
     
    16271637        assert( (old_attr & GPT_MAPPED), __FUNCTION__,
    16281638        "PTE unmapped for a COW exception / vpn %x / thread %x / process %x / cycle %d\n",
    1629         vpn, CURRENT_THREAD, process->pid, (uint32_t)hal_get_cycles() );
     1639        vpn, this, process->pid, (uint32_t)hal_get_cycles() );
    16301640
    16311641#if( DEBUG_VMM_GET_PTE & 1 )
    1632 if( DEBUG_VMM_GET_PTE < cycle )
     1642// if( DEBUG_VMM_GET_PTE < cycle )
     1643if( (vpn == 0x403) && ((local_cxy == 0) || (this->type == THREAD_RPC)) )
    16331644printk("\n[DBG] %s : thread %x handling COW for vpn %x in process %x\n",
    1634 __FUNCTION__, CURRENT_THREAD, vpn, process->pid );
     1645__FUNCTION__, this, vpn, process->pid );
    16351646#endif
    16361647
     
    16911702
    16921703#if( DEBUG_VMM_GET_PTE & 1 )
    1693 if( DEBUG_VMM_GET_PTE < cycle )
     1704// if( DEBUG_VMM_GET_PTE < cycle )
     1705if( (vpn == 0x403) && ((local_cxy == 0) || (this->type == THREAD_RPC)) )
    16941706printk("\n[DBG] %s : thread %x handling page fault for vpn %x in process %x\n",
    1695 __FUNCTION__, CURRENT_THREAD, vpn, process->pid );
     1707__FUNCTION__, this, vpn, process->pid );
    16961708#endif
    16971709            // allocate new_ppn, and initialize the new page
     
    17331745#if DEBUG_VMM_GET_PTE
    17341746cycle = (uint32_t)hal_get_cycles();
    1735 if( DEBUG_VMM_GET_PTE < cycle )
     1747// if( DEBUG_VMM_GET_PTE < cycle )
     1748if( (vpn == 0x403) && (local_cxy == 0) )
    17361749printk("\n[DBG] %s : thread %x exit / vpn %x in process %x / ppn %x / attr %x / cycle %d\n",
    1737 __FUNCTION__, CURRENT_THREAD, vpn, process->pid, new_ppn, new_attr, cycle );
     1750__FUNCTION__, this, vpn, process->pid, new_ppn, new_attr, cycle );
    17381751#endif
    17391752
     
    17621775#if DEBUG_VMM_HANDLE_PAGE_FAULT
    17631776uint32_t cycle = (uint32_t)hal_get_cycles();
    1764 if( DEBUG_VMM_HANDLE_PAGE_FAULT < cycle )
    1765 printk("\n[DBG] %s : thread %x enter for vpn %x / process %x / core[%x,%d] / cycle %d\n",
    1766 __FUNCTION__, this, vpn, process->pid, local_cxy, this->core->lid, cycle );
     1777// if( DEBUG_VMM_HANDLE_PAGE_FAULT < cycle )
     1778if( (vpn == 0x403) && (local_cxy == 0) )
     1779printk("\n[DBG] %s : thread %x in process %x enter for vpn %x / core[%x,%d] / cycle %d\n",
     1780__FUNCTION__, this, process->pid, vpn, local_cxy, this->core->lid, cycle );
    17671781#endif
    17681782
     
    17981812    if( local_cxy != ref_cxy ) 
    17991813    {
     1814
     1815#if DEBUG_VMM_HANDLE_PAGE_FAULT
     1816// if( DEBUG_VMM_HANDLE_PAGE_FAULT < cycle )
     1817if( (vpn == 0x403) && (local_cxy == 0) )
     1818printk("\n[DBG] %s : thread %x in process %x call RPC_VMM_GET_PTE\n",
     1819__FUNCTION__, this, process->pid );
     1820#endif
     1821
    18001822        rpc_vmm_get_pte_client( ref_cxy,
    18011823                                ref_ptr,
     
    18261848#if DEBUG_VMM_HANDLE_PAGE_FAULT
    18271849cycle = (uint32_t)hal_get_cycles();
    1828 if( DEBUG_VMM_HANDLE_PAGE_FAULT < cycle )
    1829 printk("\n[DBG] %s : thread %x exit for vpn %x / process %x / cycle %d\n",
    1830 __FUNCTION__, this->trdid, vpn, process->pid, cycle );
     1850// if( DEBUG_VMM_HANDLE_PAGE_FAULT < cycle )
     1851if( (vpn == 0x403) && (local_cxy == 0) )
     1852printk("\n[DBG] %s : thread %x in process %x exit for vpn %x / core[%x,%d] / cycle %d\n",
     1853__FUNCTION__, this, process->pid, vpn, local_cxy, this->core->lid, cycle );
    18311854#endif
    18321855
    18331856    return error;
    18341857
    1835 }  // end vmm_handle_page_fault()
     1858}   // end vmm_handle_page_fault()
     1859
     1860
     1861
     1862
     1863
     1864
     1865
     1866
    18361867
    18371868/* deprecated April 2018  [AG]
Note: See TracChangeset for help on using the changeset viewer.