Comments (2)
More generally speaking, what this issue wants to solve is
- if X is in use, Y must not be freed.
For example, there are multiple RECs in use, the associated RD must not be destroyed even when RMI_REALM_DESTROY called. (error code: RMI_ERROR_IN_USE)
The cases in this category are:
- RD (REALM_DESTROY): If there are other instances (e.g., Rec) that points to an RD, the RD should not be destroyed.
- REC (REC_DESTROY): If there are other instances (e.g., Run) that points an REC, the REC should not be destroyed.
from islet.
More concrete scenario:
(1) Create Rd
(2) Create Rec
(3) Destroy Rd --> Check if this Rd's reference count is 1 by (2).
Possible approaches to do:
(1)
// (1) pub struct Rec
pub struct Rec {
rd: usize, // the physical address of rd.
vcpuid: usize,
ripas: Ripas,
id: id, // we can use this ID as it's guranteed "rd" will not be destroyed as long as this Rec is in use.
}
// (2) we can put "Rec" inside "Granule"
// (3) get Rec (getter)
:: API-style-1
get_granule_object(addr, Rec (type?)) {
// 1. check if the granule at addr is valid and Rec.
// 2. If so, it returns something like "PointerMutGuard" in which it is able to directly maps "struct Rec".
// -- it increases Rec's reference count itself
// -- in order to avoid being destroyed when REC_DESTROY called.
// -- after guard ends, it decreases Rec's reference count.
}
:: API-style-2
GranuleObjectPointer --> it's like HostPointer but related to granule object (Rd/Rec/Run/Data/...)
// can we reuse "HostPointer" for both HostPointer and GranuleObjectPointer, it seems possible.
pub struct GranuleObjectPointer<T> { // T: struct Rec, struct Rd, ...
/// pointer to physical region
ptr: *const T, // struct Rec, struct Rd,
/// page_map to map or unmap `ptr` in RMM
page_map: PageMap, // --> is it needed??
}
pub fn validate<'a>(&'a self) -> Option<GranuleObjectPointerGuard<'a, T>> {
// 1. check if the granule at addr is valid and Rec.
get_granule(...) // per-struct Accessor needed??? Accessor for Rec...
if is_valid() {
increment_reference_count(granule);
return Guard;
}
}
fn drop(&mut self) {
decrement_reference_count();
}
--> it seems fitting in "temporal access" nicely, but not sure for "long-lived ones, like Rec, Rd".
--> for long-lived structs, who holds "GranuleObjectPointerGuard"?
from islet.
Related Issues (20)
- A secure yet efficient way to access from child (Rec) to parent (Rd) HOT 4
- rust-rsi issue & SDK problem HOT 6
- Running islet with --normal-world=linux-net breaks network configuration on the host HOT 4
- Network is not configured on the realm HOT 5
- Compilation fails due to the latest switch from rsa to openssl HOT 1
- The list of code patterns where verification does not work well HOT 1
- Transfer projects from samsung/islet* to islet-projects/islet* HOT 1
- Rule checker workflow is failing on the main branch HOT 1
- Islet-cli segfaults, when launched from /shared folder with rmm=islet HOT 11
- Insert autopadding HOT 1
- Reproduce veraison demo HOT 5
- How to get a CCA machine or simulate CCA chip on X86_64? HOT 1
- RTT_INIT_RIPAS error due to some garbage in the delegated granule for RTT. HOT 1
- Failed to reproduce confidential-ml example HOT 1
- RMM v1.0-eac5 support HOT 1
- autopadding: Cannot cover struct type with a field in the struct
- Failure of unsafe-analyzer analysis
- Mentorship Opportunity for CCC Projects
- realm measurement using veraison HOT 9
- Issues with safety traits and interrupting attestation
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 islet.