lkml.org 
[lkml]   [2020]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch V4 15/15] x86/kvm: Use generic exit to guest work function
Date
Sean Christopherson <sean.j.christopherson@intel.com> writes:
> On Tue, Jul 21, 2020 at 12:57:21PM +0200, Thomas Gleixner wrote:
>> - if (signal_pending(current))
>> + if (__exit_to_guest_mode_work_pending())
>
> I whined about this back in v2[*]. "exit to guest mode" is confusing becuase
> virt terminology is "enter to guest" and "exit from guest", whereas the
> kernel's terminology here is "exit from kernel to guest".
>
> My past and current self still like XFER_TO_GUEST as the base terminology.
>
> [*] https://lkml.kernel.org/r/20191023144848.GH329@linux.intel.com

Forgot about that, sorry. Will fix.

>> @@ -8676,15 +8677,11 @@ static int vcpu_run(struct kvm_vcpu *vcp
>> break;
>> }
>>
>> - if (signal_pending(current)) {
>> - r = -EINTR;
>> - vcpu->run->exit_reason = KVM_EXIT_INTR;
>> - ++vcpu->stat.signal_exits;
>> - break;
>> - }
>> - if (need_resched()) {
>> + if (exit_to_guest_mode_work_pending()) {
>> srcu_read_unlock(&kvm->srcu, vcpu->srcu_idx);
>> - cond_resched();
>> + r = exit_to_guest_mode(vcpu);
>> + if (r)
>
> This loses the stat.signal_exits accounting. Maybe this?

No, it does not:

+ if (ti_work & _TIF_SIGPENDING) {
+ kvm_handle_signal_exit(vcpu);
+ return -EINTR;
+ }

and

+#ifdef CONFIG_KVM_EXIT_TO_GUEST_WORK
+static inline void kvm_handle_signal_exit(struct kvm_vcpu *vcpu)
+{
+ vcpu->run->exit_reason = KVM_EXIT_INTR;
+ vcpu->stat.signal_exits++;
+}
+#endif /* CONFIG_KVM_EXIT_TO_GUEST_WORK */

in patch 5/15

Thanks,

tglx

\
 
 \ /
  Last update: 2020-07-22 09:40    [W:0.077 / U:1.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site