Skip to content

Commit 8d43786

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Will Deacon: - Fix spurious CPU hotplug warning message from SETEND emulation code - Fix the build when GCC wasn't inlining our I/O accessor internals * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64/io: add constant-argument check arm64: armv8_deprecated: Fix warning in isndep cpuhp starting process
2 parents 96e09b8 + 5c40e42 commit 8d43786

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

arch/arm64/include/asm/io.h

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,9 @@ extern void __memset_io(volatile void __iomem *, int, size_t);
153153
* emit the large TLP from the CPU.
154154
*/
155155

156-
static inline void __const_memcpy_toio_aligned32(volatile u32 __iomem *to,
157-
const u32 *from, size_t count)
156+
static __always_inline void
157+
__const_memcpy_toio_aligned32(volatile u32 __iomem *to, const u32 *from,
158+
size_t count)
158159
{
159160
switch (count) {
160161
case 8:
@@ -196,24 +197,22 @@ static inline void __const_memcpy_toio_aligned32(volatile u32 __iomem *to,
196197

197198
void __iowrite32_copy_full(void __iomem *to, const void *from, size_t count);
198199

199-
static inline void __const_iowrite32_copy(void __iomem *to, const void *from,
200-
size_t count)
200+
static __always_inline void
201+
__iowrite32_copy(void __iomem *to, const void *from, size_t count)
201202
{
202-
if (count == 8 || count == 4 || count == 2 || count == 1) {
203+
if (__builtin_constant_p(count) &&
204+
(count == 8 || count == 4 || count == 2 || count == 1)) {
203205
__const_memcpy_toio_aligned32(to, from, count);
204206
dgh();
205207
} else {
206208
__iowrite32_copy_full(to, from, count);
207209
}
208210
}
211+
#define __iowrite32_copy __iowrite32_copy
209212

210-
#define __iowrite32_copy(to, from, count) \
211-
(__builtin_constant_p(count) ? \
212-
__const_iowrite32_copy(to, from, count) : \
213-
__iowrite32_copy_full(to, from, count))
214-
215-
static inline void __const_memcpy_toio_aligned64(volatile u64 __iomem *to,
216-
const u64 *from, size_t count)
213+
static __always_inline void
214+
__const_memcpy_toio_aligned64(volatile u64 __iomem *to, const u64 *from,
215+
size_t count)
217216
{
218217
switch (count) {
219218
case 8:
@@ -255,21 +254,18 @@ static inline void __const_memcpy_toio_aligned64(volatile u64 __iomem *to,
255254

256255
void __iowrite64_copy_full(void __iomem *to, const void *from, size_t count);
257256

258-
static inline void __const_iowrite64_copy(void __iomem *to, const void *from,
259-
size_t count)
257+
static __always_inline void
258+
__iowrite64_copy(void __iomem *to, const void *from, size_t count)
260259
{
261-
if (count == 8 || count == 4 || count == 2 || count == 1) {
260+
if (__builtin_constant_p(count) &&
261+
(count == 8 || count == 4 || count == 2 || count == 1)) {
262262
__const_memcpy_toio_aligned64(to, from, count);
263263
dgh();
264264
} else {
265265
__iowrite64_copy_full(to, from, count);
266266
}
267267
}
268-
269-
#define __iowrite64_copy(to, from, count) \
270-
(__builtin_constant_p(count) ? \
271-
__const_iowrite64_copy(to, from, count) : \
272-
__iowrite64_copy_full(to, from, count))
268+
#define __iowrite64_copy __iowrite64_copy
273269

274270
/*
275271
* I/O memory mapping functions.

arch/arm64/kernel/armv8_deprecated.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,9 @@ static int run_all_insn_set_hw_mode(unsigned int cpu)
462462
for (int i = 0; i < ARRAY_SIZE(insn_emulations); i++) {
463463
struct insn_emulation *insn = insn_emulations[i];
464464
bool enable = READ_ONCE(insn->current_mode) == INSN_HW;
465+
if (insn->status == INSN_UNAVAILABLE)
466+
continue;
467+
465468
if (insn->set_hw_mode && insn->set_hw_mode(enable)) {
466469
pr_warn("CPU[%u] cannot support the emulation of %s",
467470
cpu, insn->name);

0 commit comments

Comments
 (0)