]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - init/main.c
HID: rmi: Check that a device is a RMI device before calling RMI functions
[mirror_ubuntu-bionic-kernel.git] / init / main.c
index 881d62438b1a79643ab6db8e4098569978f3469a..8828fc148670df6dc81b07b03ea8070c7424a349 100644 (file)
@@ -487,6 +487,8 @@ void __init __weak thread_stack_cache_init(void)
 }
 #endif
 
+void __init __weak mem_encrypt_init(void) { }
+
 /*
  * Set up kernel memory allocators
  */
@@ -640,6 +642,14 @@ asmlinkage __visible void __init start_kernel(void)
         */
        locking_selftest();
 
+       /*
+        * This needs to be called before any devices perform DMA
+        * operations that might use the SWIOTLB bounce buffers. It will
+        * mark the bounce buffers as decrypted so that their usage will
+        * not cause "plain-text" data to be decrypted when accessed.
+        */
+       mem_encrypt_init();
+
 #ifdef CONFIG_BLK_DEV_INITRD
        if (initrd_start && !initrd_below_start_ok &&
            page_to_pfn(virt_to_page((void *)initrd_start)) < min_low_pfn) {
@@ -650,8 +660,8 @@ asmlinkage __visible void __init start_kernel(void)
        }
 #endif
        page_ext_init();
-       debug_objects_mem_init();
        kmemleak_init();
+       debug_objects_mem_init();
        setup_per_cpu_pageset();
        numa_policy_init();
        if (late_time_init)