Skip to content

Ignore XSTATE_BV when comparing XTEST XsaveArea #1641

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

Merged
merged 1 commit into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion crates/core_arch/src/x86/xsave.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ mod tests {
impl PartialEq<XsaveArea> for XsaveArea {
fn eq(&self, other: &XsaveArea) -> bool {
for i in 0..self.data.len() {
if self.data[i] != other.data[i] {
// Ignore XSTATE_BV (state-component bitmap) that occupies the first byte of the XSAVE Header
// (at offset 512 bytes from the start). The value may change, for more information see the following chapter:
// 13.7 OPERATION OF XSAVE - Intel® 64 and IA-32 Architectures Software Developer’s Manual.
if i != 512 && self.data[i] != other.data[i] {
return false;
}
}
Expand Down
5 changes: 4 additions & 1 deletion crates/core_arch/src/x86_64/xsave.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ mod tests {
impl PartialEq<XsaveArea> for XsaveArea {
fn eq(&self, other: &XsaveArea) -> bool {
for i in 0..self.data.len() {
if self.data[i] != other.data[i] {
// Ignore XSTATE_BV (state-component bitmap) that occupies the first byte of the XSAVE Header
// (at offset 512 bytes from the start). The value may change, for more information see the following chapter:
// 13.7 OPERATION OF XSAVE - Intel® 64 and IA-32 Architectures Software Developer’s Manual.
if i != 512 && self.data[i] != other.data[i] {
return false;
}
}
Expand Down