Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp130476lqc; Thu, 7 Mar 2024 12:24:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWWUhe9X+Pc4bqjz3DdduSa19eZr0pPRfu4zmmqm4J/R4Fd5kdLacmEGPKMyf0wWAkwrPrYetaT6Ll3tiguoKylFeYXmQmqLbUWeqJuwQ== X-Google-Smtp-Source: AGHT+IGIZO/t0JPalM/DhCIbHAXQTIkzA5VHyZoOTeyRI3QaLnW8B4+W1CUhnc4loBpZF31RVIN3 X-Received: by 2002:a17:902:ed0d:b0:1dd:6765:103 with SMTP id b13-20020a170902ed0d00b001dd67650103mr148397pld.48.1709843041882; Thu, 07 Mar 2024 12:24:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709843041; cv=pass; d=google.com; s=arc-20160816; b=We1C8PGpCc7QoSaQRS5YB01aXIHy7GQBDUzsTBAtbKfwQKxFAaF/LN85l66jFYhYdt JdfywYOOFc2k3x5hz0YVriRyDWeGVnazzHYYvIsRMdUdT3Bd932PFlPZEVVZJWbjmDl9 r3/0gGGK+LXUSbXB214WHIhOcQ5H6m84EhPxyXd8JShvkzgyydTtZ9/FL/0gnsP5hmew 6IZykGFdFwA+s9//GKK/oiXMf+Za5ihEWamue3wT9Lwy+xdTxO8Lj/RKuk1oGVh4sWI8 CO7YupXTgVolFlCEJh1d3srBNp/Ycxr/tFVAQ3v6Ks8BpAeLmKsRwRG+Gh9IBjucU8ou a1Rw== 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=JzYa2p0WN1L2k72Xj6BYuK/wXJ3KScc8Fyb6F0WXYSw=; fh=DTfGrU5jhuY3+W5Q/Eyce4RTQxGhF5IMXQ6197/VMgM=; b=B3Yuvg+4jLlwKcDBJysxStugt2+lF+fgcHLHyLbtAE6IoajQ9v3qQd+x1dtPjIlCHf w6Cvx+LuQH6MR0b7W17zZ4a0EYJ66N/uLfj/u0/OH3Imjro/eBA5Rx55JS5TCG4i9vHX BA00coJAGN9PdurWSZvaJZafiOypUj2ynJC/PmHYRpvfXeFsriOQJJmvBOWqeW+HlVy8 eN2dplozcbHB4RzgZ9AgqCVcATlCfPVWPlHqcXiDZdZhBy+Vvlx0YTe+vgW3rWvpHl1f yOI+TbdCXUzlBIUBNiJufLjXV70ZZKzfsjHgAgE14z0hcvcoN2A2cV23EQyXCOAFDj8q C9Vg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UNrS1QcO; 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-96184-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96184-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 13-20020a170902ee4d00b001dcbcb3f53esi14097331plo.444.2024.03.07.12.24.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 12:24:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96184-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UNrS1QcO; 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-96184-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96184-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 900EF281FDA for ; Thu, 7 Mar 2024 20:24:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF6EF1386AF; Thu, 7 Mar 2024 20:23:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UNrS1QcO" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 8E21B12FB2A for ; Thu, 7 Mar 2024 20:23:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709843035; cv=none; b=h8jBrzcqc6OSxN45U0FeQTEegQBUEqeq8b3zP1eMmP8ya1AieVicHwBMi+Zx32QtjuI1yhtts+4MCitXnhZyhvQ30+8wmRXCQACbvxPpKD+EJOxx/tIZm+oUCSV8qBRSrmmBRAnEGTftj5uveEV7GwcFUUV/pa1TkgTtzriAyMM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709843035; c=relaxed/simple; bh=n41G5cMXZfffNFebNQD0HhXIaaovLpPefnDOeOUdHew=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HLtujjUevlLZCgT/jfBh31+M5pwdBZY5FyFEfrKE7p46OGA5aDKyXcJ401eW6e1oKxPKJQBgiDBu3m3bHLJSrmweS+QjyVRmCeQrngF+Lhpmwdq7S1jY0TlM1qK5UVfsmGkAEwpJTkIBt2KWAt5/Iob4YF6UYU0ENuVURlkIHgE= 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=UNrS1QcO; arc=none smtp.client-ip=170.10.133.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=1709843032; 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=JzYa2p0WN1L2k72Xj6BYuK/wXJ3KScc8Fyb6F0WXYSw=; b=UNrS1QcO7diqxQkQ+yM5Hudv9LsGPzVQG1C71ecw1N+AzeTPiV4qpUQT85HGx9rvSoJlxZ W+F+hhrI5ZvkRM6tafL4+mVfxwjFzt656/OGjpydbB5m7zErPeLSi5R2WQVuOxotdiCtl6 q1Bw7zXujqcZaqYpFVNXmtSAZHUsTTM= Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-290-PFwi8fPMOyiUnD9w66tQDQ-1; Thu, 07 Mar 2024 15:23:51 -0500 X-MC-Unique: PFwi8fPMOyiUnD9w66tQDQ-1 Received: by mail-io1-f71.google.com with SMTP id ca18e2360f4ac-7c7f57fa5eeso11330439f.1 for ; Thu, 07 Mar 2024 12:23:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709843030; x=1710447830; 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=JzYa2p0WN1L2k72Xj6BYuK/wXJ3KScc8Fyb6F0WXYSw=; b=Ur4VSR5Jf6ODdKyZceN1/Z0rGqcruesmmGOyKgBUgE4T7x+ZSp0YqCAzV8+GyAs8h7 4Qr2m5NSVBeM8e3usFeu5mgr5j4/tCJkDBW6SSOZzsfbcUAlK4NHGspyL41RK70Ona7z P1Rglv3UZnvMHqYTdpuhHypIaoaLEohaP5QqgdRNPDqH/csbGnDW7KRmhuLerfpHvsL4 DsXIRXvUAvoSZw1uhERyrKFGDeYcHbkRD+yi7js5MOAu6SVab5695gASYAc9DZlaDFtu fBVG46Y6vQ9jssC9ZTW6DTaTCXk7tbVA/Y3NMLfhOO148uIv03FXpD3mFabWgwKC2ExM nCmA== X-Forwarded-Encrypted: i=1; AJvYcCWELZHIfDNMmqVchzU8v2HtK0xkeaXPoLmvZ2eckNFtHtwMdlvFuOuMGIWgO0YGXbTlnuOzsddWorEmAFJaKtsV0jcutnB81PxYV9Qk X-Gm-Message-State: AOJu0Yw7Vq7xXtfo9t4HKhgNm6lvWKjtriZ/ud0e8/v0lnQdP0Balwqy tqptkSHO0sR4cvZUNjMllQpZXoVVoIcECFG0je3NWX6I9cSWjjnSDJCtArMTWJNexLx4d0mtpnO Pz6Enir5AJorLrELrschIrDz1zAencfGUm5d08Pmxi2pdy0tEW8kussMP3LcxzQ== X-Received: by 2002:a6b:e509:0:b0:7c8:84c8:7813 with SMTP id y9-20020a6be509000000b007c884c87813mr3123553ioc.0.1709843030396; Thu, 07 Mar 2024 12:23:50 -0800 (PST) X-Received: by 2002:a6b:e509:0:b0:7c8:84c8:7813 with SMTP id y9-20020a6be509000000b007c884c87813mr3123548ioc.0.1709843030170; Thu, 07 Mar 2024 12:23:50 -0800 (PST) Received: from redhat.com ([38.15.36.11]) by smtp.gmail.com with ESMTPSA id g12-20020a02c54c000000b00474f04561bdsm2269985jaj.136.2024.03.07.12.23.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 12:23:49 -0800 (PST) Date: Thu, 7 Mar 2024 13:23:48 -0700 From: Alex Williamson To: "Tian, Kevin" Cc: "kvm@vger.kernel.org" , "eric.auger@redhat.com" , "clg@redhat.com" , "Chatre, Reinette" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/7] vfio/pci: Disable auto-enable of exclusive INTx IRQ Message-ID: <20240307132348.5dbc57dc.alex.williamson@redhat.com> In-Reply-To: References: <20240306211445.1856768-1-alex.williamson@redhat.com> <20240306211445.1856768-2-alex.williamson@redhat.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; 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 Thu, 7 Mar 2024 08:39:16 +0000 "Tian, Kevin" wrote: > > From: Alex Williamson > > Sent: Thursday, March 7, 2024 5:15 AM > > > > Currently for devices requiring masking at the irqchip for INTx, ie. > > devices without DisINTx support, the IRQ is enabled in request_irq() > > and subsequently disabled as necessary to align with the masked status > > flag. This presents a window where the interrupt could fire between > > these events, resulting in the IRQ incrementing the disable depth twice. > > This would be unrecoverable for a user since the masked flag prevents > > nested enables through vfio. > > > > Instead, invert the logic using IRQF_NO_AUTOEN such that exclusive INTx > > is never auto-enabled, then unmask as required. > > > > Fixes: 89e1f7d4c66d ("vfio: Add PCI device driver") > > Signed-off-by: Alex Williamson > > CC stable? I've always found that having a Fixes: tag is sufficient to get picked up for stable, so I typically don't do both. If it helps out someone's process I'd be happy to though. Thanks, Alex