mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86/hvm: Replace do_sched_op calls with their underlying logic
do_sched_op(SCHEDOP_yield) just calls vcpu_yield(). Remove the indirection through the hypercall handler and use the function directly. Export vcpu_block_enable_events() to perform the same for SCHEDOP_block. Not a functional change. Signed-off-by: Teddy Astie <teddy.astie@vates.tech> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Juergen Gross <jgross@suse.com>
This commit is contained in:
1 parent
ecce7970cf
commit
8af285ff79
6 files changed
+6
-5
No files matched your search
@@ -1736,7 +1736,7 @@ void hvm_hlt(unsigned int eflags)
|
|||||||
if ( unlikely(!(eflags & X86_EFLAGS_IF)) )
|
if ( unlikely(!(eflags & X86_EFLAGS_IF)) )
|
||||||
return hvm_vcpu_down(curr);
|
return hvm_vcpu_down(curr);
|
||||||
|
|
||||||
do_sched_op(SCHEDOP_block, guest_handle_from_ptr(NULL, void));
|
vcpu_block_enable_events();
|
||||||
|
|
||||||
TRACE(TRC_HVM_HLT, /* pending = */ vcpu_runnable(curr));
|
TRACE(TRC_HVM_HLT, /* pending = */ vcpu_runnable(curr));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2159,7 +2159,7 @@ static void svm_vmexit_do_pause(struct cpu_user_regs *regs)
|
|||||||
* Do something useful, like reschedule the guest
|
* Do something useful, like reschedule the guest
|
||||||
*/
|
*/
|
||||||
perfc_incr(pauseloop_exits);
|
perfc_incr(pauseloop_exits);
|
||||||
do_sched_op(SCHEDOP_yield, guest_handle_from_ptr(NULL, void));
|
vcpu_yield();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@@ -959,7 +959,7 @@ int viridian_hypercall(struct cpu_user_regs *regs)
|
|||||||
/*
|
/*
|
||||||
* See section 14.5.1 of the specification.
|
* See section 14.5.1 of the specification.
|
||||||
*/
|
*/
|
||||||
do_sched_op(SCHEDOP_yield, guest_handle_from_ptr(NULL, void));
|
vcpu_yield();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE:
|
case HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE:
|
||||||
|
|||||||
@@ -4768,7 +4768,7 @@ void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs)
|
|||||||
|
|
||||||
case EXIT_REASON_PAUSE_INSTRUCTION:
|
case EXIT_REASON_PAUSE_INSTRUCTION:
|
||||||
perfc_incr(pauseloop_exits);
|
perfc_incr(pauseloop_exits);
|
||||||
do_sched_op(SCHEDOP_yield, guest_handle_from_ptr(NULL, void));
|
vcpu_yield();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EXIT_REASON_XSETBV:
|
case EXIT_REASON_XSETBV:
|
||||||
|
|||||||
@@ -1430,7 +1430,7 @@ void vcpu_block(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vcpu_block_enable_events(void)
|
void vcpu_block_enable_events(void)
|
||||||
{
|
{
|
||||||
local_event_delivery_enable();
|
local_event_delivery_enable();
|
||||||
vcpu_block();
|
vcpu_block();
|
||||||
|
|||||||
@@ -1030,6 +1030,7 @@ static inline bool vcpu_cpu_dirty(const struct vcpu *v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void vcpu_block(void);
|
void vcpu_block(void);
|
||||||
|
void vcpu_block_enable_events(void);
|
||||||
void vcpu_unblock(struct vcpu *v);
|
void vcpu_unblock(struct vcpu *v);
|
||||||
|
|
||||||
void vcpu_pause(struct vcpu *v);
|
void vcpu_pause(struct vcpu *v);
|
||||||
|
|||||||