Received: by 10.192.165.156 with SMTP id m28csp1134316imm; Mon, 16 Apr 2018 14:51:34 -0700 (PDT) X-Google-Smtp-Source: AIpwx49lmFisBX3Sa+JBTPlCo9pDRqeI+Wzu0HYPYUgLSupV8F4P41tgL3uC9wADcbwVfmbwSZvY X-Received: by 2002:a17:902:bd03:: with SMTP id p3-v6mr16997016pls.236.1523915494428; Mon, 16 Apr 2018 14:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523915494; cv=none; d=google.com; s=arc-20160816; b=xN9GTNsfJG4/9kd5nM3HXNSchGGtGrc8T3q5MaBJoDVFtc9c8llw73iLr5cuh8CGj0 x5Ct2/eDJi6ksU5Y4nFidxjcRRkrAKnzPQbwz5KguL/G9PmN5ScKgXR5u73pNT0Mumr1 6AK48QIkiwa3CwqsjDcYiOqLv2eH6cCjN/vSKPS14vBVedThf5PIVwBQI3KOGQCLActJ rZaWvYN8MH/RDKPR3lrVTEUUYhO7ga9Xp6w+75fq2nuTkZd33+L9g9c4Rs79BP5nasE0 hXh4Q/hKOXoFfv80EMpNcJyna7VpsY6JnlqWH/sOhNzCrToXruc2XdgdKUCAfbM6KEy/ xPCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=9XB5zZUZr+RGyzSozDdOaoI8Tc3vUsBP6NjDOlmHsgQ=; b=hZhlgEsLso/vtSUSqUzt7Ip/9RWIXv7VrUxOq1HXQopeOPt3/MtoouFHq5z5oImzIU ZEpicYfoqa9DGk5pXElCulbsREw+N6AZ0ogt1TquJY1v7Z+BbokZJgY50eZT6JEMuG36 wj03eipq9tLygKmXLgpCFstoyDKXRv3KKEbydGxUJ3n3Pp+lwx4tmEWWTa9hK7NVCl10 PFFPL38eQCdP/BbXhsX+M1cI41t86i7KzGtzWtvTycLs2U4YCwrRop4+Jt5SJGX07vmA qryw/Bfnm1eJAY3+VZCTeTASp8tWR83pwRVMq1hn5onTc3K7F3ZfbFA9he/LCOyutaCE qQ2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h17si8896983pgv.223.2018.04.16.14.51.20; Mon, 16 Apr 2018 14:51:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752989AbeDPVqt (ORCPT + 99 others); Mon, 16 Apr 2018 17:46:49 -0400 Received: from mga09.intel.com ([134.134.136.24]:12292 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752896AbeDPVqo (ORCPT ); Mon, 16 Apr 2018 17:46:44 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Apr 2018 14:46:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,460,1517904000"; d="scan'208";a="34740151" Received: from jacob-builder.jf.intel.com ([10.7.199.155]) by orsmga006.jf.intel.com with ESMTP; 16 Apr 2018 14:46:42 -0700 From: Jacob Pan To: iommu@lists.linux-foundation.org, LKML , Joerg Roedel , David Woodhouse , Greg Kroah-Hartman , Alex Williamson , Jean-Philippe Brucker Cc: Rafael Wysocki , "Liu, Yi L" , "Tian, Kevin" , Raj Ashok , Jean Delvare , "Christoph Hellwig" , "Lu Baolu" , Jacob Pan Subject: [PATCH v4 06/22] iommu/vt-d: add definitions for PFSID Date: Mon, 16 Apr 2018 14:48:55 -0700 Message-Id: <1523915351-54415-7-git-send-email-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523915351-54415-1-git-send-email-jacob.jun.pan@linux.intel.com> References: <1523915351-54415-1-git-send-email-jacob.jun.pan@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When SRIOV VF device IOTLB is invalidated, we need to provide the PF source ID such that IOMMU hardware can gauge the depth of invalidation queue which is shared among VFs. This is needed when device invalidation throttle (DIT) capability is supported. This patch adds bit definitions for checking and tracking PFSID. Signed-off-by: Jacob Pan --- include/linux/intel-iommu.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index ddc7d79..dfacd49 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h @@ -114,6 +114,7 @@ * Extended Capability Register */ +#define ecap_dit(e) ((e >> 41) & 0x1) #define ecap_pasid(e) ((e >> 40) & 0x1) #define ecap_pss(e) ((e >> 35) & 0x1f) #define ecap_eafs(e) ((e >> 34) & 0x1) @@ -284,6 +285,7 @@ enum { #define QI_DEV_IOTLB_SID(sid) ((u64)((sid) & 0xffff) << 32) #define QI_DEV_IOTLB_QDEP(qdep) (((qdep) & 0x1f) << 16) #define QI_DEV_IOTLB_ADDR(addr) ((u64)(addr) & VTD_PAGE_MASK) +#define QI_DEV_IOTLB_PFSID(pfsid) (((u64)(pfsid & 0xf) << 12) | ((u64)(pfsid & 0xff0) << 48)) #define QI_DEV_IOTLB_SIZE 1 #define QI_DEV_IOTLB_MAX_INVS 32 @@ -308,6 +310,7 @@ enum { #define QI_DEV_EIOTLB_PASID(p) (((u64)p) << 32) #define QI_DEV_EIOTLB_SID(sid) ((u64)((sid) & 0xffff) << 16) #define QI_DEV_EIOTLB_QDEP(qd) ((u64)((qd) & 0x1f) << 4) +#define QI_DEV_EIOTLB_PFSID(pfsid) (((u64)(pfsid & 0xf) << 12) | ((u64)(pfsid & 0xff0) << 48)) #define QI_DEV_EIOTLB_MAX_INVS 32 #define QI_PGRP_IDX(idx) (((u64)(idx)) << 55) @@ -467,6 +470,7 @@ struct device_domain_info { struct list_head global; /* link to global list */ u8 bus; /* PCI bus number */ u8 devfn; /* PCI devfn number */ + u16 pfsid; /* SRIOV physical function source ID */ u8 pasid_supported:3; u8 pasid_enabled:1; u8 pri_supported:1; -- 2.7.4