From patchwork Fri Jun 22 23:59:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liran Alon X-Patchwork-Id: 10483339 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0C2EA6023A for ; Sat, 23 Jun 2018 00:00:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF29D28F78 for ; Sat, 23 Jun 2018 00:00:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3FC429040; Sat, 23 Jun 2018 00:00:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9126428F78 for ; Sat, 23 Jun 2018 00:00:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934430AbeFWAAX (ORCPT ); Fri, 22 Jun 2018 20:00:23 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:41718 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934302AbeFWAAU (ORCPT ); Fri, 22 Jun 2018 20:00:20 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5MNxNuN042027; Sat, 23 Jun 2018 00:00:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=3JbWi5Hydu6jnAWJSpI9oHHb7HElCWEl1lah/qqmCeQ=; b=e7jdDZDBCmYCpIO8Jpzec/WSrhPlQMZsokXa5De79AGlVhy/AqV/lOvGowLRQztH4mAE 8VATk1QAd4YtJcw8v/tKIsuSHrGhEqTavG5RbeSUqfbx2bq6u6jONH5H04jtPevfPoTv QeBqcbrffTUX+JeDeSP0HG7+X79HqW5NOuuQMAkE7VcL5oT61dNP+qSc6QLWk02N8pSh w5DaVp8R3HfBRQjpopSpZZBr9QXO6VmQXO1+xsUwimdY/Iw9OHGvHSoDvZyOhnHpeQxS kdq/SdXZchkHvGYOh3zZw/s9Iam4ZYKgNJGPcvsD8Xeeb73SnxLBhgIDZiqlefB7tunD Lg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2jrp8euqgp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 23 Jun 2018 00:00:07 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w5N005cD023543 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 23 Jun 2018 00:00:06 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w5N005dF028083; Sat, 23 Jun 2018 00:00:05 GMT Received: from liran-pc.mynet (/79.183.72.72) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 22 Jun 2018 17:00:04 -0700 From: Liran Alon To: pbonzini@redhat.com, rkrcmar@redhat.com, kvm@vger.kernel.org Cc: jmattson@google.com, idan.brown@oracle.com, Liran Alon Subject: [PATCH kvm-unit-tests 5/9] x86: nVMX: Define VMCS field encoding constants Date: Sat, 23 Jun 2018 02:59:36 +0300 Message-Id: <1529711980-32764-6-git-send-email-liran.alon@oracle.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1529711980-32764-1-git-send-email-liran.alon@oracle.com> References: <1529711980-32764-1-git-send-email-liran.alon@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8932 signatures=668703 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=436 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1806220265 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Liran Alon Signed-off-by: Jim Mattson --- x86/vmx.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/x86/vmx.h b/x86/vmx.h index 50f4afdb6b84..2126df36f0ba 100644 --- a/x86/vmx.h +++ b/x86/vmx.h @@ -596,6 +596,21 @@ enum vm_instruction_error_number { #define ACTV_ACTIVE 0 #define ACTV_HLT 1 +/* + * VMCS field encoding: + * Bit 0: High-access + * Bits 1-9: Index + * Bits 10-12: Type + * Bits 13-15: Width + * Bits 15-64: Reserved + */ +#define VMCS_FIELD_HIGH_SHIFT (0) +#define VMCS_FIELD_INDEX_SHIFT (1) +#define VMCS_FIELD_TYPE_SHIFT (10) +#define VMCS_FIELD_WIDTH_SHIFT (13) +#define VMCS_FIELD_RESERVED_SHIFT (15) +#define VMCS_FIELD_BIT_SIZE (BITS_PER_LONG) + extern struct regs regs; extern union vmx_basic basic;