From patchwork Wed Sep 11 03:11:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Chunqi Li X-Patchwork-Id: 2868581 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EB120BF43F for ; Wed, 11 Sep 2013 03:12:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E56B20315 for ; Wed, 11 Sep 2013 03:12:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D926B2030D for ; Wed, 11 Sep 2013 03:12:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753548Ab3IKDMF (ORCPT ); Tue, 10 Sep 2013 23:12:05 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:55190 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753241Ab3IKDMD (ORCPT ); Tue, 10 Sep 2013 23:12:03 -0400 Received: by mail-pd0-f170.google.com with SMTP id x10so8570165pdj.29 for ; Tue, 10 Sep 2013 20:12:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=qe+lshdOp+H3In89vq31AKDmZ5FqJggBsD6110flYvM=; b=Q7s/G7Y/4dqHour0z7MLSvT7DEILGecic9LXeLmrdEdY05ot8gpYjGbdw+REj3G+Rd z5nSo427ZbsTZqlXCLMUM2FDULw9l/nT5ypdHe1621kPlwb53GoT9vzU2ihmvWvV+LpY 9ldo06Ya7zzeL+PvfA3moGY0/fUXra4PY8lv4cWx763V/XzZBxmu9Qe415baaYxGxZM8 5hw5MkrUv4beEtISExWWFkepfbjF/lE31WaTp+hZCepNRJaZgmI2OeQcrTq8rQ6eaBGJ 1zfi3/F9ohZaxK4QPhrCAgXLRAbNv2CTxNgSLAcmsN1hH+cyxF5LMlGJss86KSrGudJz v4Iw== X-Received: by 10.68.171.164 with SMTP id av4mr11798120pbc.175.1378869122602; Tue, 10 Sep 2013 20:12:02 -0700 (PDT) Received: from Blade1-01.Blade1-01 ([162.105.146.101]) by mx.google.com with ESMTPSA id xe9sm26498583pbc.21.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 20:12:01 -0700 (PDT) From: Arthur Chunqi Li To: kvm@vger.kernel.org Cc: jan.kiszka@siemens.com, gleb@redhat.com, pbonzini@redhat.com, Arthur Chunqi Li Subject: [PATCH] kvm-unit-tests: VMX: Fix two minor bugs Date: Wed, 11 Sep 2013 11:11:49 +0800 Message-Id: <1378869109-14128-1-git-send-email-yzt356@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 This patch just contains two minor changes to EPT framwork. 1. Reorder macro definition 2. Fix bug of setting CPU_EPT without check. Signed-off-by: Arthur Chunqi Li --- x86/vmx.h | 2 +- x86/vmx_tests.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x86/vmx.h b/x86/vmx.h index e02183f..dc1ebdf 100644 --- a/x86/vmx.h +++ b/x86/vmx.h @@ -366,9 +366,9 @@ enum Ctrl0 { CPU_NMI_WINDOW = 1ul << 22, CPU_IO = 1ul << 24, CPU_IO_BITMAP = 1ul << 25, + CPU_MSR_BITMAP = 1ul << 28, CPU_MONITOR = 1ul << 29, CPU_PAUSE = 1ul << 30, - CPU_MSR_BITMAP = 1ul << 28, CPU_SECONDARY = 1ul << 31, }; diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c index e891a9f..0759e10 100644 --- a/x86/vmx_tests.c +++ b/x86/vmx_tests.c @@ -925,7 +925,7 @@ static void ept_init() ctrl_cpu[1] = (ctrl_cpu[1] | CPU_EPT) & ctrl_cpu_rev[1].clr; vmcs_write(CPU_EXEC_CTRL0, ctrl_cpu[0]); - vmcs_write(CPU_EXEC_CTRL1, ctrl_cpu[1] | CPU_EPT); + vmcs_write(CPU_EXEC_CTRL1, ctrl_cpu[1]); if (setup_ept()) init_fail = true; data_page1 = alloc_page();