|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH] viridian: Fix bank count counting
hv_vpset_nr_banks() incorrectly counts the number of bank by using hweight64()
instead of flsl(). This for instance problematic in case only the second bank
is selected (i.e >64 vCPUs, where here hweight64 gives 1), causing only the
first
bank to be checked (non-valid) and the second (meaningful) one to be skipped.
Fixes: b4124682db6e ("viridian: add ExProcessorMasks variants of the flush
hypercalls")
Signed-off-by: Teddy Astie <teddy.astie@xxxxxxxxxx>
---
xen/arch/x86/hvm/viridian/viridian.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xen/arch/x86/hvm/viridian/viridian.c
b/xen/arch/x86/hvm/viridian/viridian.c
index 90e749ceb5..f5e526241d 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -601,7 +601,7 @@ static DEFINE_PER_CPU(union hypercall_vpset,
hypercall_vpset);
static unsigned int hv_vpset_nr_banks(struct hv_vpset *vpset)
{
- return hweight64(vpset->valid_bank_mask);
+ return fls64(vpset->valid_bank_mask);
}
static int hv_vpset_to_vpmask(const struct hv_vpset *in, paddr_t bank_gpa,
--
2.51.2
--
Teddy Astie | Vates XCP-ng Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |