Skip to content

mpk: enable more tests#7376

Merged
alexcrichton merged 2 commits intobytecodealliance:mainfrom
abrown:pku-more-tests
Oct 26, 2023
Merged

mpk: enable more tests#7376
alexcrichton merged 2 commits intobytecodealliance:mainfrom
abrown:pku-more-tests

Conversation

@abrown
Copy link
Copy Markdown
Member

@abrown abrown commented Oct 25, 2023

See the commit messages for more details, but in summary:

  • this adds a test checking that the MPK boundary checks are happening
  • this disables MPK for tests that rely on a specific slot-to-store ratio

With this change, ci/run-tests.sh runs locally on an MPK-enabled machine with MPK turned on. There is more work to be done before MPK can be turned on by default (see #7119) but this helps.

This adds a Wasmtime-level test checking that, when MPK is available on
the system, an MPK-configured memory pool obeys the same invariants as
other memory pool configurations (e.g., `guards_present` for normal
allocation, `guards_present_pooling` for non-MPK pooling allocation).

It also fixes a bug. A previous commit had updated the validation logic
of `MemoryPool` to check that the memory plan's bound would be reached
before the next slot of the same stripe. But `MemoryPool::allocate` has
some "double-check" logic that was triggered by this test. It now
matches the logic in `MemoryPool::validate`.
Some Wasmtime tests rely on specific limits to the memory pool. When MPK
is enabled, these tests fail because MPK splits access to the pool
slices among different stores. This change does not yet enable MPK,
though locally I run with MPK enabled. With this commit and MPK enabled
locally, all Wasmtime tests now pass.
@abrown abrown requested a review from a team as a code owner October 25, 2023 23:26
@abrown abrown requested review from pchickey and removed request for a team October 25, 2023 23:26
@alexcrichton alexcrichton added this pull request to the merge queue Oct 26, 2023
Merged via the queue into bytecodealliance:main with commit 9db4737 Oct 26, 2023
@abrown abrown deleted the pku-more-tests branch October 26, 2023 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants