Commit Graph

32 Commits

Author SHA1 Message Date
Nathaniel Wesley Filardo
4a4ca96125 Prepare for AAL bits / address_bits 2021-09-23 15:42:53 +01:00
Matthew Parkinson
f0e2ab702a Major refactor of snmalloc (#343)
# Pagemap
 
The Pagemap now stores all the meta-data for the object allocation. The meta-data in the pagemap is effectively a triple of the sizeclass, the remote allocator, and a pointer to a 64 byte block of meta-data for this chunk of memory. By storing the pointer to a block, it allows the pagemap to handle multiple slab sizes without branching on the fast path. There is one entry in the pagemap per 16KiB of address space, but by using the same entry in the pagemap for 4 adjacent entries, then we can treat a 64KiB range can be treated as a single slab of allocations.

This change also means there is almost no capability amplification required by the implementation on CHERI for finding meta-data. The only amplification is required, when we change the way a chunk is used to a size of object allocation.


# Backend

There is a second major aspect of the refactor that there is now a narrow API that abstracts the Pagemap, PAL and address space management. This should better enable the compartmentalisation and makes it easier to produce alternative backends for various research directions. This is a template parameter that can be used to specialised by the front-end in different ways.

# Thread local state

The thread local state has been refactored into two components, one (called 'localalloc') that is stored directly in the TLS and is constant initialised, and one that is allocated in the address space (called 'coreallloc') which is lazily created and pooled.

# Difference

This removes Superslabs/Medium slabs as there meta-data is now part of the pagemap.
2021-07-12 15:53:36 +01:00
Nathaniel Filardo
268ef2c059 SP: introduce AAL, PAL methods as per design doc
These capture the primitive architectural operations we are going to use.  At
the moment, since all AALs and PALs are not StrictProvenance, the only
implementations are stubs that just subvert the type system (but give us
something to compile against, going forward).
2021-04-09 12:39:29 +01:00
Nathaniel Filardo
db0ca64ff3 NFC: Add an AAL Concept, too
While here, pull out some constants to their own header.  Eventually we'll
want to match on AalFeatures in the AAL Concept.
2021-03-16 09:29:19 +00:00
Nathaniel Filardo
a6d18f842a NFC: Mark AAL methods noexcept 2021-03-16 09:29:19 +00:00
David CARLIER
2dd63606af Sparc support proposal. (#264)
* Sparc support proposal.

* Tweaks from feedback.
Shift to integer/pointers cast like other archs.
Assembly reworks.
Note apparently reading the register once is sufficient to provoke
a pause in the cpu adding a clobber tough.
2021-01-05 16:28:22 +00:00
David Carlier
3e7ea1a85f Fix ARM 32 bits build, prfm is a 64 bits instruction. 2020-12-02 16:39:55 +00:00
Matthew Parkinson
de0ab1dbe0 Remove iostream from ARM aal.
The ARM AAL was including `<iostream>`, this is unnecessary, and only
`<cstddef>` should be required for `size_t`.
2020-05-26 11:16:43 +01:00
Nathaniel Filardo
37766588de Linux PowerPC port 2020-05-23 15:42:10 +00:00
Nathaniel Filardo
b2ee1902dc AAL: add AalName and smallest_page_size 2020-05-23 15:42:10 +00:00
Matthew Parkinson
fbbc2ddb76 Merge pull request #191 from nwf/aal-address_t
Allow the AAL to define address_t
2020-05-23 08:26:29 +01:00
Matthew Parkinson
97e695bedc Merge pull request #193 from nwf/aal-strict-provenance
Introduce AAL StrictProvenance flag, factor CDLList
2020-05-21 17:09:54 +01:00
Amaury Chamayou
8dad07f692 Make up for the lack of intrinsic headers in Open Enclave (#195) 2020-05-21 17:04:12 +01:00
Nathaniel Filardo
4b7ee7808b AAL: new StrictProvenance feature flag 2020-05-21 12:43:38 +00:00
Nathaniel Filardo
7b296a91fa Let the AAL define address_t. 2020-05-20 14:36:06 +00:00
Amaury Chamayou
e92fef6e63 ARM CI (#148)
* Add ARM setup

* Factor what can be into common scripts
2020-03-20 08:07:12 +00:00
Matthew Parkinson
f301fdd2a0 Added SGX AAL. (#149) 2020-03-19 15:07:29 +00:00
Matthew Parkinson
4246d9a065 Workaround for QEMU behaviour. (#147)
* Fixes for ARM

* Workaround for QEMU behaviour.
2020-03-19 12:37:44 +00:00
Matthew Parkinson
0e1a7051f8 Improve constexpr failure case. 2020-03-18 14:49:34 +00:00
Matthew Parkinson
1352b28e82 Typo aarch64 2020-03-18 14:49:20 +00:00
Matthew Parkinson
04909305aa Update src/aal/aal_arm.h 2020-03-17 12:28:14 +00:00
David Carlier
55f1237df9 Few build tweaks. 2020-03-17 12:16:21 +00:00
David Carlier
c6baa0baa3 using C++11 api instead for fallback call. 2020-03-17 10:08:17 +00:00
David Carlier
e611b325ce Last tweaks 2020-03-16 18:59:51 +00:00
David Carlier
6b8650e4ce Using fallback when the (none)feature bit is present. 2020-03-13 16:46:16 +00:00
David Carlier
e7f020cf76 implementations moved on the composer class. 2020-03-13 15:39:49 +00:00
David Carlier
2d4f2c3867 AAL, basic arm implementation proposal. 2020-03-13 08:09:14 +00:00
Nathaniel Filardo
0d6f708166 AAL: feature flags 2019-12-05 11:19:48 +00:00
Nathaniel Filardo
ef40f1cf1d Replace "AAL" type with "Aal" to parallel "Pal" 2019-12-04 16:56:28 +00:00
David Chisnall
d83828c537 [NFC] Appease clang-tidy. 2019-07-10 11:22:24 +01:00
David Chisnall
ccaae50dd4 Explicitly include cstdint in the AAL.
This is not necessary with libc++ platforms because of some header
pollution, but is necessary everywhere else.
2019-07-10 11:05:55 +01:00
David Chisnall
7eabea01d6 Add an Architecture Abstraction Layer.
Currently, we support one architecture, but this provides a layer for
adding other architectures without adding more nested `#ifdef`s.

Fixes #42
2019-07-10 10:42:59 +01:00