KVM: svm: Fix erratum 383 check for 32-bit hosts
PATCH 1/1 KVM: svm: Fix erratum 383 check for 32-bit hosts
From: Jan Kiszka <[email protected]>
This overflow should have left the check broken behind for 32-bit hosts.
--- arch/x86/kvm/svm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kvm/svm.c +1 -1
@@ -1460,7 +1460,7 @@ static bool is_erratum_383(void)/* Bit 62 may or may not be set for this mce */ value &= ~(1ULL <<62 ); -if (value !=0xb600000000010015 ) +if (value !=0xb600000000010015ULL )return false;/* Clear MCi_STATUS registers */
Signature · 1 line
1.6.0.2
Quoted 3 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
This overflow should have left the check broken behind for 32-bit hosts.
The check itself should work but it gives a compile warning for me (at least in my small userspace test I did ;) Good catch, thanks.
Quoted 1 line
Signed-off-by Jan Kiszka <[email protected]>
Quoted 20 lines
--- arch/x86/kvm/svm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/x86/kvm/svm.c +1
-1@@ -1460,7 +1460,7 @@ static bool is_erratum_383(void)/* Bit 62 may or may not be set for this mce */ value &= ~(1ULL <<62 ); -if (value !=0xb600000000010015 ) +if (value !=0xb600000000010015ULL )return false;/* Clear MCi_STATUS registers */ Signature · 1 line
1.6.0.2
Quoted 7 lines · Joerg
Quoted 3 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
This overflow should have left the check broken behind for 32-bit hosts.
The check itself should work but it gives a compile warning for me (at least in my small userspace test I did ;) Good catch, thanks.
To my understanding, the test degraded to value != 0x00010015. That may not have the intended effect, no?
Jan
Quoted 26 lines
Quoted 2 lines
Signed-off-by Jan Kiszka <[email protected]>Acked-by Joerg Roedel <[email protected]>Quoted 20 lines
--- arch/x86/kvm/svm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/x86/kvm/svm.c +1
-1@@ -1460,7 +1460,7 @@ static bool is_erratum_383(void)/* Bit 62 may or may not be set for this mce */ value &= ~(1ULL <<62 ); -if (value !=0xb600000000010015 ) +if (value !=0xb600000000010015ULL )return false;/* Clear MCi_STATUS registers */ Signature · 1 line
1.6.0.2
Quoted 11 lines · Jan Kiszka
Quoted 7 lines · Joerg
Quoted 3 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
This overflow should have left the check broken behind for 32-bit hosts.
The check itself should work but it gives a compile warning for me (at least in my small userspace test I did ;) Good catch, thanks.
To my understanding, the test degraded to value !=
0x00010015. That may not have the intended effect, no?
I tested this with a small test program in userspace (compiled with gcc -m32) and the check actually works. But I get a compile warning because the constant is too large for type long. So I think the check should work in the 32 bit kernel too.
Joerg