-
Notifications
You must be signed in to change notification settings - Fork 76
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
shared_pool_alloc: zero out allocated DMA buffers #267
Conversation
DMA buffers are expected to be zeroed out upon allocation MSFT#53036590
Rebasing on newest main |
@@ -36,7 +36,7 @@ use zerocopy::AsBytes; | |||
use zerocopy::FromBytes; | |||
|
|||
pub trait VfioDmaBuffer: 'static + Send + Sync { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just sanity checking, there's nothing else that implements this trait today?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Today it is LockedMemorySpawner and SharedPoolAllocator. Tomorrow also EmulatedDmaAllocator for unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do they all follow the new contract?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not what I asked though. We've added a new requirement to this method, we need to make sure all types that implement this trait are meeting the new requirement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All prod types do (LockedMemorySpawner
gets it by way of MAP_ANONYMOUS
). It seems that the test code does not?
calls:
pub fn alloc(&self, len: usize) -> Option<DmaBuffer> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #299
DMA buffers are expected to be zeroed out upon allocation
MSFT#53036590