From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Nadav Har'El" Subject: [PATCH 0/3] Nested TSC handling Date: Tue, 2 Aug 2011 15:53:41 +0300 Message-ID: <1312289591-nyh@il.ibm.com> Cc: "Roedel, Joerg" , Zachary Amsden , Bandan Das , Marcelo Tosatti , avi@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mtagate3.uk.ibm.com ([194.196.100.163]:38874 "EHLO mtagate3.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754004Ab1HBMyI (ORCPT ); Tue, 2 Aug 2011 08:54:08 -0400 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p72Crr37007584 for ; Tue, 2 Aug 2011 12:53:53 GMT Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p72CrqnK2547792 for ; Tue, 2 Aug 2011 13:53:53 +0100 Received: from d06av03.portsmouth.uk.ibm.com (localhost.localdomain [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p72Crqxp027021 for ; Tue, 2 Aug 2011 06:53:52 -0600 Sender: kvm-owner@vger.kernel.org List-ID: The following are patches I propose for fixing the bug discovered by Bandan Das and discussed in the "Nested VMX - L1 hangs on running L2" thread. The first patch should fix the originally-reported bug, as explained in the aforementioned thread: A new x86_op read_l1_tsc() is called L1's TSC is needed, instead of assuming that calling kvm_read_msr() will do that (because this has to return L2's TSC when a nested guest is running). The second and third patches fix relatively-unimportant corner cases in nested VMX and nested SVM TSC handling. I'd appreciate it if the people who noticed this bug can verify that these patches indeed solve it for them. Patch statistics: ----------------- arch/x86/include/asm/kvm_host.h | 2 + arch/x86/kvm/svm.c | 13 ++++++-- arch/x86/kvm/vmx.c | 48 +++++++++++++++++++++++------- arch/x86/kvm/x86.c | 8 ++--- 4 files changed, 54 insertions(+), 17 deletions(-) -- Nadav Har'El IBM Haifa Research Lab