Skip to contentSkip to conversation

RISC-V: KVM: use bitmap_zero() API

PATCH In review [email protected] 2 participants 3 messages May 6, 2023 – Jun 6, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RISC-V: KVM: use bitmap_zero() API

From: Ye Xingchen <[email protected]>

bitmap_zero() is faster than bitmap_clear(), so use bitmap_zero() instead of bitmap_clear().

---
 arch/riscv/kvm/tlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kvm/tlb.c +1 -1
index 0e5479600695..44bc324aeeb0 100644
@@ -296,7 +296,7 @@ static void make_xfence_request(struct kvm *kvm,
 	unsigned int actual_req = req;
 	DECLARE_BITMAP(vcpu_mask, KVM_MAX_VCPUS);
 
-	bitmap_clear(vcpu_mask, 0, KVM_MAX_VCPUS);
+	bitmap_zero(vcpu_mask, KVM_MAX_VCPUS);
 	kvm_for_each_vcpu(i, vcpu, kvm) {
 		if (hbase != -1UL) {
 			if (vcpu->vcpu_id < hbase)
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · On Sat, May 6, 2023 at 2:40?PM <[email protected]> wrote:

From: Ye Xingchen <[email protected]>

bitmap_zero() is faster than bitmap_clear(), so use bitmap_zero() instead of bitmap_clear().

Looks good to me.

Regards,
Anup

Quoted 19 lines
---
 arch/riscv/kvm/tlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kvm/tlb.c +1 -2
index 0e5479600695..44bc324aeeb0 100644
@@ -296,7 +296,7 @@ static void make_xfence_request(struct kvm *kvm,
        unsigned int actual_req = req;
        DECLARE_BITMAP(vcpu_mask, KVM_MAX_VCPUS);
 
-       bitmap_clear(vcpu_mask, 0, KVM_MAX_VCPUS);
+       bitmap_zero(vcpu_mask, KVM_MAX_VCPUS);
        kvm_for_each_vcpu(i, vcpu, kvm) {
                if (hbase != -1UL) {
                        if (vcpu->vcpu_id < hbase)
--

2.25.1

maintainer
#2 lore raw
In reply to [email protected]
Quoted 7 lines · On Sat, May 6, 2023 at 2:40?PM <[email protected]> wrote:

From: Ye Xingchen <[email protected]>

bitmap_zero() is faster than bitmap_clear(), so use bitmap_zero() instead of bitmap_clear().

Queued this patch for 6.5

Thanks,
Anup

Quoted 19 lines
---
 arch/riscv/kvm/tlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kvm/tlb.c +1 -2
index 0e5479600695..44bc324aeeb0 100644
@@ -296,7 +296,7 @@ static void make_xfence_request(struct kvm *kvm,
        unsigned int actual_req = req;
        DECLARE_BITMAP(vcpu_mask, KVM_MAX_VCPUS);
 
-       bitmap_clear(vcpu_mask, 0, KVM_MAX_VCPUS);
+       bitmap_zero(vcpu_mask, KVM_MAX_VCPUS);
        kvm_for_each_vcpu(i, vcpu, kvm) {
                if (hbase != -1UL) {
                        if (vcpu->vcpu_id < hbase)
--

2.25.1