lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y9fSPLCyo8ZjLTYG@nvidia.com>
Date:   Mon, 30 Jan 2023 10:20:44 -0400
From:   Jason Gunthorpe <jgg@...dia.com>
To:     kernel test robot <lkp@...el.com>
Cc:     Robin Murphy <robin.murphy@....com>, joro@...tes.org,
        will@...nel.org, llvm@...ts.linux.dev,
        oe-kbuild-all@...ts.linux.dev, iommu@...ts.linux.dev,
        linux-kernel@...r.kernel.org, hch@....de, baolu.lu@...ux.intel.com,
        "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v2 7/8] iommu: Retire bus ops

On Sat, Jan 28, 2023 at 08:55:09PM +0800, kernel test robot wrote:

> >> drivers/iommu/iommufd/selftest.c:276:39: error: field designator 'iommu_ops' does not refer to any field in type 'struct bus_type'
>            static struct bus_type mock_bus = { .iommu_ops = &mock_ops };

So this shortcut isn't going to work..

Probably something like this is the simplest thing:

diff --git a/drivers/iommu/iommufd/selftest.c b/drivers/iommu/iommufd/selftest.c
index cfb5fe9a5e0ee8..27bab42b1ff841 100644
--- a/drivers/iommu/iommufd/selftest.c
+++ b/drivers/iommu/iommufd/selftest.c
@@ -274,6 +274,8 @@ static int iommufd_test_mock_domain(struct iommufd_ucmd *ucmd,
                                    struct iommu_test_cmd *cmd)
 {
        static struct bus_type mock_bus = { .iommu_ops = &mock_ops };
+       static struct iommu_device mock_iommu = { .ops = &mock_ops };
+       static struct dev_iommu mock_dev_iommu = { .iommu_dev = &mock_iommu };
        struct iommufd_hw_pagetable *hwpt;
        struct selftest_obj *sobj;
        struct iommufd_ioas *ioas;
@@ -291,6 +293,7 @@ static int iommufd_test_mock_domain(struct iommufd_ucmd *ucmd,
        sobj->idev.ictx = ucmd->ictx;
        sobj->type = TYPE_IDEV;
        sobj->idev.mock_dev.bus = &mock_bus;
+       sobj->idev.mock_dev.iommu = &mock_dev_iommu;
 
        hwpt = iommufd_device_selftest_attach(ucmd->ictx, ioas,
                                              &sobj->idev.mock_dev);

And then delete mock_bus at this patch

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