arm64 fix for -rc3

- Fix spurious CPU hotplug warning message from SETEND emulation code
 
 - Fix the build when GCC wasn't inlining our I/O accessor internals
 -----BEGIN PGP SIGNATURE-----
 
 iQFEBAABCgAuFiEEPxTL6PPUbjXGY88ct6xw3ITBYzQFAmZi7LoQHHdpbGxAa2Vy
 bmVsLm9yZwAKCRC3rHDchMFjNHHCB/9cnPBWjVe8XK3tpZADACBUovrfT/x5cr7e
 TgdELeZ7NT1Eqmh/W1ZyUxphsCVT2Ky87E2idZaXT/NnQVo7joyPKPzePlAk5jmx
 TxRKsgnFHEoISmWjCPkka86UwKtEAo7aN50tsjRIhJlv4sJJnpDhxz0B2TqDX0U4
 u9dtcl5kr+fm9odFUkJb8FcRXnTXF28IuGVSpQArqaB8liib6HqnBBe394j9Ju8S
 7Or0vOZJQidHF+azXIhwiMCjPK5t7ajY+vmCXZTR1irQmbQsSJgBogpGl/A2Ji5c
 XjOZuYiDBlnLBi5bJau+z5ciYeSraug/92D27hZ/tRH5YyoAgzYa
 =IvZ4
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2024-06-07 14:36:57 -07:00
commit 8d437867ba
2 changed files with 19 additions and 20 deletions

View File

@ -153,8 +153,9 @@ extern void __memset_io(volatile void __iomem *, int, size_t);
* emit the large TLP from the CPU. * emit the large TLP from the CPU.
*/ */
static inline void __const_memcpy_toio_aligned32(volatile u32 __iomem *to, static __always_inline void
const u32 *from, size_t count) __const_memcpy_toio_aligned32(volatile u32 __iomem *to, const u32 *from,
size_t count)
{ {
switch (count) { switch (count) {
case 8: case 8:
@ -196,24 +197,22 @@ static inline void __const_memcpy_toio_aligned32(volatile u32 __iomem *to,
void __iowrite32_copy_full(void __iomem *to, const void *from, size_t count); void __iowrite32_copy_full(void __iomem *to, const void *from, size_t count);
static inline void __const_iowrite32_copy(void __iomem *to, const void *from, static __always_inline void
size_t count) __iowrite32_copy(void __iomem *to, const void *from, size_t count)
{ {
if (count == 8 || count == 4 || count == 2 || count == 1) { if (__builtin_constant_p(count) &&
(count == 8 || count == 4 || count == 2 || count == 1)) {
__const_memcpy_toio_aligned32(to, from, count); __const_memcpy_toio_aligned32(to, from, count);
dgh(); dgh();
} else { } else {
__iowrite32_copy_full(to, from, count); __iowrite32_copy_full(to, from, count);
} }
} }
#define __iowrite32_copy __iowrite32_copy
#define __iowrite32_copy(to, from, count) \ static __always_inline void
(__builtin_constant_p(count) ? \ __const_memcpy_toio_aligned64(volatile u64 __iomem *to, const u64 *from,
__const_iowrite32_copy(to, from, count) : \ size_t count)
__iowrite32_copy_full(to, from, count))
static inline void __const_memcpy_toio_aligned64(volatile u64 __iomem *to,
const u64 *from, size_t count)
{ {
switch (count) { switch (count) {
case 8: case 8:
@ -255,21 +254,18 @@ static inline void __const_memcpy_toio_aligned64(volatile u64 __iomem *to,
void __iowrite64_copy_full(void __iomem *to, const void *from, size_t count); void __iowrite64_copy_full(void __iomem *to, const void *from, size_t count);
static inline void __const_iowrite64_copy(void __iomem *to, const void *from, static __always_inline void
size_t count) __iowrite64_copy(void __iomem *to, const void *from, size_t count)
{ {
if (count == 8 || count == 4 || count == 2 || count == 1) { if (__builtin_constant_p(count) &&
(count == 8 || count == 4 || count == 2 || count == 1)) {
__const_memcpy_toio_aligned64(to, from, count); __const_memcpy_toio_aligned64(to, from, count);
dgh(); dgh();
} else { } else {
__iowrite64_copy_full(to, from, count); __iowrite64_copy_full(to, from, count);
} }
} }
#define __iowrite64_copy __iowrite64_copy
#define __iowrite64_copy(to, from, count) \
(__builtin_constant_p(count) ? \
__const_iowrite64_copy(to, from, count) : \
__iowrite64_copy_full(to, from, count))
/* /*
* I/O memory mapping functions. * I/O memory mapping functions.

View File

@ -462,6 +462,9 @@ static int run_all_insn_set_hw_mode(unsigned int cpu)
for (int i = 0; i < ARRAY_SIZE(insn_emulations); i++) { for (int i = 0; i < ARRAY_SIZE(insn_emulations); i++) {
struct insn_emulation *insn = insn_emulations[i]; struct insn_emulation *insn = insn_emulations[i];
bool enable = READ_ONCE(insn->current_mode) == INSN_HW; bool enable = READ_ONCE(insn->current_mode) == INSN_HW;
if (insn->status == INSN_UNAVAILABLE)
continue;
if (insn->set_hw_mode && insn->set_hw_mode(enable)) { if (insn->set_hw_mode && insn->set_hw_mode(enable)) {
pr_warn("CPU[%u] cannot support the emulation of %s", pr_warn("CPU[%u] cannot support the emulation of %s",
cpu, insn->name); cpu, insn->name);