Skip to content

Commit 6c62985

Browse files
Waiman-Longbonzini
authored andcommitted
x86/paravirt: Change vcp_is_preempted() arg type to long
The cpu argument in the function prototype of vcpu_is_preempted() is changed from int to long. That makes it easier to provide a better optimized assembly version of that function. For Xen, vcpu_is_preempted(long) calls xen_vcpu_stolen(int), the downcast from long to int is not a problem as vCPU number won't exceed 32 bits. Signed-off-by: Waiman Long <longman@redhat.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 96794e4 commit 6c62985

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

arch/x86/include/asm/paravirt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ static __always_inline void pv_kick(int cpu)
673673
PVOP_VCALL1(pv_lock_ops.kick, cpu);
674674
}
675675

676-
static __always_inline bool pv_vcpu_is_preempted(int cpu)
676+
static __always_inline bool pv_vcpu_is_preempted(long cpu)
677677
{
678678
return PVOP_CALLEE1(bool, pv_lock_ops.vcpu_is_preempted, cpu);
679679
}

arch/x86/include/asm/qspinlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static inline void queued_spin_unlock(struct qspinlock *lock)
3434
}
3535

3636
#define vcpu_is_preempted vcpu_is_preempted
37-
static inline bool vcpu_is_preempted(int cpu)
37+
static inline bool vcpu_is_preempted(long cpu)
3838
{
3939
return pv_vcpu_is_preempted(cpu);
4040
}

arch/x86/kernel/kvm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ static void kvm_wait(u8 *ptr, u8 val)
589589
local_irq_restore(flags);
590590
}
591591

592-
__visible bool __kvm_vcpu_is_preempted(int cpu)
592+
__visible bool __kvm_vcpu_is_preempted(long cpu)
593593
{
594594
struct kvm_steal_time *src = &per_cpu(steal_time, cpu);
595595

arch/x86/kernel/paravirt-spinlocks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ bool pv_is_native_spin_unlock(void)
2020
__raw_callee_save___native_queued_spin_unlock;
2121
}
2222

23-
__visible bool __native_vcpu_is_preempted(int cpu)
23+
__visible bool __native_vcpu_is_preempted(long cpu)
2424
{
2525
return false;
2626
}

0 commit comments

Comments
 (0)