Heyang Zhou

Results 76 issues of Heyang Zhou

It seems that `Assembler::alter` (which uses `mprotect`) does not flush the instruction cache after code has changed, and subsequent execution sometimes still uses the old code. This issue can only...

bug

I'm building a JIT that runs on bare metal and therefore `std` is not available. Is it possible to make `dynasm-rs` compatible with the `no_std` mode (with `alloc`), as long...

Hi, I'm trying to generate some code like: ```rust dynasm!(self.a ; .arch aarch64 ; add X(31), X(1), 1 ); ``` Dynasm successfully assembles this without reporting an error. However, the...

bug

Make values with disjoint lifetimes share the same storage unit.

enhancement

Fixes https://github.com/rcore-os/rCore-Tutorial/issues/104 .

### 涉及文件 https://rcore-os.github.io/rCore-Tutorial-deploy/docs/lab-4/practice-1.html ### 相关段落 实验四(上)对 `clone()` 的要求是: > 实验:实现线程的 clone()。目前的内核线程不能进行系统调用,所以我们先简化地实现为“按 C 进行 clone”。clone 后应当为目前的线程复制一份几乎一样的拷贝,新线程与旧线程同属一个进程,公用页表和大部分内存空间,而新线程的栈是一份拷贝。 ### 遇到问题 新线程的栈和寄存器内都可能有对栈上地址的引用,拷贝栈不会更新这些引用。于是在新栈上继续执行的代码对局部变量的访问会错误地引用旧栈上的地址。 建议做以下修改之一: 1. 定义 `clone()` 为拷贝当前进程而非线程。 2. 要求显式指定新线程的入口地址,并重新分配空栈而非拷贝栈。

bug

Lab 4 的第二节「线程和进程」中,用「运行栈」指代线程在内核态运行时使用的栈;第六节中,用「内核栈」指代中断处理所用的栈。 这对名称有些令人困惑。若与线程的「用户态」对应的是线程的「内核态」,则与「用户栈」相对应的名称可能也是「内核栈」更合适一点。 若参考 Linux 的[文档](https://www.kernel.org/doc/html/latest/x86/kernel-stacks.html): > Like all other architectures, x86_64 has a kernel stack for every active thread. These thread stacks are THREAD_SIZE (2*PAGE_SIZE) big. These stacks...

enhancement

The execution of `case getGlobal` in `ExecInitExpr` depends on runtime imports to work correctly. We don't have that information before imports get resolved and therefore cannot execute init expressions ahead...

Similar to the existing `vendored-openssl` feature flag, this PR makes the `bundled` feature of rusqlite optional too. This allows swapping in different SQLite implementations and runtime-patching SQLite with `LD_PRELOAD`.