Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp892553yba; Thu, 18 Apr 2019 11:19:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbu+YpyJsYpC1Xp8fI/s0PKBRioV2O0XK6+oAC+LfsAmjqYw1lB89RsIO0LT2DMmzqDXhn X-Received: by 2002:a62:1197:: with SMTP id 23mr98846761pfr.210.1555611541853; Thu, 18 Apr 2019 11:19:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611541; cv=none; d=google.com; s=arc-20160816; b=txPl0K2nL7SNTILyjcf6H8G/ToqAj4eICH+UCYo3kY0uZ8j0eCK9ntnAbNIuo5WPwE V9TmXuDcQLjsUfwzvra6vy/6mVUM/dBnijl+6Wc8R4bfwejSEptVyRj0Aq6ALTdEv8Ho zGN7YfsFZ0UrQqZn/ijUqnvi7TEAxQ0fJ+5YEg+QB7wkOKshvdbkcoC4KqfvYqsBSMDe TCONIOryBRtfJUkL5X3k+NklY77XJ/1eDri5nCIPnzEHxOvULyWzSUq5xizOcfcL5kxj 2l0TkCsDlfqJGaRxMiiNbhj2F9FWUPJ+whxlLAwUwAQciv/jHWR1kFOP/FmGyNBcBsuK p4Ow== 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=C1BWlZ2f7qpbs7HZiWVwTGPD9Tdq5ZA88Lmaie8Z+uM=; b=PftMfd/y5gs8GO6nKxsOb14YqBBU94vP/f6PXXWgMjah+4drmrXCuVrhZtgh8UNo5O kq+tdHHhKNcBILGU2szMFumlHg8OwRZYBR22YtuAtZ9Hsjw8CGE6OzRIW6+0RrpQzMdC y3Z50/QVsFs6GGrG5og/MpUJu6dx7KSy4yas3ct+XFYuMjDFFjV+aF3q4WpWmEUKNz6e v07dFXz0AhfweCehb/az3rjtwwvMmC/VnDH4CLGVZq1JbnXCpZAW5Ch2pd2T6RDkrnvn 4UXjvODMr+s2fJ4j4L6b5eYXEsBotGSLQbskGSGHWw7xvmTOW6SAS5brmJCnDb8FfP4/ zOBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E5Svwfw8; 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 u10si2435118pga.205.2019.04.18.11.18.47; Thu, 18 Apr 2019 11:19:01 -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; dkim=pass header.i=@kernel.org header.s=default header.b=E5Svwfw8; 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 S2403935AbfDRSLx (ORCPT + 99 others); Thu, 18 Apr 2019 14:11:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:44150 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391963AbfDRSLv (ORCPT ); Thu, 18 Apr 2019 14:11:51 -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 EF83220675; Thu, 18 Apr 2019 18:11:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555611110; bh=6XNOU3Y9X5FNw5JRFbkYBWvR/i0mEH+JkI4WxxHBV74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E5Svwfw8MI9QItrnMengMouNIS2AEI1YZb5g9VAzNiez4Wut5Ijp1Vdk9Ao+ssVv4 4cO7Kt2juwxUJddRSbMZsidSS0NTE8nbbspCil2xJSPDkPW9qoXjx1HvhchsLkQj38 Q2oNOgN5iY1zaPbYQqwR+DlPsJ7BjB0ZBnlGEha0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ashok Raj , Jacob Pan , Liu Yi L , Lu Baolu , Joerg Roedel , Sasha Levin Subject: [PATCH 5.0 61/93] iommu/vt-d: Save the right domain ID used by hardware Date: Thu, 18 Apr 2019 19:57:39 +0200 Message-Id: <20190418160443.647899370@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160436.781762249@linuxfoundation.org> References: <20190418160436.781762249@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 [ Upstream commit 84c11e4df5aa4955acaa441f0cf1cb2e50daf64b ] The driver sets a default domain id (FLPT_DEFAULT_DID) in the first level only pasid entry, but saves a different domain id in @sdev->did. The value saved in @sdev->did will be used to invalidate the translation caches. Hence, the driver might result in invalidating the caches with a wrong domain id. Cc: Ashok Raj Cc: Jacob Pan Fixes: 1c4f88b7f1f92 ("iommu/vt-d: Shared virtual address in scalable mode") Signed-off-by: Liu Yi L Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/intel-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 68a21c49c562..53b1fbadc496 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -5331,7 +5331,7 @@ int intel_iommu_enable_pasid(struct intel_iommu *iommu, struct intel_svm_dev *sd ctx_lo = context[0].lo; - sdev->did = domain->iommu_did[iommu->seq_id]; + sdev->did = FLPT_DEFAULT_DID; sdev->sid = PCI_DEVID(info->bus, info->devfn); if (!(ctx_lo & CONTEXT_PASIDE)) { -- 2.19.1