Skip to contentSkip to conversation

MIPS: kvm: Fix build error with KVM_MIPS_DEBUG_COP0_COUNTERS enabled

PATCH Applied Thomas Bogendoerfer 2 participants 3 messages Jul 6, 2023 – Jul 7, 2023

Subsystems (3)
lore
Share & tools
lore

Thomas Bogendoerfer

author maintainer
#0 lore raw

PATCH 1/1 MIPS: kvm: Fix build error with KVM_MIPS_DEBUG_COP0_COUNTERS enabled

Commit e4de20576986 ("MIPS: KVM: Fix NULL pointer dereference") missed converting one place accessing cop0 registers, which results in a build error, if KVM_MIPS_DEBUG_COP0_COUNTERS is enabled.

Fixes e4de20576986 ("MIPS: KVM: Fix NULL pointer dereference")
---
 arch/mips/kvm/stats.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/kvm/stats.c +2 -2
index 53f851a61554..3e6682018fbe 100644
@@ -54,9 +54,9 @@ void kvm_mips_dump_stats(struct kvm_vcpu *vcpu)
 	kvm_info("\nKVM VCPU[%d] COP0 Access Profile:\n", vcpu->vcpu_id);
 	for (i = 0; i < N_MIPS_COPROC_REGS; i++) {
 		for (j = 0; j < N_MIPS_COPROC_SEL; j++) {
-			if (vcpu->arch.cop0->stat[i][j])
+			if (vcpu->arch.cop0.stat[i][j])
 				kvm_info("%s[%d]: %lu\n", kvm_cop0_str[i], j,
-					 vcpu->arch.cop0->stat[i][j]);
+					 vcpu->arch.cop0.stat[i][j]);
 		}
 	}
 #endif
Signature · 1 line
2.35.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Thomas Bogendoerfer

Commit e4de20576986 ("MIPS: KVM: Fix NULL pointer dereference") missed converting one place accessing cop0 registers, which results in a build error, if KVM_MIPS_DEBUG_COP0_COUNTERS is enabled.

Fixes e4de20576986 ("MIPS: KVM: Fix NULL pointer dereference")
---
  arch/mips/kvm/stats.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/kvm/stats.c +0 -0
index 53f851a61554..3e6682018fbe 100644
@@ -54,9 +54,9 @@ void kvm_mips_dump_stats(struct kvm_vcpu *vcpu)
  	kvm_info("\nKVM VCPU[%d] COP0 Access Profile:\n", vcpu->vcpu_id);

arch/mips/kvm/stats.c void kvm_mips_dump_stats(struct kvm_vcpu *vcpu) · line 62

Quoted 10 lines
arch/mips/kvm/stats.c +2 -2
  	for (i = 0; i < N_MIPS_COPROC_REGS; i++) {
  		for (j = 0; j < N_MIPS_COPROC_SEL; j++) {
-			if (vcpu->arch.cop0->stat[i][j])
+			if (vcpu->arch.cop0.stat[i][j])
  				kvm_info("%s[%d]: %lu\n", kvm_cop0_str[i], j,
-					 vcpu->arch.cop0->stat[i][j]);
+					 vcpu->arch.cop0.stat[i][j]);
  		}
  	}
  #endif

Oops, sorry I missed that :/

author maintainer Applied
#2 lore raw
In reply to Thomas Bogendoerfer
Quoted 28 lines · Thomas Bogendoerfer

Commit e4de20576986 ("MIPS: KVM: Fix NULL pointer dereference") missed converting one place accessing cop0 registers, which results in a build error, if KVM_MIPS_DEBUG_COP0_COUNTERS is enabled.

Fixes e4de20576986 ("MIPS: KVM: Fix NULL pointer dereference")
---
 arch/mips/kvm/stats.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/kvm/stats.c +2 -2
index 53f851a61554..3e6682018fbe 100644
@@ -54,9 +54,9 @@ void kvm_mips_dump_stats(struct kvm_vcpu *vcpu)
 	kvm_info("\nKVM VCPU[%d] COP0 Access Profile:\n", vcpu->vcpu_id);
 	for (i = 0; i < N_MIPS_COPROC_REGS; i++) {
 		for (j = 0; j < N_MIPS_COPROC_SEL; j++) {
-			if (vcpu->arch.cop0->stat[i][j])
+			if (vcpu->arch.cop0.stat[i][j])
 				kvm_info("%s[%d]: %lu\n", kvm_cop0_str[i], j,
-					 vcpu->arch.cop0->stat[i][j]);
+					 vcpu->arch.cop0.stat[i][j]);
 		}
 	}
 #endif
Signature · 1 line
2.35.3

applied to mips-next.

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]