@@ -673,7 +673,7 @@ long do_xenpmu_op(
{
if ( (pmu_params.val &
~(XENPMU_MODE_SELF | XENPMU_MODE_HV | XENPMU_MODE_ALL)) ||
- (hweight64(pmu_params.val) > 1) )
+ multiple_bits_set(pmu_params.val) )
return -EINVAL;
/* 32-bit dom0 can only sample itself. */
@@ -467,12 +467,14 @@ static bool is_multicast_dest(struct vlapic *vlapic, unsigned int short_hand,
return short_hand != APIC_DEST_SELF;
if ( vlapic_x2apic_mode(vlapic) )
- return dest_mode ? hweight16(dest) > 1 : dest == 0xffffffffU;
+ return dest_mode ? multiple_bits_set((uint16_t)dest)
+ : dest == 0xffffffffU;
if ( dest_mode )
- return hweight8(dest &
- GET_xAPIC_DEST_FIELD(vlapic_get_reg(vlapic,
- APIC_DFR))) > 1;
+ {
+ dest &= GET_xAPIC_DEST_FIELD(vlapic_get_reg(vlapic, APIC_DFR));
+ return multiple_bits_set((uint8_t)dest);
+ }
return dest == 0xff;
}
@@ -546,7 +546,7 @@ static int __init numa_emulation(unsigned long start_pfn,
uint64_t sz = pfn_to_paddr(end_pfn - start_pfn) / numa_fake;
/* Kludge needed for the hash function */
- if ( hweight64(sz) > 1 )
+ if ( multiple_bits_set(sz) )
{
uint64_t x = 1;