diff --git a/crates/stela-linux/build/native.rs b/crates/stela-linux/build/native.rs index ad7f855579..dc026963f1 100644 --- a/crates/stela-linux/build/native.rs +++ b/crates/stela-linux/build/native.rs @@ -381,6 +381,7 @@ impl Linux { } if super::task_fixtures() && env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("linux") { build.define("STELA_LINUX_REGISTRY_SOURCE_TEST", None); + build.define("STELA_LINUX_HOSTED_PAGE_TEST", None); } linux_archive(&build, "stela-linux", &kernel, &upstream, Path::new(COMPAT)); // A callable target-ABI fixture plus host helpers only. It links the diff --git a/crates/stela-linux/src/compat/kernel/page.c b/crates/stela-linux/src/compat/kernel/page.c index 1c77666cbc..617d46c716 100644 --- a/crates/stela-linux/src/compat/kernel/page.c +++ b/crates/stela-linux/src/compat/kernel/page.c @@ -1232,6 +1232,21 @@ static size_t find_model_run(size_t count) return NO_INDEX; } +#ifdef STELA_LINUX_HOSTED_PAGE_TEST +/* The hosted model's pages share the test allocation routes, so a hosted + * fixture refuses and counts them as it does heap allocations (route 2). */ +bool stela_test_allocation_attempt(unsigned int route); +static bool hosted_page_attempt(void) +{ + return stela_test_allocation_attempt(2); +} +#else +static bool hosted_page_attempt(void) +{ + return true; +} +#endif + struct page *__alloc_pages_noprof(gfp_t gfp, unsigned int order, int preferred_nid, nodemask_t *nodemask) { @@ -1280,7 +1295,7 @@ retry: size_t count = (size_t)1 << order; size_t first; if (catalog.hosted) { - first = find_model_run(count); + first = hosted_page_attempt() ? find_model_run(count) : NO_INDEX; if (first == NO_INDEX) { recycle_record(record_index); goto exhausted;