Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: ARM: Update comments for kvm_handle_wfi

Update comments to reflect what is really going on and add the TWE bit
to the comments in kvm_arm.h.

Also renames the function to kvm_handle_wfx like is done on arm64 for
consistency and uber-correctness.

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>

+9 -6
+1
arch/arm/include/asm/kvm_arm.h
··· 57 57 * TSC: Trap SMC 58 58 * TSW: Trap cache operations by set/way 59 59 * TWI: Trap WFI 60 + * TWE: Trap WFE 60 61 * TIDCP: Trap L2CTLR/L2ECTLR 61 62 * BSU_IS: Upgrade barriers to the inner shareable domain 62 63 * FB: Force broadcast of all maintainance operations
+8 -6
arch/arm/kvm/handle_exit.c
··· 73 73 } 74 74 75 75 /** 76 - * kvm_handle_wfi - handle a wait-for-interrupts instruction executed by a guest 76 + * kvm_handle_wfx - handle a WFI or WFE instructions trapped in guests 77 77 * @vcpu: the vcpu pointer 78 78 * @run: the kvm_run structure pointer 79 79 * 80 - * Simply sets the wait_for_interrupts flag on the vcpu structure, which will 81 - * halt execution of world-switches and schedule other host processes until 82 - * there is an incoming IRQ or FIQ to the VM. 80 + * WFE: Yield the CPU and come back to this vcpu when the scheduler 81 + * decides to. 82 + * WFI: Simply call kvm_vcpu_block(), which will halt execution of 83 + * world-switches and schedule other host processes until there is an 84 + * incoming IRQ or FIQ to the VM. 83 85 */ 84 - static int kvm_handle_wfi(struct kvm_vcpu *vcpu, struct kvm_run *run) 86 + static int kvm_handle_wfx(struct kvm_vcpu *vcpu, struct kvm_run *run) 85 87 { 86 88 trace_kvm_wfi(*vcpu_pc(vcpu)); 87 89 if (kvm_vcpu_get_hsr(vcpu) & HSR_WFI_IS_WFE) ··· 95 93 } 96 94 97 95 static exit_handle_fn arm_exit_handlers[] = { 98 - [HSR_EC_WFI] = kvm_handle_wfi, 96 + [HSR_EC_WFI] = kvm_handle_wfx, 99 97 [HSR_EC_CP15_32] = kvm_handle_cp15_32, 100 98 [HSR_EC_CP15_64] = kvm_handle_cp15_64, 101 99 [HSR_EC_CP14_MR] = kvm_handle_cp14_access,