]> git.baikalelectronics.ru Git - kernel.git/commitdiff
KVM: PPC: Book3S HV: Add a new config for P8 debug timing
authorFabiano Rosas <farosas@linux.ibm.com>
Wed, 25 May 2022 13:05:51 +0000 (10:05 -0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 29 Jun 2022 09:21:21 +0000 (19:21 +1000)
Turn the existing Kconfig KVM_BOOK3S_HV_EXIT_TIMING into
KVM_BOOK3S_HV_P8_TIMING in preparation for the addition of a new
config for P9 timings.

This applies only to P8 code, the generic timing code is still kept
under KVM_BOOK3S_HV_EXIT_TIMING.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220525130554.2614394-3-farosas@linux.ibm.com
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kvm/Kconfig
arch/powerpc/kvm/book3s_hv_rmhandlers.S

index eec536aef83a5bdf67add50b72e44685ea2df33d..8c10f536e47891abf3051234e1fae42ebccdc51f 100644 (file)
@@ -379,7 +379,7 @@ int main(void)
        OFFSET(VCPU_SPRG2, kvm_vcpu, arch.shregs.sprg2);
        OFFSET(VCPU_SPRG3, kvm_vcpu, arch.shregs.sprg3);
 #endif
-#ifdef CONFIG_KVM_BOOK3S_HV_EXIT_TIMING
+#ifdef CONFIG_KVM_BOOK3S_HV_P8_TIMING
        OFFSET(VCPU_TB_RMENTRY, kvm_vcpu, arch.rm_entry);
        OFFSET(VCPU_TB_RMINTR, kvm_vcpu, arch.rm_intr);
        OFFSET(VCPU_TB_RMEXIT, kvm_vcpu, arch.rm_exit);
index ddd88179110a096f3cb06ec1b92aed6715754001..73f8277df7d193648e4a4c85dd1cb3462908c32c 100644 (file)
@@ -128,7 +128,11 @@ config KVM_BOOK3S_64_PR
          and system calls on the host.
 
 config KVM_BOOK3S_HV_EXIT_TIMING
-       bool "Detailed timing for hypervisor real-mode code"
+       bool
+
+config KVM_BOOK3S_HV_P8_TIMING
+       bool "Detailed timing for hypervisor real-mode code (for POWER8)"
+       select KVM_BOOK3S_HV_EXIT_TIMING
        depends on KVM_BOOK3S_HV_POSSIBLE && DEBUG_FS
        help
          Calculate time taken for each vcpu in the real-mode guest entry,
index 0fc0e68d20d063b109f31f323e0867915835bced..7ded202bf9959978af0eb0284f5e96c02c8c5c08 100644 (file)
@@ -237,14 +237,14 @@ kvm_novcpu_wakeup:
        cmpdi   r4, 0
        beq     kvmppc_primary_no_guest
 
-#ifdef CONFIG_KVM_BOOK3S_HV_EXIT_TIMING
+#ifdef CONFIG_KVM_BOOK3S_HV_P8_TIMING
        addi    r3, r4, VCPU_TB_RMENTRY
        bl      kvmhv_start_timing
 #endif
        b       kvmppc_got_guest
 
 kvm_novcpu_exit:
-#ifdef CONFIG_KVM_BOOK3S_HV_EXIT_TIMING
+#ifdef CONFIG_KVM_BOOK3S_HV_P8_TIMING
        ld      r4, HSTATE_KVM_VCPU(r13)
        cmpdi   r4, 0
        beq     13f
@@ -523,7 +523,7 @@ kvmppc_hv_entry:
        li      r6, KVM_GUEST_MODE_HOST_HV
        stb     r6, HSTATE_IN_GUEST(r13)
 
-#ifdef CONFIG_KVM_BOOK3S_HV_EXIT_TIMING
+#ifdef CONFIG_KVM_BOOK3S_HV_P8_TIMING
        /* Store initial timestamp */
        cmpdi   r4, 0
        beq     1f
@@ -894,7 +894,7 @@ fast_guest_return:
        li      r9, KVM_GUEST_MODE_GUEST_HV
        stb     r9, HSTATE_IN_GUEST(r13)
 
-#ifdef CONFIG_KVM_BOOK3S_HV_EXIT_TIMING
+#ifdef CONFIG_KVM_BOOK3S_HV_P8_TIMING
        /* Accumulate timing */
        addi    r3, r4, VCPU_TB_GUEST
        bl      kvmhv_accumulate_time
@@ -945,7 +945,7 @@ secondary_too_late:
        cmpdi   r4, 0
        beq     11f
        stw     r12, VCPU_TRAP(r4)
-#ifdef CONFIG_KVM_BOOK3S_HV_EXIT_TIMING
+#ifdef CONFIG_KVM_BOOK3S_HV_P8_TIMING
        addi    r3, r4, VCPU_TB_RMEXIT
        bl      kvmhv_accumulate_time
 #endif
@@ -959,7 +959,7 @@ hdec_soon:
        li      r12, BOOK3S_INTERRUPT_HV_DECREMENTER
 12:    stw     r12, VCPU_TRAP(r4)
        mr      r9, r4
-#ifdef CONFIG_KVM_BOOK3S_HV_EXIT_TIMING
+#ifdef CONFIG_KVM_BOOK3S_HV_P8_TIMING
        addi    r3, r4, VCPU_TB_RMEXIT
        bl      kvmhv_accumulate_time
 #endif
@@ -1056,7 +1056,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
        li      r0, MSR_RI
        mtmsrd  r0, 1
 
-#ifdef CONFIG_KVM_BOOK3S_HV_EXIT_TIMING
+#ifdef CONFIG_KVM_BOOK3S_HV_P8_TIMING
        addi    r3, r9, VCPU_TB_RMINTR
        mr      r4, r9
        bl      kvmhv_accumulate_time
@@ -1135,7 +1135,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
 
 guest_exit_cont:               /* r9 = vcpu, r12 = trap, r13 = paca */
 
-#ifdef CONFIG_KVM_BOOK3S_HV_EXIT_TIMING
+#ifdef CONFIG_KVM_BOOK3S_HV_P8_TIMING
        addi    r3, r9, VCPU_TB_RMEXIT
        mr      r4, r9
        bl      kvmhv_accumulate_time
@@ -1495,7 +1495,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
        mtspr   SPRN_LPCR,r8
        isync
 
-#ifdef CONFIG_KVM_BOOK3S_HV_EXIT_TIMING
+#ifdef CONFIG_KVM_BOOK3S_HV_P8_TIMING
        /* Finish timing, if we have a vcpu */
        ld      r4, HSTATE_KVM_VCPU(r13)
        cmpdi   r4, 0
@@ -2153,7 +2153,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_TM)
        ld      r4, HSTATE_KVM_VCPU(r13)
        std     r3, VCPU_DEC_EXPIRES(r4)
 
-#ifdef CONFIG_KVM_BOOK3S_HV_EXIT_TIMING
+#ifdef CONFIG_KVM_BOOK3S_HV_P8_TIMING
        ld      r4, HSTATE_KVM_VCPU(r13)
        addi    r3, r4, VCPU_TB_CEDE
        bl      kvmhv_accumulate_time
@@ -2221,7 +2221,7 @@ kvm_end_cede:
        /* get vcpu pointer */
        ld      r4, HSTATE_KVM_VCPU(r13)
 
-#ifdef CONFIG_KVM_BOOK3S_HV_EXIT_TIMING
+#ifdef CONFIG_KVM_BOOK3S_HV_P8_TIMING
        addi    r3, r4, VCPU_TB_RMINTR
        bl      kvmhv_accumulate_time
 #endif
@@ -2961,7 +2961,7 @@ kvmppc_fix_pmao:
        isync
        blr
 
-#ifdef CONFIG_KVM_BOOK3S_HV_EXIT_TIMING
+#ifdef CONFIG_KVM_BOOK3S_HV_P8_TIMING
 /*
  * Start timing an activity
  * r3 = pointer to time accumulation struct, r4 = vcpu