Comments (5)
looks like this was removed (?) should still flush on unmap
from nanos.
Eric,
Looking in AMD64 Architecture Programmer’s Manual, Volume 2: System Programming, I came across this paragraph (p144):
"Under certain circumstances, an upper-level table entry that cannot ultimately lead to a valid translation (because there are no valid entries in the lower level table to which it points) may also be cached. This can happen while executing down a false path, when an in-progress table walk gets cancelled by the branch mispredict before the low level table entry that would cause a fault is encountered. Said another way, the fact that a page table has no valid entries does not guarantee that upper level table entries won't be accessed and cached in the processor, as long as those upper level entries are marked as present. For this reason, it is not safe to modify an upper level entry, even if no valid lower-level entries exist, without first clearing its present bit, followed by an INVLPG instruction."
Do you take this to mean that we should not be setting the present bit on upper level ptes until the terminal page entry is installed?
from nanos.
Also relevant from same page:
"InvalidationofCachedUpper-levelEntriesbyINVLPG. TheeffectofINVLPGonTLBcaching of upper-level page table entries is controlled by EFER[TCE] on processors that support the translation cache extension feature. If EFER[TCE] is 0, or if the processor does not support the translation cache extension feature, an INVLPG will flush all upper-level page table entries in the TLB as well as the target PTE. If EFER[TCE] is 1, INVLPG will flush only those upper-level entries that lead to the target PTE, along with the target PTE itself. INVLPGA may flush all upper-level entries regardless of the state of TCE. For further details, see Section 3.1.7 “Extended Feature Enable Register (EFER)” on page 55."
from nanos.
My hunch is that the entries should be written from the page level up, with the present bit set, such that the table is always in a coherent state. Then, at the end, an INVLPG is issued for the page address.
Since we don't touch any upper-level entries that aren't associated with this page, I don't see why the state of EFER[TCE] would matter.
from nanos.
Resolved in #62
from nanos.
Related Issues (20)
- vdso calls appear to be unused when running -noaccel HOT 2
- objcache pagesize assertion failure in gcp
- Question: How to run unikernel on generic kvm HOT 1
- hot reload / upgrade nanovm? HOT 8
- issue(sqlite3): WAL - journal_mode and multi-thread support - err(522) SQLITE_IOERR_SHORT_READ HOT 7
- issue(gcp): metrics - klibs(gcp,tls) - memory leak (maybe) HOT 2
- chore(storage): warn when volume name/label length > nanos(VOLUME_LABEL_MAX_LEN) HOT 1
- feat(storage): prevent nanos from starting the program if the expected volumes are not available HOT 2
- issue(smp): tokio-rs/sled deadlock (probable) on cpu count > 1 HOT 8
- issue(fs): assertion !frame_is_full(ctx->frame) failed at /nanos/src/kernel/mutex.c:109 (IP 0xffffffff800460b4) HOT 2
- issue: assertion enqueue(pn->dirty_commits, sh) failed at .../pagecache.c:1088 ... in pagecache_commit_dirty_node(); halt HOT 11
- issue(unix_clock): clock_getcpuclockid and clock_getres unexpected behavior HOT 3
- issue: assertion w->retval++ < (w->poll_fds->length / sizeof(struct pollfd)) failed at ../unix/poll.c:939 (IP 0xf..) in poll_notify(); halt HOT 4
- arm64 golang hello-wold fails to run on MacBook Air M1 HOT 2
- issue: assertion staging->end + min < size failed at /nanos/src/fs/tlog.c:427 in log_write_internal() HOT 1
- allow passing in network settings via kernel boot args for firecracker
- Much Slower Transfer Rate for HTTP Requests Compared to Native HOT 11
- Is the `memfd_create` syscall supported? HOT 4
- Missing `FUTEX_WAKE_BITSET` implementation HOT 2
- cannot enable executable stack as shared object requires: Permission denied HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nanos.