From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B3B926E6F3; Mon, 24 Nov 2025 02:45:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763952347; cv=none; b=iIT7p+k6/S0sRY1kg78jGYS8LJUcObfxydLyTLDA2GgG3P0kR6a+XYCcofz3P3MQiiW+boFfu/kxKmds1XJvUbLyXrhuJU4U8qWjqabNkwYBT4v4I2DrIMvopTdQE7uFrfpPJHhiT2HgE46/Lwy6KOIqtFDTOJQByAMoQBLRkNQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763952347; c=relaxed/simple; bh=NMPY872VM5up93G7h991nsyWCjRUvXvUGzf24Wma7xY=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=m6/6zyw7KIxLHyiqdCGnXSQKyMvXkPSTNwJuXzgDEaBnQgxDoEj3lE+bXZoA2UUbtuMnqeFu5sfHcR+DzStZOUal/1W/jjggl0mwk1B7fflOIRi5KUtpW7ovlLHCyRkCt33OfxohthkA1rWtf5bdTjpKZq2mbVH14qQgcMfAomc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shazbot.org; spf=pass smtp.mailfrom=shazbot.org; dkim=pass (2048-bit key) header.d=shazbot.org header.i=@shazbot.org header.b=zmAcXhk3; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ci4vpIsl; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shazbot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shazbot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=shazbot.org header.i=@shazbot.org header.b="zmAcXhk3"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ci4vpIsl" Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailfout.phl.internal (Postfix) with ESMTP id 61B78EC018A; Sun, 23 Nov 2025 21:45:42 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Sun, 23 Nov 2025 21:45:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shazbot.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1763952342; x=1764038742; bh=XyMJ67yTgXSbIAMvfOO91gl34Ad6fl7jZXmv2SkDhDc=; b= zmAcXhk3oVHEdPVrfr3CfutuI/9PZOvt8mnPCgPha2JRajMARJjqZ5ebx4m+EaLV xt3TKOMMXCJvsMfHKByq+AY40yR+EaAB1xGgrS4Fmw0BRNvChgyNjhXErpB9at+o yZx0KxmwS0MnG88klQ5QM0fy4241S3HQK+QDMdnO0kR5x1tPmt5WJi4Ejw2wa9nb x1q5JPCzHKWTKFHTNBxksJVhqEg0u96dBHmhYlaO6Ci/tnfRf31PlesqRMY2I+9k CVRuhRpn7mdyUPo5fX9EaC27St2zYAMQhajAJrxb4wS3a71v8DnJEaZgxEVpk3aL EUmp2HHVKwCzf96WDMhZOA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1763952342; x= 1764038742; bh=XyMJ67yTgXSbIAMvfOO91gl34Ad6fl7jZXmv2SkDhDc=; b=c i4vpIslcc8CxdLMdqKpwqtCpmqovW0GqgF/lfQ584iu5Ya2gqYNPeFhbXMBcjsQZ z7EKedJEwzpGnjTQYg+0fB6AiaZsIyTXHeaoF75G+zTU7MRl+RmTr1aJeihre/GC 2RML34BuztPozz4Cqt6tpUtHzVy/vMPw3c9kXRVphWCiBhn3LrFg/HSylBK/MjJB OyQOh2AfuN9rWyh9MH0QaTMEgF6hMWYbvdkdtwcmFDj658WFBhaei26ujgDRtDJy npA791WPk4TWeG9JtPZkUiP6635UYA5VpydABylNpfGpyz8WTLmZKp7oJT9eKofg aeIPya7/H1qTyzlWe7Yrg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvfeejgeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkjghfgggtgfesthejredttddtvdenucfhrhhomheptehlvgigucgh ihhllhhirghmshhonhcuoegrlhgvgiesshhhrgiisghothdrohhrgheqnecuggftrfgrth htvghrnhepteetudelgeekieegudegleeuvdffgeehleeivddtfeektdekkeehffehudet hffhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hlvgigsehshhgriigsohhtrdhorhhgpdhnsggprhgtphhtthhopeegtddpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtoheplhhiuhhlohhnghhfrghngheshhhurgifvghirdgtoh hmpdhrtghpthhtohepjhhgghesnhhvihguihgrrdgtohhmpdhrtghpthhtoheprghgohhr uggvvghvsehlihhnuhigrdhisghmrdgtohhmpdhrtghpthhtoheprghirhhlihgvugesgh hmrghilhdrtghomhdprhgtphhtthhopegrlhgvgidrfihilhhlihgrmhhsohhnsehrvggu hhgrthdrtghomhdprhgtphhtthhopegrnhhkihhtrgesnhhvihguihgrrdgtohhmpdhrtg hpthhtohepsghorhhnthhrrggvghgvrheslhhinhhugidrihgsmhdrtghomhdprhgtphht thhopegsrhgvthhtrdgtrhgvvghlvgihsegrmhgurdgtohhmpdhrtghpthhtohepughrih dquggvvhgvlheslhhishhtshdrfhhrvggvuggvshhkthhophdrohhrgh X-ME-Proxy: Feedback-ID: i03f14258:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 23 Nov 2025 21:45:37 -0500 (EST) Date: Sun, 23 Nov 2025 19:45:35 -0700 From: Alex Williamson To: liulongfang Cc: Jason Gunthorpe , Alexander Gordeev , David Airlie , Alex Williamson , Ankit Agrawal , Christian Borntraeger , Brett Creeley , , Eric Auger , Eric Farman , Giovanni Cabiddu , Vasily Gorbik , Heiko Carstens , , Jani Nikula , Joonas Lahtinen , , Kirti Wankhede , , Matthew Rosato , Nikhil Agarwal , Nipun Gupta , Peter Oberparleiter , Halil Pasic , , Rodrigo Vivi , Simona Vetter , Shameer Kolothum , Sven Schnelle , Tvrtko Ursulin , , Vineeth Vijayan , Yishai Hadas , Zhenyu Wang , Zhi Wang , Kevin Tian , , Pranjal Shrivastava , Mostafa Saleh Subject: Re: [PATCH v2 02/22] vfio/hisi: Convert to the get_region_info op Message-ID: <20251123194535.42acb382@shazbot.org> In-Reply-To: References: <2-v2-2a9e24d62f1b+e10a-vfio_get_region_info_op_jgg@nvidia.com> Precedence: bulk X-Mailing-List: virtualization@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 24 Nov 2025 09:39:58 +0800 liulongfang wrote: > On 2025/11/8 1:41, Jason Gunthorpe wrote: > > Change the function signature of hisi_acc_vfio_pci_ioctl() > > and re-indent it. > > > > Reviewed-by: Kevin Tian > > Acked-by: Pranjal Shrivastava > > Signed-off-by: Jason Gunthorpe > > --- > > .../vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 57 +++++++++---------- > > 1 file changed, 27 insertions(+), 30 deletions(-) > > > > diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c > > index fde33f54e99ec5..899db4d742a010 100644 > > --- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c > > +++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c > > @@ -1324,43 +1324,39 @@ static ssize_t hisi_acc_vfio_pci_read(struct vfio_device *core_vdev, > > return vfio_pci_core_read(core_vdev, buf, new_count, ppos); > > } > > > > -static long hisi_acc_vfio_pci_ioctl(struct vfio_device *core_vdev, unsigned int cmd, > > - unsigned long arg) > > +static int hisi_acc_vfio_ioctl_get_region(struct vfio_device *core_vdev, > > + struct vfio_region_info __user *arg) > > { > > - if (cmd == VFIO_DEVICE_GET_REGION_INFO) { > > - struct vfio_pci_core_device *vdev = > > - container_of(core_vdev, struct vfio_pci_core_device, vdev); > > - struct pci_dev *pdev = vdev->pdev; > > - struct vfio_region_info info; > > - unsigned long minsz; > > + struct vfio_pci_core_device *vdev = > > + container_of(core_vdev, struct vfio_pci_core_device, vdev); > > + struct pci_dev *pdev = vdev->pdev; > > + struct vfio_region_info info; > > + unsigned long minsz; > > > > - minsz = offsetofend(struct vfio_region_info, offset); > > + minsz = offsetofend(struct vfio_region_info, offset); > > > > - if (copy_from_user(&info, (void __user *)arg, minsz)) > > - return -EFAULT; > > + if (copy_from_user(&info, arg, minsz)) > > + return -EFAULT; > > > > - if (info.argsz < minsz) > > - return -EINVAL; > > + if (info.argsz < minsz) > > + return -EINVAL; > > > > - if (info.index == VFIO_PCI_BAR2_REGION_INDEX) { > > - info.offset = VFIO_PCI_INDEX_TO_OFFSET(info.index); > > + if (info.index != VFIO_PCI_BAR2_REGION_INDEX) > > + return vfio_pci_ioctl_get_region_info(core_vdev, arg); > > > > - /* > > - * ACC VF dev BAR2 region consists of both functional > > - * register space and migration control register space. > > - * Report only the functional region to Guest. > > - */ > > - info.size = pci_resource_len(pdev, info.index) / 2; > > + info.offset = VFIO_PCI_INDEX_TO_OFFSET(info.index); > > > > Please adapt based on the latest code in the Next branch. > Code updates have already been made here. I resolved this on commit, please verify in the vfio next branch. Thanks, Alex