Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build with LPAE (yem/rpi 3.19.y) #839

Closed
wants to merge 1 commit into from
Closed

Fix build with LPAE (yem/rpi 3.19.y) #839

wants to merge 1 commit into from

Conversation

yann-morin-1998
Copy link
Contributor

LPAE is a requirement for virtualisation.

However, building with LPAE enabled results in a broken build (see commit log),
due to incorrect printk formats being used to print physical addresses.

Even though the Linux kernel is booted in SVC (not HYP) mode (and thus we
can't use KVM), it is anyway interesting to fix build failures.

A very-similar fix will be submitted for rpi-3.18.y soonish.

LPAE is required for virtualisation on ARM. However, enabling LPAE
results in an unbuildable configuration, due to improper formats
used in vc_cma:

      CC      drivers/char/broadcom/vc_cma/vc_cma.o
    drivers/char/broadcom/vc_cma/vc_cma.c: In function ‘vc_cma_alloc_chunks’:
    drivers/char/broadcom/vc_cma/vc_cma.c:547:4: error: format ‘%x’ expects argument
    of type ‘unsigned int’, but argument 4 has type ‘phys_addr_t’ [-Werror=format=]
        LOG_ERR("%s: chunk phys %x, vc_cma %x-%x - "
        ^
    drivers/char/broadcom/vc_cma/vc_cma.c:547:4: error: format ‘%x’ expects argument
    of type ‘unsigned int’, but argument 5 has type ‘phys_addr_t’ [-Werror=format=]
    drivers/char/broadcom/vc_cma/vc_cma.c: In function ‘cma_worker_proc’:
    drivers/char/broadcom/vc_cma/vc_cma.c:677:7: error: format ‘%x’ expects argument
    of type ‘unsigned int’, but argument 3 has type ‘long long unsigned int’ [-Werror=format=]
           LOG_ERR
           ^
    drivers/char/broadcom/vc_cma/vc_cma.c: In function ‘vc_cma_init’:
    drivers/char/broadcom/vc_cma/vc_cma.c:1027:2: error: format ‘%x’ expects argument
    of type ‘unsigned int’, but argument 2 has type ‘phys_addr_t’ [-Werror=format=]
      printk(KERN_INFO "vc-cma: vc_cma_base      = 0x%08x\n", vc_cma_base);
      ^
    cc1: all warnings being treated as errors
    make[6]: *** [drivers/char/broadcom/vc_cma/vc_cma.o] Error 1

As explained in Documentation/printk-formats.txt, printing a physical
address phys_addr_t should be done using the %pa[p] format, which
expects a "reference" to the value.

Even if virtualisation is currently not possible (due to the bootloader
starting the kernel in SVC, not HYP, mode), fix the printk formats
nonetheless, it will anyway give better-looking code! ;-)

Signed-off-by: "Yann E. MORIN" <[email protected]>
@pelwell
Copy link
Contributor

pelwell commented Feb 20, 2015

Please rebase, then I'll pull it.

@pelwell
Copy link
Contributor

pelwell commented Feb 20, 2015

On second thoughts, abandon this PR and we'll cherry-pick it into 3.19 from 3.18 in the near future.

@yann-morin-1998
Copy link
Contributor Author

@pelwell OK, I'm closing it. Thanks! :-)

@yann-morin-1998 yann-morin-1998 deleted the yem/rpi-3.19.y branch February 23, 2015 18:06
pfpacket pushed a commit to pfpacket/linux-rpi-rust that referenced this pull request Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants