lkml.org 
[lkml]   [2021]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [v2 PATCH 3/4] x86/kvm: Add host side support for virtual suspend time injection
Date
On Fri, Aug 06 2021 at 19:07, Hikaru Nishida wrote:
>
> +#ifdef CONFIG_KVM_VIRT_SUSPEND_TIMING
> +void kvm_arch_timekeeping_inject_sleeptime(const struct timespec64 *delta)
> +{
> + struct kvm_vcpu *vcpu;
> + u64 suspend_time_ns;
> + struct kvm *kvm;
> + s64 adj;
> + int i;
> +
> + suspend_time_ns = timespec64_to_ns(delta);
> + adj = tsc_khz * (suspend_time_ns / 1000000);
> + /*
> + * Adjust TSCs on all vcpus and kvmclock as if they are stopped
> + * during host's suspension.
> + * Also, cummulative suspend time is recorded in kvm structure and
> + * the update will be notified via an interrupt for each vcpu.
> + */
> + mutex_lock(&kvm_lock);

This is invoked from with timekeeper_lock held with interrupts
disabled. How is a mutex_lock() supposed to work here?

Thanks,

tglx

\
 
 \ /
  Last update: 2021-08-10 17:25    [W:0.227 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site