Skip to content

Commit

Permalink
Merge branch '14.0' into 14.0-DSP
Browse files Browse the repository at this point in the history
  • Loading branch information
kondors1995 committed Feb 7, 2024
2 parents d3df5ff + f8b5088 commit 6b3ae7e
Show file tree
Hide file tree
Showing 44 changed files with 972 additions and 1,085 deletions.
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -800,12 +800,6 @@ ifdef CONFIG_MINIMAL_TRACING_FOR_IORAP
KBUILD_CFLAGS += -DNOTRACE
endif

ifdef CONFIG_INLINE_OPTIMIZATION
KBUILD_CFLAGS += -mllvm -inline-threshold=2000
KBUILD_CFLAGS += -mllvm -inlinehint-threshold=3000
KBUILD_CFLAGS += -mllvm -unroll-threshold=1200
endif

# Tell gcc to never replace conditional load with a non-conditional one
KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races)
Expand Down Expand Up @@ -977,7 +971,8 @@ endif

ifdef CONFIG_LTO_CLANG
ifdef CONFIG_THINLTO
lto-clang-flags := -flto=thin
lto-clang-flags := -funified-lto
lto-clang-flags += -flto=thin
LDFLAGS += --thinlto-cache-dir=.thinlto-cache
else
lto-clang-flags := -flto
Expand Down
4 changes: 0 additions & 4 deletions arch/arm64/crypto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
ccflags-y += -O3
ccflags-y += -mllvm -inline-threshold=15000
ccflags-y += -mllvm -inlinehint-threshold=10000


obj-$(CONFIG_CRYPTO_SHA1_ARM64_CE) += sha1-ce.o
sha1-ce-y := sha1-ce-glue.o sha1-ce-core.o
Expand Down
5 changes: 0 additions & 5 deletions arch/arm64/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ CFLAGS_REMOVE_ftrace.o = -pg
CFLAGS_REMOVE_insn.o = -pg
CFLAGS_REMOVE_return_address.o = -pg

ccflags-y += -mllvm -inline-threshold=15000
ccflags-y += -mllvm -inlinehint-threshold=10000

CFLAGS_setup.o = -DUTS_MACHINE='"$(UTS_MACHINE)"'
ccflags-y += -mllvm -inline-threshold=15000
ccflags-y += -mllvm -inlinehint-threshold=10000

# Object file lists.
arm64-obj-y := debug-monitors.o entry.o irq.o fpsimd.o \
Expand Down
4 changes: 0 additions & 4 deletions arch/arm64/lib/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
ccflags-y += -O3
ccflags-y += -mllvm -inline-threshold=15000
ccflags-y += -mllvm -inlinehint-threshold=10000

lib-y := checksum.o clear_user.o delay.o copy_from_user.o \
copy_to_user.o copy_in_user.o copy_page.o \
clear_page.o memchr.o memcpy.o memset.o \
Expand Down
2 changes: 0 additions & 2 deletions arch/arm64/mm/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
ccflags-y += -mllvm -inline-threshold=15000
ccflags-y += -mllvm -inlinehint-threshold=10000
obj-y := dma-mapping.o extable.o fault.o init.o \
cache.o copypage.o flush.o \
ioremap.o mmap.o pgd.o mmu.o \
Expand Down
5 changes: 1 addition & 4 deletions block/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ obj-$(CONFIG_BLOCK) := bio.o elevator.o blk-core.o blk-tag.o blk-sysfs.o \
genhd.o partition-generic.o ioprio.o \
badblocks.o partitions/

ccflags-y += -mllvm -inline-threshold=15000
ccflags-y += -mllvm -inlinehint-threshold=10000

obj-$(CONFIG_BOUNCE) += bounce.o
obj-$(CONFIG_BLK_SCSI_REQUEST) += scsi_ioctl.o
obj-$(CONFIG_BLK_DEV_BSG) += bsg.o
Expand All @@ -40,4 +37,4 @@ obj-$(CONFIG_BLK_DEBUG_FS) += blk-mq-debugfs.o
obj-$(CONFIG_BLK_SED_OPAL) += sed-opal.o
obj-$(CONFIG_BLK_INLINE_ENCRYPTION) += keyslot-manager.o bio-crypt-ctx.o \
blk-crypto.o
obj-$(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) += blk-crypto-fallback.o
obj-$(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) += blk-crypto-fallback.o
3 changes: 0 additions & 3 deletions crypto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# Cryptographic API
#

ccflags-y += -mllvm -inline-threshold=15000
ccflags-y += -mllvm -inlinehint-threshold=10000

obj-$(CONFIG_CRYPTO) += crypto.o
crypto-y := api.o cipher.o compress.o memneq.o

Expand Down
2 changes: 0 additions & 2 deletions drivers/android/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
ccflags-y += -mllvm -inline-threshold=15000
ccflags-y += -mllvm -inlinehint-threshold=10000
ccflags-y += -I$(src) # needed for trace events

