[PATCH v9 05/10] um: Add compile time assert that stub fits on a page
Benjamin Berg
benjamin at sipsolutions.net
Thu Sep 19 05:45:06 PDT 2024
From: Benjamin Berg <benjamin.berg at intel.com>
The code assumes that the stub code can fit into a single page. This is
unlikely to ever change, but add a link time assert instead so that
there will be no hard to debug error.
Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
---
arch/um/kernel/dyn.lds.S | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S
index 3385d653ebd0..dc9d9a68af55 100644
--- a/arch/um/kernel/dyn.lds.S
+++ b/arch/um/kernel/dyn.lds.S
@@ -178,3 +178,6 @@ SECTIONS
DISCARDS
}
+
+ASSERT(__syscall_stub_end - __syscall_stub_start <= PAGE_SIZE,
+ "STUB code must not be larger than one page");
--
2.46.0
More information about the linux-um
mailing list