Skip to content

Commit 2754906

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Catalin Marinas: - Bring initialisation of user space undefined instruction handling early (core_initcall) since late_initcall() happens after modprobe in initramfs is invoked. Similar fix for fpsimd initialisation - Increase the kernel stack when KASAN is enabled - Bring the PCI ACS enabling earlier via the iort_init_platform_devices() - Fix misleading data abort address printing (decimal vs hex) * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Ensure fpsimd support is ready before userspace is active arm64: Ensure the instruction emulation is ready for userspace arm64: Use larger stacks when KASAN is selected ACPI/IORT: Fix PCI ACS enablement arm64: fix misleading data abort decoding
2 parents 8d47332 + ae2e972 commit 2754906

File tree

6 files changed

+45
-7
lines changed

6 files changed

+45
-7
lines changed

arch/arm64/include/asm/memory.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,19 @@
9595
#define KERNEL_END _end
9696

9797
/*
98-
* The size of the KASAN shadow region. This should be 1/8th of the
99-
* size of the entire kernel virtual address space.
98+
* KASAN requires 1/8th of the kernel virtual address space for the shadow
99+
* region. KASAN can bloat the stack significantly, so double the (minimum)
100+
* stack size when KASAN is in use.
100101
*/
101102
#ifdef CONFIG_KASAN
102103
#define KASAN_SHADOW_SIZE (UL(1) << (VA_BITS - 3))
104+
#define KASAN_THREAD_SHIFT 1
103105
#else
104106
#define KASAN_SHADOW_SIZE (0)
107+
#define KASAN_THREAD_SHIFT 0
105108
#endif
106109

107-
#define MIN_THREAD_SHIFT 14
110+
#define MIN_THREAD_SHIFT (14 + KASAN_THREAD_SHIFT)
108111

109112
/*
110113
* VMAP'd stacks are allocated at page granularity, so we must ensure that such

arch/arm64/kernel/armv8_deprecated.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,4 +649,4 @@ static int __init armv8_deprecated_init(void)
649649
return 0;
650650
}
651651

652-
late_initcall(armv8_deprecated_init);
652+
core_initcall(armv8_deprecated_init);

arch/arm64/kernel/cpufeature.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1307,4 +1307,4 @@ static int __init enable_mrs_emulation(void)
13071307
return 0;
13081308
}
13091309

1310-
late_initcall(enable_mrs_emulation);
1310+
core_initcall(enable_mrs_emulation);

arch/arm64/kernel/fpsimd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,4 +444,4 @@ static int __init fpsimd_init(void)
444444

445445
return 0;
446446
}
447-
late_initcall(fpsimd_init);
447+
core_initcall(fpsimd_init);

arch/arm64/mm/fault.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static void data_abort_decode(unsigned int esr)
9797
(esr & ESR_ELx_SF) >> ESR_ELx_SF_SHIFT,
9898
(esr & ESR_ELx_AR) >> ESR_ELx_AR_SHIFT);
9999
} else {
100-
pr_alert(" ISV = 0, ISS = 0x%08lu\n", esr & ESR_ELx_ISS_MASK);
100+
pr_alert(" ISV = 0, ISS = 0x%08lx\n", esr & ESR_ELx_ISS_MASK);
101101
}
102102

103103
pr_alert(" CM = %lu, WnR = %lu\n",

drivers/acpi/arm64/iort.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,12 +1178,44 @@ static int __init iort_add_smmu_platform_device(struct acpi_iort_node *node)
11781178
return ret;
11791179
}
11801180

1181+
static bool __init iort_enable_acs(struct acpi_iort_node *iort_node)
1182+
{
1183+
if (iort_node->type == ACPI_IORT_NODE_PCI_ROOT_COMPLEX) {
1184+
struct acpi_iort_node *parent;
1185+
struct acpi_iort_id_mapping *map;
1186+
int i;
1187+
1188+
map = ACPI_ADD_PTR(struct acpi_iort_id_mapping, iort_node,
1189+
iort_node->mapping_offset);
1190+
1191+
for (i = 0; i < iort_node->mapping_count; i++, map++) {
1192+
if (!map->output_reference)
1193+
continue;
1194+
1195+
parent = ACPI_ADD_PTR(struct acpi_iort_node,
1196+
iort_table, map->output_reference);
1197+
/*
1198+
* If we detect a RC->SMMU mapping, make sure
1199+
* we enable ACS on the system.
1200+
*/
1201+
if ((parent->type == ACPI_IORT_NODE_SMMU) ||
1202+
(parent->type == ACPI_IORT_NODE_SMMU_V3)) {
1203+
pci_request_acs();
1204+
return true;
1205+
}
1206+
}
1207+
}
1208+
1209+
return false;
1210+
}
1211+
11811212
static void __init iort_init_platform_devices(void)
11821213
{
11831214
struct acpi_iort_node *iort_node, *iort_end;
11841215
struct acpi_table_iort *iort;
11851216
struct fwnode_handle *fwnode;
11861217
int i, ret;
1218+
bool acs_enabled = false;
11871219

11881220
/*
11891221
* iort_table and iort both point to the start of IORT table, but
@@ -1203,6 +1235,9 @@ static void __init iort_init_platform_devices(void)
12031235
return;
12041236
}
12051237

1238+
if (!acs_enabled)
1239+
acs_enabled = iort_enable_acs(iort_node);
1240+
12061241
if ((iort_node->type == ACPI_IORT_NODE_SMMU) ||
12071242
(iort_node->type == ACPI_IORT_NODE_SMMU_V3)) {
12081243

0 commit comments

Comments
 (0)