From patchwork Wed Mar 9 00:48:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Matlack X-Patchwork-Id: 8539851 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 358DD9F46A for ; Wed, 9 Mar 2016 00:49:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5FEE5201FE for ; Wed, 9 Mar 2016 00:49:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6D77420218 for ; Wed, 9 Mar 2016 00:49:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750974AbcCIAt2 (ORCPT ); Tue, 8 Mar 2016 19:49:28 -0500 Received: from mail-pf0-f182.google.com ([209.85.192.182]:35031 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752312AbcCIAtS (ORCPT ); Tue, 8 Mar 2016 19:49:18 -0500 Received: by mail-pf0-f182.google.com with SMTP id x188so25338410pfb.2 for ; Tue, 08 Mar 2016 16:49:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=9pIGQfWXMctCUriHC1RBxYh5g9GETiZFm9jEB1Tgwwk=; b=jBeyRFs0cx2R4/D7eWz9e8J+EEO+YmUfv7XUEHeAlAAbnlRy26QFjUte4UMt1QfSBB oLw4i1pE726LB8HS0T7rSzkzJXvlSmABTblRpVVhIjr2ER1XfS5gQG411XrqzBR0Pxmq J9DeGuRu/JO1yNnCf0lbUYWjtJIF6MVFUiPYv5TXqwiMqGZ4yj5Q4ugEWq3l1BJfZ0SN 6PBbf/8YobixBNlsDdn3YyCFQQxECsMN8c8AP3zhbdLHP6fRtassxwpYPzDM22OkS5TS Fadr1McnfFzGBfHeVMIzzMo7yKRqoV1W6NNzFnLvnANtTJBc02VSXew9q5FH7YV85K/k GbhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9pIGQfWXMctCUriHC1RBxYh5g9GETiZFm9jEB1Tgwwk=; b=BJGvf7/x/hD16XUonoyWOtmX9CqlBzbjAOqrOkIbJnDDCv98bJYX45jPbkj95DZdb6 ++zCCHuMAHjyXQkqWUfYEy+Zct+5jSdGD79gzEWM1M9VnKHQ/0ux/GRQWWNVmDWSXsJV Y9z27J04EUlp6KVL7MLAYmp4Gs3W08rG56jvm9l5CU5bsf2ZEbY2CG2ZgMp6Zz4ZTFn0 Enr/caJbd6sENuH6MJZjooFqZrFVq2MBTG1028Q2uBYBlF30YmxLDwzw4uIo2X0Bx+y1 /83V7GAOPPaOZV7BZqGLjcO+dj+2LlyH9uCXCAWb5DmvbnlaJx1nXqWJEyQ0/3ZcfHmy MJAQ== X-Gm-Message-State: AD7BkJKHfgqae6Wu9QYiF6XxgGNWxNGlw+7xROnDYF169HQV39qho8w66/jUrM8yV3I68aNj X-Received: by 10.98.71.92 with SMTP id u89mr41489004pfa.100.1457484557354; Tue, 08 Mar 2016 16:49:17 -0800 (PST) Received: from dmatlack.sea.corp.google.com ([172.31.89.32]) by smtp.gmail.com with ESMTPSA id rq16sm7599231pab.29.2016.03.08.16.49.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Mar 2016 16:49:16 -0800 (PST) From: David Matlack To: kvm@vger.kernel.org Cc: pbonzini@redhat.com, mtosatti@redhat.com, David Matlack Subject: [PATCH kvm-unit-tests] x86: use new kvmclock MSRs Date: Tue, 8 Mar 2016 16:48:23 -0800 Message-Id: <1457484503-90018-1-git-send-email-dmatlack@google.com> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 54750f2cf0 (KVM: x86: workaround SuSE's 2.6.16 pvclock vs masterclock issue) disables masterclock if the boot VCPU uses the old kvmclock system time MSR. This caused kvmclock_test to start running with masterclock disabled. Since the old kvmclock MSRs are deprecated, and their usage disables masterclock, switch to using the new kvmclock MSRs instead. Signed-off-by: David Matlack --- x86/kvmclock.c | 6 +++--- x86/kvmclock.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x86/kvmclock.c b/x86/kvmclock.c index 588d8ec..327e60d 100644 --- a/x86/kvmclock.c +++ b/x86/kvmclock.c @@ -229,12 +229,12 @@ void kvm_clock_init(void *data) struct pvclock_vcpu_time_info *hvc = &hv_clock[index]; printf("kvm-clock: cpu %d, msr %p\n", index, hvc); - wrmsr(MSR_KVM_SYSTEM_TIME, (unsigned long)hvc | 1); + wrmsr(MSR_KVM_SYSTEM_TIME_NEW, (unsigned long)hvc | 1); } void kvm_clock_clear(void *data) { - wrmsr(MSR_KVM_SYSTEM_TIME, 0LL); + wrmsr(MSR_KVM_SYSTEM_TIME_NEW, 0LL); } void pvclock_read_wallclock(struct pvclock_wall_clock *wall_clock, @@ -268,7 +268,7 @@ void kvm_get_wallclock(struct timespec *ts) struct pvclock_vcpu_time_info *vcpu_time; int index = smp_id(); - wrmsr(MSR_KVM_WALL_CLOCK, (unsigned long)&wall_clock); + wrmsr(MSR_KVM_WALL_CLOCK_NEW, (unsigned long)&wall_clock); vcpu_time = &hv_clock[index]; pvclock_read_wallclock(&wall_clock, vcpu_time, ts); } diff --git a/x86/kvmclock.h b/x86/kvmclock.h index 166a338..ab7dc0c 100644 --- a/x86/kvmclock.h +++ b/x86/kvmclock.h @@ -1,8 +1,8 @@ #ifndef KVMCLOCK_H #define KVMCLOCK_H -#define MSR_KVM_WALL_CLOCK 0x11 -#define MSR_KVM_SYSTEM_TIME 0x12 +#define MSR_KVM_WALL_CLOCK_NEW 0x4b564d00 +#define MSR_KVM_SYSTEM_TIME_NEW 0x4b564d01 #define MAX_CPU 64