Skip to content

Commit fcce1c6

Browse files
committed
x86/paravirt: Fix tlb_remove_table function callback prototype warning
Under W=1, this warning is visible in Clang 16 and newer: arch/x86/kernel/paravirt.c:337:4: warning: cast from 'void (*)(struct mmu_gather *, struct page *)' to 'void (*)(struct mmu_gather *, void *)' converts to incompatible function type [-Wcast-function-type-strict] (void (*)(struct mmu_gather *, void *))tlb_remove_page, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Add a direct wrapper instead, which will make this warning (and potential KCFI failures) go away. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Cc: Juergen Gross <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Sami Tolvanen <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Ajay Kaher <[email protected]> Cc: Alexey Makhalov <[email protected]> Cc: VMware PV-Drivers Reviewers <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Dave Hansen <[email protected]> Cc: [email protected] Reviewed-by: Juergen Gross <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>
1 parent b6ed2f7 commit fcce1c6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

arch/x86/kernel/paravirt.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ void __init native_pv_lock_init(void)
7979
static_branch_disable(&virt_spin_lock_key);
8080
}
8181

82+
static void native_tlb_remove_table(struct mmu_gather *tlb, void *table)
83+
{
84+
tlb_remove_page(tlb, table);
85+
}
86+
8287
unsigned int paravirt_patch(u8 type, void *insn_buff, unsigned long addr,
8388
unsigned int len)
8489
{
@@ -295,8 +300,7 @@ struct paravirt_patch_template pv_ops = {
295300
.mmu.flush_tlb_kernel = native_flush_tlb_global,
296301
.mmu.flush_tlb_one_user = native_flush_tlb_one_user,
297302
.mmu.flush_tlb_multi = native_flush_tlb_multi,
298-
.mmu.tlb_remove_table =
299-
(void (*)(struct mmu_gather *, void *))tlb_remove_page,
303+
.mmu.tlb_remove_table = native_tlb_remove_table,
300304

301305
.mmu.exit_mmap = paravirt_nop,
302306
.mmu.notify_page_enc_status_changed = paravirt_nop,

0 commit comments

Comments
 (0)