diff mbox series

[v9,05/10] um: Add compile time assert that stub fits on a page

Message ID 20240919124511.282088-6-benjamin@sipsolutions.net
State Accepted
Headers show
Series Increased address space for 64 bit | expand

Commit Message

Benjamin Berg Sept. 19, 2024, 12:45 p.m. UTC
From: Benjamin Berg <benjamin.berg@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@intel.com>
---
 arch/um/kernel/dyn.lds.S | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

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");