Skip to content

Commit 7847c7b

Browse files
jgross1Ingo Molnar
authored andcommitted
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 <jgross@suse.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: akataria@vmware.com Cc: boris.ostrovsky@oracle.com Cc: rusty@rustcorp.com.au Cc: virtualization@lists.linux-foundation.org Cc: xen-devel@lists.xenproject.org Link: http://lkml.kernel.org/r/20181030063301.15054-1-jgross@suse.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent f77084d commit 7847c7b

File tree

4 files changed

+19
-47
lines changed

4 files changed

+19
-47
lines changed

arch/x86/include/asm/paravirt_types.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@ extern struct paravirt_patch_template pv_ops;
361361
__visible extern const char start_##ops##_##name[], end_##ops##_##name[]; \
362362
asm(NATIVE_LABEL("start_", ops, name) code NATIVE_LABEL("end_", ops, name))
363363

364-
unsigned paravirt_patch_ident_32(void *insnbuf, unsigned len);
365364
unsigned paravirt_patch_ident_64(void *insnbuf, unsigned len);
366365
unsigned paravirt_patch_default(u8 type, void *insnbuf,
367366
unsigned long addr, unsigned len);
@@ -651,7 +650,6 @@ void paravirt_leave_lazy_mmu(void);
651650
void paravirt_flush_lazy_mmu(void);
652651

653652
void _paravirt_nop(void);
654-
u32 _paravirt_ident_32(u32);
655653
u64 _paravirt_ident_64(u64);
656654

657655
#define paravirt_nop ((void *)_paravirt_nop)

arch/x86/kernel/paravirt.c

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,6 @@ asm (".pushsection .entry.text, \"ax\"\n"
5656
".type _paravirt_nop, @function\n\t"
5757
".popsection");
5858

59-
/* identity function, which can be inlined */
60-
u32 notrace _paravirt_ident_32(u32 x)
61-
{
62-
return x;
63-
}
64-
65-
u64 notrace _paravirt_ident_64(u64 x)
66-
{
67-
return x;
68-
}
69-
7059
void __init default_banner(void)
7160
{
7261
printk(KERN_INFO "Booting paravirtualized kernel on %s\n",
@@ -102,6 +91,12 @@ static unsigned paravirt_patch_call(void *insnbuf, const void *target,
10291
}
10392

10493
#ifdef CONFIG_PARAVIRT_XXL
94+
/* identity function, which can be inlined */
95+
u64 notrace _paravirt_ident_64(u64 x)
96+
{
97+
return x;
98+
}
99+
105100
static unsigned paravirt_patch_jmp(void *insnbuf, const void *target,
106101
unsigned long addr, unsigned len)
107102
{
@@ -146,13 +141,11 @@ unsigned paravirt_patch_default(u8 type, void *insnbuf,
146141
else if (opfunc == _paravirt_nop)
147142
ret = 0;
148143

144+
#ifdef CONFIG_PARAVIRT_XXL
149145
/* identity functions just return their single argument */
150-
else if (opfunc == _paravirt_ident_32)
151-
ret = paravirt_patch_ident_32(insnbuf, len);
152146
else if (opfunc == _paravirt_ident_64)
153147
ret = paravirt_patch_ident_64(insnbuf, len);
154148

155-
#ifdef CONFIG_PARAVIRT_XXL
156149
else if (type == PARAVIRT_PATCH(cpu.iret) ||
157150
type == PARAVIRT_PATCH(cpu.usergs_sysret64))
158151
/* If operation requires a jmp, then jmp */
@@ -309,13 +302,8 @@ struct pv_info pv_info = {
309302
#endif
310303
};
311304

312-
#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE)
313-
/* 32-bit pagetable entries */
314-
#define PTE_IDENT __PV_IS_CALLEE_SAVE(_paravirt_ident_32)
315-
#else
316305
/* 64-bit pagetable entries */
317306
#define PTE_IDENT __PV_IS_CALLEE_SAVE(_paravirt_ident_64)
318-
#endif
319307

320308
struct paravirt_patch_template pv_ops = {
321309
/* Init ops. */

arch/x86/kernel/paravirt_patch_32.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,18 @@ DEF_NATIVE(cpu, iret, "iret");
1010
DEF_NATIVE(mmu, read_cr2, "mov %cr2, %eax");
1111
DEF_NATIVE(mmu, write_cr3, "mov %eax, %cr3");
1212
DEF_NATIVE(mmu, read_cr3, "mov %cr3, %eax");
13-
#endif
14-
15-
#if defined(CONFIG_PARAVIRT_SPINLOCKS)
16-
DEF_NATIVE(lock, queued_spin_unlock, "movb $0, (%eax)");
17-
DEF_NATIVE(lock, vcpu_is_preempted, "xor %eax, %eax");
18-
#endif
19-
20-
unsigned paravirt_patch_ident_32(void *insnbuf, unsigned len)
21-
{
22-
/* arg in %eax, return in %eax */
23-
return 0;
24-
}
2513

2614
unsigned paravirt_patch_ident_64(void *insnbuf, unsigned len)
2715
{
2816
/* arg in %edx:%eax, return in %edx:%eax */
2917
return 0;
3018
}
19+
#endif
20+
21+
#if defined(CONFIG_PARAVIRT_SPINLOCKS)
22+
DEF_NATIVE(lock, queued_spin_unlock, "movb $0, (%eax)");
23+
DEF_NATIVE(lock, vcpu_is_preempted, "xor %eax, %eax");
24+
#endif
3125

3226
extern bool pv_is_native_spin_unlock(void);
3327
extern bool pv_is_native_vcpu_is_preempted(void);

arch/x86/kernel/paravirt_patch_64.c

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,19 @@ DEF_NATIVE(cpu, wbinvd, "wbinvd");
1515

1616
DEF_NATIVE(cpu, usergs_sysret64, "swapgs; sysretq");
1717
DEF_NATIVE(cpu, swapgs, "swapgs");
18-
#endif
19-
20-
DEF_NATIVE(, mov32, "mov %edi, %eax");
2118
DEF_NATIVE(, mov64, "mov %rdi, %rax");
2219

23-
#if defined(CONFIG_PARAVIRT_SPINLOCKS)
24-
DEF_NATIVE(lock, queued_spin_unlock, "movb $0, (%rdi)");
25-
DEF_NATIVE(lock, vcpu_is_preempted, "xor %eax, %eax");
26-
#endif
27-
28-
unsigned paravirt_patch_ident_32(void *insnbuf, unsigned len)
29-
{
30-
return paravirt_patch_insns(insnbuf, len,
31-
start__mov32, end__mov32);
32-
}
33-
3420
unsigned paravirt_patch_ident_64(void *insnbuf, unsigned len)
3521
{
3622
return paravirt_patch_insns(insnbuf, len,
3723
start__mov64, end__mov64);
3824
}
25+
#endif
26+
27+
#if defined(CONFIG_PARAVIRT_SPINLOCKS)
28+
DEF_NATIVE(lock, queued_spin_unlock, "movb $0, (%rdi)");
29+
DEF_NATIVE(lock, vcpu_is_preempted, "xor %eax, %eax");
30+
#endif
3931

4032
extern bool pv_is_native_spin_unlock(void);
4133
extern bool pv_is_native_vcpu_is_preempted(void);

0 commit comments

Comments
 (0)