diff mbox series

[RFC,03/47] mm: asi: Switch to unrestricted address space when entering scheduler

Message ID 20220223052223.1202152-4-junaids@google.com (mailing list archive)
State New, archived
Headers show
Series Address Space Isolation for KVM | expand

Commit Message

Junaid Shahid Feb. 23, 2022, 5:21 a.m. UTC
To keep things simpler, we run the scheduler only in the full
unrestricted address space for the time being.

Signed-off-by: Junaid Shahid <junaids@google.com>


---
 kernel/sched/core.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 77563109c0ea..44ea197c16ea 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -19,6 +19,7 @@ 
 
 #include <asm/switch_to.h>
 #include <asm/tlb.h>
+#include <asm/asi.h>
 
 #include "../workqueue_internal.h"
 #include "../../fs/io-wq.h"
@@ -6141,6 +6142,10 @@  static void __sched notrace __schedule(unsigned int sched_mode)
 	rq = cpu_rq(cpu);
 	prev = rq->curr;
 
+	/* This could possibly be delayed to just before the context switch. */
+	VM_WARN_ON(!asi_is_target_unrestricted());
+	asi_exit();
+
 	schedule_debug(prev, !!sched_mode);
 
 	if (sched_feat(HRTICK) || sched_feat(HRTICK_DL))