obj-$(CONFIG_ANDROID_BINDERFS) += binderfs.o
Expand Down
43 changes: 27 additions & 16 deletions drivers/android/binder.c
Original file line number Diff line number Diff line change
Expand Up @@ -2193,8 +2193,9 @@ static void binder_transaction_buffer_release(struct binder_proc *proc,
* Convert the address to an offset relative to
* the base of the transaction buffer.
*/
fda_offset = parent->buffer - buffer->user_data +
fda->parent_offset;
fda_offset =
(parent->buffer - (uintptr_t)buffer->user_data) +
fda->parent_offset;
for (fd_index = 0; fd_index < fda->num_fds;
fd_index++) {
u32 fd;
Expand Down Expand Up @@ -2449,7 +2450,7 @@ static int binder_translate_fd_array(struct binder_fd_array_object *fda,
* Convert the address to an offset relative to
* the base of the transaction buffer.
*/
fda_offset = parent->buffer - t->buffer->user_data +
fda_offset = (parent->buffer - (uintptr_t)t->buffer->user_data) +
fda->parent_offset;
if (!IS_ALIGNED((unsigned long)fda_offset, sizeof(u32))) {
binder_user_error("%d:%d parent offset not aligned correctly.\n",
Expand Down Expand Up @@ -2517,9 +2518,14 @@ static int binder_fixup_parent(struct binder_transaction *t,
proc->pid, thread->pid);
return -EINVAL;
}
buffer_offset = bp->parent_offset + parent->buffer - b->user_data;
binder_alloc_copy_to_buffer(&target_proc->alloc, b, buffer_offset,
&bp->buffer, sizeof(bp->buffer));
buffer_offset = bp->parent_offset +
(uintptr_t)parent->buffer - (uintptr_t)b->user_data;
if (binder_alloc_copy_to_buffer(&target_proc->alloc, b, buffer_offset,
&bp->buffer, sizeof(bp->buffer))) {
binder_user_error("%d:%d got transaction with invalid parent offset\n",
proc->pid, thread->pid);
return -EINVAL;
}

return 0;
}
Expand Down Expand Up @@ -3055,7 +3061,7 @@ static void binder_transaction(struct binder_proc *proc,

t->buffer = binder_alloc_new_buf(&target_proc->alloc, tr->data_size,
tr->offsets_size, extra_buffers_size,
!reply && (t->flags & TF_ONE_WAY));
!reply && (t->flags & TF_ONE_WAY), current->tgid);
if (IS_ERR(t->buffer)) {
/*
* -ESRCH indicates VMA cleared. The target is dying.
Expand All @@ -3068,16 +3074,20 @@ static void binder_transaction(struct binder_proc *proc,
goto err_binder_alloc_buf_failed;
}
if (secctx) {
int err;
__maybe_unused int err;
size_t buf_offset = ALIGN(tr->data_size, sizeof(void *)) +
ALIGN(tr->offsets_size, sizeof(void *)) +
ALIGN(extra_buffers_size, sizeof(void *)) -
ALIGN(secctx_sz, sizeof(u64));

t->security_ctx = t->buffer->user_data + buf_offset;
binder_alloc_copy_to_buffer(&target_proc->alloc,
t->buffer, buf_offset,
secctx, secctx_sz);
t->security_ctx = (uintptr_t)t->buffer->user_data + buf_offset;
err = binder_alloc_copy_to_buffer(&target_proc->alloc,
t->buffer, buf_offset,
secctx, secctx_sz);
if (err) {
t->security_ctx = 0;
WARN_ON(1);
}
security_release_secctx(secctx, secctx_sz);
secctx = NULL;
}
Expand Down Expand Up @@ -3302,7 +3312,8 @@ static void binder_transaction(struct binder_proc *proc,
goto err_copy_data_failed;
}
/* Fixup buffer pointer to target proc address space */
bp->buffer = t->buffer->user_data + sg_buf_offset;
bp->buffer = (uintptr_t)
t->buffer->user_data + sg_buf_offset;
sg_buf_offset += ALIGN(bp->length, sizeof(u64));

num_valid = (buffer_offset - off_start_offset) /
Expand Down Expand Up @@ -4440,7 +4451,7 @@ static int binder_thread_read(struct binder_proc *proc,
}
trd->data_size = t->buffer->data_size;
trd->offsets_size = t->buffer->offsets_size;
trd->data.ptr.buffer = t->buffer->user_data;
trd->data.ptr.buffer = (uintptr_t)t->buffer->user_data;
trd->data.ptr.offsets = trd->data.ptr.buffer +
ALIGN(t->buffer->data_size,
sizeof(void *));
Expand Down Expand Up @@ -4776,7 +4787,7 @@ static unsigned int binder_poll(struct file *filp,

thread = binder_get_thread(proc);
if (!thread)
return EPOLLERR;
return POLLERR;

binder_inner_proc_lock(thread->proc);
thread->looper |= BINDER_LOOPER_STATE_POLL;
Expand Down Expand Up @@ -5732,7 +5743,7 @@ static void print_binder_transaction_ilocked(struct seq_file *m,
}
if (buffer->target_node)
seq_printf(m, " node %d", buffer->target_node->debug_id);
seq_printf(m, " size %zd:%zd data %lx\n",
seq_printf(m, " size %zd:%zd data %pK\n",
buffer->data_size, buffer->offsets_size,
buffer->user_data);
}
Expand Down
Loading

0 comments on commit 6b3ae7e

Please sign in to comment.