提交 27549068 编写于 作者: L Linus Torvalds

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
...@@ -95,16 +95,19 @@ ...@@ -95,16 +95,19 @@
#define KERNEL_END _end #define KERNEL_END _end
/* /*
* The size of the KASAN shadow region. This should be 1/8th of the * KASAN requires 1/8th of the kernel virtual address space for the shadow
* size of the entire kernel virtual address space. * region. KASAN can bloat the stack significantly, so double the (minimum)
* stack size when KASAN is in use.
*/ */
#ifdef CONFIG_KASAN #ifdef CONFIG_KASAN
#define KASAN_SHADOW_SIZE (UL(1) << (VA_BITS - 3)) #define KASAN_SHADOW_SIZE (UL(1) << (VA_BITS - 3))
#define KASAN_THREAD_SHIFT 1
#else #else
#define KASAN_SHADOW_SIZE (0) #define KASAN_SHADOW_SIZE (0)
#define KASAN_THREAD_SHIFT 0
#endif #endif
#define MIN_THREAD_SHIFT 14 #define MIN_THREAD_SHIFT (14 + KASAN_THREAD_SHIFT)
/* /*
* VMAP'd stacks are allocated at page granularity, so we must ensure that such * VMAP'd stacks are allocated at page granularity, so we must ensure that such
......
...@@ -649,4 +649,4 @@ static int __init armv8_deprecated_init(void) ...@@ -649,4 +649,4 @@ static int __init armv8_deprecated_init(void)
return 0; return 0;
} }
late_initcall(armv8_deprecated_init); core_initcall(armv8_deprecated_init);
...@@ -1307,4 +1307,4 @@ static int __init enable_mrs_emulation(void) ...@@ -1307,4 +1307,4 @@ static int __init enable_mrs_emulation(void)
return 0; return 0;
} }
late_initcall(enable_mrs_emulation); core_initcall(enable_mrs_emulation);
...@@ -444,4 +444,4 @@ static int __init fpsimd_init(void) ...@@ -444,4 +444,4 @@ static int __init fpsimd_init(void)
return 0; return 0;
} }
late_initcall(fpsimd_init); core_initcall(fpsimd_init);
...@@ -97,7 +97,7 @@ static void data_abort_decode(unsigned int esr) ...@@ -97,7 +97,7 @@ static void data_abort_decode(unsigned int esr)
(esr & ESR_ELx_SF) >> ESR_ELx_SF_SHIFT, (esr & ESR_ELx_SF) >> ESR_ELx_SF_SHIFT,
(esr & ESR_ELx_AR) >> ESR_ELx_AR_SHIFT); (esr & ESR_ELx_AR) >> ESR_ELx_AR_SHIFT);
} else { } else {
pr_alert(" ISV = 0, ISS = 0x%08lu\n", esr & ESR_ELx_ISS_MASK); pr_alert(" ISV = 0, ISS = 0x%08lx\n", esr & ESR_ELx_ISS_MASK);
} }
pr_alert(" CM = %lu, WnR = %lu\n", pr_alert(" CM = %lu, WnR = %lu\n",
......
...@@ -1178,12 +1178,44 @@ static int __init iort_add_smmu_platform_device(struct acpi_iort_node *node) ...@@ -1178,12 +1178,44 @@ static int __init iort_add_smmu_platform_device(struct acpi_iort_node *node)
return ret; return ret;
} }
static bool __init iort_enable_acs(struct acpi_iort_node *iort_node)
{
if (iort_node->type == ACPI_IORT_NODE_PCI_ROOT_COMPLEX) {
struct acpi_iort_node *parent;
struct acpi_iort_id_mapping *map;
int i;
map = ACPI_ADD_PTR(struct acpi_iort_id_mapping, iort_node,
iort_node->mapping_offset);
for (i = 0; i < iort_node->mapping_count; i++, map++) {
if (!map->output_reference)
continue;
parent = ACPI_ADD_PTR(struct acpi_iort_node,
iort_table, map->output_reference);
/*
* If we detect a RC->SMMU mapping, make sure
* we enable ACS on the system.
*/
if ((parent->type == ACPI_IORT_NODE_SMMU) ||
(parent->type == ACPI_IORT_NODE_SMMU_V3)) {
pci_request_acs();
return true;
}
}
}
return false;
}
static void __init iort_init_platform_devices(void) static void __init iort_init_platform_devices(void)
{ {
struct acpi_iort_node *iort_node, *iort_end; struct acpi_iort_node *iort_node, *iort_end;
struct acpi_table_iort *iort; struct acpi_table_iort *iort;
struct fwnode_handle *fwnode; struct fwnode_handle *fwnode;
int i, ret; int i, ret;
bool acs_enabled = false;
/* /*
* iort_table and iort both point to the start of IORT table, but * 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) ...@@ -1203,6 +1235,9 @@ static void __init iort_init_platform_devices(void)
return; return;
} }
if (!acs_enabled)
acs_enabled = iort_enable_acs(iort_node);
if ((iort_node->type == ACPI_IORT_NODE_SMMU) || if ((iort_node->type == ACPI_IORT_NODE_SMMU) ||
(iort_node->type == ACPI_IORT_NODE_SMMU_V3)) { (iort_node->type == ACPI_IORT_NODE_SMMU_V3)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册