-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upstream virtio block, refactor libuio, and fix virtio block descriptor chain parsing #128
Open
erichchan999
wants to merge
9
commits into
main
Choose a base branch
from
upstream_blk
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nvm haven't tested this on odroidc4 yet, will be drafting it. |
erichchan999
force-pushed
the
upstream_blk
branch
from
October 3, 2024 04:07
e408527
to
d3075cb
Compare
|
erichchan999
force-pushed
the
upstream_blk
branch
from
October 4, 2024 05:24
d3075cb
to
ccc8372
Compare
Closed
erichchan999
force-pushed
the
upstream_blk
branch
2 times, most recently
from
October 24, 2024 02:24
df313d3
to
8bb4870
Compare
erichchan999
force-pushed
the
upstream_blk
branch
from
October 31, 2024 06:27
4344338
to
8d3f665
Compare
erichchan999
changed the title
Upstream virtio block and fix descriptor chain parsing
Upstream virtio block, refactor libuio, and fix virtio block descriptor chain parsing
Nov 1, 2024
Ivan-Velickovic
force-pushed
the
upstream_blk
branch
3 times, most recently
from
November 7, 2024 01:31
7a066c4
to
4435cab
Compare
… chain parsing Signed-off-by: Eric Chan <[email protected]>
Signed-off-by: Eric Chan <[email protected]>
Signed-off-by: Eric Chan <[email protected]>
Signed-off-by: Eric Chan <[email protected]>
Signed-off-by: Eric Chan <[email protected]>
Signed-off-by: Eric Chan <[email protected]>
Signed-off-by: Eric Chan <[email protected]>
Signed-off-by: Eric Chan <[email protected]>
Signed-off-by: Eric Chan <[email protected]>
erichchan999
force-pushed
the
upstream_blk
branch
from
November 12, 2024 05:51
4435cab
to
67836a6
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR upstreams the block virtualiser changes where offsets are converted to io addresses. It also fixes a bug in virtio block to do with descriptor chain parsing.
Libuio also has a really annoying restriction: it doesn't allow you to specify more than 5 mappings. Meanwhile this example makes use of 9 mappings. I've added a (arguably hacky) workaround in libuio to allow more than uio device so that we can have more mappings. The interrupts from the extra uio devices are ignored.
Libuio used to rely on acking interrupts as a way to both ack+enable and as a point of entry into the VMM, which allowed the VMM to then signal other components. The signalling part has now been decoupled from the ack+enable. uio drivers can signal the virtualiser by writing into a registered memory region which will trap into the VMM. I've introduced uio files into the libvmm source directory to conveniently manage this. But I can see that if we don't wish to couple the libvmm repo with a specific linux module then we can leave this implementation to each example.
To upstream the issue with offsets, there needs to be a way to propagate the base physical addresses of data regions into the linux uio driver, so that the driver can convert these physical addresses back to offsets. This is because there doesn't seem to be a way to access memory from linux userspace when only given its physical address. I've added a new memory region for this purpose. It is shared between the VMM and the uio driver via a new mapping. The VMM will contain the elf-patched physical address of the data regions, it will then populate this shared mapping for uio driver to see.
Libuio used to be implemented with an event loop that only blocks on the interrupt from the uio device file descriptor. There seems to be a need to wake up the event loop handler based on multiple different events (as is seen in uio_net which needs to wait on a network socket), so the implementation has been changed to make use of epoll. Each individual driver can register a file descriptor to this epoll.
Virtio block does not guarantee the header/body/footer sections of the request are in separate descriptors. I've changed the request and response parsing logic to account for this.
libuio changes were made in conjunction with @dreamliner787-9