diff --git a/ihk b/ihk index 02ef2693..d5dc1632 160000 --- a/ihk +++ b/ihk @@ -1 +1 @@ -Subproject commit 02ef2693af4d66b74f70b8c9a60667c241b291c7 +Subproject commit d5dc1632cc9cc947dbe1c4706023f91b300af694 diff --git a/kernel/freeze.c b/kernel/freeze.c index 7b547883..2dcf7c03 100644 --- a/kernel/freeze.c +++ b/kernel/freeze.c @@ -17,13 +17,19 @@ freeze() unsigned long flags; struct ihk_os_cpu_monitor *monitor = cpu_local_var(monitor); - monitor->status_bak = monitor->status; + monitor->status_bak = monitor->status + | IHK_OS_MONITOR_ALLOW_THAW_REQUEST; monitor->status = IHK_OS_MONITOR_KERNEL_FROZEN; flags = cpu_enable_interrupt_save(); +frozen: while (monitor->status == IHK_OS_MONITOR_KERNEL_FROZEN) { cpu_halt(); cpu_pause(); } + if (monitor->status_bak != IHK_OS_MONITOR_KERNEL_THAW) { + monitor->status = IHK_OS_MONITOR_KERNEL_FROZEN; + goto frozen; + } cpu_restore_interrupt(flags); monitor->status = monitor->status_bak; } @@ -53,8 +59,10 @@ freeze_thaw(void *nmi_ctx) } } else if (multi_intr_mode == 2) { - if (monitor->status == IHK_OS_MONITOR_KERNEL_FROZEN) { - monitor->status = IHK_OS_MONITOR_KERNEL_THAW; + if (monitor->status_bak & IHK_OS_MONITOR_ALLOW_THAW_REQUEST) { + monitor->status = monitor->status_bak + & ~IHK_OS_MONITOR_ALLOW_THAW_REQUEST; + monitor->status_bak = IHK_OS_MONITOR_KERNEL_THAW; } } return 0;