From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 15A91D12694 for ; Tue, 5 Nov 2024 11:59:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B374F10E05B; Tue, 5 Nov 2024 11:59:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Wf3tXxy2"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 75DBF10E05B for ; Tue, 5 Nov 2024 11:59:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730807969; x=1762343969; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=iYxQvThTulFNhTxYIClRL9WZNYpwyg57I7kQicsNez4=; b=Wf3tXxy2J4tIfPBP+jVrZvyc/94sUK1Xh/bzhkMC+7KRJOE8bBn7BjqE qPTgEu7PMXgTZEfYjGESrBOlgq7u7DScy1RYRmT4qIe4pB8VceYZxLJ0W iJtFSK1Hc4+IgwvqbpZwXAXuwzEBvh38DSGVhvNIqAuikiKnXE91XpFbJ foZfrRACBaqtDG0NY/APeOw7+iaQnUyqJeec+JupkXObzKPYTRCJ5dkSp u48xC3DWf0ndKvATRjePQGajm/5bgkUbo8wvbmcEFTYTMW4DLDgQs1duU 3EldpYqT0MXHv9uaqDeoqeZXthyHRMxqpq8ta363x9oPGwyWQibY1zKsH g==; X-CSE-ConnectionGUID: Fdp8X2pNRemt+b2Ozic+Gg== X-CSE-MsgGUID: U6xpeIW5RSekr/d1/V4P+Q== X-IronPort-AV: E=McAfee;i="6700,10204,11246"; a="34334326" X-IronPort-AV: E=Sophos;i="6.11,260,1725346800"; d="scan'208";a="34334326" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2024 03:59:29 -0800 X-CSE-ConnectionGUID: g137h1dwRHqce1kdrFxOZw== X-CSE-MsgGUID: xyBxIVTPSwmvbT0BCkpeLA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,260,1725346800"; d="scan'208";a="83885424" Received: from lkp-server01.sh.intel.com (HELO a48cf1aa22e8) ([10.239.97.150]) by orviesa009.jf.intel.com with ESMTP; 05 Nov 2024 03:59:26 -0800 Received: from kbuild by a48cf1aa22e8 with local (Exim 4.96) (envelope-from ) id 1t8IDT-000m1L-36; Tue, 05 Nov 2024 11:59:23 +0000 Date: Tue, 5 Nov 2024 19:58:36 +0800 From: kernel test robot To: Jiqian Chen , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , Xinhui Pan Cc: oe-kbuild-all@lists.linux.dev, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Pierre-Eric Pelloux-Prayer , Jiqian Chen , Huang Rui Subject: Re: [PATCH 2/2] drm/amdgpu: Bypass resizing bars for PVH dom0 Message-ID: <202411051924.dZP9MxDH-lkp@intel.com> References: <20241105060531.3503788-3-Jiqian.Chen@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241105060531.3503788-3-Jiqian.Chen@amd.com> X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" 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: arc-randconfig-002-20241105 (https://download.01.org/0day-ci/archive/20241105/202411051924.dZP9MxDH-lkp@intel.com/config) compiler: arceb-elf-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241105/202411051924.dZP9MxDH-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 | Closes: https://lore.kernel.org/oe-kbuild-all/202411051924.dZP9MxDH-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from include/linux/dev_printk.h:14, from include/linux/device.h:15, from include/linux/power_supply.h:15, from drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:28: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: In function 'amdgpu_device_resize_fb_bar': >> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1542:13: error: implicit declaration of function 'xen_initial_domain' [-Werror=implicit-function-declaration] 1542 | if (xen_initial_domain() && xen_pvh_domain()) | ^~~~~~~~~~~~~~~~~~ include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var' 57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) | ^~~~ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1542:9: note: in expansion of macro 'if' 1542 | if (xen_initial_domain() && xen_pvh_domain()) | ^~ >> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1542:37: error: implicit declaration of function 'xen_pvh_domain' [-Werror=implicit-function-declaration] 1542 | if (xen_initial_domain() && xen_pvh_domain()) | ^~~~~~~~~~~~~~ include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var' 57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) | ^~~~ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1542:9: note: in expansion of macro 'if' 1542 | if (xen_initial_domain() && xen_pvh_domain()) | ^~ cc1: some warnings being treated as errors 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