git: libnvmm: Fix -Winline warnings

Aaron LI aly at crater.dragonflybsd.org
Sat Oct 3 07:05:13 PDT 2026


commit a7418acfc7d295f9d42581788953b06e7a582e75
Author: Aaron LI <aly at aaronly.me>
Date:   Sat Oct 3 21:48:37 2026 +0800

    libnvmm: Fix -Winline warnings
    
    GCC 12.5 would give the following -Winline warnings:
    
    ```
    cc   -pipe -O   -ggdb3 -std=gnu11 -Wmissing-include-dirs -Wsystem-headers -Wall -Wformat-security -Winit-self -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wold-style-definition -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls  -Wno-pointer-sign -Wno-format-overflow -Wno-format-truncation -Wno-stringop-truncation -Wno-stringop-overflow -Wno-address-of-packed-member   -c libnvmm.c -o libnvmm.o
    In file included from libnvmm.c:48:
    libnvmm_x86.c: In function 'nvmm_gva_to_gpa':
    libnvmm_x86.c:624:1: warning: inlining failed in call to 'x86_gva_to_gpa': --param max-inline-insns-single limit reached [-Winline]
      624 | x86_gva_to_gpa(struct nvmm_machine *mach, struct nvmm_vcpu *vcpu,
          | ^~~~~~~~~~~~~~
    libnvmm_x86.c:722:14: note: called from here
      722 |         es = x86_gva_to_gpa(mach, vcpu, gva, gpa, NVMM_PROT_READ, prot, false);
          |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    libnvmm_x86.c: In function 'read_guest_memory':
    libnvmm_x86.c:624:1: warning: inlining failed in call to 'x86_gva_to_gpa': --param max-inline-insns-single limit reached [-Winline]
      624 | x86_gva_to_gpa(struct nvmm_machine *mach, struct nvmm_vcpu *vcpu,
          | ^~~~~~~~~~~~~~
    libnvmm_x86.c:944:14: note: called from here
      944 |         es = x86_gva_to_gpa(mach, vcpu, gva, &gpa, want_prot, &prot, !for_exec);
          |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    libnvmm_x86.c: In function 'write_guest_memory':
    libnvmm_x86.c:624:1: warning: inlining failed in call to 'x86_gva_to_gpa': --param max-inline-insns-single limit reached [-Winline]
      624 | x86_gva_to_gpa(struct nvmm_machine *mach, struct nvmm_vcpu *vcpu,
          | ^~~~~~~~~~~~~~
    libnvmm_x86.c:999:14: note: called from here
      999 |         es = x86_gva_to_gpa(mach, vcpu, gva, &gpa, NVMM_PROT_WRITE, &prot,
          |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1000 |             true);
          |             ~~~~~
    ```
    
    Fix it by applying the `always_inline` attribute to `x86_gva_to_gpa()`
    and related helper functions.
    
    While there, undefine the macros before defining them to avoid potential
    conflicts.

Summary of changes:
 lib/libnvmm/libnvmm_x86.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a7418acfc7d295f9d42581788953b06e7a582e75


-- 
DragonFly BSD source repository


More information about the Commits mailing list