From: kernel test robot <lkp@intel.com>
To: "Jiqian Chen" <Jiqian.Chen@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Xinhui Pan" <Xinhui.Pan@amd.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>,
Jiqian Chen <Jiqian.Chen@amd.com>, Huang Rui <Ray.Huang@amd.com>
Subject: Re: [PATCH 2/2] drm/amdgpu: Bypass resizing bars for PVH dom0
Date: Wed, 6 Nov 2024 00:49:44 +0800 [thread overview]
Message-ID: <202411060019.p34zs7ce-lkp@intel.com> (raw)
In-Reply-To: <20241105060531.3503788-3-Jiqian.Chen@amd.com>
Hi Jiqian,
kernel test robot noticed the following build errors:
[auto build test ERROR on linus/master]
[also build test ERROR on v6.12-rc6 next-20241105]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Jiqian-Chen/drm-amdgpu-set-passthrough-mode-for-xen-pvh-hvm/20241105-141716
base: linus/master
patch link: https://lore.kernel.org/r/20241105060531.3503788-3-Jiqian.Chen%40amd.com
patch subject: [PATCH 2/2] drm/amdgpu: Bypass resizing bars for PVH dom0
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20241106/202411060019.p34zs7ce-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 639a7ac648f1e50ccd2556e17d401c04f9cce625)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241106/202411060019.p34zs7ce-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411060019.p34zs7ce-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:33:
In file included from include/linux/iommu.h:10:
In file included from include/linux/scatterlist.h:8:
In file included from include/linux/mm.h:2213:
include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
504 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
505 | item];
| ~~~~
include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
511 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
512 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
518 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
524 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
525 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1542:6: error: call to undeclared function 'xen_initial_domain'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
1542 | if (xen_initial_domain() && xen_pvh_domain())
| ^
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1542:30: error: call to undeclared function 'xen_pvh_domain'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
1542 | if (xen_initial_domain() && xen_pvh_domain())
| ^
4 warnings and 2 errors generated.
vim +/xen_initial_domain +1542 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
1519
1520 /**
1521 * amdgpu_device_resize_fb_bar - try to resize FB BAR
1522 *
1523 * @adev: amdgpu_device pointer
1524 *
1525 * Try to resize FB BAR to make all VRAM CPU accessible. We try very hard not
1526 * to fail, but if any of the BARs is not accessible after the size we abort
1527 * driver loading by returning -ENODEV.
1528 */
1529 int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
1530 {
1531 int rbar_size = pci_rebar_bytes_to_size(adev->gmc.real_vram_size);
1532 struct pci_bus *root;
1533 struct resource *res;
1534 unsigned int i;
1535 u16 cmd;
1536 int r;
1537
1538 if (!IS_ENABLED(CONFIG_PHYS_ADDR_T_64BIT))
1539 return 0;
1540
1541 /* Bypass for PVH dom0 which doesn't support resizable bar */
> 1542 if (xen_initial_domain() && xen_pvh_domain())
1543 return 0;
1544
1545 /* Bypass for VF */
1546 if (amdgpu_sriov_vf(adev))
1547 return 0;
1548
1549 /* PCI_EXT_CAP_ID_VNDR extended capability is located at 0x100 */
1550 if (!pci_find_ext_capability(adev->pdev, PCI_EXT_CAP_ID_VNDR))
1551 DRM_WARN("System can't access extended configuration space, please check!!\n");
1552
1553 /* skip if the bios has already enabled large BAR */
1554 if (adev->gmc.real_vram_size &&
1555 (pci_resource_len(adev->pdev, 0) >= adev->gmc.real_vram_size))
1556 return 0;
1557
1558 /* Check if the root BUS has 64bit memory resources */
1559 root = adev->pdev->bus;
1560 while (root->parent)
1561 root = root->parent;
1562
1563 pci_bus_for_each_resource(root, res, i) {
1564 if (res && res->flags & (IORESOURCE_MEM | IORESOURCE_MEM_64) &&
1565 res->start > 0x100000000ull)
1566 break;
1567 }
1568
1569 /* Trying to resize is pointless without a root hub window above 4GB */
1570 if (!res)
1571 return 0;
1572
1573 /* Limit the BAR size to what is available */
1574 rbar_size = min(fls(pci_rebar_get_possible_sizes(adev->pdev, 0)) - 1,
1575 rbar_size);
1576
1577 /* Disable memory decoding while we change the BAR addresses and size */
1578 pci_read_config_word(adev->pdev, PCI_COMMAND, &cmd);
1579 pci_write_config_word(adev->pdev, PCI_COMMAND,
1580 cmd & ~PCI_COMMAND_MEMORY);
1581
1582 /* Free the VRAM and doorbell BAR, we most likely need to move both. */
1583 amdgpu_doorbell_fini(adev);
1584 if (adev->asic_type >= CHIP_BONAIRE)
1585 pci_release_resource(adev->pdev, 2);
1586
1587 pci_release_resource(adev->pdev, 0);
1588
1589 r = pci_resize_resource(adev->pdev, 0, rbar_size);
1590 if (r == -ENOSPC)
1591 DRM_INFO("Not enough PCI address space for a large BAR.");
1592 else if (r && r != -ENOTSUPP)
1593 DRM_ERROR("Problem resizing BAR0 (%d).", r);
1594
1595 pci_assign_unassigned_bus_resources(adev->pdev->bus);
1596
1597 /* When the doorbell or fb BAR isn't available we have no chance of
1598 * using the device.
1599 */
1600 r = amdgpu_doorbell_init(adev);
1601 if (r || (pci_resource_flags(adev->pdev, 0) & IORESOURCE_UNSET))
1602 return -ENODEV;
1603
1604 pci_write_config_word(adev->pdev, PCI_COMMAND, cmd);
1605
1606 return 0;
1607 }
1608
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2024-11-05 16:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-05 6:05 [PATCH 0/2] Fix some issues when using amdgpu on XEN PVH dom0 Jiqian Chen
2024-11-05 6:05 ` [PATCH 1/2] drm/amdgpu: set passthrough mode for xen pvh/hvm Jiqian Chen
2024-11-13 8:13 ` Chen, Jiqian
2024-11-05 6:05 ` [PATCH 2/2] drm/amdgpu: Bypass resizing bars for PVH dom0 Jiqian Chen
2024-11-05 11:58 ` kernel test robot
2024-11-05 13:42 ` Christian König
2024-11-06 3:20 ` Chen, Jiqian
2024-11-06 15:50 ` Christian König
2024-11-07 2:17 ` Chen, Jiqian
2024-11-05 16:49 ` kernel test robot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202411060019.p34zs7ce-lkp@intel.com \
--to=lkp@intel.com \
--cc=Jiqian.Chen@amd.com \
--cc=Ray.Huang@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pierre-eric.pelloux-prayer@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.