Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1243713pxa; Thu, 20 Aug 2020 06:35:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxYv5clV1qgXCA+V1AHEIoW4z6UzdYedwCGu9Dt/+F/uQxxNxm/OjDC6+QOccZhHNbtf1k X-Received: by 2002:a17:906:c108:: with SMTP id do8mr3429226ejc.88.1597930553792; Thu, 20 Aug 2020 06:35:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597930553; cv=none; d=google.com; s=arc-20160816; b=a68Fn4tiKalk8WCwKdI3RLIs43MgGsb3xlDJzRIpvqGW5I+rFT/ELcz56WgYUAPOnC sDtJviRFbFB6POsU9zPGnFeLxBKFZu6vHZy7la7BJz0ewC3R3W8U9gbs7MwFMhxP4/DL uKQqDNXC1JlvfsiqG34qEg4p1W3LpTtPqtH44+D90n47yzktHPjifX6MA9fJNb7yHj+t wlGkkO52iApTQ8Jnh8IcympWO95KYqCUMdSs5K3bCnh15sXCeLPkKGuZlLjm/eAR9zrJ 88/bIfRxkknAElMuN2zYF05ET45dcvez2XTjWnpN+A9JKUh6BKAkzxp5168XQvD8jhQg kvEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=42YIBGjaZ0Uxa0xZ3sbslX+dhrdW5unRbmU/sfiCdYc=; b=Zx1f2n7cqeEo4VMKYiEzX5UPq8JixfRXRB3KVXjDmVThgNsu2ioGN8UU1Q/Wp2Eo5d 98fxQ/NNJ6Si9Kg8viNU1XmaxQ6KXb4B9vHVOVlLZUKgUYIKfWfA68XJtJw+yd34UVBm elGGJt0VlSjMow1d1Lg6fdQu4mIcm+wfI0aMzaF1djyo/HshyDVNbYOnZYmtPMLbkwLW 4yKttmgs3Gr7l790vqlM1VQtav/puPc8xMxBSAt0+WJi3DOOL72lMjK1xh+4Z5KQ3rBS JFX/yxsdtM4ig1+zFfjJXuSHIYmz9Yo5iNcG1ElGzEQq1tLwyi1eLew0IqsjIC8ySAfo 4fIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z+9MioD1; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h19si1435334edq.302.2020.08.20.06.35.29; Thu, 20 Aug 2020 06:35:53 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Z+9MioD1; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728428AbgHTNcR (ORCPT + 99 others); Thu, 20 Aug 2020 09:32:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:44796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727063AbgHTJcW (ORCPT ); Thu, 20 Aug 2020 05:32:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B450B22B4E; Thu, 20 Aug 2020 09:32:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915942; bh=D9DNfhMsTz15k1jPQJBicJhju+SA7iaChukrI5WFEkI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z+9MioD11iZ7YBvA6XsT4ooMbA+LdQW4DntKaewwXlb7VtAr8QoUzOFoOyVCZ8baz AuZK7s8f80Ced4v/mhhT2WMIO1N1IKHkQe2IR+TX+w81P/KAe8nCkgwavLPA44vLsP Pi4N8DxvskOPiMh7z9yfRaGT41WQvWwOSvOR4mQ0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liu Yi L , Jacob Pan , Lu Baolu , Eric Auger , Joerg Roedel , Sasha Levin Subject: [PATCH 5.8 159/232] iommu/vt-d: Enforce PASID devTLB field mask Date: Thu, 20 Aug 2020 11:20:10 +0200 Message-Id: <20200820091620.513899086@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Liu Yi L [ Upstream commit 5f77d6ca5ca74e4b4a5e2e010f7ff50c45dea326 ] Set proper masks to avoid invalid input spillover to reserved bits. Signed-off-by: Liu Yi L Signed-off-by: Jacob Pan Signed-off-by: Lu Baolu Reviewed-by: Eric Auger Link: https://lore.kernel.org/r/20200724014925.15523-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- 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 04bd9279c3fb3..711bdca975be3 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h @@ -381,8 +381,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.25.1