Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp603884lqb; Fri, 24 May 2024 07:56:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWmp/NYdzAgC+OSc3yofH5g0EotC/NU59bqztfIGMguWlYnS3wSo5X+8pFYTYTb5yPosb4g3Omo9D1PHCNWBdoz7pryCQuPZS/eWP4a7g== X-Google-Smtp-Source: AGHT+IHd8dXgiD318FtSnHGvZqljhj4Ou+e5rng5ccizs8lUyO9hLOmAvRuCGb3ngmb8NC/haIIu X-Received: by 2002:a17:906:7b55:b0:a5c:f349:da82 with SMTP id a640c23a62f3a-a626536c954mr156295866b.68.1716562607855; Fri, 24 May 2024 07:56:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716562607; cv=pass; d=google.com; s=arc-20160816; b=o+mVwSIip5wfA7xmRoc/Vyiwg9TI6TCSWbbzsmdbOiH5oNslmWyt27K5fpfcYaWfs8 mO6v38jctmpRHX0nhjAACbGYPQJns25ANKeBAQkZ7vIwm0oBH8OuLCXlOxNUUIzyzNic BEotOMWtcuA4tVOAUC7Hd5E1ELXK4ikB4MCzWMjRkBDlNiGKyAFqZcorroru/5uHlt0t k07PojqwNZYP73xyQsA7avr3MQbhY1ERaRhWdFYj1SSto9nFFandXzycKP2pM/chYmUB rSQ2Ep2tO9F/biBQWtD/e6bOP3jgGn2wCcwOsvHDrQdGKabis4Hg/fyI9c9tYaV3y1pd wn1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=IFd4NSwhfGGM0dkHfawikZtgqzn4xojK3Pqv6CdYZAo=; fh=WrOScZDy3QIrDlpeb7eZLDc25Xj3htMZ4j087eYK+vk=; b=WiGZEieWk85S3FPl/AbjPDe+Mmz13uHgOV3menCwH8GVu5Pxcoo2sqYiaV5kua7+Bf /QJuSTaFl5QN/QiYDKxbe5LxdDQuUfrtzagIDNj760NqiNbhTaJF6v30XSGtZt4efEGO MPadsLEBqc3OuyNDOoZSRgR27RL6JLBlU1suPmXMkPdJwZNyfY2531JAyjBVzgPO3qTf sGcrXDIUcNaDd6fgweLcz6OVLWk5bI4InLnQZRSppjomFTwaWPrnHRXSgc6Sb6BdDRBU /nmedcpUZpka7y0nMXnYWmvCfuHfh1pZ3dhCbw7epWKDV+dLz49W1zlsk9XOG/P5UnfQ 11Tg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NpPwofG2; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-188819-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188819-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626cdca32csi91003966b.911.2024.05.24.07.56.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 07:56:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188819-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NpPwofG2; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-188819-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188819-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 6F17D1F21903 for ; Fri, 24 May 2024 14:56:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F3DFB12D205; Fri, 24 May 2024 14:56:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="NpPwofG2" Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8139212CDBC for ; Fri, 24 May 2024 14:56:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716562589; cv=none; b=VnQKfO+XnFf1SDTvXfhmRvQ1ElmwNSj4jB4frnX1DK4MwQK0r4UVOh9Z73bcDP5oCjJydX3XIFYh+pISfjl3LXWvpTEdyP5KH31GXJ5Nxh63OYcfFy25i1SGlxR4BYwWOfz5LzXaKGcUBJYPK47OLQ+DRM3P01PlKxpJOoUcUXc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716562589; c=relaxed/simple; bh=OYw8Cg1eCDv4d2lRRfYHRk0lfNtBpolIkz/iSx2vZqs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LLfz19KaXYzJd+Z9r8JzmQfYlynzpTag9BP/oIvWwSFC84SLJ/+zpyNapJB3UtJMGDcBoiUjcY5aoSgaG1dMd3JcQBNV49ukUxAsQn/hLDhSgJ31Nj0K5nVecKAIVeDfX5O4XzoKYzUBhzOz+chfdV5WwNQrvk1UpjrW06+Bt68= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=NpPwofG2; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4210c9d1df6so1781635e9.2 for ; Fri, 24 May 2024 07:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716562586; x=1717167386; darn=vger.kernel.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=IFd4NSwhfGGM0dkHfawikZtgqzn4xojK3Pqv6CdYZAo=; b=NpPwofG2YFaIMPOzgmeWLIZcM84n/mpwjjXkpYeeSfe8k96Cmvqsi3ruBpQghEd9Nz ZgZLop6umYPTQFhfunXW0JumlW1XeURH1wRC6XcapR2RvnS7mal1TJThzMSocwDuVTuO I4oyL8f9dBCgEWNzNbndfwktCXBsUhRRvT7QZcFVzxNm9FT8KJkQAC1IOiLf0fpKqfrR bkEt7L5gTw74PcU8Ojc/jzwedVwcDfNY8SFH9T+Q3I2qdxeqyNTK+EYSmu5564iVXQLj i6v2cjd5zLKI3URicA6lgNV2BmIpQE2BphgRBbG/FzhNv2uWQOtikFUHGiWjHneGWSer eBHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716562586; x=1717167386; 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=IFd4NSwhfGGM0dkHfawikZtgqzn4xojK3Pqv6CdYZAo=; b=D2VqnI+NJ+1LBrvJPp8DZwTqrJkXgcLEuw0wJwpBLee9ODKY54GNZIjaarksZfmAty ZtD6f7VoMzII1E3OiSBAUe6v+YSWjX3QZk1PabkzskRpQaGQ21rpI0O2k6pBj+ZX+1U4 QuFstEDaGByfaXGCGcTl/BXLIRaOJsp4ozVIy91H1+t7PoSkpcFPekxM22/jkkewJKRa +HSLw0jLau2QHHp7EReQBvSYAY2haQVrhxRJHvBypJUpUSWb6zwBPe9N0FZGr9uwNa5t Oyd5NvaZQc/xrpMPJs6quVyyHlWgDdvK0x04l0YQQ4fUxqXIkoPI0C5goewMgISCO5TE bluw== X-Forwarded-Encrypted: i=1; AJvYcCXo1Ci9SXN8SK82dgsJXpW02DziI8Sih4DL6n3QXdN89Q22HXdRyTH3Z39sDjku+hVAcLm2w9wu3CYsez/b6zncxiv6+x8rQVvANEtK X-Gm-Message-State: AOJu0YwrtgqQFNPngznp7i1OBP0Yz+5Zd5buqOjEE4UR+ZAp4EqXJcDw zZ58gKPPg9Xfwp4eMfp5z3CaPDxR+09UqCgodlC611X757p82ARPlBaMGpMh9K4= X-Received: by 2002:a05:600c:6b04:b0:41f:f053:edb4 with SMTP id 5b1f17b1804b1-421089ebea3mr21345815e9.23.1716562585592; Fri, 24 May 2024 07:56:25 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-420fc82c4e0sm74313045e9.0.2024.05.24.07.56.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 07:56:25 -0700 (PDT) Date: Fri, 24 May 2024 17:56:21 +0300 From: Dan Carpenter To: Sean Anderson Cc: Bjorn Helgaas , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , linux-pci@vger.kernel.org, Michal Simek , Thippeswamy Havalige , linux-arm-kernel@lists.infradead.org, Bjorn Helgaas , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Bharat Kumar Gogada Subject: Re: [PATCH v3 2/7] PCI: xilinx-nwl: Fix off-by-one in IRQ handler Message-ID: References: <20240522222834.GA101664@bhelgaas> <9299ee92-a32b-4b82-aa37-c7087a5c1376@linux.dev> 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-Disposition: inline In-Reply-To: <9299ee92-a32b-4b82-aa37-c7087a5c1376@linux.dev> On Thu, May 23, 2024 at 11:21:52AM -0400, Sean Anderson wrote: > On 5/22/24 18:28, Bjorn Helgaas wrote: > > On Mon, May 20, 2024 at 10:53:57AM -0400, Sean Anderson wrote: > >> MSGF_LEG_MASK is laid out with INTA in bit 0, INTB in bit 1, INTC in bit > >> 2, and INTD in bit 3. Hardware IRQ numbers start at 0, and we register > >> PCI_NUM_INTX irqs. So to enable INTA (aka hwirq 0) we should set bit 0. > >> Remove the subtraction of one. This fixes the following UBSAN error: > > > > Thanks for these details! > > > > I guess UBSAN == "undefined behavior sanitizer", right? That sounds > > like an easy way to find this but not the way users are likely to find > > it. > > It's pretty likely they will find it this way, since I found it this way > and no one else had ;) > > > I assume users would notice spurious and missing interrupts, e.g., > > a driver that tried to enable INTB would have actually enabled INTA, > > so we'd see spurious INTA interrupts and the driver would never see > > the INTB it expected. > > > > And a driver that tried to enable INTA would never see that interrupt, > > and we might not set any bit in MSGF_LEG_MASK? > > And yes, this would manifest as INTx interrupts being broken. > It's so weird that it's been broken for seven years and no one reported it. :/ regards, dan carpenter