Commit graph

2,637 commits

Author SHA1 Message Date
Amaan Cheval
3471663d84 Add default profile for Debian (using debian-full Docker image) 2020-08-30 19:29:54 -05:00
Fabian
83febd1376 Remove duplicated constants (TLB_*) 2020-08-30 19:29:54 -05:00
Fabian
bf895ff1b2 profiler: Keep track of fast/slow path for jitted memory access 2020-08-30 19:29:54 -05:00
Fabian
b70a5c081a Allow fast path for memory reads from pages that contain code 2020-08-30 19:29:54 -05:00
Fabian
fcdda9487e handle_irqs: Do interrupt flag check from Rust 2020-08-30 19:29:54 -05:00
Fabian
36a46bca80 Remove non-faulting stat 2020-08-30 19:29:54 -05:00
Fabian
22ba923f9a Track number of module invalidations 2020-08-30 19:29:54 -05:00
Fabian
3cb7f7a0b4 Clean up casts of physical and virtual addresses 2020-08-30 19:29:54 -05:00
Fabian
8919079209 Print current state of has_flat_segmentation 2020-08-30 19:29:54 -05:00
Fabian
62dd6be561 Track missed entry points 2020-08-30 19:29:54 -05:00
Fabian
37c8459392 Clean up c2rust-generated profiler 2020-08-30 19:29:54 -05:00
Awal Garg
54151e2306 jit 0x0FBF 2020-08-30 19:29:54 -05:00
Awal Garg
0377e95c42 jit 0x0FB7 2020-08-30 19:29:54 -05:00
Ernest Wong
3773f0bfdf Filesystem tests: Increase memory size to 64MiB
OOM Killer was killing the processes.
2020-08-30 19:29:54 -05:00
Ernest Wong
e5a689ac2d Filesystem: Expand tests for hard links
Verify multiple hardlinks and verify nlinks counter.
2020-08-30 19:29:54 -05:00
Ernest Wong
40ed4f8dde Filesystem: Simplify nlinks management across filesystems
Now that hard links aren't allowed across filesystems, it's ok to store
the relevant nlinks information within local inode.

For mountpoints (forwarder inodes that point to a root inode), it is
possible to bump the nlinks of the forwarder during link_under_dir and
unlink_from_dir so that this nlinks counter is modified independently
from the real inode's nlinks counter.

For divert(), it is actually ok to divert forwarder inodes that point to
hardlinked files, so I've relaxed the assertion predicate.
2020-08-30 19:29:54 -05:00
Ernest Wong
66cf97e0a7 Filesystem: Tidy comments, clarify nlinks special case. 2020-08-30 19:29:54 -05:00
Ernest Wong
6c61d48c8f Filesystem: Fix typo with path concatenation during Rename 2020-08-30 19:29:54 -05:00
Ernest Wong
c3739fc22a 9p: Disable filename tracking by default 2020-08-30 19:29:54 -05:00
Ernest Wong
c7dda46de1 Filesystem: Disallow hardlinks across filesystems
Although hardlinks across filesystems worked quite well in the current
implementation, we will run into problems when we try to implement
different backends for each sub-filesystem.

Note: EPERM is used instead of EXDEV since the mv command will silently
try to use copy-and-unlink when rename(2) fails with EXDEV.

The rules for linking has been reverted back:
 - Before commit: Any inode, including forwarders, could be linked as
long as the parent is not a forwarder and is a directory.
 - After commit: Only non-forwarders and root-forwarders are allowed to
be linked, and must be linked under a directory and not a forwarder.
2020-08-30 19:29:54 -05:00
Ernest Wong
1a7dc59f07 9p: Track filename during RENAMEAT 2020-08-30 19:29:54 -05:00
Ernest Wong
0d885e5e8c 9p: put dbg_name into state and document its limitations 2020-08-30 19:29:54 -05:00
Ernest Wong
2560394855 Filesystem: set unlinked status on the real inode
The real_inode's status is supposedly set to STATUS_UNLINKED when there
are no more references to the inode from other directories. Previously,
this status was incorrectly applied to the forwarder and not the actual
real_inode.
2020-08-30 19:29:54 -05:00
Ernest Wong
0595c11740 Filesystem: fix nlinks counting for mountpoints 2020-08-30 19:29:54 -05:00
Ernest Wong
8f4fcfa6f7 9p: return correct error code for link and unlink 2020-08-30 19:29:54 -05:00
Ernest Wong
5aa5c88bf8 Filesystem state: restore onto existing configuration
Don't create new filesystems based off from state file.
Don't overwrite fs.baseurl
2020-08-30 19:29:54 -05:00
Ernest Wong
5b456b64cb 9p: don't rely on inode.name for debug messages 2020-08-30 19:29:54 -05:00
Ernest Wong
00b9ad683a Filesystem tests: don't rely on inode.name 2020-08-30 19:29:54 -05:00
Ernest Wong
d1519d4509 Filesystem: hard links, replace linked lists with Map.
Unfortunately, I didn't split this into multiple commits:

