Skip to content
23 changes: 9 additions & 14 deletions arch/arm64/kernel/jump_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@

#ifdef HAVE_JUMP_LABEL

static void __arch_jump_label_transform(struct jump_entry *entry,
enum jump_label_type type,
bool is_static)
void arch_jump_label_transform(struct jump_entry *entry,
enum jump_label_type type)
{
void *addr = (void *)entry->code;
u32 insn;
Expand All @@ -37,22 +36,18 @@ static void __arch_jump_label_transform(struct jump_entry *entry,
insn = aarch64_insn_gen_nop();
}

if (is_static)
aarch64_insn_patch_text_nosync(addr, insn);
else
aarch64_insn_patch_text(&addr, &insn, 1);
}

void arch_jump_label_transform(struct jump_entry *entry,
enum jump_label_type type)
{
__arch_jump_label_transform(entry, type, false);
aarch64_insn_patch_text(&addr, &insn, 1);
}

void arch_jump_label_transform_static(struct jump_entry *entry,
enum jump_label_type type)
{
__arch_jump_label_transform(entry, type, true);
/*
* We use the architected A64 NOP in arch_static_branch, so there's no
* need to patch an identical A64 NOP over the top of it here. The core
* will call arch_jump_label_transform from a module notifier if the
* NOP needs to be replaced by a branch.
*/
}

#endif /* HAVE_JUMP_LABEL */
46 changes: 38 additions & 8 deletions arch/arm64/lib/copy_page.S
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,50 @@
* x1 - src
*/
ENTRY(copy_page)
/* Assume cache line size is 64 bytes. */
prfm pldl1strm, [x1, #64]
1: ldp x2, x3, [x1]
ldp x2, x3, [x1]
ldp x4, x5, [x1, #16]
ldp x6, x7, [x1, #32]
ldp x8, x9, [x1, #48]
add x1, x1, #64
prfm pldl1strm, [x1, #64]
ldp x10, x11, [x1, #64]
ldp x12, x13, [x1, #80]
ldp x14, x15, [x1, #96]
ldp x16, x17, [x1, #112]

mov x18, #(PAGE_SIZE - 128)
add x1, x1, #128
1:
subs x18, x18, #128

stnp x2, x3, [x0]
ldp x2, x3, [x1]
stnp x4, x5, [x0, #16]
ldp x4, x5, [x1, #16]
stnp x6, x7, [x0, #32]
ldp x6, x7, [x1, #32]
stnp x8, x9, [x0, #48]
add x0, x0, #64
tst x1, #(PAGE_SIZE - 1)
b.ne 1b
ldp x8, x9, [x1, #48]
stnp x10, x11, [x0, #64]
ldp x10, x11, [x1, #64]
stnp x12, x13, [x0, #80]
ldp x12, x13, [x1, #80]
stnp x14, x15, [x0, #96]
ldp x14, x15, [x1, #96]
stnp x16, x17, [x0, #112]
ldp x16, x17, [x1, #112]

add x0, x0, #128
add x1, x1, #128

b.gt 1b

stnp x2, x3, [x0]
stnp x4, x5, [x0, #16]
stnp x6, x7, [x0, #32]
stnp x8, x9, [x0, #48]
stnp x10, x11, [x0, #64]
stnp x12, x13, [x0, #80]
stnp x14, x15, [x0, #96]
stnp x16, x17, [x0, #112]

ret
ENDPROC(copy_page)
2 changes: 2 additions & 0 deletions arch/arm64/lib/memcpy.S
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ D_h .req x14
.weak memcpy
ENTRY(__memcpy)
ENTRY(memcpy)
prfm pldl1strm, [src, #(1*L1_CACHE_BYTES)]
mov dst, dstin
cmp count, #16
/*When memory length is less than 16, the accessed are not aligned.*/
Expand Down Expand Up @@ -190,6 +191,7 @@ ENTRY(memcpy)
ldp C_l, C_h, [src],#16
stp D_l, D_h, [dst],#16
ldp D_l, D_h, [src],#16
prfm pldl1strm, [src, #(4*L1_CACHE_BYTES)]
subs count, count, #64
b.ge 1b
stp A_l, A_h, [dst],#16
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/lib/memmove.S
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ D_h .req x14
.weak memmove
ENTRY(__memmove)
ENTRY(memmove)
prfm pldl1strm, [src, #L1_CACHE_BYTES]
cmp dstin, src
b.lo __memcpy
add tmp1, src, count
Expand Down Expand Up @@ -186,6 +187,7 @@ ENTRY(memmove)
ldp C_l, C_h, [src, #-48]
stp D_l, D_h, [dst, #-64]!
ldp D_l, D_h, [src, #-64]!
prfm pldl1strm, [src, #(4*L1_CACHE_BYTES)]
subs count, count, #64
b.ge 1b
stp A_l, A_h, [dst, #-16]
Expand Down
6 changes: 3 additions & 3 deletions drivers/input/touchscreen/synaptics_driver_s3320.c
Original file line number Diff line number Diff line change
Expand Up @@ -3575,20 +3575,20 @@ static int synaptics_ts_probe(struct i2c_client *client, const struct i2c_device

//push_component_info(TP, ts->fw_id, ts->manu_name);

synaptics_wq = create_singlethread_workqueue("synaptics_wq");
synaptics_wq = alloc_ordered_workqueue("synaptics_wq", WQ_HIGHPRI);
if( !synaptics_wq ){
ret = -ENOMEM;
goto exit_createworkqueue_failed;
}
INIT_DELAYED_WORK(&ts->speed_up_work,speedup_synaptics_resume);

synaptics_report = create_singlethread_workqueue("synaptics_report");
synaptics_report = alloc_ordered_workqueue("synaptics_report", WQ_HIGHPRI);
if( !synaptics_report ){
ret = -ENOMEM;
goto exit_createworkqueue_failed;
}

get_base_report = create_singlethread_workqueue("get_base_report");
get_base_report = alloc_ordered_workqueue("get_base_report", WQ_HIGHPRI);
if( !get_base_report ){
ret = -ENOMEM;
goto exit_createworkqueue_failed;
Expand Down
6 changes: 3 additions & 3 deletions drivers/md/dm-crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1841,16 +1841,16 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
}

ret = -ENOMEM;
cc->io_queue = alloc_workqueue("kcryptd_io", WQ_MEM_RECLAIM, 1);
cc->io_queue = alloc_workqueue("kcryptd_io", WQ_HIGHPRI | WQ_MEM_RECLAIM, 1);
if (!cc->io_queue) {
ti->error = "Couldn't create kcryptd io queue";
goto bad;
}

if (test_bit(DM_CRYPT_SAME_CPU, &cc->flags))
cc->crypt_queue = alloc_workqueue("kcryptd", WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, 1);
cc->crypt_queue = alloc_workqueue("kcryptd", WQ_HIGHPRI | WQ_MEM_RECLAIM, 1);
else
cc->crypt_queue = alloc_workqueue("kcryptd", WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM | WQ_UNBOUND,
cc->crypt_queue = alloc_workqueue("kcryptd", WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_UNBOUND,
num_online_cpus());
if (!cc->crypt_queue) {
ti->error = "Couldn't create kcryptd queue";
Expand Down
2 changes: 1 addition & 1 deletion drivers/md/dm-verity.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ static int verity_ctr(struct dm_target *ti, unsigned argc, char **argv)
}

/* WQ_UNBOUND greatly improves performance when running on ramdisk */
v->verify_wq = alloc_workqueue("kverityd", WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM | WQ_UNBOUND, num_online_cpus());
v->verify_wq = alloc_workqueue("kverityd", WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_UNBOUND, num_online_cpus());
if (!v->verify_wq) {
ti->error = "Cannot allocate workqueue";
r = -ENOMEM;
Expand Down
21 changes: 20 additions & 1 deletion fs/binfmt_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,25 @@ static int padzero(unsigned long elf_bss)
#define ELF_BASE_PLATFORM NULL
#endif

/*
* Use get_random_int() to implement AT_RANDOM while avoiding depletion
* of the entropy pool.
*/
static void get_atrandom_bytes(unsigned char *buf, size_t nbytes)
{
unsigned char *p = buf;

while (nbytes) {
unsigned int random_variable;
size_t chunk = min(nbytes, sizeof(random_variable));

random_variable = get_random_int();
memcpy(p, &random_variable, chunk);
p += chunk;
nbytes -= chunk;
}
}

static int
create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
unsigned long load_addr, unsigned long interp_load_addr)
Expand Down Expand Up @@ -207,7 +226,7 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
/*
* Generate 16 random bytes for userspace PRNG seeding.
*/
get_random_bytes(k_rand_bytes, sizeof(k_rand_bytes));
get_atrandom_bytes(k_rand_bytes, sizeof(k_rand_bytes));
u_rand_bytes = (elf_addr_t __user *)
STACK_ALLOC(p, sizeof(k_rand_bytes));
if (__copy_to_user(u_rand_bytes, k_rand_bytes, sizeof(k_rand_bytes)))
Expand Down
4 changes: 2 additions & 2 deletions include/linux/lz4.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#define LZ4_MEM_COMPRESS (4096 * sizeof(unsigned char *))
#define LZ4HC_MEM_COMPRESS (65538 * sizeof(unsigned char *))
#define LZ4_MEM_COMPRESS (16384)
#define LZ4HC_MEM_COMPRESS (262144 + (2 * sizeof(unsigned char *)))

/*
* lz4_compressbound()
Expand Down
2 changes: 1 addition & 1 deletion mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ struct scan_control {
/*
* From 0 .. 100. Higher means more swappy.
*/
int vm_swappiness = 60;
int vm_swappiness = 0;
/*
* The total number of pages which are beyond the high watermark within all
* zones.
Expand Down
4 changes: 3 additions & 1 deletion mm/vmstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,9 @@ static int vmstat_show(struct seq_file *m, void *arg)
unsigned long *l = arg;
unsigned long off = l - (unsigned long *)m->private;

seq_printf(m, "%s %lu\n", vmstat_text[off], *l);
seq_puts(m, vmstat_text[off]);
seq_put_decimal_ull(m, ' ', *l);
seq_putc(m, '\n');
return 0;
}

Expand Down