Ignore XSTATE_BV when comparing XTEST XsaveArea

This commit is contained in:
Martin Liska 2024-09-21 14:25:20 +02:00 committed by Amanieu d'Antras
parent d6f40ec495
commit 04f4ca9680
2 changed files with 8 additions and 2 deletions

View file

@ -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 Developers Manual.
if i != 512 && self.data[i] != other.data[i] {
return false;
}
}

View file

@ -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 Developers Manual.
if i != 512 && self.data[i] != other.data[i] {
return false;
}
}