Ignore:
Timestamp:
Apr 10, 2019, 10:09:39 AM (20 months ago)
Author:
alain
Message:

Fix a bug in the vmm_remove_vseg() function: the physical pages
associated to an user DATA vseg were released to the kernel when
the target process descriptor was in the reference cluster.
This physical pages release should be done only when the page
forks counter value is zero.
All other modifications are cosmetic.

File:
1 edited

Legend:

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

    r619 r625  
    189189    if( CURRENT_THREAD->type != THREAD_USER )
    190190    {
    191         printk("\n[KERNEL PANIC] in %s : illegal thread type %s\n",
     191        printk("\n[PANIC] in %s : illegal thread type %s\n",
    192192        __FUNCTION__, thread_type_str(CURRENT_THREAD->type) );
    193193
     
    250250            else if( error == EXCP_USER_ERROR )      // illegal vaddr
    251251            {
    252                 printk("\n[USER ERROR] in %s : thread[%x,%x] on core[%x,%x] / cycle %d\n"
     252                printk("\n[ERROR] in %s : thread[%x,%x] on core[%x,%x] / cycle %d\n"
    253253                "  %s : epc %x / badvaddr %x / is_ins %d\n",
    254254                __FUNCTION__, this->process->pid, this->trdid, local_cxy,
     
    260260            else  // error == EXCP_KERNEL_PANIC 
    261261            {
    262                 printk("\n[KERNEL PANIC] in %s : thread[%x,%x] on core[%x,%x] / cycle %d\n"
     262                printk("\n[PANIC] in %s : thread[%x,%x] on core[%x,%x] / cycle %d\n"
    263263                "  %s : epc %x / badvaddr %x / is_ins %d\n",
    264264                __FUNCTION__, this->process->pid, this->trdid, local_cxy,
     
    272272        case MMU_READ_PRIVILEGE_VIOLATION:   // illegal
    273273        {
    274             printk("\n[USER ERROR] in %s : thread[%x,%x] on core[%x,%x] / cycle %d\n"
     274            printk("\n[ERROR] in %s : thread[%x,%x] on core[%x,%x] / cycle %d\n"
    275275            "  %s : epc %x / badvaddr %x / is_ins %d\n",
    276276            __FUNCTION__, this->process->pid, this->trdid, local_cxy,
     
    299299            else if( error == EXCP_USER_ERROR )  // illegal write access
    300300            {
    301                     printk("\n[USER ERROR] in %s : thread[%x,%x] on core[%x,%x] / cycle %d\n"
     301                    printk("\n[ERROR] in %s : thread[%x,%x] on core[%x,%x] / cycle %d\n"
    302302                    "  %s : epc %x / badvaddr %x / is_ins %d\n",
    303303                    __FUNCTION__, this->process->pid, this->trdid, local_cxy,
     
    309309            else   // error == EXCP_KERNEL_PANIC
    310310            {
    311                 printk("\n[KERNEL PANIC] in %s : thread[%x,%x] on core[%x,%x] / cycle %d\n"
     311                printk("\n[PANIC] in %s : thread[%x,%x] on core[%x,%x] / cycle %d\n"
    312312                "  %s : epc %x / badvaddr %x / is_ins %d\n",
    313313                __FUNCTION__, this->process->pid, this->trdid, local_cxy,
     
    320320        case MMU_READ_EXEC_VIOLATION:        // user error
    321321        {
    322             printk("\n[USER ERROR] in %s : thread[%x,%x] on core[%x,%x] / cycle %d\n"
     322            printk("\n[ERROR] in %s : thread[%x,%x] on core[%x,%x] / cycle %d\n"
    323323            "  %s : epc %x / badvaddr %x / is_ins %d\n",
    324324            __FUNCTION__, this->process->pid, this->trdid, local_cxy,
     
    330330        default:                             // this is a kernel error   
    331331        {
    332             printk("\n[KERNEL PANIC] in %s : thread[%x,%x] on core[%x,%x] / cycle %d\n"
     332            printk("\n[PANIC] in %s : thread[%x,%x] on core[%x,%x] / cycle %d\n"
    333333            "  %s : epc %x / badvaddr %x / is_ins %d\n",
    334334            __FUNCTION__, this->process->pid, this->trdid, local_cxy,
     
    346346//////////////////////////////////////////////////////////////////////////////////////////
    347347// @ this     : pointer on faulty thread descriptor.
    348 // @ error    : EXCP_USER_ERROR or EXCP_KERNEL_PANIC
    349 //////////////////////////////////////////////////////////////////////////////////////////
    350 static void hal_exception_dump( thread_t * this,
    351                                 error_t    error )
     348//////////////////////////////////////////////////////////////////////////////////////////
     349static void hal_exception_dump( thread_t * this )
    352350{
    353351    core_t    * core    = this->core;
     
    366364    remote_busylock_acquire( lock_xp );
    367365
    368     if( error == EXCP_USER_ERROR )
    369     {
    370         nolock_printk("\n=== USER ERROR / thread(%x,%x) / core[%d] / cycle %d ===\n",
    371         process->pid, this->trdid, core->lid, (uint32_t)hal_get_cycles() );
    372     }
    373     else
    374     {
    375         nolock_printk("\n=== KERNEL PANIC / thread(%x,%x) / core[%d] / cycle %d ===\n",
    376         process->pid, this->trdid, core->lid, (uint32_t)hal_get_cycles() );
    377     }
     366    nolock_printk("\n=== thread(%x,%x) / core[%d] / cycle %d ===\n",
     367    process->pid, this->trdid, core->lid, (uint32_t)hal_get_cycles() );
    378368
    379369        nolock_printk("busylocks = %d / blocked_vector = %X / flags = %X\n\n",
     
    507497        if( error == EXCP_USER_ERROR )          //  user error => kill user process
    508498        {
    509         hal_exception_dump( this , error );
     499        hal_exception_dump( this );
    510500
    511501        sys_exit( EXIT_FAILURE );
     
    513503    else if( error == EXCP_KERNEL_PANIC )   // kernel error => kernel panic
    514504    {
    515         hal_exception_dump( this , error );
     505        hal_exception_dump( this );
    516506
    517507        hal_core_sleep();
Note: See TracChangeset for help on using the changeset viewer.