Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp579315ybt; Mon, 6 Jul 2020 17:10:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzloqU5yOMwGz+xO+A7F1rpO0CJl0p9YenDW7YOJUXPxajCrns88fRqcL3UGp4GV1+WcnUI X-Received: by 2002:aa7:db57:: with SMTP id n23mr57931095edt.235.1594080642807; Mon, 06 Jul 2020 17:10:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594080642; cv=none; d=google.com; s=arc-20160816; b=KFE8JxgkuHdxW6HRDKS2CAeCtQEXgQKAgelFKXlloTdsYDiGqxSIxP18mGIrE2MQLY EewsMoKUQkuOiClfGiBG1sMFdI5xQ9OQkiBHdkhytjwj1aZBqP2qb0HLXV3/ieR35uTu MhzmqhfJWedw9ZxGUsr8MTo0EY++ty4wNFU+FaJHBJ7hjXS79ulukPb7lIhWpltbp+bk am0PTma0f8IKHurADLn8Ie10Bv4Y4KmOU0PDzs+q/sfud0dVAUx91m8+ieGgUkbAaJN4 25VzWzGmIJ3JDoJnBhgvydk1sH91unkG96AE7GznlYfwzB1P01wJKD/oYCtvStHanvyp MFZA== 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=Dwwf2TfpJEAiYYIHwlfJbiMXlp7pGRAk3kYEtcuFLTE=; b=hkYlwoZmu9D3FvcJkSN45/QsA/8au8Hz7iq+i/9qztd06OUd9pqQjrj++qXXts3tlj Levb4UE2JPW6JzRgpBxh8j29GFAtW2w/z8aOxJATeFkn92ef9hDZNATqygrxnkI7bdKY +Gi2XKIPQS7KeKW38wGZqVBQ8wwcgzypjI0UnE9isSvTTV+wPnbrKF9IYJtkO1qMvk5Z MzoZ9K5xObNOO2do4XquXRT72VIbY/0Plf4P6a8eDSC5mipYtdTPmWd5N20++Y+wXX9z vQO5WKN1k5mYihZBl90OxUOtr2yxAleSiS+EvrRc6m/oyyHcwvnnCqKHLSzdvu0tHg+7 VwTg== 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 gt15si14942944ejb.747.2020.07.06.17.10.19; Mon, 06 Jul 2020 17:10:42 -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 S1727077AbgGGAGU (ORCPT + 99 others); Mon, 6 Jul 2020 20:06:20 -0400 Received: from mga07.intel.com ([134.134.136.100]:18972 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726729AbgGGAGU (ORCPT ); Mon, 6 Jul 2020 20:06:20 -0400 IronPort-SDR: PqOJ6IMGmM5wjkEjw5tJ0qpjnibuEEX6NBWvKBjJvTMMhqk3YKAjm6NdgzcFFnM8xJAS9aAIhw dwBBwUc6PK1g== X-IronPort-AV: E=McAfee;i="6000,8403,9674"; a="212492290" X-IronPort-AV: E=Sophos;i="5.75,321,1589266800"; d="scan'208";a="212492290" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2020 17:06:17 -0700 IronPort-SDR: KZ8hXdd9ThnSzWKppZJ/QJ8Orsls6iwGjBmIS93WJAe61QUKhVFW7hJiaEAA7AFWo6iBE/SHi9 LDEZI0jm0SYw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,321,1589266800"; d="scan'208";a="456913814" Received: from jacob-builder.jf.intel.com ([10.7.199.155]) by orsmga005.jf.intel.com with ESMTP; 06 Jul 2020 17:06:17 -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 v4 1/7] iommu/vt-d: Enforce PASID devTLB field mask Date: Mon, 6 Jul 2020 17:12:48 -0700 Message-Id: <1594080774-33413-2-git-send-email-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1594080774-33413-1-git-send-email-jacob.jun.pan@linux.intel.com> References: <1594080774-33413-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 Reviewed-by: Eric Auger 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