- Keeping track of nlinks is now all done by link_under_dir and
unlink_from_dir methods.

- Inodes are no longer associated with a name.

- Directory structure is now represented using a Map<name to idx>, so
the directory inode fully owns the directory entries instead a linked
list scattered across many inodes.

- The parameter order for FS#Link and FS#link_under_dir has been
modified to be consistent with 9p's: (dirid, fid, name)

- Allowed the movement of hardlinked files between filesystems
"vertically", as long as the target inode is reachable within the
filesystem and subfilesystems without ever having to traverse to the
parent filesystem.

- The methods FS#copy_inode and FS#divert does not put the filesystem in
an invalid state: FS#copy_inode does not modify inode.nlinks nor
inode.direntries, and FS#divert makes sure to delete the original nlinks
and direntries after it has been copied over to a new inode.

- Added extra assertions in FS#link_under_dir and FS#unlink_from_dir

- Forwarders should not be deleted upon unlink: the files are still
accessible.

- Non-root non-directory forwarders can now be linked under
non-forwarder directories for extra freedom for hardlinks. Now, the rule
for linking is: never link under a forwarder, and never link a directory
more than once.

Some tests and some 9p debug code is broken because they rely on
inode.name which no longer exists nor makes sense to exist.

Will fix in next commit.
2020-08-30 19:29:54 -05:00
Ernest Wong
d368ccf617 Add more tests for filesystem hardlinks 2020-08-30 19:29:54 -05:00
Fabian
1980a96093 popf: Warn on trap flag 2020-08-30 19:29:54 -05:00
Fabian
beaa54feda popf: Call handle_irqs only if interrupt flag is set from 0 to 1 2020-08-30 19:29:54 -05:00
Fabian
295985e8e0 Remove code section: Only a single buffer is used for generating code 2020-08-30 19:29:54 -05:00
Fabian
41b60d278c Accept builder in gen_jmp_rel16, simplifying 2020-08-30 19:29:54 -05:00
Fabian
d691b311a2 Simplify some code 2020-08-30 19:29:54 -05:00
Fabian
98d69c0bef Mark unimplemented instructions as block boundaries 2020-08-30 19:29:54 -05:00
Fabian
46f9bc9d00 Remove non-faulting property of instructions (all instructions are non-faulting) 2020-08-30 19:29:54 -05:00
Fabian
27a374e4fd Make warnings fatal in Rust test 2020-08-30 19:29:54 -05:00
Fabian
fa958d95c3 Fix warnings: Remove unused stuff 2020-08-30 19:29:54 -05:00
Fabian
841b528a04 Remove jit_dirty_cache_single in favour of jit_dirty_page 2020-08-30 19:29:54 -05:00
Fabian
456c4cbe65 mxcsr: Print warning only when bit is flipped & use constants 2020-08-30 19:29:54 -05:00
Fabian
26e6452c2c Fix mxcsr warning 2020-08-30 19:29:54 -05:00
Fabian
419ddf765a Remove some functions when profiler is disabled 2020-08-30 19:29:54 -05:00
Fabian
1a3c491647 More tests for rep {movs,stos}{b,d} 2020-08-30 19:29:54 -05:00
Fabian
d24972e3b5 {movs,stos}{b,d}: Call jit_dirty_cache once per page 2020-08-30 19:29:54 -05:00
Fabian
f182923bbd Page table accessed/dirty bits: Only write if necessary 2020-08-30 19:29:54 -05:00
Fabian
f1b50734c9 c2rust cleanup: Remove build system 2020-08-30 19:29:54 -05:00
Fabian
0a50a8474e c2rust cleanup: Remove unnecessary suffixes on numbers 2020-08-30 19:29:54 -05:00
Fabian
b5ed5f7c5b c2rust cleanup: Remove -> () 2020-08-30 19:29:54 -05:00
Fabian
cb80830881 c2rust cleanup: Enable mutable_transmutes warnings 2020-08-30 19:29:54 -05:00