From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754437AbbKLS6z (ORCPT ); Thu, 12 Nov 2015 13:58:55 -0500 Received: from relay.parallels.com ([195.214.232.42]:35866 "EHLO relay.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751471AbbKLS6x (ORCPT ); Thu, 12 Nov 2015 13:58:53 -0500 Subject: Re: [PATCH 1/1] drivers/hv: correct tsc page sequence invalid value To: KY Srinivasan References: <1446464063-25755-1-git-send-email-den@openvz.org> <56443CC3.5010002@openvz.org> CC: "rkagan@virtuozzo.com" , "devel@linuxdriverproject.org" , "linux-kernel@vger.kernel.org" , Andrey Smetanin , Haiyang Zhang , Vitaly Kuznetsov From: "Denis V. Lunev" Message-ID: <5644E123.60202@openvz.org> Date: Thu, 12 Nov 2015 21:57:39 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: US-EXCH.sw.swsoft.com (10.255.249.47) To MSK-EXCH1.sw.swsoft.com (10.67.48.55) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/12/2015 08:35 PM, KY Srinivasan wrote: > >> -----Original Message----- >> From: Denis V. Lunev [mailto:den@openvz.org] >> Sent: Wednesday, November 11, 2015 11:16 PM >> To: KY Srinivasan >> Cc: rkagan@virtuozzo.com; devel@linuxdriverproject.org; linux- >> kernel@vger.kernel.org; Andrey Smetanin ; >> Haiyang Zhang ; Vitaly Kuznetsov >> >> Subject: Re: [PATCH 1/1] drivers/hv: correct tsc page sequence invalid value >> >> On 11/02/2015 10:42 PM, KY Srinivasan wrote: >>>> -----Original Message----- >>>> From: Denis V. Lunev [mailto:den@openvz.org] >>>> Sent: Monday, November 2, 2015 3:34 AM >>>> Cc: rkagan@virtuozzo.com; devel@linuxdriverproject.org; linux- >>>> kernel@vger.kernel.org; Andrey Smetanin ; >> KY >>>> Srinivasan ; Haiyang Zhang >>>> ; Vitaly Kuznetsov ; >>>> Denis V. Lunev >>>> Subject: [PATCH 1/1] drivers/hv: correct tsc page sequence invalid value >>>> >>>> From: Andrey Smetanin >>>> >>>> Hypervisor Top Level Functional Specification v3/4 says >>>> that TSC page sequence value = -1(0xFFFFFFFF) is used to >>>> indicate that TSC page no longer reliable source of reference >>>> timer. Unfortunately, we found that Windows Hyper-V guest >>>> side implementation uses sequence value = 0 to indicate >>>> that Tsc page no longer valid. This is clearly visible >>>> inside Windows 2012R2 ntoskrnl.exe HvlGetReferenceTime() >>>> function dissassembly: >>>> >>>> HvlGetReferenceTime proc near >>>> xchg ax, ax >>>> loc_1401C3132: >>>> mov rax, cs:HvlpReferenceTscPage >>>> mov r9d, [rax] >>>> test r9d, r9d >>>> jz short loc_1401C3176 >>>> rdtsc >>>> mov rcx, cs:HvlpReferenceTscPage >>>> shl rdx, 20h >>>> or rdx, rax >>>> mov rax, [rcx+8] >>>> mov rcx, cs:HvlpReferenceTscPage >>>> mov r8, [rcx+10h] >>>> mul rdx >>>> mov rax, cs:HvlpReferenceTscPage >>>> add rdx, r8 >>>> mov ecx, [rax] >>>> cmp ecx, r9d >>>> jnz short loc_1401C3132 >>>> jmp short loc_1401C3184 >>>> loc_1401C3176: >>>> mov ecx, 40000020h >>>> rdmsr >>>> shl rdx, 20h >>>> or rdx, rax >>>> loc_1401C3184: >>>> mov rax, rdx >>>> retn >>>> HvlGetReferenceTime endp >>>> >>>> This patch aligns Tsc page invalid sequence value with >>>> Windows Hyper-V guest implementation which is more >>>> compatible with both Hyper-V hypervisor and KVM hypervisor. >>>> >>>> Signed-off-by: Andrey Smetanin >>>> CC: "K. Y. Srinivasan" >>> Thanks Andrey; the Hyper-V team will be updating the Hyper-V >> documentation. >>> Acked-by: K. Y. Srinivasan >>> >>> Regards, >>> >>> K. Y >> K.Y., >> >> can you pls clarify the state of this patch? It is a bit unclear >> to me whether it is applied or not. > I will be submitting this shortly. > >> By the way, I also do not see the following patch >> "drivers/hv: cleanup synic msrs if vmbus connect failed" >> as applied in the Linux-next. You have promised to resend >> it will correct author. > It was resent on October 29. It is in Greg's queue. > > Regards, > > K. Y >> Thank you in advance, >> Den thank you very much for this update :) Den