[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/arm: mark handle_linux_pci_domain() __init


  • To: Julien Grall <julien@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Fri, 14 Oct 2022 15:23:05 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=68HpaOmUzeR4ND0qN+hUef0LVVc5NazVcmHrSQKZrew=; b=VgoQkD+V+cWNTN5vhARK3HKAJj874JjEEWb1VevAGdKl6AoQ6Z+4JjiFITdSlUGoUzpb0GFdYw1mgTFlyp0Ja722Z+DgOM8u9uomu+v6wWcLi7dwQwzLipu/KmJ4MlTg3HCt0KzMSkuCln84v4VwX0EU9dJWvTaa311macQI+5RCwN/i6JHkqTFBYyqilNqlEfZNp0ndBSQ6noI9TopOnwVG7Q91r36kznzcS6gz+6XJj+rt1EG/WkeFz0w0x6YekNQM0rgyUY5PlGLJyY1/7RmLMg2HdtMCGIPN34+ZR8PkhQYxgzJ5sVpkrCXhBIpbyKf7ynBLoXrAphaEh9JFBg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K+BRjNjFNa/JbaApXBrLlKjSTWm6MWFC589x/OtVVos9cg26QiScuuF8Vx3/qRGnmjjkpqRih/eyRsQRLwTuNJe9xUCd0ZYB2b7Jo5XwpGINW9PBVb3ynyopWAXNArc2T7eWhh8JV1+8+bKZ6oODpXfxuSPSJLcKTXqQUqlv/YpqpIVOfIt0f0oPzPdIuoQvdE77cxCkch+RgkDoQLQw/NNbia9SpTD0Ekw4Bs0UfnaP/HnCcwtV0mBnozrtgUNga7OLxnTXGtScYDxKGKLkLrlwEq8OVn8UDktwiWD8J0K5muM7hqT8SLfIS/LxqD/LXjwWAJr8iEIUcM38sbR48w==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 14 Oct 2022 19:23:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10/14/22 04:22, Julien Grall wrote:
Hi,

On 14/10/2022 08:16, Jan Beulich wrote:
On 14.10.2022 04:53, Stewart Hildebrand wrote:
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>

I guess a non-empty description and a Fixes: tag would be nice.

Okay, I will send a v2 with the following description:
All functions in domain_build.c should be marked __init. This was spotted when building the hypervisor with -Og.

Fixes: 1050a7b91c xen/arm: add pci-domain for disabled devices
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>

+1. I am actually quite interested to understand how this was spotted.

The build system should check that any function/data in domain_build.c
are part of the __init section. So I guess the compiler you are using
doesn't inline the function?

If so, I am actually surprised you are the first one spotted this... We
are building on various distribution without any issues (?). I would be
interested to know the compiler version and maybe we could add it in the
CI.

I added -Og to the make command line so it takes precedence over the default -O1/-O2:

$ make EXTRA_CFLAGS_XEN_CORE="-Og" XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- dist-xen -j $(nproc)

Indeed, I did observe the build error:
Error: size of arch/arm/domain_build.o:.text is 0x00000008

I used this rune to reveal the culprit:

$ aarch64-none-linux-gnu-objdump -d xen/arch/arm/domain_build.o | head

xen/arch/arm/domain_build.o:     file format elf64-littleaarch64


Disassembly of section .text:

0000000000000000 <handle_linux_pci_domain>:
    0:   52800000        mov     w0, #0x0                        // #0
    4:   d65f03c0        ret

I am using this toolchain: https://developer.arm.com/-/media/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu.tar.xz

Further, there were two more build errors observed when building with -Og:
arch/arm/domain_build.c: In function ‘make_cpus_node’:
arch/arm/domain_build.c:2013:12: error: ‘clock_valid’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
 2013 |         if ( clock_valid )
      |            ^

arch/arm/efi/boot.c: In function ‘efi_start’:
arch/arm/efi/boot.c:1464:9: error: ‘argc’ may be used uninitialized in this function [-Werror=maybe-uninitialized]  1464 |         efi_arch_handle_cmdline(argc ? *argv : NULL, options, name.s);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I assume these uninitialized use errors can simply be fixed by initializing the respective variables to false/0, but a second opinion would certainly be helpful.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.