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

Re: [PATCH] xen/riscv: fix build issue for bullseye-riscv64 container


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 31 Jul 2024 17:44:02 +0200
  • Autocrypt: addr=jbeulich@xxxxxxxx; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL
  • Cc: Alistair Francis <alistair.francis@xxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 31 Jul 2024 15:44:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 31.07.2024 17:37, Andrew Cooper wrote:
> On 31/07/2024 4:07 pm, Oleksii Kurochko wrote:
>> Address compilation error on bullseye-riscv64 container:
>>    undefined reference to `guest_physmap_remove_page`
>>
>> Since there is no current implementation of `guest_physmap_remove_page()`,
>> a stub function has been added.
>>
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
>> Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> 
> Usually we do Fixes/Reported-by tags first.  (We try to do tags in
> chronological/logical order).
> 
> I've confirmed this fixes the issue, so Acked-by: Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>
> 
> Having tried a different approach,
> 
> user@3c393ef3b4c0:/build/xen$ make
>   UPD     include/xen/compile.h
> Xen 4.20-unstable
> make[1]: Nothing to be done for 'include'.
> make[1]: 'arch/riscv/include/asm/asm-offsets.h' is up to date.
>   CC      common/version.o
>   LD      common/built_in.o
>   CC      arch/riscv/setup.o
>   LD      arch/riscv/built_in.o
>   LD      prelink.o
>   LDS     arch/riscv/xen.lds
> riscv64-linux-gnu-ld      -T arch/riscv/xen.lds -N prelink.o \
>     ./common/symbols-dummy.o -o ./.xen-syms.0
> riscv64-linux-gnu-ld: prelink.o: in function `register_keyhandler':
> /build/xen/common/keyhandler.c:106: undefined reference to
> `guest_physmap_remove_page'
> riscv64-linux-gnu-ld: ./.xen-syms.0: hidden symbol
> `guest_physmap_remove_page' isn't defined
> riscv64-linux-gnu-ld: final link failed: bad value
> make[2]: *** [arch/riscv/Makefile:15: xen-syms] Error 1
> make[1]: *** [build.mk:90: xen] Error 2
> make: *** [Makefile:610: xen] Error 2
> user@3c393ef3b4c0:/build/xen$ find . -name \*.o | while read F; do nm $F
> | grep guest_physmap_remove_page && echo $F; done
>                  U guest_physmap_remove_page
> ./common/memory.o
>                  U guest_physmap_remove_page
> ./common/built_in.o
>                  U guest_physmap_remove_page
> ./prelink.o
> 
> 
> despite the linker fingering keyhandler.c (very likely a toolchain bug),
> it's memory.o which has the undefined reference.
> 
> Looking at memory.i, there are calls in guest_remove_page(),
> memory_exchange(), and do_memory_op(), and no obvious way to DCE any of
> them.
> 
> However, with bookworm, while memory.i does still have the same calls,
> the resulting object file has no undefined references, so clearly
> something has DCE'd them.

The many stubs that have just BUG() in them result in a lot of DCE
according to my checking (many functions or basic blocks end - somewhat
confusingly - in a function call leading to such a stub). But apparently
not enough with the older compiler version.

Jan



 


Rackspace

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