Commit 7ac8a242 authored by Charles Jacobsen's avatar Charles Jacobsen Committed by Vikram Narayanan

Wasn't doing a get/put on kthread.

Still haven't figured out page fault bug.
parent c9000525
......@@ -2465,6 +2465,8 @@ static int vmx_handle_hard_exception(struct lcd_arch_thread *t)
*
* TODO: We will have microkernel handle it.
*/
LCD_ARCH_ERR("page fault: faulting gv address = %lx",
t->exit_qualification);
return LCD_ARCH_STATUS_PAGE_FAULT;
default:
LCD_ARCH_ERR("hw exception: vector = %x, info = %x",
......
......@@ -1341,10 +1341,14 @@ int lcd_thread_kill(struct lcd_thread *t)
{
int ret;
/*
* Stop the kernel thread and get return value, host kernel takes
* care of the rest of the details for the kernel thread.
* Stop the kernel thread and get return value.
*/
ret = kthread_stop(t->kthread);
/*
* Decrement the kthread's reference count. Host kernel will clean
* up the rest.
*/
put_task_struct(t->kthread);
/*
* The LCD still owns the lcd thread's stack, so we won't free it.
*
......@@ -1477,7 +1481,14 @@ static int lcd_add_thread(struct lcd *lcd, gva_t pc, gva_t stack_gva,
LCD_ERR("failed to create kthread");
goto fail8;
}
t->kthread->lcd_thread = t; /* store back reference */
/*
* Bumpg reference count on kthread
*/
get_task_struct(t->kthread);
/*
* Store back reference
*/
t->kthread->lcd_thread = t;
/*
* DONE!
......
......@@ -475,7 +475,6 @@ fail1:
return ret;
}
#if 0
static int test08(void)
{
......@@ -520,7 +519,7 @@ fail1:
return -1;
}
#endif
static void lcd_tests(void)
{
......@@ -538,8 +537,8 @@ static void lcd_tests(void)
return;
if (test07())
return;
// if (test08())
// return;
if (test08())
return;
LCD_MSG("all tests passed!");
return;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment