Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1709454pxb; Mon, 8 Mar 2021 04:36:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxajf4UDcQNQOPBDS/leUf7LQuX0PAHVJQph9BgtMlsW3Py1Uxlg9z/DSM5VuFhN1DVc1Dz X-Received: by 2002:a17:906:7f84:: with SMTP id f4mr14328745ejr.525.1615207006678; Mon, 08 Mar 2021 04:36:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615207006; cv=none; d=google.com; s=arc-20160816; b=ciHp9Nm2sbEBobGgEGURTEDvO/QGnh7WSS82NkrHNuLyASk4ujhQNKN777cBve39cf XpOpXzuaUcFQlxQtRj/q+SNxEXNH4Y8IqoXB1GXIap9WJ37sY9InEwfBJC1Xq60MWcdA 6tGI6+vqN16NIPjp2pnbgsTrJgaG7UJpy9oXxUnnnFleV/i0pkCp9fdq5AFr6S4ToSRq MME8IBZGTQQ4/MIcerS9g+UeMWmO9PSNH6Bj/IwCyd7R+PmUxx75TVx0vjselUWp1vU1 RMYcbx+cikwwEb0x/ipm1gTCBMXcIUsYP68w9ADhWZcfc0eyffaE0Q6iAclEOrmfwOS8 NJGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aNBZXMBlgSzghI6kX6bEyg9hDiXGPsOW5fla3jVdWB8=; b=ZGRkzCt75US0WyZZzkyJOOqfHNpDGI1EgtnxoD57npWT2e612UqN/6swgeCnJRAOz/ BjKX4hh8E8bvQ2BeNwB/unFOkZhKBPgYrsuCrKG9FYeNT7eDTx7LOuI9W/GcopJ37WVh mIM/XSBYt7bPym0mOE1BG+w4b/J2I9VUTPnRsnNC9IzPnKPXDPeigmdGnDQ5+3R4JRIn 5NP/90qMebB+OSAElg70Z5/WFhyPUQtrzMBRS1kjUXlt4zF5b3sSU6b9SSfn+gGGibhf WbPG7LMV4jtRhE8j7GxDSKWCy1Dtmj9S1tGMJj0U/ppOKDCZyoiQsIQ9vFjiopOhzqXw l7Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IZugKfn1; 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=pass (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 bu7si4786322ejb.97.2021.03.08.04.36.23; Mon, 08 Mar 2021 04:36:46 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=IZugKfn1; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232117AbhCHMfN (ORCPT + 99 others); Mon, 8 Mar 2021 07:35:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:43522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231864AbhCHMem (ORCPT ); Mon, 8 Mar 2021 07:34:42 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2EEC8651C9; Mon, 8 Mar 2021 12:34:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615206881; bh=iHS1uGsJ9PogdqEJ7G0jS2z2i+YhY334y2LSP7Uj2hc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IZugKfn1rJpeWNelNQ9qFrP1+pUCZ9jEVD6ab9SpyblhoR4DCZAcQyCZbvOVSjUKN qzReDquXlDGPXFc2L2Qhbibvf/dbBf2T3bzHIMCVidb77ZWt4ln1PC4tSC2Td1+0KA sDn+BJBXi7dD2l7qRNIWva0qFDnj1rP027JgqpPw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zenghui Yu , Lu Baolu , Joerg Roedel , Sasha Levin Subject: [PATCH 5.10 38/42] iommu/vt-d: Fix status code for Allocate/Free PASID command Date: Mon, 8 Mar 2021 13:31:04 +0100 Message-Id: <20210308122719.977647609@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210308122718.120213856@linuxfoundation.org> References: <20210308122718.120213856@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zenghui Yu [ Upstream commit 444d66a23c1f1e4c4d12aed4812681d0ad835d60 ] As per Intel vt-d spec, Rev 3.0 (section 10.4.45 "Virtual Command Response Register"), the status code of "No PASID available" error in response to the Allocate PASID command is 2, not 1. The same for "Invalid PASID" error in response to the Free PASID command. We will otherwise see confusing kernel log under the command failure from guest side. Fix it. Fixes: 24f27d32ab6b ("iommu/vt-d: Enlightened PASID allocation") Signed-off-by: Zenghui Yu Acked-by: Lu Baolu Link: https://lore.kernel.org/r/20210227073909.432-1-yuzenghui@huawei.com Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/intel/pasid.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/iommu/intel/pasid.h +++ b/drivers/iommu/intel/pasid.h @@ -30,8 +30,8 @@ #define VCMD_VRSP_IP 0x1 #define VCMD_VRSP_SC(e) (((e) >> 1) & 0x3) #define VCMD_VRSP_SC_SUCCESS 0 -#define VCMD_VRSP_SC_NO_PASID_AVAIL 1 -#define VCMD_VRSP_SC_INVALID_PASID 1 +#define VCMD_VRSP_SC_NO_PASID_AVAIL 2 +#define VCMD_VRSP_SC_INVALID_PASID 2 #define VCMD_VRSP_RESULT_PASID(e) (((e) >> 8) & 0xfffff) #define VCMD_CMD_OPERAND(e) ((e) << 8) /*