Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp720762ybt; Wed, 1 Jul 2020 08:29:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAvKVikqcEExEDC2BpmWOnk52Yc970lIth0arP6ZaomvEn0YwYYb0yQpf+fR3pBHox2DdA X-Received: by 2002:a17:906:7247:: with SMTP id n7mr23660560ejk.105.1593617368333; Wed, 01 Jul 2020 08:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593617368; cv=none; d=google.com; s=arc-20160816; b=jhqlFj+nZTPzdIYcffbDkoJA0nZKcavAMHwNTZDtahHouTY8LWeFLlHzlH+x2mxKcP l/BP8TYIZnmcAg8Z1hdLfXaBTT6vcCo5uJulvVD811e3hzCoYD2o3T2Ntd4CJmFW+o56 ZRsG6xkuIdg8cJq+a7JuGdkHTd4J0x58ywuFea2OYzFoEv2Sph0oiHpMIGQb5GtXNAJG n5BHGOVFKkBBrtnD7huJBemhGt4AgRZmsQiLdd9peoC8QM3SI75yViHXY/8UMOJd7Zzs IQhXpJ/ByM1ruto9ognBSNK/wL1ws4DOkLvwsvowIiu2S45+fPvYIysDlI64BnzsoYC9 8Y4A== 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:ironport-sdr:ironport-sdr; bh=8L4GZdBQaKNysSzKV3OFcRr6cZZEDdazaUJwyTXeuro=; b=ReyBTJ9JccV6iWrl9CsDzUcpqJxeFLWE7vINkddyr0yrJL2m3pGD6dn0jhXJzVRWcQ tx00Lp/Cos82+Z8HD16kmzAfQMRcs93ZJOHA4U8cObVMqgRKTODEc0Q4u+/lVgsglAM9 lSKFOzfso+w1j+qrFk2Kz2MUpO9Hg+Mymnf3yzO4KvTaE6iQcv6jENk9BS807HpQE4v3 o8Sh7XSuNxdIWMDv80RRis+tVyLlQQgvOroqIwkaOrVwGn9IULUvJgW9Mm2FFae+6EHg OfH8N8qUW6uVLHK17uJE3udXkZH1ifSp4pa/rlfbqrIQLyUxGB6Cf7+zjRP5wBKHZZAj JjYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nw19si1530937ejb.264.2020.07.01.08.29.04; Wed, 01 Jul 2020 08:29:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732061AbgGAP1u (ORCPT + 99 others); Wed, 1 Jul 2020 11:27:50 -0400 Received: from mga17.intel.com ([192.55.52.151]:54824 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732001AbgGAP1Z (ORCPT ); Wed, 1 Jul 2020 11:27:25 -0400 IronPort-SDR: sesyluKdx3UTorKkoLSOA47okCs+b8uKYCwocJu+ZuZNnfo+9ce2D2iXHE6PnVm73V5M6gAt6w JfqW1O8nnqhg== X-IronPort-AV: E=McAfee;i="6000,8403,9668"; a="126699715" X-IronPort-AV: E=Sophos;i="5.75,300,1589266800"; d="scan'208";a="126699715" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2020 08:27:22 -0700 IronPort-SDR: o6Sl+l5eihHnFW386J38UEz47viTG8vYO4IEfA/SDBbA4F1hMjd8YEBCS+orLRWVXZRzNESa+U JtjMt0u9LxCg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,300,1589266800"; d="scan'208";a="295591641" Received: from jacob-builder.jf.intel.com ([10.7.199.155]) by orsmga002.jf.intel.com with ESMTP; 01 Jul 2020 08:27:22 -0700 From: Jacob Pan To: iommu@lists.linux-foundation.org, LKML , "Lu Baolu" , Joerg Roedel , David Woodhouse Cc: Yi Liu , "Tian, Kevin" , Raj Ashok , Eric Auger , Jacob Pan Subject: [PATCH v3 1/7] iommu/vt-d: Enforce PASID devTLB field mask Date: Wed, 1 Jul 2020 08:33:50 -0700 Message-Id: <1593617636-79385-2-git-send-email-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1593617636-79385-1-git-send-email-jacob.jun.pan@linux.intel.com> References: <1593617636-79385-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 From: Liu Yi L Set proper masks to avoid invalid input spillover to reserved bits. Acked-by: Lu Baolu Signed-off-by: Liu Yi L Signed-off-by: Jacob Pan --- include/linux/intel-iommu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 4100bd224f5c..729386ca8122 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h @@ -380,8 +380,8 @@ enum { #define QI_DEV_EIOTLB_ADDR(a) ((u64)(a) & VTD_PAGE_MASK) #define QI_DEV_EIOTLB_SIZE (((u64)1) << 11) -#define QI_DEV_EIOTLB_GLOB(g) ((u64)g) -#define QI_DEV_EIOTLB_PASID(p) (((u64)p) << 32) +#define QI_DEV_EIOTLB_GLOB(g) ((u64)(g) & 0x1) +#define QI_DEV_EIOTLB_PASID(p) ((u64)((p) & 0xfffff) << 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) | \ -- 2.7.4