From owner-svn-src-all@freebsd.org Fri Sep 30 00:31:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22365C02FF3; Fri, 30 Sep 2016 00:31:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E568B18EC; Fri, 30 Sep 2016 00:31:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8U0VIWw061936; Fri, 30 Sep 2016 00:31:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8U0VIve061935; Fri, 30 Sep 2016 00:31:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609300031.u8U0VIve061935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 30 Sep 2016 00:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306466 - in stable: 10/sys/x86/iommu 11/sys/x86/iommu X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2016 00:31:19 -0000 Author: jhb Date: Fri Sep 30 00:31:17 2016 New Revision: 306466 URL: https://svnweb.freebsd.org/changeset/base/306466 Log: MFC 303886: Add additional constants. - Add constants for the fields in the root-entry table address register, namely the root type type (RTT) and root table address (RTA) mask. - Add macros for the bitmask of the domain ID field in the second word of context table entries as well as a helper macro (DMAR_CTX2_GET_DID) to extract the domain ID from a context table entry. Sponsored by: Chelsio Communications Modified: stable/11/sys/x86/iommu/intel_reg.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/x86/iommu/intel_reg.h Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/x86/iommu/intel_reg.h ============================================================================== --- stable/11/sys/x86/iommu/intel_reg.h Fri Sep 30 00:16:54 2016 (r306465) +++ stable/11/sys/x86/iommu/intel_reg.h Fri Sep 30 00:31:17 2016 (r306466) @@ -67,7 +67,9 @@ typedef struct dmar_ctx_entry { #define DMAR_CTX2_AW_4LVL 2 /* 4-level page tables */ #define DMAR_CTX2_AW_5LVL 3 /* 5-level page tables */ #define DMAR_CTX2_AW_6LVL 4 /* 6-level page tables */ +#define DMAR_CTX2_DID_MASK 0xffff0 #define DMAR_CTX2_DID(x) ((x) << 8) /* Domain Identifier */ +#define DMAR_CTX2_GET_DID(ctx2) (((ctx2) & DMAR_CTX2_DID_MASK) >> 8) typedef struct dmar_pte { uint64_t pte; @@ -214,6 +216,8 @@ typedef struct dmar_irte { /* Root-Entry Table Address register */ #define DMAR_RTADDR_REG 0x20 +#define DMAR_RTADDR_RTT (1 << 11) /* Root Table Type */ +#define DMAR_RTADDR_RTA_MASK 0xfffffffffffff000 /* Context Command register */ #define DMAR_CCMD_REG 0x28