History

Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm

Pull ARM fixes from Russell King: - add the new bpf syscall to ARM. - drop a redundant return statement in __iommu_alloc_remap() - fix a performance issue noticed by Thomas Petazzoni with kmap_atomic(). - fix an issue with the L2 cache OF parsing code which caused it to incorrectly print warnings on each boot, and make the warning text more consistent with the rest of the code * 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: ARM: 8180/1: mm: implement no-highmem fast path in kmap_atomic_pfn() ARM: 8183/1: l2c: Improve l2c310_of_parse() error message ARM: 8181/1: Drop extra return statement ARM: 8182/1: l2c: Make l2x0_cache_size_of_parse() return 'int' ARM: enable bpf syscall

Linus Torvalds committed 12 years ago

Commit 3c43de02 parents 7501a53 9ff0bb55 files · +23 −9Browse files

Unified · Split

5 files
  1. arch/arm/include/uapi/asm/unistd.h +1 −0
  2. arch/arm/kernel/calls.S +1 −0
  3. arch/arm/mm/cache-l2x0.c +18 −8
  4. arch/arm/mm/dma-mapping.c +0 −1
  5. arch/arm/mm/highmem.c +3 −0
arch/arm/include/uapi/asm/unistd.h+1−0
@@ -412,6 +412,7 @@ · 411 unmodified lines
412412 #define __NR_seccomp (__NR_SYSCALL_BASE+383)
413413 #define __NR_getrandom (__NR_SYSCALL_BASE+384)
414414 #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
415+#define __NR_bpf (__NR_SYSCALL_BASE+386)
415416
416417 /*
417418 * The following SWIs are ARM private.
arch/arm/kernel/calls.S+1−0
@@ -395,6 +395,7 @@ · 394 unmodified lines
395395 CALL(sys_seccomp)
396396 CALL(sys_getrandom)
397397 /* 385 */ CALL(sys_memfd_create)
398+ CALL(sys_bpf)
398399 #ifndef syscalls_counted
399400 .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
400401 #define syscalls_counted
arch/arm/mm/cache-l2x0.c+18−8
@@ -956,7 +956,7 @@ static u32 cache_id_part_number_from_dt; · 955 unmodified lines
956956 * @associativity: variable to return the calculated associativity in
957957 * @max_way_size: the maximum size in bytes for the cache ways
958958 */
959−static void __init l2x0_cache_size_of_parse(const struct device_node *np,
959+static int __init l2x0_cache_size_of_parse(const struct device_node *np,
960960 u32 *aux_val, u32 *aux_mask,
961961 u32 *associativity,
962962 u32 max_way_size)
@@ -974,7 +974,7 @@ static void __init l2x0_cache_size_of_parse(const struct device_node *np, · 11 unmodified lines
974974 of_property_read_u32(np, "cache-line-size", &line_size);
975975
976976 if (!cache_size || !sets)
977− return;
977+ return -ENODEV;
978978
979979 /* All these l2 caches have the same line = block size actually */
980980 if (!line_size) {
@@ -1009,7 +1009,7 @@ static void __init l2x0_cache_size_of_parse(const struct device_node *np, · 28 unmodified lines
10091009
10101010 if (way_size > max_way_size) {
10111011 pr_err("L2C OF: set size %dKB is too large\n", way_size);
1012− return;
1012+ return -EINVAL;
10131013 }
10141014
10151015 pr_info("L2C OF: override cache size: %d bytes (%dKB)\n",
@@ -1027,7 +1027,7 @@ static void __init l2x0_cache_size_of_parse(const struct device_node *np, · 11 unmodified lines
10271027 if (way_size_bits < 1 || way_size_bits > 6) {
10281028 pr_err("L2C OF: cache way size illegal: %dKB is not mapped\n",
10291029 way_size);
1030− return;
1030+ return -EINVAL;
10311031 }
10321032
10331033 mask |= L2C_AUX_CTRL_WAY_SIZE_MASK;
@@ -1036,6 +1036,8 @@ static void __init l2x0_cache_size_of_parse(const struct device_node *np, · 2 unmodified lines
10361036 *aux_val &= ~mask;
10371037 *aux_val |= val;
10381038 *aux_mask &= ~mask;
1039+
1040+ return 0;
10391041 }
10401042
10411043 static void __init l2x0_of_parse(const struct device_node *np,
@@ -1046,6 +1048,7 @@ static void __init l2x0_of_parse(const struct device_node *np, · 4 unmodified lines
10461048 u32 dirty = 0;
10471049 u32 val = 0, mask = 0;
10481050 u32 assoc;
1051+ int ret;
10491052
10501053 of_property_read_u32(np, "arm,tag-latency", &tag);
10511054 if (tag) {
@@ -1068,7 +1071,10 @@ static void __init l2x0_of_parse(const struct device_node *np, · 16 unmodified lines
10681071 val |= (dirty - 1) << L2X0_AUX_CTRL_DIRTY_LATENCY_SHIFT;
10691072 }
10701073
1071− l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_256K);
1074+ ret = l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_256K);
1075+ if (ret)
1076+ return;
1077+
10721078 if (assoc > 8) {
10731079 pr_err("l2x0 of: cache setting yield too high associativity\n");
10741080 pr_err("l2x0 of: %d calculated, max 8\n", assoc);
@@ -1125,6 +1131,7 @@ static void __init l2c310_of_parse(const struct device_node *np, · 50 unmodified lines
11251131 u32 tag[3] = { 0, 0, 0 };
11261132 u32 filter[2] = { 0, 0 };
11271133 u32 assoc;
1134+ int ret;
11281135
11291136 of_property_read_u32_array(np, "arm,tag-latency", tag, ARRAY_SIZE(tag));
11301137 if (tag[0] && tag[1] && tag[2])
@@ -1152,7 +1159,10 @@ static void __init l2c310_of_parse(const struct device_node *np, · 21 unmodified lines
11521159 l2x0_base + L310_ADDR_FILTER_START);
11531160 }
11541161
1155− l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_512K);
1162+ ret = l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_512K);
1163+ if (ret)
1164+ return;
1165+
11561166 switch (assoc) {
11571167 case 16:
11581168 *aux_val &= ~L2X0_AUX_CTRL_ASSOC_MASK;
@@ -1164,8 +1174,8 @@ static void __init l2c310_of_parse(const struct device_node *np, · 5 unmodified lines
11641174 *aux_mask &= ~L2X0_AUX_CTRL_ASSOC_MASK;
11651175 break;
11661176 default:
1167− pr_err("PL310 OF: cache setting yield illegal associativity\n");
1168− pr_err("PL310 OF: %d calculated, only 8 and 16 legal\n", assoc);
1177+ pr_err("L2C-310 OF cache associativity %d invalid, only 8 or 16 permitted\n",
1178+ assoc);
11691179 break;
11701180 }
11711181 }
arch/arm/mm/dma-mapping.c+0−1
@@ -1198,7 +1198,6 @@ __iommu_alloc_remap(struct page **pages, size_t size, gfp_t gfp, pgprot_t prot, · 1197 unmodified lines
11981198 {
11991199 return dma_common_pages_remap(pages, size,
12001200 VM_ARM_DMA_CONSISTENT | VM_USERMAP, prot, caller);
1201− return NULL;
12021201 }
12031202
12041203 /*
arch/arm/mm/highmem.c+3−0
@@ -127,8 +127,11 @@ void *kmap_atomic_pfn(unsigned long pfn) · 126 unmodified lines
127127 {
128128 unsigned long vaddr;
129129 int idx, type;
130+ struct page *page = pfn_to_page(pfn);
130131
131132 pagefault_disable();
133+ if (!PageHighMem(page))
134+ return page_address(page);
132135
133136 type = kmap_atomic_idx_push();
134137 idx = type + KM_TYPE_NR * smp_processor_id();