Skip to content

Commit 084071d

Browse files
matosattibonzini
authored andcommitted
KVM: rename KVM_REQ_PENDING_TIMER to KVM_REQ_UNBLOCK
KVM_REQ_UNBLOCK will be used to exit a vcpu from its inner vcpu halt emulation loop. Rename KVM_REQ_PENDING_TIMER to KVM_REQ_UNBLOCK, switch PowerPC to arch specific request bit. Signed-off-by: Marcelo Tosatti <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 57ab879 commit 084071d

File tree

6 files changed

+11
-6
lines changed

6 files changed

+11
-6
lines changed

Documentation/virt/kvm/vcpu-requests.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,12 @@ KVM_REQ_MMU_RELOAD
118118
necessary to inform each VCPU to completely refresh the tables. This
119119
request is used for that.
120120

121-
KVM_REQ_PENDING_TIMER
121+
KVM_REQ_UNBLOCK
122122

123-
This request may be made from a timer handler run on the host on behalf
124-
of a VCPU. It informs the VCPU thread to inject a timer interrupt.
123+
This request informs the vCPU to exit kvm_vcpu_block. It is used for
124+
example from timer handlers that run on the host on behalf of a vCPU,
125+
or in order to update the interrupt routing and ensure that assigned
126+
devices will wake up the vCPU.
125127

126128
KVM_REQ_UNHALT
127129

arch/powerpc/include/asm/kvm_host.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
/* PPC-specific vcpu->requests bit members */
5252
#define KVM_REQ_WATCHDOG KVM_ARCH_REQ(0)
5353
#define KVM_REQ_EPR_EXIT KVM_ARCH_REQ(1)
54+
#define KVM_REQ_PENDING_TIMER KVM_ARCH_REQ(2)
5455

5556
#include <linux/mmu_notifier.h>
5657

arch/x86/kvm/lapic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1669,7 +1669,7 @@ static void apic_timer_expired(struct kvm_lapic *apic, bool from_timer_fn)
16691669
}
16701670

16711671
atomic_inc(&apic->lapic_timer.pending);
1672-
kvm_make_request(KVM_REQ_PENDING_TIMER, vcpu);
1672+
kvm_make_request(KVM_REQ_UNBLOCK, vcpu);
16731673
if (from_timer_fn)
16741674
kvm_vcpu_kick(vcpu);
16751675
}

arch/x86/kvm/x86.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9501,7 +9501,7 @@ static int vcpu_run(struct kvm_vcpu *vcpu)
95019501
if (r <= 0)
95029502
break;
95039503

9504-
kvm_clear_request(KVM_REQ_PENDING_TIMER, vcpu);
9504+
kvm_clear_request(KVM_REQ_UNBLOCK, vcpu);
95059505
if (kvm_cpu_has_pending_timer(vcpu))
95069506
kvm_inject_pending_timer_irqs(vcpu);
95079507

include/linux/kvm_host.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static inline bool is_error_page(struct page *page)
147147
*/
148148
#define KVM_REQ_TLB_FLUSH (0 | KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP)
149149
#define KVM_REQ_MMU_RELOAD (1 | KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP)
150-
#define KVM_REQ_PENDING_TIMER 2
150+
#define KVM_REQ_UNBLOCK 2
151151
#define KVM_REQ_UNHALT 3
152152
#define KVM_REQUEST_ARCH_BASE 8
153153

virt/kvm/kvm_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2929,6 +2929,8 @@ static int kvm_vcpu_check_block(struct kvm_vcpu *vcpu)
29292929
goto out;
29302930
if (signal_pending(current))
29312931
goto out;
2932+
if (kvm_check_request(KVM_REQ_UNBLOCK, vcpu))
2933+
goto out;
29322934

29332935
ret = 0;
29342936
out:

0 commit comments

Comments
 (0)