Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1791958pxb; Fri, 26 Feb 2021 23:49:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhfNxLV1UVgXW/male/aVCKiGT6EI9jRrXgJ0bnYna6FDhck26qn4EV64V8Xi18r+uISv8 X-Received: by 2002:aa7:c887:: with SMTP id p7mr7085624eds.28.1614412169852; Fri, 26 Feb 2021 23:49:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614412169; cv=none; d=google.com; s=arc-20160816; b=kyAb1hMcwuMDjeB2DPy9OBHkTi0B2ySphmzoiJ6yUBcCRAy+ABOcieeZp+prFnd+RT aW69aULWTSAapfe7Wl1up9vvrTgdXPW5rq0yyml8d0g20swy9gu+q3fiwUOkNRLH+SfJ 50FPexxnq45Zxiba5AS6dNkXCxajDdzW7BXREeUMjmkrZ5gXzMd749N+pVFxPDxmK9rt R8WZqZiBvOGAnH6EXXXuUHsyHqNR92k26QBdCIv9SUUIGiINRGr1BEfK4n5p6I1hFSSh wZa6nhYlW3AWLLujgnLqZvfYXEz+qwwuV+mvyWaU+JkTuVQ+9wcu6e7e3ZPpoJcYUzVg bl7g== 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 :message-id:date:subject:cc:to:from; bh=03eUhbp6OPzcD1ZMZDr+htTdx4fUWTAyG4CFRPSpJQY=; b=YF0v74D0qcS85JgZWvfg0nINTxD2Ll7lvKJBkcxIG7OmrT/6OwHbD4u5sVkUGaiIxh uhb623+L9DCJ4NzZPzU1kq4O5pIxPoLHk6vDob6vE1J9RkquMskSpBz+sAXDSjGE5byL NYWq1gLDlICYOdzHXomng/CNCT7SBv7VQKMue1Si9v+/K/HT1pEDiiwUkjy4gZh5bqQs R46Ph7CBkD+0DdzTxNA9kO8ejoh7iy4Ti268fNLn+w3oAYSrV6pRU3GXKAuDI56LVD2e acTiXELCxqiI0Jl00yXmKypkfKtfYbL4qYvkajS4bGUwgHeZNN3cB/YBDhg0mxVkG1Hx SpYg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i6si2350333ejz.383.2021.02.26.23.48.38; Fri, 26 Feb 2021 23:49:29 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229953AbhB0HlP (ORCPT + 99 others); Sat, 27 Feb 2021 02:41:15 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:13095 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbhB0HlN (ORCPT ); Sat, 27 Feb 2021 02:41:13 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Dndgc4FJSz16Cm2; Sat, 27 Feb 2021 15:38:52 +0800 (CST) Received: from DESKTOP-8RFUVS3.china.huawei.com (10.174.185.179) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.498.0; Sat, 27 Feb 2021 15:40:23 +0800 From: Zenghui Yu To: , CC: , , , , , , , , , Zenghui Yu Subject: [PATCH] iommu/vt-d: Fix status code for Allocate/Free PASID command Date: Sat, 27 Feb 2021 15:39:09 +0800 Message-ID: <20210227073909.432-1-yuzenghui@huawei.com> X-Mailer: git-send-email 2.23.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.185.179] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/iommu/intel/pasid.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/intel/pasid.h b/drivers/iommu/intel/pasid.h index 97dfcffbf495..444c0bec221a 100644 --- 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) /* -- 2.19.1