Skip to content
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

Replace MTD flash drives with PMEM drives #32

Merged
merged 2 commits into from
Oct 10, 2023
Merged

Replace MTD flash drives with PMEM drives #32

merged 2 commits into from
Oct 10, 2023

Conversation

edubart
Copy link
Contributor

@edubart edubart commented Oct 5, 2023

@edubart edubart self-assigned this Oct 5, 2023
@edubart edubart added the enhancement New feature or request label Oct 5, 2023
@@ -55,6 +55,7 @@ CONFIG_EXT2_FS_SECURITY=y
CONFIG_EXT4_FS=y
# CONFIG_PROC_PAGE_MONITOR is not set
CONFIG_TMPFS=y
CONFIG_HUGETLBFS=y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this screw with our TLB implementation?

Copy link
Contributor Author

@edubart edubart Oct 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problems with this, we can use 2MB pages without problems even while only supporting 4KB pages in our TLB, because we have a conservative implementation of TLB that shootdown more than it could. And I already have tested this for a while now.

Actually this config is orthogonal to this PR and the init system, but it is used in World Arcade, and other dapps I am coding. I think we should enable this by default because it enables a way to map fixed physical pages to virtual memory in userspace with minimal overhead, useful for some advanced dapps that needs to write/read to programs in userspace from outside.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using huge pages for this feels like a hack. You could use UIO for this instead.

  • You can have physically mapped memory into you dapp, emulator defines to where (via dtb).
  • Optionally have multiple separate regions.
  • Of arbitrary sizes.

It requires a dtb entry and the CONFIG_UIO and CONFIG_UIO_PDRV_GENIRQ kernel configs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a hack until we have a better way to do this, could be with custom DTB entries like you said, but this will require a new emulator feature to insert custom entries in DTB.

Copy link
Contributor

@diegonehab diegonehab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See question about TLB.

@edubart edubart requested a review from diegonehab October 6, 2023 17:19
@edubart edubart merged commit bed47c6 into main Oct 10, 2023
1 check passed
@edubart edubart deleted the feature/new-init branch October 10, 2023 19:57
@vfusco vfusco added this to the v0.19.0 milestone Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants