x86/paravirt: remove unused _paravirt_ident_32
Subsystems (2)
Juergen Gross
maintainerPATCH 1/1 x86/paravirt: remove unused _paravirt_ident_32
There is no user of _paravirt_ident_32 left in the tree. Remove it together with the related paravirt_patch_ident_32().
paravirt_patch_ident_64() can be moved inside CONFIG_PARAVIRT_XXL.
Signed-off-by Juergen Gross <[email protected]>
--- arch/x86/include/asm/paravirt_types.h | 2 -- arch/x86/kernel/paravirt.c | 26 +++++++------------------- arch/x86/kernel/paravirt_patch_32.c | 18 ++++++------------ arch/x86/kernel/paravirt_patch_64.c | 20 ++++++-------------- 4 files changed, 19 insertions(+), 47 deletions(-)
arch/x86/include/asm/paravirt_types.h +0 -2
@@ -361,7 +361,6 @@ extern struct paravirt_patch_template pv_ops; __visible extern const char start_##ops##_##name[], end_##ops##_##name[]; \ asm(NATIVE_LABEL("start_", ops, name) code NATIVE_LABEL("end_", ops, name)) -unsigned paravirt_patch_ident_32 (void *insnbuf,unsigned len);unsigned paravirt_patch_ident_64 (void *insnbuf,unsigned len);unsigned paravirt_patch_default (u8 type,void *insnbuf,unsigned long addr,unsigned len);
@@ -651,7 +650,6 @@ void paravirt_leave_lazy_mmu(void);void paravirt_flush_lazy_mmu (void );void _paravirt_nop (void ); -u32 _paravirt_ident_32 (u32 );u64 _paravirt_ident_64 (u64 );#define paravirt_nop ((void *)_paravirt_nop)
arch/x86/kernel/paravirt.c +7 -19
@@ -56,17 +56,6 @@ asm (".pushsection .entry.text, \"ax\"\n"".type _paravirt_nop, @function\n\t" ".popsection"); -/* identity function, which can be inlined */ -u32 notrace _paravirt_ident_32(u32 x) -{ -return x; -} - -u64 notrace _paravirt_ident_64(u64 x) -{ -return x; -} -void __init default_banner (void ) { printk(KERN_INFO "Booting paravirtualized kernel on %s\n",
@@ -102,6 +91,12 @@ static unsigned paravirt_patch_call(void *insnbuf, const void *target, }#ifdef CONFIG_PARAVIRT_XXL +/* identity function, which can be inlined */ +u64 notrace _paravirt_ident_64(u64 x) +{ +return x; +} +static unsigned paravirt_patch_jmp (void *insnbuf,const void *target,unsigned long addr,unsigned len) {
@@ -146,13 +141,11 @@ unsigned paravirt_patch_default(u8 type, void *insnbuf,else if (opfunc == _paravirt_nop) ret =0 ; +#ifdef CONFIG_PARAVIRT_XXL /* identity functions just return their single argument */ -else if (opfunc == _paravirt_ident_32) - ret =paravirt_patch_ident_32 (insnbuf, len); else if (opfunc == _paravirt_ident_64) ret =paravirt_patch_ident_64 (insnbuf, len); -#ifdef CONFIG_PARAVIRT_XXL else if (type == PARAVIRT_PATCH(cpu.iret) || type == PARAVIRT_PATCH(cpu.usergs_sysret64))/* If operation requires a jmp, then jmp */
@@ -309,13 +302,8 @@ struct pv_info pv_info = {#endif }; -#if defined(CONFIG_X86_32 ) && !defined(CONFIG_X86_PAE ) -/* 32-bit pagetable entries */ -#define PTE_IDENT __PV_IS_CALLEE_SAVE(_paravirt_ident_32) -#else /* 64-bit pagetable entries */ #define PTE_IDENT __PV_IS_CALLEE_SAVE(_paravirt_ident_64) -#endif struct paravirt_patch_template pv_ops = {/* Init ops. */
arch/x86/kernel/paravirt_patch_32.c +6 -12
@@ -10,24 +10,18 @@ DEF_NATIVE(cpu, iret, "iret");DEF_NATIVE (mmu, read_cr2,"mov %cr2, %eax" );DEF_NATIVE (mmu, write_cr3,"mov %eax, %cr3" );DEF_NATIVE (mmu, read_cr3,"mov %cr3, %eax" ); -#endif - -#if defined(CONFIG_PARAVIRT_SPINLOCKS ) -DEF_NATIVE (lock, queued_spin_unlock,"movb $0, (%eax)" ); -DEF_NATIVE (lock, vcpu_is_preempted,"xor %eax, %eax" ); -#endif - -unsigned paravirt_patch_ident_32 (void *insnbuf,unsigned len) -{ -/* arg in %eax, return in %eax */ -return 0 ; -}unsigned paravirt_patch_ident_64 (void *insnbuf,unsigned len) {/* arg in %edx:%eax, return in %edx:%eax */ return 0 ; } +#endif + +#if defined(CONFIG_PARAVIRT_SPINLOCKS ) +DEF_NATIVE (lock, queued_spin_unlock,"movb $0, (%eax)" ); +DEF_NATIVE (lock, vcpu_is_preempted,"xor %eax, %eax" ); +#endif extern bool pv_is_native_spin_unlock (void );extern bool pv_is_native_vcpu_is_preempted (void );
arch/x86/kernel/paravirt_patch_64.c +6 -14
@@ -15,27 +15,19 @@ DEF_NATIVE(cpu, wbinvd, "wbinvd");DEF_NATIVE (cpu, usergs_sysret64,"swapgs; sysretq" );DEF_NATIVE (cpu, swapgs,"swapgs" ); -#endif - -DEF_NATIVE(, mov32, "mov %edi, %eax"); DEF_NATIVE(, mov64, "mov %rdi, %rax"); -#if defined(CONFIG_PARAVIRT_SPINLOCKS ) -DEF_NATIVE (lock, queued_spin_unlock,"movb $0, (%rdi)" ); -DEF_NATIVE (lock, vcpu_is_preempted,"xor %eax, %eax" ); -#endif - -unsigned paravirt_patch_ident_32 (void *insnbuf,unsigned len) -{ -return paravirt_patch_insns (insnbuf, len, - start__mov32, end__mov32); -} -unsigned paravirt_patch_ident_64 (void *insnbuf,unsigned len) {return paravirt_patch_insns (insnbuf, len, start__mov64, end__mov64); } +#endif + +#if defined(CONFIG_PARAVIRT_SPINLOCKS ) +DEF_NATIVE (lock, queued_spin_unlock,"movb $0, (%rdi)" ); +DEF_NATIVE (lock, vcpu_is_preempted,"xor %eax, %eax" ); +#endif extern bool pv_is_native_spin_unlock (void );extern bool pv_is_native_vcpu_is_preempted (void );
Signature · 1 line
2.16.4
tip-bot for Juergen Gross
merge bot[tip:x86/urgent] x86/paravirt: Remove unused _paravirt_ident_32
x86/paravirt: Remove unused _paravirt_ident_32
Commit-ID: 7847c7be0481558f17e3ef3b03f573677fd30d29 Gitweb: https://git.kernel.org/tip/7847c7be0481558f17e3ef3b03f573677fd30d29 Author: Juergen Gross <[email protected]> AuthorDate: Tue, 30 Oct 2018 07:33:01 +0100 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 30 Oct 2018 09:55:31 +0100
x86/paravirt: Remove unused _paravirt_ident_32
There is no user of _paravirt_ident_32 left in the tree. Remove it together with the related paravirt_patch_ident_32().
paravirt_patch_ident_64() can be moved inside CONFIG_PARAVIRT_XXL=y.
Signed-off-by Juergen Gross <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- arch/x86/include/asm/paravirt_types.h | 2 -- arch/x86/kernel/paravirt.c | 26 +++++++------------------- arch/x86/kernel/paravirt_patch_32.c | 18 ++++++------------ arch/x86/kernel/paravirt_patch_64.c | 20 ++++++-------------- 4 files changed, 19 insertions(+), 47 deletions(-)
arch/x86/include/asm/paravirt_types.h +0 -2
@@ -361,7 +361,6 @@ extern struct paravirt_patch_template pv_ops; __visible extern const char start_##ops##_##name[], end_##ops##_##name[]; \ asm(NATIVE_LABEL("start_", ops, name) code NATIVE_LABEL("end_", ops, name)) -unsigned paravirt_patch_ident_32 (void *insnbuf,unsigned len);unsigned paravirt_patch_ident_64 (void *insnbuf,unsigned len);unsigned paravirt_patch_default (u8 type,void *insnbuf,unsigned long addr,unsigned len);
@@ -651,7 +650,6 @@ void paravirt_leave_lazy_mmu(void);void paravirt_flush_lazy_mmu (void );void _paravirt_nop (void ); -u32 _paravirt_ident_32 (u32 );u64 _paravirt_ident_64 (u64 );#define paravirt_nop ((void *)_paravirt_nop)
arch/x86/kernel/paravirt.c +7 -19
@@ -56,17 +56,6 @@ asm (".pushsection .entry.text, \"ax\"\n"".type _paravirt_nop, @function\n\t" ".popsection"); -/* identity function, which can be inlined */ -u32 notrace _paravirt_ident_32(u32 x) -{ -return x; -} - -u64 notrace _paravirt_ident_64(u64 x) -{ -return x; -} -void __init default_banner (void ) { printk(KERN_INFO "Booting paravirtualized kernel on %s\n",
@@ -102,6 +91,12 @@ static unsigned paravirt_patch_call(void *insnbuf, const void *target, }#ifdef CONFIG_PARAVIRT_XXL +/* identity function, which can be inlined */ +u64 notrace _paravirt_ident_64(u64 x) +{ +return x; +} +static unsigned paravirt_patch_jmp (void *insnbuf,const void *target,unsigned long addr,unsigned len) {
@@ -146,13 +141,11 @@ unsigned paravirt_patch_default(u8 type, void *insnbuf,else if (opfunc == _paravirt_nop) ret =0 ; +#ifdef CONFIG_PARAVIRT_XXL /* identity functions just return their single argument */ -else if (opfunc == _paravirt_ident_32) - ret =paravirt_patch_ident_32 (insnbuf, len); else if (opfunc == _paravirt_ident_64) ret =paravirt_patch_ident_64 (insnbuf, len); -#ifdef CONFIG_PARAVIRT_XXL else if (type == PARAVIRT_PATCH(cpu.iret) || type == PARAVIRT_PATCH(cpu.usergs_sysret64))/* If operation requires a jmp, then jmp */
@@ -309,13 +302,8 @@ struct pv_info pv_info = {#endif }; -#if defined(CONFIG_X86_32 ) && !defined(CONFIG_X86_PAE ) -/* 32-bit pagetable entries */ -#define PTE_IDENT __PV_IS_CALLEE_SAVE(_paravirt_ident_32) -#else /* 64-bit pagetable entries */ #define PTE_IDENT __PV_IS_CALLEE_SAVE(_paravirt_ident_64) -#endif struct paravirt_patch_template pv_ops = {/* Init ops. */
arch/x86/kernel/paravirt_patch_32.c +6 -12
@@ -10,24 +10,18 @@ DEF_NATIVE(cpu, iret, "iret");DEF_NATIVE (mmu, read_cr2,"mov %cr2, %eax" );DEF_NATIVE (mmu, write_cr3,"mov %eax, %cr3" );DEF_NATIVE (mmu, read_cr3,"mov %cr3, %eax" ); -#endif - -#if defined(CONFIG_PARAVIRT_SPINLOCKS ) -DEF_NATIVE (lock, queued_spin_unlock,"movb $0, (%eax)" ); -DEF_NATIVE (lock, vcpu_is_preempted,"xor %eax, %eax" ); -#endif - -unsigned paravirt_patch_ident_32 (void *insnbuf,unsigned len) -{ -/* arg in %eax, return in %eax */ -return 0 ; -}unsigned paravirt_patch_ident_64 (void *insnbuf,unsigned len) {/* arg in %edx:%eax, return in %edx:%eax */ return 0 ; } +#endif + +#if defined(CONFIG_PARAVIRT_SPINLOCKS ) +DEF_NATIVE (lock, queued_spin_unlock,"movb $0, (%eax)" ); +DEF_NATIVE (lock, vcpu_is_preempted,"xor %eax, %eax" ); +#endif extern bool pv_is_native_spin_unlock (void );extern bool pv_is_native_vcpu_is_preempted (void );
arch/x86/kernel/paravirt_patch_64.c +6 -14
@@ -15,27 +15,19 @@ DEF_NATIVE(cpu, wbinvd, "wbinvd");DEF_NATIVE (cpu, usergs_sysret64,"swapgs; sysretq" );DEF_NATIVE (cpu, swapgs,"swapgs" ); -#endif - -DEF_NATIVE(, mov32, "mov %edi, %eax"); DEF_NATIVE(, mov64, "mov %rdi, %rax"); -#if defined(CONFIG_PARAVIRT_SPINLOCKS ) -DEF_NATIVE (lock, queued_spin_unlock,"movb $0, (%rdi)" ); -DEF_NATIVE (lock, vcpu_is_preempted,"xor %eax, %eax" ); -#endif - -unsigned paravirt_patch_ident_32 (void *insnbuf,unsigned len) -{ -return paravirt_patch_insns (insnbuf, len, - start__mov32, end__mov32); -} -unsigned paravirt_patch_ident_64 (void *insnbuf,unsigned len) {return paravirt_patch_insns (insnbuf, len, start__mov64, end__mov64); } +#endif + +#if defined(CONFIG_PARAVIRT_SPINLOCKS ) +DEF_NATIVE (lock, queued_spin_unlock,"movb $0, (%rdi)" ); +DEF_NATIVE (lock, vcpu_is_preempted,"xor %eax, %eax" ); +#endif extern bool pv_is_native_spin_unlock (void );extern bool pv_is_native_vcpu_is_preempted (void );