Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/paravirt: Introduce new paravirt-base.h header

Move the pv_info related definitions and the declarations of the global
paravirt function primitives into a new header file paravirt-base.h.

Use that header instead of paravirt_types.h in ptrace.h.

Additionally, this is a preparation to reduce the include hell with paravirt
enabled.

[ bp: Massage commit message. ]

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20260105110520.21356-14-jgross@suse.com

authored by

Juergen Gross and committed by
Borislav Petkov (AMD)
f01b4f4a 39965afb

+34 -24
+29
arch/x86/include/asm/paravirt-base.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + 3 + #ifndef _ASM_X86_PARAVIRT_BASE_H 4 + #define _ASM_X86_PARAVIRT_BASE_H 5 + 6 + /* 7 + * Wrapper type for pointers to code which uses the non-standard 8 + * calling convention. See PV_CALL_SAVE_REGS_THUNK below. 9 + */ 10 + struct paravirt_callee_save { 11 + void *func; 12 + }; 13 + 14 + struct pv_info { 15 + #ifdef CONFIG_PARAVIRT_XXL 16 + u16 extra_user_64bit_cs; /* __USER_CS if none */ 17 + #endif 18 + const char *name; 19 + }; 20 + 21 + void default_banner(void); 22 + extern struct pv_info pv_info; 23 + unsigned long paravirt_ret0(void); 24 + #ifdef CONFIG_PARAVIRT_XXL 25 + u64 _paravirt_ident_64(u64); 26 + #endif 27 + #define paravirt_nop ((void *)nop_func) 28 + 29 + #endif /* _ASM_X86_PARAVIRT_BASE_H */
+3 -1
arch/x86/include/asm/paravirt.h
··· 4 4 /* Various instructions on x86 need to be replaced for 5 5 * para-virtualization: those hooks are defined here. */ 6 6 7 + #ifndef __ASSEMBLER__ 8 + #include <asm/paravirt-base.h> 9 + #endif 7 10 #include <asm/paravirt_types.h> 8 11 9 12 #ifdef CONFIG_PARAVIRT ··· 604 601 #undef PVOP_VCALL4 605 602 #undef PVOP_CALL4 606 603 607 - extern void default_banner(void); 608 604 void native_pv_lock_init(void) __init; 609 605 610 606 #else /* __ASSEMBLER__ */
+1 -22
arch/x86/include/asm/paravirt_types.h
··· 7 7 #ifndef __ASSEMBLER__ 8 8 #include <linux/types.h> 9 9 10 + #include <asm/paravirt-base.h> 10 11 #include <asm/desc_defs.h> 11 12 #include <asm/pgtable_types.h> 12 13 #include <asm/nospec-branch.h> ··· 18 17 struct cpumask; 19 18 struct flush_tlb_info; 20 19 struct vm_area_struct; 21 - 22 - /* 23 - * Wrapper type for pointers to code which uses the non-standard 24 - * calling convention. See PV_CALL_SAVE_REGS_THUNK below. 25 - */ 26 - struct paravirt_callee_save { 27 - void *func; 28 - }; 29 - 30 - /* general info */ 31 - struct pv_info { 32 - #ifdef CONFIG_PARAVIRT_XXL 33 - u16 extra_user_64bit_cs; /* __USER_CS if none */ 34 - #endif 35 - 36 - const char *name; 37 - }; 38 20 39 21 #ifdef CONFIG_PARAVIRT_XXL 40 22 struct pv_lazy_ops { ··· 210 226 struct pv_lock_ops lock; 211 227 } __no_randomize_layout; 212 228 213 - extern struct pv_info pv_info; 214 229 extern struct paravirt_patch_template pv_ops; 215 230 216 231 #define paravirt_ptr(op) [paravirt_opptr] "m" (pv_ops.op) ··· 480 497 __PVOP_VCALL(op, PVOP_CALL_ARG1(arg1), PVOP_CALL_ARG2(arg2), \ 481 498 PVOP_CALL_ARG3(arg3), PVOP_CALL_ARG4(arg4)) 482 499 483 - unsigned long paravirt_ret0(void); 484 500 #ifdef CONFIG_PARAVIRT_XXL 485 - u64 _paravirt_ident_64(u64); 486 501 unsigned long pv_native_save_fl(void); 487 502 void pv_native_irq_disable(void); 488 503 void pv_native_irq_enable(void); 489 504 unsigned long pv_native_read_cr2(void); 490 505 #endif 491 - 492 - #define paravirt_nop ((void *)nop_func) 493 506 494 507 #endif /* __ASSEMBLER__ */ 495 508
+1 -1
arch/x86/include/asm/ptrace.h
··· 172 172 #endif /* !__i386__ */ 173 173 174 174 #ifdef CONFIG_PARAVIRT 175 - #include <asm/paravirt_types.h> 175 + #include <asm/paravirt-base.h> 176 176 #endif 177 177 178 178 #include <asm/proto.h>