]> Pileus Git - ~andy/linux/blobdiff - arch/arm64/kernel/module.c
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
[~andy/linux] / arch / arm64 / kernel / module.c
index ca0e3d55da998fe5b302530bad487f52a7127938..e2ad0d87721f74590e1c92be20cf1cc8fc6c6e52 100644 (file)
@@ -29,7 +29,7 @@
 void *module_alloc(unsigned long size)
 {
        return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END,
-                                   GFP_KERNEL, PAGE_KERNEL_EXEC, -1,
+                                   GFP_KERNEL, PAGE_KERNEL_EXEC, NUMA_NO_NODE,
                                    __builtin_return_address(0));
 }
 
@@ -111,6 +111,9 @@ static u32 encode_insn_immediate(enum aarch64_imm_type type, u32 insn, u64 imm)
        u32 immlo, immhi, lomask, himask, mask;
        int shift;
 
+       /* The instruction stream is always little endian. */
+       insn = le32_to_cpu(insn);
+
        switch (type) {
        case INSN_IMM_MOVNZ:
                /*
@@ -179,7 +182,7 @@ static u32 encode_insn_immediate(enum aarch64_imm_type type, u32 insn, u64 imm)
        insn &= ~(mask << shift);
        insn |= (imm & mask) << shift;
 
-       return insn;
+       return cpu_to_le32(insn);
 }
 
 static int reloc_insn_movw(enum aarch64_reloc_op op, void *place, u64 val,