[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 6/8] IOMMU: log appropriate SBDF
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Tue, 12 Apr 2022 12:05:39 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UyGdbvd5XN7XcjCzQ2srCi8QDDeO0xX4ZiQGX7jhEE0=; b=hq0cMgKupozCF2AhugeCmDQCllXf2ZX84StGeRQUma4bF+92yFH801OBZZVYAC4waJyxT2NttfcsoXh7YwAS30riKskD59ML68eyBeWnieQjddiQwAmt2ggdM6vx02yyZVZuTJiYkKDM4xcisAKQwfsjdcjJHBDFilPAPJOclYIT8HD5/gXBgdTZ9OEiRBiTMSr9tMIYEQGlJtkd5kmzgTY80ZF6QoH5iAfMhDWBQIoDptGX1hDjXppS0PoznPpHudYJ9GsmAUh0kY8I2+sdHbsiPk4hO+O16J85cbOJOUgRbZAKhj42cr5PJ48rf3BtHC/DMmZwZShzzjVZCdROug==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IZ/rP3dlNREj++wfG8XPjjPD9nzUKo698Fa0FDbDSJlcANnyz72HPasos8GcQCyKgHDZIEepmvhP9nXgVlV56QUt6QX4XKqSR10NKCL/njXx+i1rWKheNxz3QKRuTnQmOs1xoY4+Dfw6dw0Zw/9HKOkeGkpJFBIWHPhBlzyMuuiVS6DOqJofnpO4Gx60XyzTOyr0ncIZhY4XVZE+zOSJ6lUq7Ovi/GayhCGMqsg95SgDRuErAUGKcdo5K3wnRNfYWO6Nf0EHe68DIdcGJ9wGIYnU/aEc6ZUyQh4An3sUk9aw9dG8iaCGuw/l+oh5X8cOlZXQxjUlgm49jKmWeGK8SQ==
- Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Paul Durrant" <paul@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Delivery-date: Tue, 12 Apr 2022 10:06:00 +0000
- Ironport-data: A9a23:uQUeNK2xt4AKiJpSIvbD5cVxkn2cJEfYwER7XKvMYLTBsI5bp2QFz TYbDz2PP66KMWb9c94ibo20o0xXvsWDzd43QQc6pC1hF35El5HIVI+TRqvS04J+DSFhoGZPt Zh2hgzodZhsJpPkjk7xdOCn9xGQ7InQLlbGILes1htZGEk1EE/NtTo5w7Rj2tIx24Dga++wk YiaT/P3aQfNNwFcagr424rbwP+4lK2v0N+wlgVWicFj5DcypVFMZH4sDfjZw0/DaptVBoaHq 9Prl9lVyI97EyAFUbtJmp6jGqEDryW70QKm0hK6UID66vROS7BbPg/W+5PwZG8O4whlkeydx /1qmoO3cBYJB5GTt7sAUjdeFANULZNZreqvzXiX6aR/zmXDenrohf5vEFs3LcsT/eMf7WNmr KJCbmpXN1ba2rzwkOnTpupE36zPKOHxO4wSoDd4xCzxBvc6W5HTBa7N4Le02R9u1p4RQaeOO aL1bxJzMzPsZjJuIWwsGb4Fv8v1o0fZdGNH/Qf9Sa0fvDGIkV0ZPKLWGMLcZ9iiVchT2EGCq Qru72n/Rx0XKtGb4T6E6W63wP/CmzvhX4AfH6H+8eRl6HWRzGEODBwdVXOgvOK0zEW5Xrpix 1c8o3R06/JorQryE4e7D0bQTGO4UgA0fPVPFNQryDixlYWL/ge3AG8mZC5/d4lz3CMpfgAC2 liMltLvIDVgtryJVH6Qn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bMkcEIDaeRCds18Kc=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Mon, Apr 11, 2022 at 11:38:28AM +0200, Jan Beulich wrote:
> To handle phantom devices, several functions are passed separate "devfn"
> arguments besides a PCI device. In such cases we want to log the phantom
> device's coordinates instead of the main one's. (Note that not all of
> the instances being changed are fallout from the referenced commit.)
>
> Fixes: 1ee1441835f4 ("print: introduce a format specifier for pci_sbdf_t")
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
I'm unsure it matters much to have the logs from failures to find an
IOMMU using pdev->sbdf or devfn, as the parent device should have been
added before attempting to add any phantom functions, and hence would
have already failed to find an IOMMU.
>
> --- a/xen/drivers/passthrough/amd/iommu_cmd.c
> +++ b/xen/drivers/passthrough/amd/iommu_cmd.c
> @@ -291,7 +291,8 @@ void amd_iommu_flush_iotlb(u8 devfn, con
>
> if ( !iommu )
> {
> - AMD_IOMMU_WARN("can't find IOMMU for %pp\n", &pdev->sbdf);
> + AMD_IOMMU_WARN("can't find IOMMU for %pp\n",
> + &PCI_SBDF3(pdev->seg, pdev->bus, devfn));
Hm, the call to find_iommu_for_device() is explicitly using
pdev->devfn, so while the iommu of the phantom function is tied to
it's parent, it's unclear to me that logging the SBDF of the phantom
function will make this clearer for a user reading the logs.
> return;
> }
>
> --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
> +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
> @@ -461,7 +461,7 @@ static int cf_check reassign_device(
> if ( !iommu )
> {
> AMD_IOMMU_WARN("failed to find IOMMU: %pp cannot be assigned to
> %pd\n",
> - &pdev->sbdf, target);
> + &PCI_SBDF3(pdev->seg, pdev->bus, devfn), target);
IIRC we would first reassign the parent, and then the phantom
functions, so we would always hit this error first with devfn ==
pdev->sbdf.bdf.
Thanks, Roger.
|