Skip to content

Commit 4d24323

Browse files
committed
Merge branch 'main' of https://github.com/bytecodealliance/wasmtime into wasi_http_next
2 parents 4b61b64 + 4d5eaea commit 4d24323

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1017
-290
lines changed

.github/pull_request_template.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
<!--
2+
Please make sure you include the following information:
23
3-
Please ensure that the following steps are all taken care of before submitting
4-
the PR.
4+
- If this work has been discussed elsewhere, please include a link to that
5+
conversation. If it was discussed in an issue, just mention "issue #...".
56
6-
- [ ] This has been discussed in issue #..., or if not, please tell us why
7-
here.
8-
- [ ] A short description of what this does, why it is needed; if the
9-
description becomes long, the matter should probably be discussed in an issue
10-
first.
11-
- [ ] This PR contains test cases, if meaningful.
12-
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
13-
If you don't know who could review this, please indicate so. The list of
14-
suggested reviewers on the right can help you.
7+
- Explain why this change is needed. If the details are in an issue already,
8+
this can be brief.
159
16-
Please ensure all communication adheres to the [code of
17-
conduct](https://github.com/bytecodealliance/wasmtime/blob/master/CODE_OF_CONDUCT.md).
10+
Our development process is documented in the Wasmtime book:
11+
https://docs.wasmtime.dev/contributing-development-process.html
12+
13+
Please ensure all communication follows the code of conduct:
14+
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
1815
-->

Cargo.lock

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ cranelift-object = { path = "cranelift/object", version = "0.96.0" }
163163
cranelift-jit = { path = "cranelift/jit", version = "0.96.0" }
164164
cranelift-fuzzgen = { path = "cranelift/fuzzgen" }
165165
cranelift-bforest = { path = "cranelift/bforest", version = "0.96.0" }
166+
cranelift-control = { path = "cranelift/control", version = "0.96.0" }
166167
cranelift = { path = "cranelift/umbrella", version = "0.96.0" }
167168

168169
wasmtime-wasi-http = { path = "crates/wasi-http", version = "=0.0.1" }

RELEASES.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,98 @@ Unreleased.
1616

1717
### Added
1818

19+
* Allow the MPL-2.0 and OpenSSL licenses in dependencies of wasmtime.
20+
[#6136](https://github.com/bytecodealliance/wasmtime/pull/6136)
21+
22+
* Add a bounds-checking optimization for dynamic memories and guard pages.
23+
[#6031](https://github.com/bytecodealliance/wasmtime/pull/6031)
24+
25+
* Add support for generating perf maps for simple perf profiling. Additionally,
26+
the `--jitdump` and `--vtune` flags have been replaced with a single
27+
`--profile` flags that accepts `perfmap`, `jitdump`, and `vtune` arguments.
28+
[#6030](https://github.com/bytecodealliance/wasmtime/pull/6030)
29+
30+
* Validate faulting addresses are valid to fault on. As a mitigation to CVEs
31+
like `GHSA-ff4p-7xrq-q5r8`, check that the address involved in a fault is one
32+
that could be contained in a `Store`, or print a scary message and abort
33+
immediately.
34+
[#6028](https://github.com/bytecodealliance/wasmtime/pull/6028)
35+
36+
* Add the `--default-values-unknown-imports` option to define unknown function
37+
imports as functions that return the default value for their result type.
38+
[#6010](https://github.com/bytecodealliance/wasmtime/pull/6010)
39+
40+
* Add `Clone` for `component::InstancePre`.
41+
[#5996](https://github.com/bytecodealliance/wasmtime/issues/5996)
42+
43+
* Add `--dynamic-memory-reserved-for-growth` cli flag.
44+
[#5980](https://github.com/bytecodealliance/wasmtime/issues/5980)
45+
46+
* Introduce the `wasmtime-explorer` crate for investigating the compilation of
47+
wasm modules. This functionality is also exposed via the `wasmtime explore`
48+
command.
49+
[#5975](https://github.com/bytecodealliance/wasmtime/pull/5975)
50+
51+
* Added support for the Relaxed SIMD proposal.
52+
[#5892](https://github.com/bytecodealliance/wasmtime/pull/5892)
53+
54+
* Cranelift gained many new machine-independent optimizations.
55+
[#5909](https://github.com/bytecodealliance/wasmtime/pull/5909)
56+
[#6032](https://github.com/bytecodealliance/wasmtime/pull/6032)
57+
[#6033](https://github.com/bytecodealliance/wasmtime/pull/6033)
58+
[#6034](https://github.com/bytecodealliance/wasmtime/pull/6034)
59+
[#6037](https://github.com/bytecodealliance/wasmtime/pull/6037)
60+
[#6052](https://github.com/bytecodealliance/wasmtime/pull/6052)
61+
[#6053](https://github.com/bytecodealliance/wasmtime/pull/6053)
62+
[#6072](https://github.com/bytecodealliance/wasmtime/pull/6072)
63+
[#6095](https://github.com/bytecodealliance/wasmtime/pull/6095)
64+
[#6130](https://github.com/bytecodealliance/wasmtime/pull/6130)
65+
1966
### Changed
2067

68+
* Derive `Copy` on `wasmtime::ValType`.
69+
[#6138](https://github.com/bytecodealliance/wasmtime/pull/6138)
70+
71+
* Make `StoreContextMut` accessible in the epoch deadline callback.
72+
[#6075](https://github.com/bytecodealliance/wasmtime/pull/6075)
73+
74+
* Take SIGFPE signals for divide traps on `x86_64`.
75+
[#6026](https://github.com/bytecodealliance/wasmtime/pull/6026)
76+
77+
* Use more specialized AVX instructions in the `x86_64` backend.
78+
[#5924](https://github.com/bytecodealliance/wasmtime/pull/5924)
79+
[#5930](https://github.com/bytecodealliance/wasmtime/pull/5930)
80+
[#5931](https://github.com/bytecodealliance/wasmtime/pull/5931)
81+
[#5982](https://github.com/bytecodealliance/wasmtime/pull/5982)
82+
[#5986](https://github.com/bytecodealliance/wasmtime/pull/5986)
83+
[#5999](https://github.com/bytecodealliance/wasmtime/pull/5999)
84+
[#6023](https://github.com/bytecodealliance/wasmtime/pull/6023)
85+
[#6025](https://github.com/bytecodealliance/wasmtime/pull/6025)
86+
[#6060](https://github.com/bytecodealliance/wasmtime/pull/6060)
87+
[#6086](https://github.com/bytecodealliance/wasmtime/pull/6086)
88+
[#6092](https://github.com/bytecodealliance/wasmtime/pull/6092)
89+
90+
* Generate more cache-friendly code for traps.
91+
[#6011](https://github.com/bytecodealliance/wasmtime/pull/6011)
92+
93+
### Fixed
94+
95+
* Fixed suboptimal code generation in the `aarch64` backend.
96+
[#5976](https://github.com/bytecodealliance/wasmtime/pull/5976)
97+
[#5977](https://github.com/bytecodealliance/wasmtime/pull/5977)
98+
[#5987](https://github.com/bytecodealliance/wasmtime/pull/5987)
99+
[#5997](https://github.com/bytecodealliance/wasmtime/pull/5997)
100+
[#6078](https://github.com/bytecodealliance/wasmtime/pull/6078)
101+
102+
* Fixed suboptimal code generation in the `riscv64` backend.
103+
[#5854](https://github.com/bytecodealliance/wasmtime/pull/5854)
104+
[#5857](https://github.com/bytecodealliance/wasmtime/pull/5857)
105+
[#5919](https://github.com/bytecodealliance/wasmtime/pull/5919)
106+
[#5951](https://github.com/bytecodealliance/wasmtime/pull/5951)
107+
[#5964](https://github.com/bytecodealliance/wasmtime/pull/5964)
108+
[#6087](https://github.com/bytecodealliance/wasmtime/pull/6087)
109+
110+
21111
--------------------------------------------------------------------------------
22112

23113
## 7.0.0
@@ -76,6 +166,12 @@ Released 2023-03-20
76166
instructions has been fixed.
77167
[#5871](https://github.com/bytecodealliance/wasmtime/pull/5871)
78168

169+
* Guest-controlled out-of-bounds read/write on x86\_64
170+
[GHSA-ff4p-7xrq-q5r8](https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-ff4p-7xrq-q5r8)
171+
172+
* Miscompilation of `i8x16.select` with the same inputs on x86\_64
173+
[GHSA-xm67-587q-r2vw](https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-xm67-587q-r2vw)
174+
79175
--------------------------------------------------------------------------------
80176

81177
## 6.0.1

cranelift/codegen/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ capstone = { workspace = true, optional = true }
1919
cranelift-codegen-shared = { path = "./shared", version = "0.96.0" }
2020
cranelift-entity = { workspace = true }
2121
cranelift-bforest = { workspace = true }
22+
cranelift-control = { workspace = true }
2223
hashbrown = { workspace = true, features = ["raw"] }
2324
target-lexicon = { workspace = true }
2425
log = { workspace = true }

cranelift/codegen/src/context.rs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ use crate::{timing, CompileError};
3333
#[cfg(feature = "souper-harvest")]
3434
use alloc::string::String;
3535
use alloc::vec::Vec;
36+
use cranelift_control::ControlPlane;
3637

3738
#[cfg(feature = "souper-harvest")]
3839
use crate::souper_harvest::do_souper_harvest;
@@ -124,23 +125,28 @@ impl Context {
124125
&mut self,
125126
isa: &dyn TargetIsa,
126127
mem: &mut Vec<u8>,
128+
ctrl_plane: &mut ControlPlane,
127129
) -> CompileResult<&CompiledCode> {
128-
let compiled_code = self.compile(isa)?;
130+
let compiled_code = self.compile(isa, ctrl_plane)?;
129131
mem.extend_from_slice(compiled_code.code_buffer());
130132
Ok(compiled_code)
131133
}
132134

133135
/// Internally compiles the function into a stencil.
134136
///
135137
/// Public only for testing and fuzzing purposes.
136-
pub fn compile_stencil(&mut self, isa: &dyn TargetIsa) -> CodegenResult<CompiledCodeStencil> {
138+
pub fn compile_stencil(
139+
&mut self,
140+
isa: &dyn TargetIsa,
141+
ctrl_plane: &mut ControlPlane,
142+
) -> CodegenResult<CompiledCodeStencil> {
137143
let _tt = timing::compile();
138144

139145
self.verify_if(isa)?;
140146

141147
self.optimize(isa)?;
142148

143-
isa.compile_function(&self.func, &self.domtree, self.want_disasm)
149+
isa.compile_function(&self.func, &self.domtree, self.want_disasm, ctrl_plane)
144150
}
145151

146152
/// Optimize the function, performing all compilation steps up to
@@ -212,11 +218,17 @@ impl Context {
212218
/// code sink.
213219
///
214220
/// Returns information about the function's code and read-only data.
215-
pub fn compile(&mut self, isa: &dyn TargetIsa) -> CompileResult<&CompiledCode> {
216-
let stencil = self.compile_stencil(isa).map_err(|error| CompileError {
217-
inner: error,
218-
func: &self.func,
219-
})?;
221+
pub fn compile(
222+
&mut self,
223+
isa: &dyn TargetIsa,
224+
ctrl_plane: &mut ControlPlane,
225+
) -> CompileResult<&CompiledCode> {
226+
let stencil = self
227+
.compile_stencil(isa, ctrl_plane)
228+
.map_err(|error| CompileError {
229+
inner: error,
230+
func: &self.func,
231+
})?;
220232
Ok(self
221233
.compiled_code
222234
.insert(stencil.apply_params(&self.func.params)))

cranelift/codegen/src/incremental_cache.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ use crate::{isa::TargetIsa, timing};
3232
use crate::{trace, CompileError, Context};
3333
use alloc::borrow::{Cow, ToOwned as _};
3434
use alloc::string::ToString as _;
35+
use cranelift_control::ControlPlane;
3536

3637
impl Context {
3738
/// Compile the function, as in `compile`, but tries to reuse compiled artifacts from former
@@ -40,6 +41,7 @@ impl Context {
4041
&mut self,
4142
isa: &dyn TargetIsa,
4243
cache_store: &mut dyn CacheKvStore,
44+
ctrl_plane: &mut ControlPlane,
4345
) -> CompileResult<(&CompiledCode, bool)> {
4446
let cache_key_hash = {
4547
let _tt = timing::try_incremental_cache();
@@ -52,7 +54,7 @@ impl Context {
5254
let info = compiled_code.code_info();
5355

5456
if isa.flags().enable_incremental_compilation_cache_checks() {
55-
let actual_result = self.compile(isa)?;
57+
let actual_result = self.compile(isa, ctrl_plane)?;
5658
assert_eq!(*actual_result, compiled_code);
5759
assert_eq!(actual_result.code_info(), info);
5860
// no need to set `compiled_code` here, it's set by `compile()`.
@@ -71,10 +73,12 @@ impl Context {
7173
cache_key_hash
7274
};
7375

74-
let stencil = self.compile_stencil(isa).map_err(|err| CompileError {
75-
inner: err,
76-
func: &self.func,
77-
})?;
76+
let stencil = self
77+
.compile_stencil(isa, ctrl_plane)
78+
.map_err(|err| CompileError {
79+
inner: err,
80+
func: &self.func,
81+
})?;
7882

7983
let stencil = {
8084
let _tt = timing::store_incremental_cache();

0 commit comments

Comments
 (0)