x86/mcheck: keep the banks past the end of the CMCI map polled
PATCH 1/1 x86/mcheck: keep the banks past the end of the CMCI map polled
bitmap_copy() copies whole words, so in set_poll_bankmask() it clears the banks past the end of the CMCI map that bitmap_fill() had just set, leaving them neither polled nor reported by CMCI. Set those bits after the copy instead.
--- xen/arch/x86/cpu/mcheck/mce.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
xen/arch/x86/cpu/mcheck/mce.c +7 -2
@@ -621,9 +621,14 @@ static void set_poll_bankmask(struct cpuinfo_x86 *c) {const struct mca_banks *cmci =per_cpu (no_cmci_banks, cpu); -if (unlikely (cmci->num < mb->num) ) -bitmap_fill (mb->bank_map, mb->num);bitmap_copy (mb->bank_map, cmci->bank_map,min (mb->num, cmci->num)); +/* +* Banks past the end of the CMCI map are not reported by CMCI +* either, so they need polling. Set them after the copy, which +* works in whole words and would otherwise clear them again. +*/ +if (unlikely (cmci->num < mb->num) ) +bitmap_set (mb->bank_map, cmci->num, mb->num - cmci->num); } else {
Signature · 1 line
2.47.3
Quoted 4 lines · Stefano Stabellini
bitmap_copy()copies whole words, so inset_poll_bankmask()it clears the banks past the end of the CMCI map thatbitmap_fill()had just set, leaving them neither polled nor reported by CMCI. Set those bits after the copy instead.
May I suggest
"bitmap_copy() copies whole words, so in set_poll_bankmask() it may clear
banks past the end of the CMCI map that bitmap_fill() may just have set, leaving them neither polled nor reported by CMCI. Set those bits after the copy instead."
Quoted 4 lines
Fixes 560cf418c845 ("x86/mcheck: allow varying bank counts per CPU")Signed-off-by Stefano Stabellini <[email protected]>Reviewed-by Jason Andryuk <[email protected]>Acked-by Roger Pau Monné <[email protected]>
No further tags needed, as it looks.
Jan
PATCH v2 1/1 x86/mcheck: keep the banks past the end of the CMCI map polled
In reply to Stefano Stabellinibitmap_copy() copies whole words, so in set_poll_bankmask() it may clear banks past the end of the CMCI map that bitmap_fill() may just have set, leaving them neither polled nor reported by CMCI. Set those bits after the copy instead.
---
v2:
- reword the commit message as suggested by Jan
--- xen/arch/x86/cpu/mcheck/mce.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
xen/arch/x86/cpu/mcheck/mce.c +7 -2
@@ -621,9 +621,14 @@ static void set_poll_bankmask(struct cpuinfo_x86 *c) {const struct mca_banks *cmci =per_cpu (no_cmci_banks, cpu); -if (unlikely (cmci->num < mb->num) ) -bitmap_fill (mb->bank_map, mb->num);bitmap_copy (mb->bank_map, cmci->bank_map,min (mb->num, cmci->num)); +/* +* Banks past the end of the CMCI map are not reported by CMCI +* either, so they need polling. Set them after the copy, which +* works in whole words and would otherwise clear them again. +*/ +if (unlikely (cmci->num < mb->num) ) +bitmap_set (mb->bank_map, cmci->num, mb->num - cmci->num); } else {
Signature · 1 line
2.47.3