From patchwork Mon Feb 22 23:40:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Feiner X-Patchwork-Id: 8385261 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 77B6CC0553 for ; Mon, 22 Feb 2016 23:40:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A909E20632 for ; Mon, 22 Feb 2016 23:40:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C0B5620630 for ; Mon, 22 Feb 2016 23:40:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756488AbcBVXkn (ORCPT ); Mon, 22 Feb 2016 18:40:43 -0500 Received: from mail-pf0-f170.google.com ([209.85.192.170]:34172 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756407AbcBVXkm (ORCPT ); Mon, 22 Feb 2016 18:40:42 -0500 Received: by mail-pf0-f170.google.com with SMTP id x65so100688879pfb.1 for ; Mon, 22 Feb 2016 15:40:41 -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=OykZYIs7CIgKVB2A8rfbPRFT3YDK2dnZoKSVqImLKZc=; b=cwshIgdR+l4BpSzVBXd8ZS9s8Qiha8KMXqJ/n3oE5y0dmt4LM0iOcjWgbzyTQFxAVd lcgASqUbsKgrC87zZxWsLz9iZpgFSh+YVbU23ph4kmX2yCXl9M8aG2aw98IcesPmiJ7B GsxOj51POEW8OroSf7G3UlSIZn3PJRQNgJYnhTHp1wDALep9+P5BGLb3j0oiIdPm772D Qh4MrLmwcUP07kOEJi5Qo3VZRV/PIjrnOmExY0k9JMLjTE5IVCeN7uSAVpls9nCsCIGK EzTkDltjG1yiulow4S4TtQB6sd9tLnKR/rmfab5fSCsfujv036HaFBGI2DtUGSNXVELv LijA== 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=OykZYIs7CIgKVB2A8rfbPRFT3YDK2dnZoKSVqImLKZc=; b=FsPz7DjFwsEWxv/YixAsJrz9hwrD7Y/S41qhOOf0dBvuB/5RIhdDroCMAb/K0Ykbjv 8BH/bVtPSVEPFayl754QuDGORNpoAQ/KPNO8tqG8i4Lus5wKSgz5LL9ZY6yOGxw7SuD+ 7kZXKqr1lo/DjiyTLxVtmLvcZ4hGC8kv8OAkMl5O9YJStHQVU718iwYmNNwlWrtN9FIc 0hK3nA37EIllXvq41US4Nr/dyQyrO/EItfsR3CelnDAa59tFx+kmKZ+fo00XMG6TIx0M j+XckC9hjS2FN+t4XY691xOVOCerlO4Jx59fDSag0W+dz65Cu5z2ZcjnjhXYeij46ZY8 DZGA== X-Gm-Message-State: AG10YOSYqNRe2aKUmjMd4Yerv+/lwsMCBq7/xQrnjbkxDGiYR/+vOyR+uDai3lQ7HYDyLKJ9 X-Received: by 10.98.16.69 with SMTP id y66mr41884963pfi.86.1456184441614; Mon, 22 Feb 2016 15:40:41 -0800 (PST) Received: from localhost ([2620:0:1009:3:b080:5ad3:222b:6c77]) by smtp.gmail.com with ESMTPSA id tb10sm39508557pab.22.2016.02.22.15.40.40 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 22 Feb 2016 15:40:41 -0800 (PST) From: Peter Feiner To: kvm@vger.kernel.org, drjones@redhat.com, pbonzini@redhat.com Cc: pfeiner@google.com Subject: [kvm-unit-tests PATCH] x86: vmx: fix definition of X86_CR4_VMXE Date: Mon, 22 Feb 2016 15:40:36 -0800 Message-Id: <1456184436-31168-1-git-send-email-pfeiner@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 Was defined as 0x1 when it should have been 0x2000 (13th bit of CR4). See Intel manual 23.7. 0x1 is the VME 'Virtual-8086 Mode Extensions' bit, which the vmx tests don't exercise. The correct bit was being set thanks to IA32_VMX_CR4_FIXED{0,1} MSRs forcing it. I hacked the test setup to forcibly un-set the bit and observed the correct #UD VMXON behavior. Adding a test to verify the #UD behavior is follow-up work. Signed-off-by: Peter Feiner --- lib/x86/processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/x86/processor.h b/lib/x86/processor.h index 95cea1a..dff1689 100644 --- a/lib/x86/processor.h +++ b/lib/x86/processor.h @@ -21,7 +21,7 @@ #define X86_CR0_WP 0x00010000 #define X86_CR0_AM 0x00040000 #define X86_CR0_PG 0x80000000 -#define X86_CR4_VMXE 0x00000001 +#define X86_CR4_VMXE 0x00002000 #define X86_CR4_TSD 0x00000004 #define X86_CR4_DE 0x00000008 #define X86_CR4_PSE 0x00000010