summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Jones <joneslee@google.com>2024-01-30 08:54:56 +0000
committerLee Jones <joneslee@google.com>2024-01-30 11:00:07 +0000
commit26918276af6b1a90a2f5e7ccd98c20c45003e3b6 (patch)
tree266c65528c95962eeb1c236e3130db926af5bc38
parent17b84efca5835e25a84572c4801fce596cf5fbc2 (diff)
downloadcommon-patches-26918276af6b1a90a2f5e7ccd98c20c45003e3b6.tar.gz
aosp/android-mainline: update series
up to dea76525f98d8 ("ANDROID: gki_defconfig: Set CONFIG_IDLE_INJECT and CONFIG_CPU_IDLE_THERMAL into y") Signed-off-by: Lee Jones <joneslee@google.com> Change-Id: Ic812dab895c07aa047dacd7d2c393456446b6575
-rw-r--r--android-mainline/ANDROID-Revert-mm-handle-read-faults-under-the-VMA-lock.patch32
-rw-r--r--android-mainline/ANDROID-fs-Move-iocb_to_rw_flags-to-fuse-passthrough.patch63
-rw-r--r--android-mainline/ANDROID-fs-fuse-Keep-FUSE-file-times-consistent-with-lower-file.patch8
-rw-r--r--android-mainline/ANDROID-fuse-Add-support-for-d_canonical_path.patch4
-rw-r--r--android-mainline/ANDROID-overlayfs-override_creds-off-option-bypass-creator_cred.patch24
-rw-r--r--android-mainline/ANDROID-tools-Miscellaneous.patch18
-rw-r--r--android-mainline/FROMGIT-arch-mm-fault-fix-major-fault-accounting-when-retrying-under-per-VMA-lock.patch116
-rw-r--r--android-mainline/FROMLIST-fs-Generic-function-to-convert-iocb-to-rw-flags.patch96
-rw-r--r--android-mainline/NOUPSTREAM-ANDROID-gki_defconfigs.patch16
-rw-r--r--android-mainline/Revert-usb-typec-tcpm-fix-cc-role-at-port-reset-2.patch38
-rw-r--r--android-mainline/series7
11 files changed, 263 insertions, 159 deletions
diff --git a/android-mainline/ANDROID-Revert-mm-handle-read-faults-under-the-VMA-lock.patch b/android-mainline/ANDROID-Revert-mm-handle-read-faults-under-the-VMA-lock.patch
deleted file mode 100644
index a9cffdb2..00000000
--- a/android-mainline/ANDROID-Revert-mm-handle-read-faults-under-the-VMA-lock.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Lee Jones <joneslee@google.com>
-Date: Tue, 30 Jan 2024 08:15:41 +0000
-Subject: ANDROID: Revert "mm: handle read faults under the VMA lock"
-
-This reverts commit faab0a6453d49aee6fa5a871e2b44991a1dff6ab. This is
-causing the test drop_caches#set_perf_property to fail.
-
-Bug: 317385399
-Change-Id: I1d1e5483650cd59f633760bdeeed8c3123c7b415
-Signed-off-by: Will McVicker <willmcvicker@google.com>
----
- mm/memory.c | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/mm/memory.c b/mm/memory.c
---- a/mm/memory.c
-+++ b/mm/memory.c
-@@ -4621,9 +4621,10 @@ static vm_fault_t do_read_fault(struct vm_fault *vmf)
- return ret;
- }
-
-- ret = vmf_can_call_fault(vmf);
-- if (ret)
-- return ret;
-+ if (vmf->flags & FAULT_FLAG_VMA_LOCK) {
-+ vma_end_read(vmf->vma);
-+ return VM_FAULT_RETRY;
-+ }
-
- ret = __do_fault(vmf);
- if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY)))
diff --git a/android-mainline/ANDROID-fs-Move-iocb_to_rw_flags-to-fuse-passthrough.patch b/android-mainline/ANDROID-fs-Move-iocb_to_rw_flags-to-fuse-passthrough.patch
new file mode 100644
index 00000000..61c4d317
--- /dev/null
+++ b/android-mainline/ANDROID-fs-Move-iocb_to_rw_flags-to-fuse-passthrough.patch
@@ -0,0 +1,63 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Alessio Balsini <balsini@google.com>
+Date: Fri, 5 Jan 2024 14:14:18 +0000
+Subject: ANDROID: fs: Move iocb_to_rw_flags to fuse/passthrough
+
+Fixup build error in aosp/2896080 by migrating iocb_to_rw_flags() to
+FUSE passthrough, which depends on it.
+To avoid possible name overlapping, the "fuse_" prefix is added to the
+function name.
+
+This change is meant to be a fixup for aosp/2896080.
+
+Test: build
+Bug: 168023149
+Change-Id: I7696d22a0671cbd457084a17be4e7315109819a3
+Signed-off-by: Alessio Balsini <balsini@google.com>
+---
+ fs/fuse/passthrough.c | 19 +++++++++++++------
+ 1 file changed, 13 insertions(+), 6 deletions(-)
+
+diff --git a/fs/fuse/passthrough.c b/fs/fuse/passthrough.c
+--- a/fs/fuse/passthrough.c
++++ b/fs/fuse/passthrough.c
+@@ -15,6 +15,11 @@ struct fuse_aio_req {
+ struct kiocb *iocb_fuse;
+ };
+
++static inline rwf_t fuse_iocb_to_rw_flags(int ifl, int iocb_mask)
++{
++ return ifl & iocb_mask;
++}
++
+ static void fuse_file_accessed(struct file *dst_file, struct file *src_file)
+ {
+ struct inode *dst_inode;
+@@ -95,9 +100,10 @@ ssize_t fuse_passthrough_read_iter(struct kiocb *iocb_fuse,
+
+ old_cred = override_creds(ff->passthrough.cred);
+ if (is_sync_kiocb(iocb_fuse)) {
+- ret = vfs_iter_read(passthrough_filp, iter, &iocb_fuse->ki_pos,
+- iocb_to_rw_flags(iocb_fuse->ki_flags,
+- PASSTHROUGH_IOCB_MASK));
++ ret = vfs_iter_read(
++ passthrough_filp, iter, &iocb_fuse->ki_pos,
++ fuse_iocb_to_rw_flags(iocb_fuse->ki_flags,
++ PASSTHROUGH_IOCB_MASK));
+ } else {
+ struct fuse_aio_req *aio_req;
+
+@@ -139,9 +145,10 @@ ssize_t fuse_passthrough_write_iter(struct kiocb *iocb_fuse,
+ old_cred = override_creds(ff->passthrough.cred);
+ if (is_sync_kiocb(iocb_fuse)) {
+ file_start_write(passthrough_filp);
+- ret = vfs_iter_write(passthrough_filp, iter, &iocb_fuse->ki_pos,
+- iocb_to_rw_flags(iocb_fuse->ki_flags,
+- PASSTHROUGH_IOCB_MASK));
++ ret = vfs_iter_write(
++ passthrough_filp, iter, &iocb_fuse->ki_pos,
++ fuse_iocb_to_rw_flags(iocb_fuse->ki_flags,
++ PASSTHROUGH_IOCB_MASK));
+ file_end_write(passthrough_filp);
+ if (ret > 0)
+ fuse_copyattr(fuse_filp, passthrough_filp);
diff --git a/android-mainline/ANDROID-fs-fuse-Keep-FUSE-file-times-consistent-with-lower-file.patch b/android-mainline/ANDROID-fs-fuse-Keep-FUSE-file-times-consistent-with-lower-file.patch
index eba512a8..09276158 100644
--- a/android-mainline/ANDROID-fs-fuse-Keep-FUSE-file-times-consistent-with-lower-file.patch
+++ b/android-mainline/ANDROID-fs-fuse-Keep-FUSE-file-times-consistent-with-lower-file.patch
@@ -23,7 +23,7 @@ Signed-off-by: Lee Jones <joneslee@google.com>
diff --git a/fs/fuse/passthrough.c b/fs/fuse/passthrough.c
--- a/fs/fuse/passthrough.c
+++ b/fs/fuse/passthrough.c
-@@ -117,6 +117,8 @@ ssize_t fuse_passthrough_read_iter(struct kiocb *iocb_fuse,
+@@ -123,6 +123,8 @@ ssize_t fuse_passthrough_read_iter(struct kiocb *iocb_fuse,
out:
revert_creds(old_cred);
@@ -32,7 +32,7 @@ diff --git a/fs/fuse/passthrough.c b/fs/fuse/passthrough.c
return ret;
}
-@@ -136,6 +138,8 @@ ssize_t fuse_passthrough_write_iter(struct kiocb *iocb_fuse,
+@@ -142,6 +144,8 @@ ssize_t fuse_passthrough_write_iter(struct kiocb *iocb_fuse,
inode_lock(fuse_inode);
@@ -41,7 +41,7 @@ diff --git a/fs/fuse/passthrough.c b/fs/fuse/passthrough.c
old_cred = override_creds(ff->passthrough.cred);
if (is_sync_kiocb(iocb_fuse)) {
file_start_write(passthrough_filp);
-@@ -176,9 +180,7 @@ ssize_t fuse_passthrough_mmap(struct file *file, struct vm_area_struct *vma)
+@@ -183,9 +187,7 @@ ssize_t fuse_passthrough_mmap(struct file *file, struct vm_area_struct *vma)
int ret;
const struct cred *old_cred;
struct fuse_file *ff = file->private_data;
@@ -51,7 +51,7 @@ diff --git a/fs/fuse/passthrough.c b/fs/fuse/passthrough.c
if (!passthrough_filp->f_op->mmap)
return -ENODEV;
-@@ -197,17 +199,7 @@ ssize_t fuse_passthrough_mmap(struct file *file, struct vm_area_struct *vma)
+@@ -204,17 +206,7 @@ ssize_t fuse_passthrough_mmap(struct file *file, struct vm_area_struct *vma)
else
fput(file);
diff --git a/android-mainline/ANDROID-fuse-Add-support-for-d_canonical_path.patch b/android-mainline/ANDROID-fuse-Add-support-for-d_canonical_path.patch
index 49864681..7acf6b16 100644
--- a/android-mainline/ANDROID-fuse-Add-support-for-d_canonical_path.patch
+++ b/android-mainline/ANDROID-fuse-Add-support-for-d_canonical_path.patch
@@ -134,7 +134,7 @@ diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
diff --git a/fs/fuse/passthrough.c b/fs/fuse/passthrough.c
--- a/fs/fuse/passthrough.c
+++ b/fs/fuse/passthrough.c
-@@ -212,8 +212,7 @@ ssize_t fuse_passthrough_mmap(struct file *file, struct vm_area_struct *vma)
+@@ -219,8 +219,7 @@ ssize_t fuse_passthrough_mmap(struct file *file, struct vm_area_struct *vma)
return ret;
}
@@ -144,7 +144,7 @@ diff --git a/fs/fuse/passthrough.c b/fs/fuse/passthrough.c
{
int res;
struct file *passthrough_filp;
-@@ -225,11 +224,7 @@ int fuse_passthrough_open(struct fuse_dev *fud,
+@@ -232,11 +231,7 @@ int fuse_passthrough_open(struct fuse_dev *fud,
if (!fc->passthrough)
return -EPERM;
diff --git a/android-mainline/ANDROID-overlayfs-override_creds-off-option-bypass-creator_cred.patch b/android-mainline/ANDROID-overlayfs-override_creds-off-option-bypass-creator_cred.patch
index 2277eeea..154fa682 100644
--- a/android-mainline/ANDROID-overlayfs-override_creds-off-option-bypass-creator_cred.patch
+++ b/android-mainline/ANDROID-overlayfs-override_creds-off-option-bypass-creator_cred.patch
@@ -172,7 +172,7 @@ diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c
diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
--- a/fs/overlayfs/file.c
+++ b/fs/overlayfs/file.c
-@@ -59,13 +59,14 @@ static struct file *ovl_open_realfile(const struct file *file,
+@@ -57,13 +57,14 @@ static struct file *ovl_open_realfile(const struct file *file,
if (err) {
realfile = ERR_PTR(err);
} else {
@@ -189,7 +189,7 @@ diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
pr_debug("open(%p[%pD2/%c], 0%o) -> (%p, 0%o)\n",
file, file, ovl_whatisit(inode, realinode), file->f_flags,
-@@ -227,7 +228,7 @@ static loff_t ovl_llseek(struct file *file, loff_t offset, int whence)
+@@ -225,7 +226,7 @@ static loff_t ovl_llseek(struct file *file, loff_t offset, int whence)
old_cred = ovl_override_creds(inode->i_sb);
ret = vfs_llseek(real.file, offset, whence);
@@ -198,7 +198,7 @@ diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
file->f_pos = real.file->f_pos;
ovl_inode_unlock(inode);
-@@ -341,7 +342,7 @@ static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *iter)
+@@ -354,7 +355,7 @@ static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *iter)
ovl_aio_cleanup_handler(aio_req);
}
out:
@@ -207,7 +207,7 @@ diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
ovl_file_accessed(file);
out_fdput:
fdput(real);
-@@ -414,7 +415,7 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter)
+@@ -427,7 +428,7 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter)
ovl_aio_cleanup_handler(aio_req);
}
out:
@@ -216,7 +216,7 @@ diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
out_fdput:
fdput(real);
-@@ -438,7 +439,7 @@ static ssize_t ovl_splice_read(struct file *in, loff_t *ppos,
+@@ -451,7 +452,7 @@ static ssize_t ovl_splice_read(struct file *in, loff_t *ppos,
old_cred = ovl_override_creds(file_inode(in)->i_sb);
ret = vfs_splice_read(real.file, ppos, pipe, len, flags);
@@ -225,7 +225,7 @@ diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
ovl_file_accessed(in);
fdput(real);
-@@ -480,7 +481,7 @@ static ssize_t ovl_splice_write(struct pipe_inode_info *pipe, struct file *out,
+@@ -493,7 +494,7 @@ static ssize_t ovl_splice_write(struct pipe_inode_info *pipe, struct file *out,
file_end_write(real.file);
/* Update size */
ovl_copyattr(inode);
@@ -234,7 +234,7 @@ diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
fdput(real);
out_unlock:
-@@ -507,7 +508,7 @@ static int ovl_fsync(struct file *file, loff_t start, loff_t end, int datasync)
+@@ -520,7 +521,7 @@ static int ovl_fsync(struct file *file, loff_t start, loff_t end, int datasync)
if (file_inode(real.file) == ovl_inode_upper(file_inode(file))) {
old_cred = ovl_override_creds(file_inode(file)->i_sb);
ret = vfs_fsync_range(real.file, start, end, datasync);
@@ -243,7 +243,7 @@ diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
}
fdput(real);
-@@ -531,7 +532,7 @@ static int ovl_mmap(struct file *file, struct vm_area_struct *vma)
+@@ -544,7 +545,7 @@ static int ovl_mmap(struct file *file, struct vm_area_struct *vma)
old_cred = ovl_override_creds(file_inode(file)->i_sb);
ret = call_mmap(vma->vm_file, vma);
@@ -252,7 +252,7 @@ diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
ovl_file_accessed(file);
return ret;
-@@ -557,7 +558,7 @@ static long ovl_fallocate(struct file *file, int mode, loff_t offset, loff_t len
+@@ -570,7 +571,7 @@ static long ovl_fallocate(struct file *file, int mode, loff_t offset, loff_t len
old_cred = ovl_override_creds(file_inode(file)->i_sb);
ret = vfs_fallocate(real.file, mode, offset, len);
@@ -261,7 +261,7 @@ diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
/* Update size */
ovl_copyattr(inode);
-@@ -582,7 +583,7 @@ static int ovl_fadvise(struct file *file, loff_t offset, loff_t len, int advice)
+@@ -595,7 +596,7 @@ static int ovl_fadvise(struct file *file, loff_t offset, loff_t len, int advice)
old_cred = ovl_override_creds(file_inode(file)->i_sb);
ret = vfs_fadvise(real.file, offset, len, advice);
@@ -270,7 +270,7 @@ diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
fdput(real);
-@@ -641,7 +642,7 @@ static loff_t ovl_copyfile(struct file *file_in, loff_t pos_in,
+@@ -654,7 +655,7 @@ static loff_t ovl_copyfile(struct file *file_in, loff_t pos_in,
flags);
break;
}
@@ -279,7 +279,7 @@ diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
/* Update size */
ovl_copyattr(inode_out);
-@@ -703,7 +704,7 @@ static int ovl_flush(struct file *file, fl_owner_t id)
+@@ -716,7 +717,7 @@ static int ovl_flush(struct file *file, fl_owner_t id)
if (real.file->f_op->flush) {
old_cred = ovl_override_creds(file_inode(file)->i_sb);
err = real.file->f_op->flush(real.file, id);
diff --git a/android-mainline/ANDROID-tools-Miscellaneous.patch b/android-mainline/ANDROID-tools-Miscellaneous.patch
index c29e73b2..1bc583dc 100644
--- a/android-mainline/ANDROID-tools-Miscellaneous.patch
+++ b/android-mainline/ANDROID-tools-Miscellaneous.patch
@@ -9,15 +9,15 @@ Change-Id: Ic155709fbf07ec0575fa2fa954ee199e63051a97
tools/testing/android/OWNERS | 4 +
tools/testing/android/bin/acloudb.sh | 43 +++++++++
tools/testing/android/bin/kselftest.sh | 88 +++++++++++++++++++
- .../selftests/android/config_arm64.xml | 78 ++++++++++++++++
- .../selftests/android/config_x86_64.xml | 84 ++++++++++++++++++
+ .../selftests/android/config_arm64.xml | 82 +++++++++++++++++
+ .../selftests/android/config_x86_64.xml | 88 +++++++++++++++++++
.../filesystems/binderfs/binderfs_test.c | 10 +++
.../selftests/futex/functional/futex_wait.c | 6 ++
.../futex/functional/futex_wait_timeout.c | 11 ++-
.../futex/functional/futex_wait_wouldblock.c | 13 ++-
tools/testing/selftests/net/psock_tpacket.c | 2 +
tools/testing/selftests/rtc/rtctest.c | 2 +
- 11 files changed, 334 insertions(+), 7 deletions(-)
+ 11 files changed, 342 insertions(+), 7 deletions(-)
create mode 100644 tools/testing/android/OWNERS
create mode 100755 tools/testing/android/bin/acloudb.sh
create mode 100755 tools/testing/android/bin/kselftest.sh
@@ -178,7 +178,7 @@ diff --git a/tools/testing/selftests/android/config_arm64.xml b/tools/testing/se
new file mode 100644
--- /dev/null
+++ b/tools/testing/selftests/android/config_arm64.xml
-@@ -0,0 +1,78 @@
+@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2023 The Android Open Source Project
+SPDX-License-Identifier: GPL-2.0 OR Apache-2.0
@@ -191,6 +191,10 @@ new file mode 100644
+ <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />
+ <target_preparer class="com.android.tradefed.targetprep.StopServicesSetup" />
+
++ <object type="module_controller" class="com.android.tradefed.testtype.suite.module.KernelTestModuleController" >
++ <option name="arch" value="arm64"/>
++ </object>
++
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+ <option name="cleanup" value="true" />
+ <option name="push-file" key="selftests" value="/data/selftests" />
@@ -261,7 +265,7 @@ diff --git a/tools/testing/selftests/android/config_x86_64.xml b/tools/testing/s
new file mode 100644
--- /dev/null
+++ b/tools/testing/selftests/android/config_x86_64.xml
-@@ -0,0 +1,84 @@
+@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2023 The Android Open Source Project
+SPDX-License-Identifier: GPL-2.0 OR Apache-2.0
@@ -274,6 +278,10 @@ new file mode 100644
+ <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />
+ <target_preparer class="com.android.tradefed.targetprep.StopServicesSetup" />
+
++ <object type="module_controller" class="com.android.tradefed.testtype.suite.module.KernelTestModuleController" >
++ <option name="arch" value="x86_64"/>
++ </object>
++
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+ <option name="cleanup" value="true" />
+ <option name="push-file" key="selftests" value="/data/selftests" />
diff --git a/android-mainline/FROMGIT-arch-mm-fault-fix-major-fault-accounting-when-retrying-under-per-VMA-lock.patch b/android-mainline/FROMGIT-arch-mm-fault-fix-major-fault-accounting-when-retrying-under-per-VMA-lock.patch
new file mode 100644
index 00000000..f2e6761a
--- /dev/null
+++ b/android-mainline/FROMGIT-arch-mm-fault-fix-major-fault-accounting-when-retrying-under-per-VMA-lock.patch
@@ -0,0 +1,116 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Suren Baghdasaryan <surenb@google.com>
+Date: Tue, 26 Dec 2023 13:46:10 -0800
+Subject: FROMGIT: arch/mm/fault: fix major fault accounting when retrying
+ under per-VMA lock
+
+A test [1] in Android test suite started failing after [2] was merged. It
+turns out that after handling a major fault under per-VMA lock, the
+process major fault counter does not register that fault as major. Before
+[2] read faults would be done under mmap_lock, in which case
+FAULT_FLAG_TRIED flag is set before retrying. That in turn causes
+mm_account_fault() to account the fault as major once retry completes.
+With per-VMA locks we often retry because a fault can't be handled without
+locking the whole mm using mmap_lock. Therefore such retries do not set
+FAULT_FLAG_TRIED flag. This logic does not work after [2] because we can
+now handle read major faults under per-VMA lock and upon retry the fact
+there was a major fault gets lost. Fix this by setting FAULT_FLAG_TRIED
+after retrying under per-VMA lock if VM_FAULT_MAJOR was returned. Ideally
+we would use an additional VM_FAULT bit to indicate the reason for the
+retry (could not handle under per-VMA lock vs other reason) but this
+simpler solution seems to work, so keeping it simple.
+
+[1] https://cs.android.com/android/platform/superproject/+/master:test/vts-testcase/kernel/api/drop_caches_prop/drop_caches_test.cpp
+[2] https://lore.kernel.org/all/20231006195318.4087158-6-willy@infradead.org/
+
+Link: https://lkml.kernel.org/r/20231226214610.109282-1-surenb@google.com
+Fixes: 12214eba1992 ("mm: handle read faults under the VMA lock")
+Signed-off-by: Suren Baghdasaryan <surenb@google.com>
+Cc: Matthew Wilcox <willy@infradead.org>
+Cc: Alexander Gordeev <agordeev@linux.ibm.com>
+Cc: Andy Lutomirski <luto@kernel.org>
+Cc: Catalin Marinas <catalin.marinas@arm.com>
+Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
+Cc: Michael Ellerman <mpe@ellerman.id.au>
+Cc: Palmer Dabbelt <palmer@dabbelt.com>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Will Deacon <will@kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+
+(cherry picked from commit 46e714c729c8d1d8110bc0545d7ffe8a759c9dc0
+ https://git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm mm-hotfixes-stable)
+
+Bug: 317385399
+Change-Id: Ic7e97bf610dcabb7d3ac2306b2f1213be0ddd269
+Signed-off-by: Suren Baghdasaryan <surenb@google.com>
+---
+ arch/arm64/mm/fault.c | 2 ++
+ arch/powerpc/mm/fault.c | 2 ++
+ arch/riscv/mm/fault.c | 2 ++
+ arch/s390/mm/fault.c | 3 +++
+ arch/x86/mm/fault.c | 2 ++
+ 5 files changed, 11 insertions(+)
+
+diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
+--- a/arch/arm64/mm/fault.c
++++ b/arch/arm64/mm/fault.c
+@@ -607,6 +607,8 @@ static int __kprobes do_page_fault(unsigned long far, unsigned long esr,
+ goto done;
+ }
+ count_vm_vma_lock_event(VMA_LOCK_RETRY);
++ if (fault & VM_FAULT_MAJOR)
++ mm_flags |= FAULT_FLAG_TRIED;
+
+ /* Quick path to respond to signals */
+ if (fault_signal_pending(fault, regs)) {
+diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
+--- a/arch/powerpc/mm/fault.c
++++ b/arch/powerpc/mm/fault.c
+@@ -497,6 +497,8 @@ static int ___do_page_fault(struct pt_regs *regs, unsigned long address,
+ goto done;
+ }
+ count_vm_vma_lock_event(VMA_LOCK_RETRY);
++ if (fault & VM_FAULT_MAJOR)
++ flags |= FAULT_FLAG_TRIED;
+
+ if (fault_signal_pending(fault, regs))
+ return user_mode(regs) ? 0 : SIGBUS;
+diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c
+--- a/arch/riscv/mm/fault.c
++++ b/arch/riscv/mm/fault.c
+@@ -304,6 +304,8 @@ void handle_page_fault(struct pt_regs *regs)
+ goto done;
+ }
+ count_vm_vma_lock_event(VMA_LOCK_RETRY);
++ if (fault & VM_FAULT_MAJOR)
++ flags |= FAULT_FLAG_TRIED;
+
+ if (fault_signal_pending(fault, regs)) {
+ if (!user_mode(regs))
+diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
+--- a/arch/s390/mm/fault.c
++++ b/arch/s390/mm/fault.c
+@@ -337,6 +337,9 @@ static void do_exception(struct pt_regs *regs, int access)
+ return;
+ }
+ count_vm_vma_lock_event(VMA_LOCK_RETRY);
++ if (fault & VM_FAULT_MAJOR)
++ flags |= FAULT_FLAG_TRIED;
++
+ /* Quick path to respond to signals */
+ if (fault_signal_pending(fault, regs)) {
+ if (!user_mode(regs))
+diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
+--- a/arch/x86/mm/fault.c
++++ b/arch/x86/mm/fault.c
+@@ -1370,6 +1370,8 @@ void do_user_addr_fault(struct pt_regs *regs,
+ goto done;
+ }
+ count_vm_vma_lock_event(VMA_LOCK_RETRY);
++ if (fault & VM_FAULT_MAJOR)
++ flags |= FAULT_FLAG_TRIED;
+
+ /* Quick path to respond to signals */
+ if (fault_signal_pending(fault, regs)) {
diff --git a/android-mainline/FROMLIST-fs-Generic-function-to-convert-iocb-to-rw-flags.patch b/android-mainline/FROMLIST-fs-Generic-function-to-convert-iocb-to-rw-flags.patch
deleted file mode 100644
index 0c054148..00000000
--- a/android-mainline/FROMLIST-fs-Generic-function-to-convert-iocb-to-rw-flags.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Alessio Balsini <balsini@google.com>
-Date: Mon, 25 Jan 2021 16:58:50 +0000
-Subject: FROMLIST: fs: Generic function to convert iocb to rw flags
-
-OverlayFS implements its own function to translate iocb flags into rw
-flags, so that they can be passed into another vfs call.
-With commit ce71bfea207b4 ("fs: align IOCB_* flags with RWF_* flags")
-Jens created a 1:1 matching between the iocb flags and rw flags,
-simplifying the conversion.
-
-Reduce the OverlayFS code by making the flag conversion function generic
-and reusable.
-
-[CPNOTE: 20/05/21] Lee: Still fresh - hopefully this will land upstream soon
-
-Bug: 168023149
-Link: https://lore.kernel.org/lkml/20210125153057.3623715-2-balsini@android.com/
-Signed-off-by: Alessio Balsini <balsini@android.com>
-Change-Id: I74aefeafd6ebbda2fbabee9024474dfe4cc6c2a7
-Signed-off-by: Alessio Balsini <balsini@google.com>
-Signed-off-by: Lee Jones <joneslee@google.com>
----
- fs/overlayfs/file.c | 23 +++++------------------
- include/linux/fs.h | 5 +++++
- 2 files changed, 10 insertions(+), 18 deletions(-)
-
-diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
---- a/fs/overlayfs/file.c
-+++ b/fs/overlayfs/file.c
-@@ -15,6 +15,8 @@
- #include <linux/fs.h>
- #include "overlayfs.h"
-
-+#define OVL_IOCB_MASK (IOCB_DSYNC | IOCB_HIPRI | IOCB_NOWAIT | IOCB_SYNC)
-+
- struct ovl_aio_req {
- struct kiocb iocb;
- refcount_t ref;
-@@ -263,22 +265,6 @@ static void ovl_file_accessed(struct file *file)
- touch_atime(&file->f_path);
- }
-
--static rwf_t ovl_iocb_to_rwf(int ifl)
--{
-- rwf_t flags = 0;
--
-- if (ifl & IOCB_NOWAIT)
-- flags |= RWF_NOWAIT;
-- if (ifl & IOCB_HIPRI)
-- flags |= RWF_HIPRI;
-- if (ifl & IOCB_DSYNC)
-- flags |= RWF_DSYNC;
-- if (ifl & IOCB_SYNC)
-- flags |= RWF_SYNC;
--
-- return flags;
--}
--
- static inline void ovl_aio_put(struct ovl_aio_req *aio_req)
- {
- if (refcount_dec_and_test(&aio_req->ref)) {
-@@ -335,7 +321,8 @@ static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *iter)
- old_cred = ovl_override_creds(file_inode(file)->i_sb);
- if (is_sync_kiocb(iocb)) {
- ret = vfs_iter_read(real.file, iter, &iocb->ki_pos,
-- ovl_iocb_to_rwf(iocb->ki_flags));
-+ iocb_to_rw_flags(iocb->ki_flags,
-+ OVL_IOCB_MASK));
- } else {
- struct ovl_aio_req *aio_req;
-
-@@ -403,7 +390,7 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter)
- if (is_sync_kiocb(iocb)) {
- file_start_write(real.file);
- ret = vfs_iter_write(real.file, iter, &iocb->ki_pos,
-- ovl_iocb_to_rwf(ifl));
-+ iocb_to_rw_flags(ifl, OVL_IOCB_MASK));
- file_end_write(real.file);
- /* Update size */
- ovl_copyattr(inode);
-diff --git a/include/linux/fs.h b/include/linux/fs.h
---- a/include/linux/fs.h
-+++ b/include/linux/fs.h
-@@ -3270,6 +3270,11 @@ static inline int kiocb_set_rw_flags(struct kiocb *ki, rwf_t flags)
- return 0;
- }
-
-+static inline rwf_t iocb_to_rw_flags(int ifl, int iocb_mask)
-+{
-+ return ifl & iocb_mask;
-+}
-+
- static inline ino_t parent_ino(struct dentry *dentry)
- {
- ino_t res;
diff --git a/android-mainline/NOUPSTREAM-ANDROID-gki_defconfigs.patch b/android-mainline/NOUPSTREAM-ANDROID-gki_defconfigs.patch
index f9b9b288..b130e741 100644
--- a/android-mainline/NOUPSTREAM-ANDROID-gki_defconfigs.patch
+++ b/android-mainline/NOUPSTREAM-ANDROID-gki_defconfigs.patch
@@ -24,13 +24,13 @@ Signed-off-by: Lee Jones <joneslee@google.com>
arch/arm64/configs/16k_gki.fragment | 3 +
arch/arm64/configs/crashdump_defconfig | 81 +++
arch/arm64/configs/db845c_gki.fragment | 14 +-
- arch/arm64/configs/gki_defconfig | 705 ++++++++++++++++++++++++
+ arch/arm64/configs/gki_defconfig | 708 ++++++++++++++++++++++++
arch/arm64/configs/microdroid_defconfig | 216 ++++++++
arch/riscv/configs/gki_defconfig | 647 ++++++++++++++++++++++
arch/x86/configs/crashdump_defconfig | 87 +++
- arch/x86/configs/gki_defconfig | 654 ++++++++++++++++++++++
+ arch/x86/configs/gki_defconfig | 657 ++++++++++++++++++++++
arch/x86/configs/microdroid_defconfig | 290 ++++++++++
- 9 files changed, 2694 insertions(+), 3 deletions(-)
+ 9 files changed, 2700 insertions(+), 3 deletions(-)
create mode 100644 arch/arm64/configs/16k_gki.fragment
create mode 100644 arch/arm64/configs/crashdump_defconfig
create mode 100644 arch/arm64/configs/gki_defconfig
@@ -194,7 +194,7 @@ diff --git a/arch/arm64/configs/gki_defconfig b/arch/arm64/configs/gki_defconfig
new file mode 100644
--- /dev/null
+++ b/arch/arm64/configs/gki_defconfig
-@@ -0,0 +1,705 @@
+@@ -0,0 +1,708 @@
+CONFIG_UAPI_HEADER_TEST=y
+CONFIG_AUDIT=y
+CONFIG_NO_HZ=y
@@ -498,6 +498,7 @@ new file mode 100644
+CONFIG_BLK_DEV_LOOP_MIN_COUNT=16
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=8192
++CONFIG_BLK_DEV_UBLK=y
+CONFIG_SRAM=y
+CONFIG_SCSI=y
+# CONFIG_SCSI_PROC_FS is not set
@@ -616,6 +617,7 @@ new file mode 100644
+CONFIG_THERMAL_GOV_USER_SPACE=y
+CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y
+CONFIG_CPU_THERMAL=y
++CONFIG_CPU_IDLE_THERMAL=y
+CONFIG_DEVFREQ_THERMAL=y
+CONFIG_THERMAL_EMULATION=y
+CONFIG_WATCHDOG=y
@@ -750,6 +752,7 @@ new file mode 100644
+CONFIG_IIO_TRIGGER=y
+CONFIG_PWM=y
+CONFIG_POWERCAP=y
++CONFIG_IDLE_INJECT=y
+CONFIG_ANDROID_BINDER_IPC=y
+CONFIG_ANDROID_BINDERFS=y
+CONFIG_ANDROID_VENDOR_HOOKS=y
@@ -1869,7 +1872,7 @@ diff --git a/arch/x86/configs/gki_defconfig b/arch/x86/configs/gki_defconfig
new file mode 100644
--- /dev/null
+++ b/arch/x86/configs/gki_defconfig
-@@ -0,0 +1,654 @@
+@@ -0,0 +1,657 @@
+CONFIG_UAPI_HEADER_TEST=y
+CONFIG_KERNEL_LZ4=y
+CONFIG_AUDIT=y
@@ -2161,6 +2164,7 @@ new file mode 100644
+CONFIG_BLK_DEV_LOOP_MIN_COUNT=16
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=8192
++CONFIG_BLK_DEV_UBLK=y
+CONFIG_SRAM=y
+CONFIG_SCSI=y
+# CONFIG_SCSI_PROC_FS is not set
@@ -2258,6 +2262,7 @@ new file mode 100644
+CONFIG_THERMAL_GOV_BANG_BANG=y
+CONFIG_THERMAL_GOV_USER_SPACE=y
+CONFIG_CPU_THERMAL=y
++CONFIG_CPU_IDLE_THERMAL=y
+CONFIG_DEVFREQ_THERMAL=y
+CONFIG_THERMAL_EMULATION=y
+# CONFIG_X86_PKG_TEMP_THERMAL is not set
@@ -2378,6 +2383,7 @@ new file mode 100644
+CONFIG_IIO_BUFFER=y
+CONFIG_IIO_TRIGGER=y
+CONFIG_POWERCAP=y
++CONFIG_IDLE_INJECT=y
+CONFIG_ANDROID_BINDER_IPC=y
+CONFIG_ANDROID_BINDERFS=y
+CONFIG_ANDROID_VENDOR_HOOKS=y
diff --git a/android-mainline/Revert-usb-typec-tcpm-fix-cc-role-at-port-reset-2.patch b/android-mainline/Revert-usb-typec-tcpm-fix-cc-role-at-port-reset-2.patch
new file mode 100644
index 00000000..319f753f
--- /dev/null
+++ b/android-mainline/Revert-usb-typec-tcpm-fix-cc-role-at-port-reset-2.patch
@@ -0,0 +1,38 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@google.com>
+Date: Wed, 3 Jan 2024 16:03:29 +0000
+Subject: Revert "usb: typec: tcpm: fix cc role at port reset"
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This reverts commit 1e35f074399dece73d5df11847d4a0d7a6f49434.
+
+Seems to break Pixel 6 testing so revert for now. Will need to come
+back later.
+
+Bug: 298207935
+Reported-by: André Draszik <draszik@google.com>
+Change-Id: I8fec8b7ae1b508b963c3bc78ae9308e791a2ef66
+Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
+(cherry picked from commit 49836fa33188dd4cdabe1df3dfb1ff589c0a3d9b)
+[ta: the change was removed in commit 5032efbbcf31 ("ANDROID: bring back
+typec charger changes."), add it again.]
+Signed-off-by: Tudor Ambarus <tudordana@google.com>
+---
+ drivers/usb/typec/tcpm/tcpm.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
+--- a/drivers/usb/typec/tcpm/tcpm.c
++++ b/drivers/usb/typec/tcpm/tcpm.c
+@@ -4861,8 +4861,7 @@ static void run_state_machine(struct tcpm_port *port)
+ break;
+ case PORT_RESET:
+ tcpm_reset_port(port);
+- tcpm_set_cc(port, tcpm_default_state(port) == SNK_UNATTACHED ?
+- TYPEC_CC_RD : tcpm_rp_cc(port));
++ tcpm_set_cc(port, TYPEC_CC_OPEN);
+ tcpm_set_state(port, PORT_RESET_WAIT_OFF,
+ PD_T_ERROR_RECOVERY);
+ break;
diff --git a/android-mainline/series b/android-mainline/series
index 082aac17..8223d0dd 100644
--- a/android-mainline/series
+++ b/android-mainline/series
@@ -2,7 +2,7 @@
# android-mainline patches
#
# Applies onto upstream c9d01179e185f Linux v6.6-15100-gc9d01179e185f
-# Matches android-mainline 7b33d5fab923d ("Merge c9d01179e185 ("Merge tag 'bcachefs-2023-11-5' of https://evilpiepirate.org/git/bcachefs") into android-mainline")
+# Matches android-mainline dea76525f98d8 ("ANDROID: gki_defconfig: Set CONFIG_IDLE_INJECT and CONFIG_CPU_IDLE_THERMAL into y")
# Status: Tested
#
Revert-sched-core-Prevent-race-condition-between-cpuset-and-__sched_setscheduler.patch
@@ -19,9 +19,8 @@ ANDROID-Revert-cpuidle-dt-Push-RCU-idle-into-driver.patch
TODO-LEE-ANDROID-Revert-usb-typec-tcpm-not-sink-vbus-if-operational-current-is-0mA.patch
Revert-sched-debug-Remove-the-proc-sys-kernel-sched_child_runs_first-sysctl.patch
Revert-crypto-pkcs7-remove-sha1-support.patch
-ANDROID-Revert-mm-handle-read-faults-under-the-VMA-lock.patch
+Revert-usb-typec-tcpm-fix-cc-role-at-port-reset-2.patch
_____ANNOTATION-pending-upstream_____.patch
-FROMLIST-fs-Generic-function-to-convert-iocb-to-rw-flags.patch
UPSTREAM-fuse-fix-matching-of-FUSE_DEV_IOC_CLONE-command.patch
FROMLIST-fuse-Definitions-and-ioctl-for-passthrough.patch
FROMLIST-fuse-Passthrough-initialization-and-release.patch
@@ -41,8 +40,10 @@ FROMLIST-fs-select-mark-do_select-noinline_for_stack.patch
UPSTREAM-cpuidle-dt-Push-RCU-idle-into-driver.patch
FROMLIST-kheaders-dereferences-the-source-tree.patch
FROMLIST-Revert-fuse-Apply-flags2-only-when-userspace-set-the-FUSE_INIT_EXT.patch
+ANDROID-fs-Move-iocb_to_rw_flags-to-fuse-passthrough.patch
UPSTREAM-ASoC-codecs-aw88399-Fix-Wuninitialized-in-aw_dev_set_vcalb.patch
UPSTREAM-drm-amd-display-Increase-frame-warning-limit-with-KASAN-or-KCSAN-in-dml2.patch
+FROMGIT-arch-mm-fault-fix-major-fault-accounting-when-retrying-under-per-VMA-lock.patch
_____ANNOTATION-binder-changes_____.patch
ONHOLD-ANDROID-binder-add-support-for-RT-prio-inheritance.patch
ANDROID-binder-fold-common-setup-of-node_prio.patch