Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796245586; b=V4gcl5Nfm1YimVXmt3yA6eQklGhVAjpe81iqFBh/eC+kSchnyKr2sLXkedKRmunuMQ8S RiViJHM84NXFEvp2RkOmWzCCcfcXBIDnJ0ahL8oE5yXjXQsJM6XfE2FamFJl+WBO2y/gM WWAXp9xggKtH5+IwtvhejDFTWDSXkwOlXMXkUIAVHiQXgs2fKTAGNCgSMMPuICBxqzOyE p2PkkR4r/lAsFP1khD8cAn/aJ8XojkVG+plMSi6L5r3nkJ4tV25aH/OHzCSFRznof7wsW nTh4Gsjz4KG0/Fekcq2LGwGG9mX2TT4JeCRyZ7zf+pwVfurQKTso+AYOBYqBmMVw6zw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796245586; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received: X-Received:Received:Message-ID:Subject:From:To:Cc:Date:In-Reply-To: References:Content-Type:Content-Transfer-Encoding:User-Agent: MIME-Version; bh=2xu9RaDgLqibyyJAaFEVfMTeLUU11BWPpUnufl5a5xk=; b=QdI4+tKqMv72HaA0R953AOMSf1WvAb1pdASKUvUD25BGZpiatvMd9vOKju+KjTUOKjkF 9C+DfHLL3SB6QD9ZWgq/QhbdEGyhUGUx6srV0onLJlKndOey+ESadoahQ81G1wb3Xk98Q uN452Ak2V39+nD9gIIbXza3dB2PXSptK/KCWnbvGn2QIBQkpTiJMlg1cQZpxp4xYCVA0p iMjyNZxfBfu2gGryVZdHQyO41v7Elnf9sNwAp3IYTaJmTQKT1Gv62fwbor+QO8Shc6+PC H6uVN9wMPRXunL2OTyNKcMgQ00GiFAjgiFnPRJ49N0Z1pZ70SdAjWnZZuO2kvWHxEbQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Sp67Dstc; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=bZ1PjHga; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A90F7606A32C for ; Wed, 2 Dec 2026 21:06:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A90F7606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Sp67Dstc; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=bZ1PjHga DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796245584; 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=2xu9RaDgLqibyyJAaFEVfMTeLUU11BWPpUnufl5a5xk=; b=Sp67DstcYl51pNHUpqjy29hTqJMc0uFASwXpKf4HeQLv6+n84DpErkxrunxgHMKYCUyVL/ afUDDX48XkounVaOKGZcQi/2boXbct3NzNmzuc1uFejU6aVY7awjUsZFv3oJGB2QlRuaS6 Ebbmr3S2LayJoKYxaI7j3+NWsQ6Q3zU= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-373-2g4VFsfdMw2LTqugpI-BXg-1; Wed, 2 Dec 2026 21:06:22 +0000 X-MC-Unique: 2g4VFsfdMw2LTqugpI-BXg-1 X-Mimecast-MFC-AGG-ID: 2g4VFsfdMw2LTqugpI-BXg_1796245582 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-55c5cbc838aso285283501cf.3 for ; Wed, 02 Dec 2026 13:06:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1796245582; x=1796850382; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:from:to :cc:subject:date:message-id:reply-to:content-type; bh=2xu9RaDgLqibyyJAaFEVfMTeLUU11BWPpUnufl5a5xk=; b=bZ1PjHgaH6JtGX+phtR83pGVwl05tI2XeBw1iMDb1CfW7Y7yY5zrVe9Qd6eRq2ZKai IoGw7/2J8cuIxXDo0PNc/bnCtnf+O+R245AlquLFf6uxK59xlS35j4IDMh99QG2BePMO qR5lO6aLRTSMjEvhYiJ/fGx41Mg5txwP6AhPqy937jYdMsNzuSyR0TXlL5mqH2W3q/N0 pdBjbh8q5TWu3Z2eQTB9RV/JFlIbl8KszSqcjr0NZrGQrJ/W8oCKGHNiQnz4eE8re3e3 IsKMAKiHjZ72VIVWB7wMYZTy4WCdgoPuQQQ7FfUBgB1Qx7cwZ5ApWMxMPeCpjIBTU+qo TDRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796245582; x=1796850382; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=2xu9RaDgLqibyyJAaFEVfMTeLUU11BWPpUnufl5a5xk=; b=NZx0L3n/dSs5YNhHCyreyEarIJt97z6mHFk1tkSrBJ64aQsswo/xze0pMt1wQpi+Kq x8zILXhg2vrWX8GJXtnZaX8jGMCUzRMf6DDL1WzVSS48yQQ5r/XfpJyka1tsa/0LNRDH Mx71b9bZyBRtgdKCWa+jtqIPTgCqj/XY7ZUCmdoCn2K5omYuK8NF9sPIumwUc1mQcdYW nQtSLa0sBwboiVkiPPhUHgSivBjJ0FCDjYwOxAFoh74L/ISz3qc2hPgkSUoJLLdb1GRR V7OXwsxZ7Sq+maA+8y/ZdxkPwsqMVMk4uV1y4o33Bc/hOL4t+qzg3ccx6dMrfiKw97MC cRvQ== X-Forwarded-Encrypted: i=1; AL+hErHX10qJuVKP63P5ysFFV5ardlMDJKcaTHxnCiU7JpzvyQ0T18zAmP4ZaMOGEbuiHhjKAR5cjGx0bZw=@vger.kernel.org X-Gm-Message-State: APuU4Z8wksxxcbiNn3cFRtpKYER0PEHw5Sy6LUf90WqEU81lQDRUtOJv w81Arqa5N0ZTklbSU1efScbqCtrJ7A8xhDcYr2M3RWVn9fnPZ3WlrObbvb6BXkIYBPVObwbY0rQ hdmt9Ylgnd9Eaype0FVHjlGN2sS7kH7SNcut5p1eDhWBmnoXvqIhiXcNkRmBxGA== X-Gm-Gg: AZFdTZeSH/nMYJ8GaBti+RWQc3FJ724pH6J+o7Ljddz9dw50PWVuI8AP/K7+ASNt0fx g64RoBW8AHh3fRxpIU5LCX+3ebMBp33YQjE52aXIwrCYcs1SdUNa9IASv19J3ND2siXUlpfLWp/ 8pNnzBycGTI+dnrVuPIOPIqMvGdRMJpT5lSa8/YBr0HxqySdtuS1OtYCHpxsW8ysFdmdNRb7XVx Ut1a11pMmcVKeU+f0Y7+rx8TomNQ3yDcdd1pjiJgJocuXn6+ClZu7Wa0vy8TmcArz9Lsx148x38 N+mfA6bc2RfjOOxMRP7kjHoEiCwCBqIPALEWkuP46oOGAUTlXypGMNUpWivsWfcVrCDUd7BXmMH QGSpOPlDmCVo8JYP9xx1SZZzp1LfmfYOFwrQQqSC4kDr6ka4XIFt9Q2MfB+/U9XClgW9sVbEHp+ JZsXzc/drcbFOAQfAFtcUkDB367N3AGkDWGWYuNGnIhdwlCw3ct139tBsPLG8Iq0Wva0aamvs= X-Received: by 2002:ac8:5fcf:0:b0:54b:6814:ffd5 with SMTP id d75a77b69052e-55d76a7d8a2mr791072261cf.48.1796245581882; Wed, 02 Dec 2026 13:06:21 -0800 (PST) X-Received: by 2002:ac8:5fcf:0:b0:54b:6814:ffd5 with SMTP id d75a77b69052e-55d76a7d8a2mr791071381cf.48.1796245581247; Wed, 02 Dec 2026 13:06:21 -0800 (PST) Received: from loberman-thinkpadp16gen3.rmtusma.csb ([2600:6c65:2440:d8c:aa2b:ddff:fe88:da74]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-55da87b3ba8sm246392021cf.1.2026.12.02.13.06.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 13:06:20 -0800 (PST) Message-ID: <5eb3294725c5b0be0d397aa830baec13341320ca.camel@redhat.com> Subject: Re: [PATCH v3] PCI: hv: Hardwire PCI_INTERRUPT_LINE and PCI_INTERRUPT_PIN to 0 From: Laurence Oberman To: Hamza Mahfooz , linux-hyperv@vger.kernel.org Cc: Haiyang Zhang , Wei Liu , Dexuan Cui , Lorenzo Pieralisi , Krzysztof =?UTF-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Jake Oshins , linux-pci@vger.kernel.org, Michael Kelley , stable@vger.kernel.org, Asher Kariv , Mukesh R , njavali@marvell.com, GR-QLogic-Storage-Upstream@marvell.com, linux-scsi@vger.kernel.org Date: Wed, 02 Dec 2026 16:06:19 -0500 In-Reply-To: <20261202144345.275647-1-hamza@kernel.org> References: <20261202144345.275647-1-hamza@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.60.2 (3.60.2-3.fc44) X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 On Wed, 2026-12-02 at 09:43 -0500, Hamza Mahfooz wrote: > Hyper-V Discrete Device Assignment (DDA) does not support legacy > (INTx) > interrupts. >=20 > The current code recognizes PCI_INTERRUPT_LINE and PCI_INTERRUPT_PIN > reads and forces a zero value, but only for 8 bit reads. If a 16 or > 32 > bit read overlaps these fields, they may be returned as a non-zero > value. Fix this by recognizing such overlap, and forcing the > PCI_INTERRUPT_LINE and PCI_INTERRUPT_PIN bytes to zero while > retaining > the adjacent bytes returned by the host/HW. >=20 > Cc: stable@vger.kernel.org > Fixes: 4daace0d8ce8 ("PCI: hv: Add paravirtual PCI front-end for > Microsoft Hyper-V VMs") > Co-developed-by: Asher Kariv > Signed-off-by: Asher Kariv > Signed-off-by: Mukesh R > Signed-off-by: Wei Liu > Signed-off-by: Hamza Mahfooz > --- > v2: > - Fix a compilation error > v3: > - Capitalize "Hardwire" in the subject. (Michael) > - Add description/comment clarifications. (Michael) > - Also hardwire PCI_INTERRUPT_LINE to 0 for 16 and 32 bit reads. > (Michael) > - Emulate 16 bit reads of PCI_INTERRUPT_LINE/PCI_INTERRUPT_PIN, and > clear > =C2=A0 the low 16 bits of 32 bit reads instead of writing through a char > =C2=A0 pointer. > --- > =C2=A0drivers/pci/controller/pci-hyperv.c | 11 +++++++++-- > =C2=A01 file changed, 9 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/pci/controller/pci-hyperv.c > b/drivers/pci/controller/pci-hyperv.c > index 824cf27e85e6..05a528df7a51 100644 > --- a/drivers/pci/controller/pci-hyperv.c > +++ b/drivers/pci/controller/pci-hyperv.c > @@ -1213,8 +1213,7 @@ static void _hv_pcifront_read_config(struct > hv_pci_dev *hpdev, int where, > =C2=A0 =C2=A0=C2=A0 PCI_CAPABILITY_LIST) { > =C2=A0 /* ROM BARs are unimplemented */ > =C2=A0 *val =3D 0; > - } else if ((where >=3D PCI_INTERRUPT_LINE && where + size <=3D > PCI_INTERRUPT_PIN) || > - =C2=A0=C2=A0 (where >=3D PCI_INTERRUPT_PIN && where + size <=3D > PCI_MIN_GNT)) { > + } else if (where >=3D PCI_INTERRUPT_LINE && where + size <=3D > PCI_MIN_GNT) { > =C2=A0 /* > =C2=A0 * Interrupt Line and Interrupt PIN are hard-wired > to zero > =C2=A0 * because this front-end only supports message- > signaled > @@ -1256,6 +1255,14 @@ static void _hv_pcifront_read_config(struct > hv_pci_dev *hpdev, int where, > =C2=A0 mb(); > =C2=A0 } > =C2=A0 spin_unlock_irqrestore(&hbus->config_lock, flags); > + > + /* > + * Make sure PCI_INTERRUPT_LINE and > PCI_INTERRUPT_PIN are > + * hard-wired to 0, since they may be included in a > 32 bit > + * read, which is skipped by the above emulation. > + */ > + if (where =3D=3D PCI_INTERRUPT_LINE) > + *val &=3D ~0xffff; > =C2=A0 } else { > =C2=A0 dev_err(dev, "Attempt to read beyond a function's > config space.\n"); > =C2=A0 } Hi Hamza, No objection to this change. For the record, it affects qla2xxx under DDA. The driver uses PCI_INTERRUPT_PIN to identify the physical port of a multi-port HBA, which selects that port's NVRAM and WWPN. With the pin reading 0 and every function presented as function 0, all ports get port 0's WWPN. I described this earlier in [1]. Nilesh (Marvell, Cc'd) has a qla2xxx fix that reads the physical port from the ISP control/status register in the HBA's MMIO space instead of from PCI config space, so it is not affected by this patch. I tested it today on an ISP2281 with the DDA conditions simulated (pin and function forced to 0): with the fix each port gets its own WWPN; without it both ports report port 0's WWPN and the second port never comes up on the fabric. Nilesh will post it to linux-scsi. Since this patch is tagged for stable, the qla2xxx fix should go to stable as well. Otherwise multi-port QLogic HBAs in DDA guests on stable kernels will end up with duplicate WWPNs. [1] https://lore.kernel.org/linux-hyperv// Thanks, Laurence