From patchwork Wed Jun 14 06:27:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rex Zhang X-Patchwork-Id: 13279558 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E9DAEB64DA for ; Wed, 14 Jun 2023 06:27:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243138AbjFNG1V (ORCPT ); Wed, 14 Jun 2023 02:27:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242281AbjFNG1U (ORCPT ); Wed, 14 Jun 2023 02:27:20 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0CC110E3 for ; Tue, 13 Jun 2023 23:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686724039; x=1718260039; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=fIxeHj97LZx9dgC11r28UEXB75hD3EgHjNg+NPgV75I=; b=mB4pMvL+yURyyg2L5600QDWUWqBHT88couakS8TIeKWOIE+WyO+kokMs kaYh7Ry/gPD2KpkeKXPU8ICrOb2SnoExadHNKuQOS3hwnnVlOMhgDR+fb CH96HEUVqtOFZl0hIpWUf6Q9KElx5hx6/gK4DCy5De4xVFL1yaT/PqDoA qbJmb/yE9WDcU9Ke1PEFqH3N2t/s2JXa0VhiyDmLvYaaWd6UD6DJbI2BD aQtPr2ytKIy918TlJGd8wLgae6oELeuMRhIulIUWv2xQZ9ze7HhyKO1U1 gK3u96DkkhkUYOWtPBARWWbat6JIsc2Lu9PtAGyL6SN960F+CXr4BnLT7 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="356026627" X-IronPort-AV: E=Sophos;i="6.00,241,1681196400"; d="scan'208";a="356026627" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2023 23:27:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="801788832" X-IronPort-AV: E=Sophos;i="6.00,241,1681196400"; d="scan'208";a="801788832" Received: from rex-z390-aorus-pro.sh.intel.com ([10.239.161.21]) by FMSMGA003.fm.intel.com with ESMTP; 13 Jun 2023 23:27:17 -0700 From: rex.zhang@intel.com To: vkoul@kernel.org, fenghua.yu@intel.com, dave.jiang@intel.com, dmaengine@vger.kernel.org Cc: ramesh.thomas@intel.com, tony.zhu@intel.com, rex.zhang@intel.com Subject: [PATCH 1/2] dmaengine: idxd: Modify the dependence of attribute pasid_enabled Date: Wed, 14 Jun 2023 14:27:06 +0800 Message-Id: <20230614062706.1743078-1-rex.zhang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org From: Rex Zhang Kernel PASID and user PASID are separately enabled. User needs to know the user PASID enabling status to decide how to use IDXD device in user space. This is done via the attribute /sys/bus/dsa/devices/dsa0/pasid_enabled. It's unnecessary for user to know the kernel PASID enabling status because user won't use the kernel PASID. But instead of showing the user PASID enabling status, the attribute shows the kernel PASID enabling status. Fix the issue by showing the user PASID enabling status in the attribute. Fixes: 42a1b73852c4 ("dmaengine: idxd: Separate user and kernel pasid enabling") Signed-off-by: Rex Zhang Acked-by: Fenghua Yu Acked-by: Dave Jiang --- drivers/dma/idxd/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c index 293739ac5596..b6a0a12412af 100644 --- a/drivers/dma/idxd/sysfs.c +++ b/drivers/dma/idxd/sysfs.c @@ -1480,7 +1480,7 @@ static ssize_t pasid_enabled_show(struct device *dev, { struct idxd_device *idxd = confdev_to_idxd(dev); - return sysfs_emit(buf, "%u\n", device_pasid_enabled(idxd)); + return sysfs_emit(buf, "%u\n", device_user_pasid_enabled(idxd)); } static DEVICE_ATTR_RO(pasid_enabled); From patchwork Wed Jun 14 06:28:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rex Zhang X-Patchwork-Id: 13279559 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADD78EB64D8 for ; Wed, 14 Jun 2023 06:28:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242549AbjFNG2a (ORCPT ); Wed, 14 Jun 2023 02:28:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234691AbjFNG23 (ORCPT ); Wed, 14 Jun 2023 02:28:29 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A9C4199 for ; Tue, 13 Jun 2023 23:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686724108; x=1718260108; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=YsAuy37whDbFap+QQxD/rhhZq3K/u2UHV/jCPDSRsZ4=; b=NKwUWkomj+lvrF0ilCeQp5XdhQL7jazStJZKquGeJkjZbqtDDuLKTMeN kaNivcw4uqjwyQ40vBTTNp0Nh1s3Y/DiOCWrZtj8GPr5tmfa6WzizdJKV M3TVlrcVSsZk9tStg2PPHv/BK/XxdIpG9m8LsAKY+5LPly4sSPZAnY0ke iQtvA1QSGpRJkks4ASVfcla8ngl3AlK0IXpluMyE+Qi4VHfMEoRgSExLp NOIEwyYwZ3CKR5N6CFdQIgex8b9eV2NKParhtnMy0ybaobzILq6aSEm9Z xyUboM1vWImZIAXILk31vBYgxEv/iMIDN6z4uH1paTpYEVu9QDgMfcWVM Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="444906209" X-IronPort-AV: E=Sophos;i="6.00,241,1681196400"; d="scan'208";a="444906209" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2023 23:28:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="662277517" X-IronPort-AV: E=Sophos;i="6.00,241,1681196400"; d="scan'208";a="662277517" Received: from rex-z390-aorus-pro.sh.intel.com ([10.239.161.21]) by orsmga003.jf.intel.com with ESMTP; 13 Jun 2023 23:28:25 -0700 From: rex.zhang@intel.com To: vkoul@kernel.org, fenghua.yu@intel.com, dave.jiang@intel.com, dmaengine@vger.kernel.org Cc: ramesh.thomas@intel.com, tony.zhu@intel.com, rex.zhang@intel.com Subject: [PATCH 2/2] dmaengine: idxd: Modify ABI documentation for attribute pasid_enabled Date: Wed, 14 Jun 2023 14:28:23 +0800 Message-Id: <20230614062823.1743180-1-rex.zhang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org From: Rex Zhang Modify the sysfs attribute description in ABI/stable documentation for the attribute /sys/bus/dsa/devices/dsa0/pasid_enabled. Signed-off-by: Rex Zhang Acked-by: Fenghua Yu Acked-by: Dave Jiang --- Documentation/ABI/stable/sysfs-driver-dma-idxd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/ABI/stable/sysfs-driver-dma-idxd b/Documentation/ABI/stable/sysfs-driver-dma-idxd index 534b7a3d59fc..825e619250bf 100644 --- a/Documentation/ABI/stable/sysfs-driver-dma-idxd +++ b/Documentation/ABI/stable/sysfs-driver-dma-idxd @@ -84,7 +84,7 @@ What: /sys/bus/dsa/devices/dsa/pasid_enabled Date: Oct 27, 2020 KernelVersion: 5.11.0 Contact: dmaengine@vger.kernel.org -Description: To indicate if PASID (process address space identifier) is +Description: To indicate if user PASID (process address space identifier) is enabled or not for this device. What: /sys/bus/dsa/devices/dsa/state