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

atomic_bitmap: add capability to reset bits range #270

Merged
merged 2 commits into from
May 2, 2024

Conversation

russell-islam
Copy link
Contributor

@russell-islam russell-islam commented Nov 20, 2023

Currently, there is no implementation to reset a single bit or bit range for AtomicBitmap struct. This patch adds necessary function to reset a specific bit or a bit range. This use case is needed for Cloud-Hypervisor in managing page cache for Microsoft Hypervisor related to SEV-SNP guest. Rather than implementing a new one , it is helpful to add feature to this struct.

Summary of the PR

Please summarize here why the changes in this PR are needed.

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR are signed (with git commit -s), and the commit
    message has max 60 characters for the summary and max 75 characters for each
    description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

@russell-islam russell-islam force-pushed the muislam/reset-atomic-bitmap branch 2 times, most recently from 65d1d37 to 8711bdc Compare December 12, 2023 21:39
roypat
roypat previously approved these changes Dec 13, 2023
Copy link

@jinankjain jinankjain left a comment

Choose a reason for hiding this comment

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

LGTM

/// is for the page corresponding to `start_addr`, and the last bit that we set corresponds
/// to address `start_addr + len - 1`.
pub fn reset_addr_range(&self, start_addr: usize, len: usize) {
self.set_reset_addr_range(start_addr, len, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a nitpick, but it's a bit counter-intuitive in my opinion that the third argument being set to true means that the bits are set to zero, I would expect the opposite. Otherwise LGTM.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@00xc Fixed now

@russell-islam
Copy link
Contributor Author

@00xc Could you please take another look into this PR?

Currently, there is no implementation to reset a single
bit or bit range for AtomicBitmap struct. This patch adds
necessary function to reset a specific bit or a bit range.
This use case is needed for Cloud-Hypervisor in managing
page cache for Microsoft Hypervisor related to SEV-SNP
guest. Rather than implementing a new one , it is helpful
to add feature to this struct.

Signed-off-by: Muminul Islam <[email protected]>
@russell-islam russell-islam force-pushed the muislam/reset-atomic-bitmap branch from 4d4df5c to 172427a Compare January 17, 2024 20:53
@russell-islam
Copy link
Contributor Author

russell-islam commented Jan 24, 2024

@russell-islam
Copy link
Contributor Author

Pinging again: @alexandruag @bonzini @jiangliu

@roypat roypat merged commit ab4aaf0 into rust-vmm:main May 2, 2024
2 checks passed
@roypat roypat mentioned this pull request Sep 3, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants