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

Serialization issue #87

Closed
IsaacDynamo opened this issue Mar 18, 2022 · 2 comments · Fixed by #140
Closed

Serialization issue #87

IsaacDynamo opened this issue Mar 18, 2022 · 2 comments · Fixed by #140

Comments

@IsaacDynamo
Copy link
Contributor

I don't use the serialize feature my self but the following use-case seems broken:

  • Serialization on machine A
  • Deserialization on machine B

Structs with a CpuIdReader member will return a mix of machine A and B features.

For example a RdtMonitoringInfo serialized on machine A and deserialized on machine B will return a mix of info. RdtMonitoringInfo::rmid_range() will return machine A info while RdtMonitoringInfo::l3_monitoring() will return machine B info.

@gz
Copy link
Owner

gz commented Mar 18, 2022

Agreed!
I fear this will likely happen in more places than just RdtMonitoringInfo.

A better solution for serialization/deserialization would probably be to just make CpuId serializeable (by reading all possible/reachable cpuid leafs) and storing/shipping that in a Vec<Vec<CpuIdResult>>. On deserialization a CpuId can be instantiated with with_cpuid_fn or similar function that then just reads from the Vec<Vec<CpuIdResult>>.

@gz
Copy link
Owner

gz commented Mar 18, 2022

Luckily I don't think there are many users of the serialize feature yet.

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 a pull request may close this issue.

2 participants