From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4F55FCCF9F8 for ; Mon, 3 Nov 2025 07:39:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9893110E368; Mon, 3 Nov 2025 07:39:49 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="BY6CfqLC"; dkim-atps=neutral Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9FBCA10E36D for ; Mon, 3 Nov 2025 07:39:48 +0000 (UTC) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-295c64cb951so89475ad.0 for ; Sun, 02 Nov 2025 23:39:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1762155588; x=1762760388; darn=lists.freedesktop.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=zzwh3KfEQpKPksD5Xn4ZAd8EEqdDZL8lWisUmSvX4T0=; b=BY6CfqLCQ3uqqnHw7n/1B1wB6A1GuSwqwwWzy2hiuOtsFt3H7zYC/GnTegW3RffCJF pgMwjXgYYlMJMyLVxTmzw5Y3ekrLsmJTX1s+JU4Fv3i3mu+rveKMy3eJUB7PI+dG7r9i Kba/0c9lZoqsbYL28RIUdY4xe4cY2Jm5mt7M9eLy9CYSY7xOhTUCLqU51GfyL1mxCJ4N PDB9m1TZmjVJ0+iSbe6GO8RmauPJGK2+v0tCU1WQhHug8A6eZgBH1QaCRhpCRIW2NggV HOGbLbgHTFB3xFtra99EveYMaBZxjkqZy0D/OEsifBSnalcKL89+dYVSW8zmsLqYR5dp DSug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762155588; x=1762760388; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zzwh3KfEQpKPksD5Xn4ZAd8EEqdDZL8lWisUmSvX4T0=; b=SKJuxwGO2QNgCbfoqC9MtneYaNtxBpYCvlQmZKy9QWaxKcGFQ1c2PWtSeXZt3g3imY iqwExGm5hUjIMgdhMf9lS5w+VQLU8kE7nmEhlSwI7N+TK/GdsmUtEdyJfOCPVXjS8XuF Cmf/uyMS9crmEtCNCS2XQVWL4do3Yh9ERmXp7M/Nr7A8JYxPH/kPGYcFG6tZtW7hUW4l zm2+b7Q1UT4mB5NyLY2pq9lC6mtInNjxrLzqbUBztwCKdqxE9B03NUEJ3w6h/Uh79IDR FLbSk6NhF/SnJURK2kY+/ffXmHZtKfDY1kRHmZmDaosSbNFAAHWFrfF6oP/kWUjm7DJV MVxw== X-Forwarded-Encrypted: i=1; AJvYcCVLyRIjBmBQ/yeWl4cZqc4UokubrEgpagbOeg2nsbkRaG35tOGG8oIs1hYC1ZFpS/ciG2PWQvGV2pY=@lists.freedesktop.org X-Gm-Message-State: AOJu0YwKFjazkl6e9BPLfrSxBfERNwW/byLfKJ3PCEO4NL/goTx5yjOT LwiEEzWfowTnN8GrXAvqxEmIvYWxfH8sEXiU/WIMQY/v2MajhRw3jsEQvHGBmePvwQ== X-Gm-Gg: ASbGncswquw7wpyWEtugH4T1npetz3F/yVEvABS8lyj2OaQNE+y1UmVWEEOVZIQH+UD 3e/2Jd/O7UAAF5dzFAyUcfN4b/t0jzjoVgkY89TZ0H0472qDhIyLXW9CKwk71O7Ec+lUVUcj07r N6NLz1xiBy7gXQpRWECvdPnJezC4X1qIk5UshLcCokjWFBkoDlnLi54sRwhZy2ka4dWuBLBOWjI LW6tTTWb79M6MSpH5Q+yXI65UyIJ+k42qPl/d0Bv91p4sY+CN0HjntTHTOC1UPNtblznvlau+/x YZJqkT1Ap0N9Oub16awmuxRm/YS7IT2jMXT1vPeQL9lIH4A0cYFc+x3Fri6IyLz4q5vEgL/Brpe aEbaHz4rt3xsLUWXQJd74Y8BfJwxB+oTFsnMyvT+BVUaEuYf5Q9wMsZ6TbpfuEzXnPlL30n+Loj ddwThvhNMgQPAVWC2CHPO/u8mxRzTknocwGtv1vxhrizLkWNyU X-Google-Smtp-Source: AGHT+IGoX/eRPHIgiRFzzACV20d0ftHJvRprPrWC1Oq8kyrn4muK0Mu+0fpj1flmH53tBH91iPLzGw== X-Received: by 2002:a17:902:ea0d:b0:24b:1741:1a4c with SMTP id d9443c01a7336-295549f6bcbmr6601575ad.0.1762155587782; Sun, 02 Nov 2025 23:39:47 -0800 (PST) Received: from google.com (164.210.142.34.bc.googleusercontent.com. [34.142.210.164]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2952e9a399csm102714425ad.33.2025.11.02.23.39.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Nov 2025 23:39:47 -0800 (PST) Date: Mon, 3 Nov 2025 07:39:37 +0000 From: Pranjal Shrivastava To: Jason Gunthorpe Cc: Alexander Gordeev , David Airlie , Alex Williamson , Ankit Agrawal , Christian Borntraeger , Brett Creeley , dri-devel@lists.freedesktop.org, Eric Auger , Eric Farman , Giovanni Cabiddu , Vasily Gorbik , Heiko Carstens , intel-gfx@lists.freedesktop.org, Jani Nikula , Joonas Lahtinen , Kevin Tian , kvm@vger.kernel.org, Kirti Wankhede , linux-s390@vger.kernel.org, Longfang Liu , Matthew Rosato , Nikhil Agarwal , Nipun Gupta , Peter Oberparleiter , Halil Pasic , qat-linux@intel.com, Rodrigo Vivi , Simona Vetter , Shameer Kolothum , Mostafa Saleh , Sven Schnelle , Tvrtko Ursulin , virtualization@lists.linux.dev, Vineeth Vijayan , Yishai Hadas , Zhenyu Wang , Zhi Wang , patches@lists.linux.dev Subject: Re: [PATCH 14/22] vfio: Require drivers to implement get_region_info Message-ID: References: <0-v1-679a6fa27d31+209-vfio_get_region_info_op_jgg@nvidia.com> <14-v1-679a6fa27d31+209-vfio_get_region_info_op_jgg@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14-v1-679a6fa27d31+209-vfio_get_region_info_op_jgg@nvidia.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Oct 23, 2025 at 08:09:28PM -0300, Jason Gunthorpe wrote: > Remove the fallback through the ioctl callback, no drivers use this now. > > Signed-off-by: Jason Gunthorpe > --- > drivers/vfio/vfio_main.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c > index a390163ce706c4..f056e82ba35075 100644 > --- a/drivers/vfio/vfio_main.c > +++ b/drivers/vfio/vfio_main.c > @@ -1297,13 +1297,13 @@ static long vfio_device_fops_unl_ioctl(struct file *filep, > break; > > case VFIO_DEVICE_GET_REGION_INFO: > - if (!device->ops->get_region_info) > - goto ioctl_fallback; > - ret = device->ops->get_region_info(device, uptr); > + if (unlikely(!device->ops->get_region_info)) > + ret = -EINVAL; Nit: Let's also add a warn/err log here highliting that the device doesn't populate the get_region_info op? > + else > + ret = device->ops->get_region_info(device, uptr); > break; > > default: > -ioctl_fallback: > if (unlikely(!device->ops->ioctl)) > ret = -EINVAL; > else Reviewed-by: Pranjal Shrivastava Thanks, Praan