diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2016-03-06 13:11:15 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-03-08 06:26:41 -0500 |
commit | 1a8aa8acab4f3949e05ceb51e36f627b1651814c (patch) | |
tree | a9effb39a76330371a4bd51ce8a3a20f0a66e68e | |
parent | fe36d8912c8e402c62ce5a8712b6a47baae1ceaa (diff) |
x86/apic: Deinline __default_send_IPI_*, save ~200 bytes
__default_send_IPI_shortcut: 49 bytes, 2 callsites
__default_send_IPI_dest_field: 108 bytes, 7 callsites
text data bss dec hex filename
96184086 20860488 36122624 153167198 921255e vmlinux_before
96183823 20860520 36122624 153166967 9212477 vmlinux
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Borislav Petkov <bp@alien.de>
Cc: Daniel J Blueman <daniel@numascale.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Travis <travis@sgi.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Link: http://lkml.kernel.org/r/1457287876-6001-1-git-send-email-dvlasenk@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/include/asm/ipi.h | 58 | ||||
-rw-r--r-- | arch/x86/kernel/apic/ipi.c | 60 |
2 files changed, 62 insertions, 56 deletions
diff --git a/arch/x86/include/asm/ipi.h b/arch/x86/include/asm/ipi.h index cfc9a0d2d07c..a4fe16e42b7b 100644 --- a/arch/x86/include/asm/ipi.h +++ b/arch/x86/include/asm/ipi.h | |||
@@ -57,67 +57,13 @@ static inline void __xapic_wait_icr_idle(void) | |||
57 | cpu_relax(); | 57 | cpu_relax(); |
58 | } | 58 | } |
59 | 59 | ||
60 | static inline void | 60 | void __default_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest); |
61 | __default_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest) | ||
62 | { | ||
63 | /* | ||
64 | * Subtle. In the case of the 'never do double writes' workaround | ||
65 | * we have to lock out interrupts to be safe. As we don't care | ||
66 | * of the value read we use an atomic rmw access to avoid costly | ||
67 | * cli/sti. Otherwise we use an even cheaper single atomic write | ||
68 | * to the APIC. | ||
69 | */ | ||
70 | unsigned int cfg; | ||
71 | |||
72 | /* | ||
73 | * Wait for idle. | ||
74 | */ | ||
75 | __xapic_wait_icr_idle(); | ||
76 | |||
77 | /* | ||
78 | * No need to touch the target chip field | ||
79 | */ | ||
80 | cfg = __prepare_ICR(shortcut, vector, dest); | ||
81 | |||
82 | /* | ||
83 | * Send the IPI. The write to APIC_ICR fires this off. | ||
84 | */ | ||
85 | native_apic_mem_write(APIC_ICR, cfg); | ||
86 | } | ||
87 | 61 | ||
88 | /* | 62 | /* |
89 | * This is used to send an IPI with no shorthand notation (the destination is | 63 | * This is used to send an IPI with no shorthand notation (the destination is |
90 | * specified in bits 56 to 63 of the ICR). | 64 | * specified in bits 56 to 63 of the ICR). |
91 | */ | 65 | */ |
92 | static inline void | 66 | void __default_send_IPI_dest_field(unsigned int mask, int vector, unsigned int dest); |
93 | __default_send_IPI_dest_field(unsigned int mask, int vector, unsigned int dest) | ||
94 | { | ||
95 | unsigned long cfg; | ||
96 | |||
97 | /* | ||
98 | * Wait for idle. | ||
99 | */ | ||
100 | if (unlikely(vector == NMI_VECTOR)) | ||
101 | safe_apic_wait_icr_idle(); | ||
102 | else | ||
103 | __xapic_wait_icr_idle(); | ||
104 | |||
105 | /* | ||
106 | * prepare target chip field | ||
107 | */ | ||
108 | cfg = __prepare_ICR2(mask); | ||
109 | native_apic_mem_write(APIC_ICR2, cfg); | ||
110 | |||
111 | /* | ||
112 | * program the ICR | ||
113 | */ | ||
114 | cfg = __prepare_ICR(0, vector, dest); | ||
115 | |||
116 | /* | ||
117 | * Send the IPI. The write to APIC_ICR fires this off. | ||
118 | */ | ||
119 | native_apic_mem_write(APIC_ICR, cfg); | ||
120 | } | ||
121 | 67 | ||
122 | extern void default_send_IPI_single(int cpu, int vector); | 68 | extern void default_send_IPI_single(int cpu, int vector); |
123 | extern void default_send_IPI_single_phys(int cpu, int vector); | 69 | extern void default_send_IPI_single_phys(int cpu, int vector); |
diff --git a/arch/x86/kernel/apic/ipi.c b/arch/x86/kernel/apic/ipi.c index eb45fc9b6124..28bde88b0085 100644 --- a/arch/x86/kernel/apic/ipi.c +++ b/arch/x86/kernel/apic/ipi.c | |||
@@ -18,6 +18,66 @@ | |||
18 | #include <asm/proto.h> | 18 | #include <asm/proto.h> |
19 | #include <asm/ipi.h> | 19 | #include <asm/ipi.h> |
20 | 20 | ||
21 | void __default_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest) | ||
22 | { | ||
23 | /* | ||
24 | * Subtle. In the case of the 'never do double writes' workaround | ||
25 | * we have to lock out interrupts to be safe. As we don't care | ||
26 | * of the value read we use an atomic rmw access to avoid costly | ||
27 | * cli/sti. Otherwise we use an even cheaper single atomic write | ||
28 | * to the APIC. | ||
29 | */ | ||
30 | unsigned int cfg; | ||
31 | |||
32 | /* | ||
33 | * Wait for idle. | ||
34 | */ | ||
35 | __xapic_wait_icr_idle(); | ||
36 | |||
37 | /* | ||
38 | * No need to touch the target chip field | ||
39 | */ | ||
40 | cfg = __prepare_ICR(shortcut, vector, dest); | ||
41 | |||
42 | /* | ||
43 | * Send the IPI. The write to APIC_ICR fires this off. | ||
44 | */ | ||
45 | native_apic_mem_write(APIC_ICR, cfg); | ||
46 | } | ||
47 | |||
48 | /* | ||
49 | * This is used to send an IPI with no shorthand notation (the destination is | ||
50 | * specified in bits 56 to 63 of the ICR). | ||
51 | */ | ||
52 | void __default_send_IPI_dest_field(unsigned int mask, int vector, unsigned int dest) | ||
53 | { | ||
54 | unsigned long cfg; | ||
55 | |||
56 | /* | ||
57 | * Wait for idle. | ||
58 | */ | ||
59 | if (unlikely(vector == NMI_VECTOR)) | ||
60 | safe_apic_wait_icr_idle(); | ||
61 | else | ||
62 | __xapic_wait_icr_idle(); | ||
63 | |||
64 | /* | ||
65 | * prepare target chip field | ||
66 | */ | ||
67 | cfg = __prepare_ICR2(mask); | ||
68 | native_apic_mem_write(APIC_ICR2, cfg); | ||
69 | |||
70 | /* | ||
71 | * program the ICR | ||
72 | */ | ||
73 | cfg = __prepare_ICR(0, vector, dest); | ||
74 | |||
75 | /* | ||
76 | * Send the IPI. The write to APIC_ICR fires this off. | ||
77 | */ | ||
78 | native_apic_mem_write(APIC_ICR, cfg); | ||
79 | } | ||
80 | |||
21 | void default_send_IPI_single_phys(int cpu, int vector) | 81 | void default_send_IPI_single_phys(int cpu, int vector) |
22 | { | 82 | { |
23 | unsigned long flags; | 83 | unsigned long flags; |