lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150526092240.4a74fa67@redhat.com>
Date:	Tue, 26 May 2015 09:22:40 -0400
From:	Luiz Capitulino <lcapitulino@...hat.com>
To:	Marcelo Tosatti <mtosatti@...hat.com>
Cc:	Owen Hofmann <osh@...gle.com>, Paolo Bonzini <pbonzini@...hat.com>,
	KVM General <kvm@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Sasha Levin <sasha.levin@...cle.com>
Subject: Re: [PATCH v2] KVM: x86: zero kvmclock_offset when vcpu0
 initializes kvmclock system MSR

On Sat, 23 May 2015 17:06:29 -0300
Marcelo Tosatti <mtosatti@...hat.com> wrote:

> Initialize kvmclock base, on kvmclock system MSR write time, 
> so that the guest sees kvmclock counting from zero.
> 
> This matches baremetal behaviour when kvmclock in guest
> sets sched clock stable.
> 
> Signed-off-by: Marcelo Tosatti <mtosatti@...hat.com>

Tested-by: Luiz Capitulino <lcapitulino@...hat.com>

> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index cc2c759..ea40d24 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -2188,6 +2188,8 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
>  					&vcpu->requests);
>  
>  			ka->boot_vcpu_runs_old_kvmclock = tmp;
> +
> +			ka->kvmclock_offset = -get_kernel_ns();
>  		}
>  
>  		vcpu->arch.time = data;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