Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3319685rdb; Tue, 6 Feb 2024 14:04:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwuCuWzXkQgfAyF9UoXLNIEbOttizrg/BcEij0YS9E1+4I3vHuw8V6Zw5nFCVgbQN7ObMN X-Received: by 2002:aa7:d308:0:b0:55f:6b8:b304 with SMTP id p8-20020aa7d308000000b0055f06b8b304mr2575921edq.8.1707257043630; Tue, 06 Feb 2024 14:04:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707257043; cv=pass; d=google.com; s=arc-20160816; b=DAzNR8UtEQe31JJxtG7LhHKrUZ56i+yu+aI445AFsCeS320wJyPbEScQYzpsBYDgiO QmIlJPvG5Pjp8tw8tuonSmozhsjkxSwXLffmz740Ti+x8IhW3tf/fOI+wNIPoF+tYigu +gJQb/oqlKPa0ChJmXRsoN4j/r8fQvO28Cue+/+8xgNskfgR/K4yKVVfQ5s4/Fi6V2XM UCMb5MEuc97Bool5O9CtsWFxkoZCsZd3rnAWq8ywdiT8TFweVTTyEhaOK3+G0MnIvX4t aqCdui41xI3Y97ChHGQEd/RIMfpWjqQGfSE/rC4galXckzQdPQcKBzXQ+d7LqbbX4I50 tWuA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=PDKzvyBK0Sw7QBvN0Qa/Z/hBlRKiTfiQLbziKDVBqPY=; fh=y3eB6BLEIJzxqJJUVQNi2DbLCgQYI73Q58YW7LGU07Y=; b=o1z1+StvQHZDTE7vUQxUeiX68/lftkCjYM5A/RxTgpjJAZAtpvinVHkVH8MPcekweR E0aee+sKuRDzBn8WjLzz1BUGzc+QAPuTDnuseUrInoLiGQZk8N4k+hf+oB3xIDw0ydap sjv1khBrIn28ey6RO6IDUuoK+580O08CjgSmooxsAFvyY0F+zvcewXwW7X29xLUtbz+s mqhi1lCKj5bXEVu6wa1K2pWI3jBU1+tqo5eX6HEoGQep3YzSXXsEbpnH8a0+BFhziGmw gEujFF4LnIt8Pd6YLyCrHROoriGAcALvLowzSqmC6RhQcUpQwag13PGD9sWqAgIMuhLv gZWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Xzu1OTGe; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-55665-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55665-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCUOcCVP9NFoF0c6lwwHjp6D2pghmuPbK6hkp0/5/XmcWpaHHV7HL+N/OK6/7DPL/cuQM+qK9mszE0y2G6UVNoJxNHpZVcGRB7fnyxmPTg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g18-20020a0564021ed200b00560ae160e34si1230626edg.584.2024.02.06.14.04.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 14:04:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55665-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Xzu1OTGe; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-55665-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55665-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 58AF01F227B8 for ; Tue, 6 Feb 2024 22:04:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26DD51BF35; Tue, 6 Feb 2024 22:03:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Xzu1OTGe" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 6E66F1BC35 for ; Tue, 6 Feb 2024 22:03:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707257029; cv=none; b=jdLpCuibsS9npY017qE5lWb7/erzsjKy3C9Or0UENq9meD3BFanBX7DLJHQGHLN7Yun8QS3VQSwKEZ7jHZmTgrRqPFnXfRFO64RT1MNEcuzxkogaqCt+DXVhMKD3R/vcgFV2ONj2dri44FMCZF04hPptsKX4zS5Of55C7Ct7DcM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707257029; c=relaxed/simple; bh=zElfxugSAaICSwSSy+gtvyX3G5fBSjbaZmZkf6g4Mp8=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RsdbOjVmoRbyqIRt9wchT2y4g45uCl72pB8valGWFP/j/vH+nALtC8o8iC34/AB4l2K3FIwHfAIQRehOeJC6sq8jcFq8K/+4hNgMquNQWu0dc7OJBdNAaW57AHmDOEVhKgXMOaH08OcviU/WAFLEehnDQU9ePQN30HPxXGOH6hw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Xzu1OTGe; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707257025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PDKzvyBK0Sw7QBvN0Qa/Z/hBlRKiTfiQLbziKDVBqPY=; b=Xzu1OTGe71CHkUbx7CDn21DKbRBFjfY0usNQiFofbeOEYGA9z57MCpVZfd9g0nwEvUSQEv Aubg1XI0q9OT6B8ZErog8JJ3IHCHkuyyYp8NI6OJIFD3cMPwL1nKaOXU34i1nfCyx6x06L 4HYFM7YyHjsGgeoGNHkyi2y3ZpXlLpM= Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-651-nUvB5OFGOSKwzOwED1teVA-1; Tue, 06 Feb 2024 17:03:43 -0500 X-MC-Unique: nUvB5OFGOSKwzOwED1teVA-1 Received: by mail-il1-f197.google.com with SMTP id e9e14a558f8ab-363d86bef43so4210095ab.0 for ; Tue, 06 Feb 2024 14:03:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707257023; x=1707861823; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PDKzvyBK0Sw7QBvN0Qa/Z/hBlRKiTfiQLbziKDVBqPY=; b=OC63+C/F9m9ZaIyY7iZAHQHscL2rL7LkWDGFy0BzlRmH+0OS36YfsjoXaWqXXR98XJ 3VSTj5wgdNCu9ku/7u21ZgiNibe9XwDrumchLxb7cC/9T4VnLMUh7NnYZaQsJHVLrGEM bHiyRDWCWGHyNdubI7PAziAWWV0CVXK7i/Y9Gw564V9nONTTCGAYBMbe8lzXYJd4IhXV zSsoJEJa0gNpsPw/rkSCJZ974FPX4HfuiGdox2NSl6m7Sb59sXyOAokoNR8fc0gm265O SC4Bep5Q76+OxbqP2S+L5V7NRqHTEbIj/NajQ1IzrKpr6Bwz5hmchDOA282qFtmRZEkG zEgg== X-Gm-Message-State: AOJu0YyKp7yb9YwhQIcQgjOBTbMq6rUPFOiKEd0hTIeepMyBgCZuzYd0 z0eehcJu1yyf3V/5Jii9NzZAmy0pBiuOJ/l5F0z/57NUntq+GWibfc4ULdAVE2hfthV3KeKXeLi BVvNbNiCagHUvXop9ZTxgGq/GBXnWfNjEw7ipIW7vA+w8H6kI2imZVdc2pEEtnw== X-Received: by 2002:a05:6e02:2187:b0:363:c4b9:d931 with SMTP id j7-20020a056e02218700b00363c4b9d931mr4354088ila.20.1707257023135; Tue, 06 Feb 2024 14:03:43 -0800 (PST) X-Received: by 2002:a05:6e02:2187:b0:363:c4b9:d931 with SMTP id j7-20020a056e02218700b00363c4b9d931mr4354072ila.20.1707257022938; Tue, 06 Feb 2024 14:03:42 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXQzH2XLbn+eAliDfhQRmJ9GpqgucS43F2DwvbQAkrFSAfd1TrkUQ5NRwDPMzidsOvSj4+nXSlxS9ud1ag5oX6OCc0G89se0V83F9Gfc39s2FZppNKaAyYqSSIdrl15ov7pMBuBnavHAX3E2wiY9epoN/SnpYXfehS9YMnJRU+EgLZVr/IIG3JmF5jv46+7cIuqbx4MAkALe1xbXBMaDJtI1tKwh7QGEsu2i/2Cm1H7jFz382dWccXVV8UETzln47spDRfk4YKw686grjtiT6aqO2S+fxL9JcuPm4rcPjYBsnAoIiQA8d0XlX2j4zn6jJiq1Z7O5A== Received: from redhat.com ([38.15.36.11]) by smtp.gmail.com with ESMTPSA id bp30-20020a056e02349e00b0036287013d01sm793765ilb.36.2024.02.06.14.03.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 14:03:42 -0800 (PST) Date: Tue, 6 Feb 2024 15:03:41 -0700 From: Alex Williamson To: Reinette Chatre Cc: , , , , , , , , Subject: Re: [PATCH 15/17] vfio/pci: Let enable and disable of interrupt types use same signature Message-ID: <20240206150341.798bb9fe.alex.williamson@redhat.com> In-Reply-To: <5784cc9b-697a-40fa-99b0-b75530f51214@intel.com> References: <20240205153542.0883e2ff.alex.williamson@redhat.com> <5784cc9b-697a-40fa-99b0-b75530f51214@intel.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 6 Feb 2024 13:46:37 -0800 Reinette Chatre wrote: > Hi Alex, > > On 2/5/2024 2:35 PM, Alex Williamson wrote: > > On Thu, 1 Feb 2024 20:57:09 -0800 > > Reinette Chatre wrote: > > .. > > >> @@ -715,13 +724,13 @@ static int vfio_pci_set_intx_trigger(struct vfio_pci_core_device *vdev, > >> if (is_intx(vdev)) > >> return vfio_irq_set_block(vdev, start, count, fds, index); > >> > >> - ret = vfio_intx_enable(vdev); > >> + ret = vfio_intx_enable(vdev, start, count, index); > > > > Please trace what happens when a user calls SET_IRQS to setup a trigger > > eventfd with start = 0, count = 1, followed by any other combination of > > start and count values once is_intx() is true. vfio_intx_enable() > > cannot be the only place we bounds check the user, all of the INTx > > callbacks should be an error or nop if vector != 0. Thanks, > > > > Thank you very much for catching this. I plan to add the vector > check to the device_name() and request_interrupt() callbacks. I do > not think it is necessary to add the vector check to disable() since > it does not operate on a range and from what I can tell it depends on > a successful enable() that already contains the vector check. Similar, > free_interrupt() requires a successful request_interrupt() (that will > have vector check in next version). > send_eventfd() requires a valid interrupt context that is only > possible if enable() or request_interrupt() succeeded. Sounds reasonable. > If user space creates an eventfd with start = 0 and count = 1 > and then attempts to trigger the eventfd using another combination then > the changes in this series will result in a nop while the current > implementation will result in -EINVAL. Is this acceptable? I think by nop, you mean the ioctl returns success. Was the call a success? Thanks, Alex