[MINI-OS PATCH 04/19] time: unbind VIRQ_TIMER across kexec

Juergen Gross posted 19 patches 4 months ago
There is a newer version of this series
[MINI-OS PATCH 04/19] time: unbind VIRQ_TIMER across kexec
Posted by Juergen Gross 4 months ago
Deactivate the VIRQ_TIMER event when doing kexec() in order to be
able to set it up again in the new kernel.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/time.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/x86/time.c b/arch/x86/time.c
index 52916e15..3a2a1d29 100644
--- a/arch/x86/time.c
+++ b/arch/x86/time.c
@@ -36,6 +36,7 @@
 #include <mini-os/types.h>
 #include <mini-os/hypervisor.h>
 #include <mini-os/events.h>
+#include <mini-os/kexec.h>
 #include <mini-os/time.h>
 #include <mini-os/lib.h>
 
@@ -193,3 +194,16 @@ void fini_time(void)
     HYPERVISOR_set_timer_op(0);
     unbind_evtchn(port);
 }
+
+#ifdef CONFIG_KEXEC
+static int unbind_virq_timer(bool undo)
+{
+    if ( undo )
+        init_time();
+    else
+        fini_time();
+
+    return 0;
+}
+kexec_call(unbind_virq_timer);
+#endif
-- 
2.43.0
Re: [MINI-OS PATCH 04/19] time: unbind VIRQ_TIMER across kexec
Posted by Jason Andryuk 3 months, 3 weeks ago
On 2025-07-02 04:12, Juergen Gross wrote:
> Deactivate the VIRQ_TIMER event when doing kexec() in order to be
> able to set it up again in the new kernel.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>