Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2141917rwb; Thu, 19 Jan 2023 21:54:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXsb/bJAXDORcTNNXJhlUvz8T4kQPeLjE07fjQqwYmHQul2YX/rR8/NoLJQNT7Ge5jEoLAV2 X-Received: by 2002:a05:6a20:7da2:b0:b8:5a85:632c with SMTP id v34-20020a056a207da200b000b85a85632cmr18763960pzj.60.1674194058677; Thu, 19 Jan 2023 21:54:18 -0800 (PST) Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h63-20020a636c42000000b004cd73b07192si14481858pgc.18.2023.01.19.21.54.13; Thu, 19 Jan 2023 21:54:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ANJqes9X; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230216AbjATFBP (ORCPT + 47 others); Fri, 20 Jan 2023 00:01:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230055AbjATFAz (ORCPT ); Fri, 20 Jan 2023 00:00:55 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54CC97AF0B for ; Thu, 19 Jan 2023 20:48:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674190129; x=1705726129; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=7Gbcpl+Lav+jvU7PIvH2NlsAuLetOrzRpdQhhoF/wuI=; b=ANJqes9Xy4avbLPrIwSJzzHxvadcnPW8TjFoahu0JAfGDEa6ILH1hy2O +tFUVp/Ht+MoHkr4ykWP0WVyGLqW7BVyUtmhqf8SwWQ3TRIMrh1VOueOy LBGzW+BLSoDML8NxRroffEX45h0eqOyfgWVFgPvcnLXGDklVAfPhXqYO2 rbTLkrQi+8P9rRzVVqhaG7wKVl0N/281LrJCs/OlZ8+lLjRBdsLkxIA6c +hj8nzTsmBVkaeH+TE50FKZKQS/fgdfMdRPDcVDOrDuBzzbwuy3ylksOC 5vIqO+OymXHn0XdKQJAcw9lqWMQQ9S/LHSCuoy/sAXX/rbEFLPq6ROeOm g==; X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="309016943" X-IronPort-AV: E=Sophos;i="5.97,230,1669104000"; d="scan'208";a="309016943" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2023 14:06:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="723683526" X-IronPort-AV: E=Sophos;i="5.97,230,1669104000"; d="scan'208";a="723683526" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga008.fm.intel.com with ESMTP; 19 Jan 2023 14:06:05 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 19 Jan 2023 14:06:04 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 19 Jan 2023 14:06:04 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Thu, 19 Jan 2023 14:06:04 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.168) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Thu, 19 Jan 2023 14:06:04 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NENhUUZQmR2NiGpjXlp0bNhRJySvVPR7s0J458xviYr9hp2wgVjtdZn2mDC9ltXRaKsFOsci9rWuQq18sclKxVCnn7Un1I17CQvSqSOHltYlzFIn2gXDT39C9W/NooR/NFk3j2hbLk3Acs2ZeKyX6HOsRqSWomCYcOiy/iG9EwvdEZZdJT+Oiklr/DI6P5jkfb/5DWgHI4iLuW1xy6WqtfukVtkajMzUVSDRhJq/t21DmyvXzbVdvNyyD7gHptiKMFFQfQmMKCgDNdN5EoV7Ru57zajTg7HEtPeWSxydpRTIvxR4HuEAJu8rmNnIijy1lGcjUYZcYypawTSgS273Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=o4W/akzkeUC24Iyj+B08ERmZp6mX0V0s7w/TWnYzFGU=; b=bjXLdaIt2s9rncI3KQR0E4Yt3i4DNYfw5uQaURZsQWuiHZD97XQSZMrKbeWdVwxeUry2+kRhXEob5ee/8SKXPTcpZ3v4CSinpUnW8oXN7HT6ki6fLnWMfkqxSTVMcOOeadO8mLgu2ZfVQYO7lfjqgvYqveE9VrVw9Anlj+wZWQk+11CgugqHEPkHDscBoQiQ+AV6JUMrTp7yDvBJnGS4B51Ahpop9LeyxuMWd8iTURmWuoUi9dT38X7vwIlNYmIUUYC0jhsKsZFewvzgLJZ4fuLq9cFCKTomDIjTW+juPR9jpDDxwQ/ycfKiJJNvXWxzMXjxKk/lXUXuI1SDkKF7Fw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MN0PR11MB6059.namprd11.prod.outlook.com (2603:10b6:208:377::9) by PH0PR11MB5045.namprd11.prod.outlook.com (2603:10b6:510:3f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.24; Thu, 19 Jan 2023 22:06:01 +0000 Received: from MN0PR11MB6059.namprd11.prod.outlook.com ([fe80::1818:e39d:454d:a930]) by MN0PR11MB6059.namprd11.prod.outlook.com ([fe80::1818:e39d:454d:a930%4]) with mapi id 15.20.6002.025; Thu, 19 Jan 2023 22:06:01 +0000 Date: Thu, 19 Jan 2023 17:05:56 -0500 From: Rodrigo Vivi To: Zhenyu Wang CC: Deepak R Varma , David Airlie , , Saurabh Singh Sengar , , , Praveen Kumar , Daniel Vetter , Subject: Re: [Intel-gfx] [PATCH 2/2] drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes Message-ID: References: <188df08e0feba0cda2c92145f513dd4e57c6e6cf.1673375066.git.drv@mailo.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: BYAPR08CA0040.namprd08.prod.outlook.com (2603:10b6:a03:117::17) To MN0PR11MB6059.namprd11.prod.outlook.com (2603:10b6:208:377::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR11MB6059:EE_|PH0PR11MB5045:EE_ X-MS-Office365-Filtering-Correlation-Id: c8939b6e-d5c1-4ba9-7464-08dafa6959f8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LnsYCvuXcGdQYz8XQFQsOPgh/Bcy+o6ZwhKPaik8neJv1JmFqa64vdIvT8mxwuLnump0Lj7Zjx547rY1mRCP1iqRjoteshxXkc0w5jcs4X0b4b4MI9KO/EX8fDRX1Xa56wDZcttqcP86de/v4A+zf213ZuiUaBhkg7Eu32fVcrAKsx1qpE7rRT4ZhNmsJ+prBkGwNLLWN4/+YXsi0v1NhCv77tOeUMtrfl1Fcut9l4hYfvOU9BAP7eG9qP8l+J/VnDpRD8/kfFuQHGcqgHsY7KCzFfP7uYV0k4NxtMrGBjF58pEtoH0ZDo7s91bqlTChN17sJ7nfWyigQu8C/H3wrJGPa/e1w4KmSuVmDtZm+zbMsfsoJIiBUZaoEqbrT3Qsm5VkYVb3wW+dXQHNMtADHHjw1CvlfFHGGL9O8A9vE2/fEDyzcIqGhAIvBxJalWn+MuoCdJd633NBhM4fdr7XIfrbQ3peHsUVlloA5oapiPUuM8UOeoaloOYbgzmrmg5UQUsZFKgj1YXnuUaO4K9FS6W+ipMZHnmPg4N9VMaGJYhCg5+9Q324STInWp+sltl1c6qtzs7VlLthny3M7NAVGr9P2jBZL3P5jcAXcOJvKTGNK6AQLXw4pxCb4gtIyDQhGDQywJYo2F6UexmskxfXb1oJyZ3Jbm7P0KeSn+2Ij9UUnHPuIsyJqFJdCNmoAUMSNz7ZHZlW5+vw0A6ExWh7iJOv9VKPof8MPOaLQjrkGL0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR11MB6059.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(376002)(366004)(396003)(136003)(346002)(451199015)(38100700002)(36756003)(82960400001)(86362001)(2616005)(6666004)(186003)(6506007)(53546011)(6486002)(478600001)(44832011)(26005)(966005)(6512007)(5660300002)(8936002)(7416002)(2906002)(41300700001)(66556008)(66946007)(6916009)(66476007)(54906003)(4326008)(8676002)(316002)(83380400001)(67856001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?3l9Xxy53yxM7MMT09jR/OHPecoxN4a3PYoVKaal9W8zNvWWqrmIWF2Lkg8FZ?= =?us-ascii?Q?+dFLHyt232QhQu442sdCWxuIV9GMm5B/gk2yrcLB6PTA9nJaR39CQk2K2kzd?= =?us-ascii?Q?eD6WsjK/SGp3liJrJiOD8nmlRFTfZeNap796SAKmhqqv/eczw5oBBt7yjm6m?= =?us-ascii?Q?1untaf7bFh0f17B0bnND0pkRvIw1rSjuaGiu5BZkNiwR3RhEf+9wn4veUid3?= =?us-ascii?Q?JrZQ100vw1StftMgHZKGRIS1RQYPPl9MD4B5wiEsO2T35c8BWInOTTQUd/sc?= =?us-ascii?Q?rl4biSAEpoxEtLUlPNgB2InE3kzxnvClP3Zra3IGamNFnF1Vs0VSCJRlaHxM?= =?us-ascii?Q?G/CUN3NbzFovGEEp1Hc+mGaG4jUEVNLpGc11gh6gCLtlE+Mc+HzVINlZgmVg?= =?us-ascii?Q?g4SHfIxnDD2Gz0oWl8PLh8+HT/msTWmnrrKBPjpOdjKKPrxV6MWYqbQtMico?= =?us-ascii?Q?I1IVKcfGgPexrYVXVh5f8Zi1m6BxlWtME6q1iD7HO31Ab0zSzyxNgWGm3oDk?= =?us-ascii?Q?Ofi7HuN/BGLQl4pCHEw1rdwq2gY36wFi0iw+R1dPrdcgi7RPqcyOnd7KziSI?= =?us-ascii?Q?TuFa7BzJrUHvV+1naL1FqsCnNa04sbDYzY+GgWLKO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xRQ+BTyaVDTw7Q4/tVpI9BTtt8cb//6GW6zsJpyc/68DQNrX?= =?us-ascii?Q?82hMp6lT5PGQ6kn11qresZ0uc3S1j8/mwtw8qAFT886rWyOh4zqbRZXjvT2r?= =?us-ascii?Q?kA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: c8939b6e-d5c1-4ba9-7464-08dafa6959f8 X-MS-Exchange-CrossTenant-AuthSource: MN0PR11MB6059.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 22:06:01.7137 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Qz7Q4wKYj1yt1F0vDx+Xxgx85nGeqhdFDcl1oX4m6GjADUJgQyBHsFY5vXWXI90tgTpbMleHq991pMxGHQPnIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5045 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 19, 2023 at 09:26:20AM +0800, Zhenyu Wang wrote: > On 2023.01.18 11:44:55 -0500, Rodrigo Vivi wrote: > > On Wed, Jan 18, 2023 at 10:18:11AM +0530, Deepak R Varma wrote: > > > On Tue, Jan 17, 2023 at 02:29:37PM -0500, Rodrigo Vivi wrote: > > > > On Mon, Jan 16, 2023 at 01:44:46PM +0800, Zhenyu Wang wrote: > > > > > On 2023.01.10 13:49:57 -0500, Rodrigo Vivi wrote: > > > > > > On Wed, Jan 11, 2023 at 12:00:12AM +0530, Deepak R Varma wrote: > > > > > > > Using DEFINE_SIMPLE_ATTRIBUTE macro with the debugfs_create_file() > > > > > > > function adds the overhead of introducing a proxy file operation > > > > > > > functions to wrap the original read/write inside file removal protection > > > > > > > functions. This adds significant overhead in terms of introducing and > > > > > > > managing the proxy factory file operations structure and function > > > > > > > wrapping at runtime. > > > > > > > As a replacement, a combination of DEFINE_DEBUGFS_ATTRIBUTE macro paired > > > > > > > with debugfs_create_file_unsafe() is suggested to be used instead. The > > > > > > > DEFINE_DEBUGFS_ATTRIBUTE utilises debugfs_file_get() and > > > > > > > debugfs_file_put() wrappers to protect the original read and write > > > > > > > function calls for the debug attributes. There is no need for any > > > > > > > runtime proxy file operations to be managed by the debugfs core. > > > > > > > Following coccicheck make command helped identify this change: > > > > > > > > > > > > > > make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci > > > > > > > > > > > > > > Signed-off-by: Deepak R Varma > > > > > > > > > > > > I believe these 2 gvt cases could be done in one patch. > > > > > > But anyways, > > > > > > > > > > > > Reviewed-by: Rodrigo Vivi > > > > > > > > > > > > for both patches... and will leave these 2 patches for gvt folks > > > > > > to apply. Unless they ack and I apply in the drm-intel along with the other ones. > > > > > > > > > > > > > > > > yeah, they're fine with me, feel free to apply them directly. > > > > > > > > > > Acked-by: Zhenyu Wang > > > > > > > > Unfortunately I got some conflicts when trying to apply on drm-intel-next. > > > > > > > > We probably need a new version, and probably through gvt branches it > > > > will be easier to handle conflicts if they appear. > > > > > > Hello Rodrigo, > > > Sure. I will send in a new version. I am current using linux-next git repo as my > > > remote origin [tag 20230113]. Are there any specific instruction/location from > > > where I should access the gvt branch? > > > > https://github.com/intel/gvt-linux.git > > > > but with the linux-next your patch is probably right for them. > > > > yeah, I think so as currently from last pull request I don't have > other updates in gvt tree, maybe it's just d-i-n hasn't included > recent gvt change. > > I saw Deepak sent a new one, feel free to apply. Let me know if > there's still any issue. It still doesn't apply in drm-intel-next. Could you please take it through your branch? > > thanks! > > > > > > > > > > > > > --- > > > > > > > drivers/gpu/drm/i915/gvt/debugfs.c | 6 +++--- > > > > > > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > > > > > > > > > > > diff --git a/drivers/gpu/drm/i915/gvt/debugfs.c b/drivers/gpu/drm/i915/gvt/debugfs.c > > > > > > > index 03f081c3d9a4..baccbf1761b7 100644 > > > > > > > --- a/drivers/gpu/drm/i915/gvt/debugfs.c > > > > > > > +++ b/drivers/gpu/drm/i915/gvt/debugfs.c > > > > > > > @@ -165,7 +165,7 @@ static int vgpu_status_get(void *data, u64 *val) > > > > > > > return 0; > > > > > > > } > > > > > > > > > > > > > > -DEFINE_SIMPLE_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n"); > > > > > > > +DEFINE_DEBUGFS_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n"); > > > > > > > > > > > > > > /** > > > > > > > * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU > > > > > > > @@ -182,8 +182,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu) > > > > > > > &vgpu_mmio_diff_fops); > > > > > > > debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu, > > > > > > > &vgpu_scan_nonprivbb_fops); > > > > > > > - debugfs_create_file("status", 0644, vgpu->debugfs, vgpu, > > > > > > > - &vgpu_status_fops); > > > > > > > + debugfs_create_file_unsafe("status", 0644, vgpu->debugfs, vgpu, > > > > > > > + &vgpu_status_fops); > > > > > > > } > > > > > > > > > > > > > > /** > > > > > > > -- > > > > > > > 2.34.1 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >