From patchwork Sat Sep 1 08:12:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junjie Mao X-Patchwork-Id: 1394861 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id A85F3DFABE for ; Sat, 1 Sep 2012 08:12:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752577Ab2IAIMr (ORCPT ); Sat, 1 Sep 2012 04:12:47 -0400 Received: from mga09.intel.com ([134.134.136.24]:22202 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752404Ab2IAIMp convert rfc822-to-8bit (ORCPT ); Sat, 1 Sep 2012 04:12:45 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 01 Sep 2012 01:12:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,351,1344236400"; d="scan'208";a="187864963" Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35]) by orsmga001.jf.intel.com with ESMTP; 01 Sep 2012 01:12:44 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server (TLS) id 14.1.355.2; Sat, 1 Sep 2012 01:12:44 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.239]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.175]) with mapi id 14.01.0355.002; Sat, 1 Sep 2012 16:12:42 +0800 From: "Mao, Junjie" To: Avi Kivity , Marcelo Tosatti , "'kvm@vger.kernel.org'" Subject: [PATCH] Restore cr3 after tests on PCID Thread-Topic: [PATCH] Restore cr3 after tests on PCID Thread-Index: Ac2IGY8Abs+fKWkmSKyBfUPFtKJaBA== Date: Sat, 1 Sep 2012 08:12:42 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The INVPCID enabling test assumes cr3[11:0] is 0. But at present PCID enabling test sets cr3[11:0] to 1 for its own purpose and doesn't restore the register, which leads to a failure when INVPCID test tries to enable PCIDE. This patch restores cr3 after PCID enabling test is done so that PCIDE can be enabled normally in later tests. Signed-off-by: Junjie Mao --- x86/pcid.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/x86/pcid.c b/x86/pcid.c index de0f6fe..8bfeba2 100644 --- a/x86/pcid.c +++ b/x86/pcid.c @@ -79,6 +79,7 @@ void test_pcid_enabled(void) write_cr3(cr3 | 0x001); if (write_cr4_checking(cr4 | X86_CR4_PCIDE) != GP_VECTOR) goto report; + write_cr3(cr3); passed = 1;