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

mm/validate: fully migrate and clear bitmap & other cleanups #134

Merged
merged 3 commits into from
Nov 23, 2023

Conversation

00xc
Copy link
Member

@00xc 00xc commented Oct 17, 2023

  • Remove useless pub on ValidBitmap methods.
  • Fix: if the number of pages in the bitmap was not a multiple of 64, the remainder would not be copied over to the new bitmap during migration, which could lead to tracking validated pages as invalid.
  • Use an usize to index into the bitmap, as offsets are always positive.
  • Fully clear the bitmap after initialization.

@00xc 00xc changed the title mm/validate: fully migrate bitmap & minor cleanups mm/validate: fully migrate and clear bitmap & other cleanups Oct 17, 2023
src/mm/validate.rs Outdated Show resolved Hide resolved
@00xc
Copy link
Member Author

00xc commented Oct 27, 2023

@joergroedel I think this is ready to be merged

@joergroedel
Copy link
Member

@00xc This breaks make test-in-svsm. Can you please have a look?

@joergroedel
Copy link
Member

Bisection points at

commit 9e5d903b2d940bf2e81cfbf305582af7e35591fd (HEAD)
Author: Carlos López <carlos.lopez@suse.com>
Date:   Tue Oct 17 14:35:44 2023 +0200

    mm/validate: use usize instead of isize to index into the bitmap
    
    The offsets are always positive from the start of the bitmap, so use
    an unsigned type.
    
    Signed-off-by: Carlos López <carlos.lopez@suse.com>

@00xc
Copy link
Member Author

00xc commented Nov 21, 2023

Bisection points at

commit 9e5d903b2d940bf2e81cfbf305582af7e35591fd (HEAD)
Author: Carlos López <carlos.lopez@suse.com>
Date:   Tue Oct 17 14:35:44 2023 +0200

    mm/validate: use usize instead of isize to index into the bitmap
    
    The offsets are always positive from the start of the bitmap, so use
    an unsigned type.
    
    Signed-off-by: Carlos López <carlos.lopez@suse.com>

Only happens in debug builds, so I suspect some debug assertion is being triggered.

@00xc
Copy link
Member Author

00xc commented Nov 21, 2023

I'm working on a bigger rework of the bitmap to increase safety.

00xc added 3 commits November 21, 2023 17:19
Remove useless pub identifiers on methods on the private ValidBitmap
struct.

Signed-off-by: Carlos López <carlos.lopez@suse.com>
If the number of pages in the bitmap was not a multiple of 64, the
remainder would not be copied over to the new bitmap during
migration, which could lead to tracking validated pages as invalid.

Signed-off-by: Carlos López <carlos.lopez@suse.com>
The offsets are always positive from the start of the bitmap, so use
an unsigned type.

Signed-off-by: Carlos López <carlos.lopez@suse.com>
@00xc
Copy link
Member Author

00xc commented Nov 21, 2023

Turns out my assumption on 498b599 was wrong, things should work now. I'll push my rework of the bitmap to a separate PR.

@joergroedel joergroedel merged commit 3f53bc2 into coconut-svsm:main Nov 23, 2023
2 checks passed
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.

3 participants