On 16.12.2024 15:28, Carlo Nonato wrote: > On Mon, Dec 16, 2024 at 2:56 PM Michal Orzel <michal.or...@amd.com> wrote: >> On 13/12/2024 17:28, Carlo Nonato wrote: >>> --- a/xen/arch/arm/arm64/mmu/mm.c >>> +++ b/xen/arch/arm/arm64/mmu/mm.c >>> @@ -1,6 +1,7 @@ >>> /* SPDX-License-Identifier: GPL-2.0-only */ >>> >>> #include <xen/init.h> >>> +#include <xen/llc-coloring.h> >>> #include <xen/mm.h> >>> #include <xen/pfn.h> >>> >>> @@ -138,8 +139,36 @@ void update_boot_mapping(bool enable) >>> } >>> >>> extern void switch_ttbr_id(uint64_t ttbr); >>> +extern void relocate_xen(uint64_t ttbr, void *src, void *dst, size_t len); >>> >>> typedef void (switch_ttbr_fn)(uint64_t ttbr); >>> +typedef void (relocate_xen_fn)(uint64_t ttbr, void *src, void *dst, size_t >>> len); >>> + >>> +void __init relocate_and_switch_ttbr(uint64_t ttbr) { >> CODING_STYLE: { needs to be on its own line >> >> Also, this function is only executed in case of LLC coloring, so shouldn't it >> be #ifdef protected. > > Here and in other places (patch #8) I'm relying on DCE to remove functions > that are not called. This was a suggestion from Jan in that patch. Can we > adopt the same here?
Yet how would the compiler spot that the function is unused? That would only work with LTO / WPO. DCE (as I did suggest elsewhere) requires the functions in question to be static (allowing the compiler to see enough of the whole picture). Jan