Commit graph

853011 commits

Author SHA1 Message Date
Gagan Malvi
09a9a915a4
ARM64/configs: Unify defconfigs.
Signed-off-by: Gagan Malvi <malvigagan@gmail.com>
2021-08-21 16:49:59 +02:00
starlight5234
18fa9a8194
arm64: defconfig: Regen
Change-Id: I359ea61e4ad5e7066d276f3ec0e13c6fafb1012d
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:46:51 +02:00
starlight5234
747d569a36
arm64: defconfig: Align with stock defconfig
Change-Id: I0f9b7e02b9a1614d3e454664c9632ae5a4700eac
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:45:36 +02:00
starlight5234
7189c35c33
arm64: defconfig: Enable some filesystems.
Change-Id: I7c752ed4c48bf15b35daf472bc0488660752aa22
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
Co-authored-by: Gagan Malvi <malvigagan@gmail.com>
2021-08-21 16:43:08 +02:00
Park Ju Hyung
a6f98d3fb0
fs: Expose exFAT for building.
Change-Id: Ib047ebf4e32f43ca77009d8e7c887c0585e7cac6
2021-08-21 16:13:01 +02:00
Tetsuhiro Kohada
017e4b3ec2
exfat: remove useless check in exfat_move_file()
In exfat_move_file(), the identity of source and target directory has been
checked by the caller.
Also, it gets stream.start_clu from file dir-entry, which is an invalid
determination.

Signed-off-by: Tetsuhiro Kohada <kohada.t2@gmail.com>
Acked-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:13:01 +02:00
Tetsuhiro Kohada
487d998a94
exfat: remove 'rwoffset' in exfat_inode_info
Remove 'rwoffset' in exfat_inode_info and replace it with the parameter of
exfat_readdir().
Since rwoffset is referenced only by exfat_readdir(), it is not necessary
a exfat_inode_info's member.
Also, change cpos to point to the next of entry-set, and return the index
of dir-entry via dir_entry->entry.

Signed-off-by: Tetsuhiro Kohada <kohada.t2@gmail.com>
Acked-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:13:01 +02:00
Tetsuhiro Kohada
0af5cfbd0e
exfat: replace memcpy with structure assignment
Use structure assignment instead of memcpy.

Signed-off-by: Tetsuhiro Kohada <kohada.t2@gmail.com>
Acked-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:13:01 +02:00
Tetsuhiro Kohada
5d9d5f907f
exfat: remove useless directory scan in exfat_add_entry()
There is nothing in directory just created, so there is no need to scan.

Signed-off-by: Tetsuhiro Kohada <kohada.t2@gmail.com>
Acked-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:13:00 +02:00
Tetsuhiro Kohada
5b2bd51bed
exfat: eliminate dead code in exfat_find()
The exfat_find_dir_entry() called by exfat_find() doesn't return -EEXIST.
Therefore, the root-dir information setting is never executed.

Signed-off-by: Tetsuhiro Kohada <kohada.t2@gmail.com>
Acked-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:13:00 +02:00
Xianting Tian
5906a75ace
exfat: use i_blocksize() to get blocksize
We alreday has the interface i_blocksize() to get blocksize,
so use it.

Signed-off-by: Xianting Tian <tian.xianting@h3c.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:13:00 +02:00
Namjae Jeon
7fbbd8aa00
exfat: fix misspellings using codespell tool
Sedat reported typos using codespell tool.

 $ codespell fs/exfat/*.c | grep -v iput
 fs/exfat/namei.c:293: upto ==> up to
 fs/exfat/nls.c:14: tabel ==> table

 $ codespell fs/exfat/*.h
 fs/exfat/exfat_fs.h:133: usally ==> usually

Fix typos found by codespell.

Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:13:00 +02:00
Namjae Jeon
40e33a34f3
exfat: fix use of uninitialized spinlock on error path
syzbot reported warning message:

Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1d6/0x29e lib/dump_stack.c:118
 register_lock_class+0xf06/0x1520 kernel/locking/lockdep.c:893
 __lock_acquire+0xfd/0x2ae0 kernel/locking/lockdep.c:4320
 lock_acquire+0x148/0x720 kernel/locking/lockdep.c:5029
 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
 _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151
 spin_lock include/linux/spinlock.h:354 [inline]
 exfat_cache_inval_inode+0x30/0x280 fs/exfat/cache.c:226
 exfat_evict_inode+0x124/0x270 fs/exfat/inode.c:660
 evict+0x2bb/0x6d0 fs/inode.c:576
 exfat_fill_super+0x1e07/0x27d0 fs/exfat/super.c:681
 get_tree_bdev+0x3e9/0x5f0 fs/super.c:1342
 vfs_get_tree+0x88/0x270 fs/super.c:1547
 do_new_mount fs/namespace.c:2875 [inline]
 path_mount+0x179d/0x29e0 fs/namespace.c:3192
 do_mount fs/namespace.c:3205 [inline]
 __do_sys_mount fs/namespace.c:3413 [inline]
 __se_sys_mount+0x126/0x180 fs/namespace.c:3390
 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

If exfat_read_root() returns an error, spinlock is used in
exfat_evict_inode() without initialization. This patch combines
exfat_cache_init_inode() with exfat_inode_init_once() to initialize
spinlock by slab constructor.

Fixes: c35b6810c495 ("exfat: add exfat cache")
Cc: stable@vger.kernel.org # v5.7+
Reported-by: syzbot <syzbot+b91107320911a26c9a95@syzkaller.appspotmail.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:13:00 +02:00
Tetsuhiro Kohada
d5362e854c
exfat: fix pointer error checking
Fix missing result check of exfat_build_inode().
And use PTR_ERR_OR_ZERO instead of PTR_ERR.

Signed-off-by: Tetsuhiro Kohada <kohada.t2@gmail.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:13:00 +02:00
Tetsuhiro Kohada
55952cbd45
exfat: retain 'VolumeFlags' properly
MediaFailure and VolumeDirty should be retained if these are set before
mounting.

In '3.1.13.3 Media Failure Field' of exfat specification describe:

 If, upon mounting a volume, the value of this field is 1,
 implementations which scan the entire volume for media failures and
 record all failures as "bad" clusters in the FAT (or otherwise resolve
 media failures) may clear the value of  this field to 0.

Therefore, We should not clear MediaFailure without scanning volume.

In '8.1 Recommended Write Ordering' of exfat specification describe:

 Clear the value of the VolumeDirty field to 0, if its value prior to
 the first step was 0.

Therefore, We should not clear VolumeDirty after mounting.
Also rename ERR_MEDIUM to MEDIA_FAILURE.

Signed-off-by: Tetsuhiro Kohada <kohada.t2@gmail.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:13:00 +02:00
Tetsuhiro Kohada
f40eb4fc08
exfat: optimize exfat_zeroed_cluster()
Replace part of exfat_zeroed_cluster() with exfat_update_bhs().
And remove exfat_sync_bhs().

Signed-off-by: Tetsuhiro Kohada <kohada.t2@gmail.com>
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:12:59 +02:00
Tetsuhiro Kohada
d46997a980
exfat: add error check when updating dir-entries
Add error check when synchronously updating dir-entries.

Suggested-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Tetsuhiro Kohada <kohada.t2@gmail.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:12:59 +02:00
Tetsuhiro Kohada
52ef604213
exfat: write multiple sectors at once
Write multiple sectors at once when updating dir-entries.
Add exfat_update_bhs() for that. It wait for write completion once
instead of sector by sector.
It's only effective if sync enabled.

Signed-off-by: Tetsuhiro Kohada <kohada.t2@gmail.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:12:59 +02:00
Tetsuhiro Kohada
03403e12fe
exfat: remove EXFAT_SB_DIRTY flag
This flag is set/reset in exfat_put_super()/exfat_sync_fs()
to avoid sync_blockdev().
- exfat_put_super():
Before calling this, the VFS has already called sync_filesystem(),
so sync is never performed here.
- exfat_sync_fs():
After calling this, the VFS calls sync_blockdev(), so, it is meaningless
to check EXFAT_SB_DIRTY or to bypass sync_blockdev() here.

Remove the EXFAT_SB_DIRTY check to ensure synchronization.
And remove the code related to the flag.

Signed-off-by: Tetsuhiro Kohada <kohada.t2@gmail.com>
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:12:59 +02:00
Ilya Ponetayev
f564c70c44
exfat: fix name_hash computation on big endian systems
On-disk format for name_hash field is LE, so it must be explicitly
transformed on BE system for proper result.

Fixes: 370e812b3ec1 ("exfat: add nls operations")
Cc: stable@vger.kernel.org # v5.7
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
Signed-off-by: Ilya Ponetayev <i.ponetaev@ndmsystems.com>
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:12:59 +02:00
Hyeongseok Kim
5c3af28113
exfat: fix wrong size update of stream entry by typo
The stream.size field is updated to the value of create timestamp
of the file entry. Fix this to use correct stream entry pointer.

Fixes: 29bbb14bfc80 ("exfat: fix incorrect update of stream entry in __exfat_truncate()")
Signed-off-by: Hyeongseok Kim <hyeongseok@gmail.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:12:59 +02:00
Namjae Jeon
3d7bd6b5ee
exfat: fix wrong hint_stat initialization in exfat_find_dir_entry()
We found the wrong hint_stat initialization in exfat_find_dir_entry().
It should be initialized when cluster is EXFAT_EOF_CLUSTER.

Fixes: ca06197382bd ("exfat: add directory operations")
Cc: stable@vger.kernel.org # v5.7
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:12:59 +02:00
Namjae Jeon
fa2e177211
exfat: fix overflow issue in exfat_cluster_to_sector()
An overflow issue can occur while calculating sector in
exfat_cluster_to_sector(). It needs to cast clus's type to sector_t
before left shifting.

Fixes: 1acf1a564b60 ("exfat: add in-memory and on-disk structures and headers")
Cc: stable@vger.kernel.org # v5.7
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2021-08-21 16:12:59 +02:00
Gagan Malvi
b99ac02f5a
Merge branch 'master' of https://github.com/arter97/exfat-linux into ruby
Change-Id: I83d92081ed680d9cc2b7a476a463c87324b6222b
2021-08-21 16:12:58 +02:00
Danny Lin
8098862fa4
power: supply: Classify Battery Monitor Systems as batteries
CAF's new fuel gauge drivers report POWER_SUPPLY_TYPE_BMS (Battery
Monitor System) instead of POWER_SUPPLY_TYPE_BATTERY (battery), and
rightfully so because it describes their purpose more accurately.

Update the power_supply_is_system_supplied function to recognize BMS
power supplies as batteries to prevent it from attempting to query the
POWER_SUPPLY_PROP_ONLINE property on our fuel gauge drivers.

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: dreamisbaka <jolinux.g@gmail.com>
2021-08-21 16:12:58 +02:00
Danny Lin
d25a021cea
msm: msm_bus: Kill transaction logging functionality
The transaction logging (and especially strcmp call) is unnecessary for
us and adds measurably significant overhead. Kill it entirely.

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: dreamisbaka <jolinux.g@gmail.com>
2021-08-21 16:12:58 +02:00
kdrag0n
38238767fb
block: disable I/O stats accounting by default
While Android userspace (e.g. storaged) does use iostats via
/proc/diskstats, init will explicitly enable iostats for the devices on
which it is primarily used - sda and sdf. Avoid the 0.5-1% overhead for
block devices that do not need it.

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
[@0ctobot: Adapted for msm-4.19]
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: dreamisbaka <jolinux.g@gmail.com>
2021-08-21 16:12:58 +02:00
Tim Murray
3670a932bd
cpuidle: don't disable cpuidle when entering suspend
cpuidle was disabled while entering suspend as part of commit
8651f97bd9 in order to work around some
ACPI bugs. However, there's no reason to do this on modern
platforms. Leaving cpuidle enabled can result in improved power
consumption if dpm_resume_noirq runs for a significant time.

Change-Id: Ie182785b176f448698c0264eba554d1e315e8a06
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: dreamisbaka <jolinux.g@gmail.com>
2021-08-21 16:12:58 +02:00
Fieah Lim
c5128d78c1
cpuidle: enter_state: Don't needlessly calculate diff time
Currently, ktime_us_delta() is invoked unconditionally to compute the
idle residency of the CPU, but it only makes sense to do that if a
valid idle state has been entered, so move the ktime_us_delta()
invocation after the entered_state >= 0 check.

While at it, merge two comment blocks in there into one and drop
a space between type casting of diff.

This patch has no functional changes.

Signed-off-by: Fieah Lim <kw@fieahl.im>
[ rjw: Changelog cleanup, comment format fix ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: dreamisbaka <jolinux.g@gmail.com>
2021-08-21 16:12:58 +02:00
Wilco Dijkstra
4a20e7c419
arm64: Use optimized memcmp
Patch written by Wilco Dijkstra submitted for review to newlib:
https://sourceware.org/ml/newlib/2017/msg00524.html

This is an optimized memcmp for AArch64.  This is a complete rewrite
using a different algorithm.  The previous version split into cases
where both inputs were aligned, the inputs were mutually aligned and
unaligned using a byte loop.  The new version combines all these cases,
while small inputs of less than 8 bytes are handled separately.

This allows the main code to be sped up using unaligned loads since
there are now at least 8 bytes to be compared.  After the first 8 bytes,
align the first input.  This ensures each iteration does at most one
unaligned access and mutually aligned inputs behave as aligned.
After the main loop, process the last 8 bytes using unaligned accesses.

This improves performance of (mutually) aligned cases by 25% and
unaligned by >500% (yes >6 times faster) on large inputs.

2017-06-28  Wilco Dijkstra  <wdijkstr@arm.com>

        * bionic/libc/arch-arm64/generic/bionic/memcmp.S (memcmp):
                Rewrite of optimized memcmp.

GLIBC benchtests/bench-memcmp.c performance comparison for Cortex-A53:

Length    1, alignment  1/ 1:        153%
Length    1, alignment  1/ 1:        119%
Length    1, alignment  1/ 1:        154%
Length    2, alignment  2/ 2:        121%
Length    2, alignment  2/ 2:        140%
Length    2, alignment  2/ 2:        121%
Length    3, alignment  3/ 3:        105%
Length    3, alignment  3/ 3:        105%
Length    3, alignment  3/ 3:        105%
Length    4, alignment  4/ 4:        155%
Length    4, alignment  4/ 4:        154%
Length    4, alignment  4/ 4:        161%
Length    5, alignment  5/ 5:        173%
Length    5, alignment  5/ 5:        173%
Length    5, alignment  5/ 5:        173%
Length    6, alignment  6/ 6:        145%
Length    6, alignment  6/ 6:        145%
Length    6, alignment  6/ 6:        145%
Length    7, alignment  7/ 7:        125%
Length    7, alignment  7/ 7:        125%
Length    7, alignment  7/ 7:        125%
Length    8, alignment  8/ 8:        111%
Length    8, alignment  8/ 8:        130%
Length    8, alignment  8/ 8:        124%
Length    9, alignment  9/ 9:        160%
Length    9, alignment  9/ 9:        160%
Length    9, alignment  9/ 9:        150%
Length   10, alignment 10/10:        170%
Length   10, alignment 10/10:        137%
Length   10, alignment 10/10:        150%
Length   11, alignment 11/11:        160%
Length   11, alignment 11/11:        160%
Length   11, alignment 11/11:        160%
Length   12, alignment 12/12:        146%
Length   12, alignment 12/12:        168%
Length   12, alignment 12/12:        156%
Length   13, alignment 13/13:        167%
Length   13, alignment 13/13:        167%
Length   13, alignment 13/13:        173%
Length   14, alignment 14/14:        167%
Length   14, alignment 14/14:        168%
Length   14, alignment 14/14:        168%
Length   15, alignment 15/15:        168%
Length   15, alignment 15/15:        173%
Length   15, alignment 15/15:        173%
Length    1, alignment  0/ 0:        134%
Length    1, alignment  0/ 0:        127%
Length    1, alignment  0/ 0:        119%
Length    2, alignment  0/ 0:        94%
Length    2, alignment  0/ 0:        94%
Length    2, alignment  0/ 0:        106%
Length    3, alignment  0/ 0:        82%
Length    3, alignment  0/ 0:        87%
Length    3, alignment  0/ 0:        82%
Length    4, alignment  0/ 0:        115%
Length    4, alignment  0/ 0:        115%
Length    4, alignment  0/ 0:        122%
Length    5, alignment  0/ 0:        127%
Length    5, alignment  0/ 0:        119%
Length    5, alignment  0/ 0:        127%
Length    6, alignment  0/ 0:        103%
Length    6, alignment  0/ 0:        100%
Length    6, alignment  0/ 0:        100%
Length    7, alignment  0/ 0:        82%
Length    7, alignment  0/ 0:        91%
Length    7, alignment  0/ 0:        87%
Length    8, alignment  0/ 0:        111%
Length    8, alignment  0/ 0:        124%
Length    8, alignment  0/ 0:        124%
Length    9, alignment  0/ 0:        136%
Length    9, alignment  0/ 0:        136%
Length    9, alignment  0/ 0:        136%
Length   10, alignment  0/ 0:        136%
Length   10, alignment  0/ 0:        135%
Length   10, alignment  0/ 0:        136%
Length   11, alignment  0/ 0:        136%
Length   11, alignment  0/ 0:        136%
Length   11, alignment  0/ 0:        135%
Length   12, alignment  0/ 0:        136%
Length   12, alignment  0/ 0:        136%
Length   12, alignment  0/ 0:        136%
Length   13, alignment  0/ 0:        135%
Length   13, alignment  0/ 0:        136%
Length   13, alignment  0/ 0:        136%
Length   14, alignment  0/ 0:        136%
Length   14, alignment  0/ 0:        136%
Length   14, alignment  0/ 0:        136%
Length   15, alignment  0/ 0:        136%
Length   15, alignment  0/ 0:        136%
Length   15, alignment  0/ 0:        136%
Length    4, alignment  0/ 0:        115%
Length    4, alignment  0/ 0:        115%
Length    4, alignment  0/ 0:        115%
Length   32, alignment  0/ 0:        127%
Length   32, alignment  7/ 2:        395%
Length   32, alignment  0/ 0:        127%
Length   32, alignment  0/ 0:        127%
Length    8, alignment  0/ 0:        111%
Length    8, alignment  0/ 0:        124%
Length    8, alignment  0/ 0:        124%
Length   64, alignment  0/ 0:        128%
Length   64, alignment  6/ 4:        475%
Length   64, alignment  0/ 0:        131%
Length   64, alignment  0/ 0:        134%
Length   16, alignment  0/ 0:        128%
Length   16, alignment  0/ 0:        119%
Length   16, alignment  0/ 0:        128%
Length  128, alignment  0/ 0:        129%
Length  128, alignment  5/ 6:        475%
Length  128, alignment  0/ 0:        130%
Length  128, alignment  0/ 0:        129%
Length   32, alignment  0/ 0:        126%
Length   32, alignment  0/ 0:        126%
Length   32, alignment  0/ 0:        126%
Length  256, alignment  0/ 0:        127%
Length  256, alignment  4/ 8:        545%
Length  256, alignment  0/ 0:        126%
Length  256, alignment  0/ 0:        128%
Length   64, alignment  0/ 0:        171%
Length   64, alignment  0/ 0:        171%
Length   64, alignment  0/ 0:        174%
Length  512, alignment  0/ 0:        126%
Length  512, alignment  3/10:        585%
Length  512, alignment  0/ 0:        126%
Length  512, alignment  0/ 0:        127%
Length  128, alignment  0/ 0:        129%
Length  128, alignment  0/ 0:        128%
Length  128, alignment  0/ 0:        129%
Length 1024, alignment  0/ 0:        125%
Length 1024, alignment  2/12:        611%
Length 1024, alignment  0/ 0:        126%
Length 1024, alignment  0/ 0:        126%
Length  256, alignment  0/ 0:        128%
Length  256, alignment  0/ 0:        127%
Length  256, alignment  0/ 0:        128%
Length 2048, alignment  0/ 0:        125%
Length 2048, alignment  1/14:        625%
Length 2048, alignment  0/ 0:        125%
Length 2048, alignment  0/ 0:        125%
Length  512, alignment  0/ 0:        126%
Length  512, alignment  0/ 0:        127%
Length  512, alignment  0/ 0:        127%
Length 4096, alignment  0/ 0:        125%
Length 4096, alignment  0/16:        125%
Length 4096, alignment  0/ 0:        125%
Length 4096, alignment  0/ 0:        125%
Length 1024, alignment  0/ 0:        126%
Length 1024, alignment  0/ 0:        126%
Length 1024, alignment  0/ 0:        126%
Length 8192, alignment  0/ 0:        125%
Length 8192, alignment 63/18:        636%
Length 8192, alignment  0/ 0:        125%
Length 8192, alignment  0/ 0:        125%
Length   16, alignment  1/ 2:        317%
Length   16, alignment  1/ 2:        317%
Length   16, alignment  1/ 2:        317%
Length   32, alignment  2/ 4:        395%
Length   32, alignment  2/ 4:        395%
Length   32, alignment  2/ 4:        398%
Length   64, alignment  3/ 6:        475%
Length   64, alignment  3/ 6:        475%
Length   64, alignment  3/ 6:        477%
Length  128, alignment  4/ 8:        479%
Length  128, alignment  4/ 8:        479%
Length  128, alignment  4/ 8:        479%
Length  256, alignment  5/10:        543%
Length  256, alignment  5/10:        539%
Length  256, alignment  5/10:        543%
Length  512, alignment  6/12:        585%
Length  512, alignment  6/12:        585%
Length  512, alignment  6/12:        585%
Length 1024, alignment  7/14:        611%
Length 1024, alignment  7/14:        611%
Length 1024, alignment  7/14:        611%

Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: dreamisbaka <jolinux.g@gmail.com>
2021-08-21 16:12:39 +02:00
Hong-Mei Li
364f97ef25
arm64: lib: memory utilities optimization
Optimize memcpy and memmove, to prefetch several cache lines.
We can achieve 15% memcpy speed improvement with the preload method.

Change-Id: I2259b98a33eba0b7466920b3f270f953e609cf13
Signed-off-by: Hong-Mei Li <a21834@motorola.com>
Reviewed-on: http://gerrit.mot.com/740766
SLTApproved: Slta Waiver <sltawvr@motorola.com>
SME-Granted: SME Approvals Granted
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Zhi-Ming Yuan <a14194@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: dreamisbaka <jolinux.g@gmail.com>
2021-08-21 16:12:33 +02:00
Sultan Alsawaf
07665b1117
setlocalversion: Never append a "+" to localversion
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Change-Id: I63923f987f419f549d0fdf6813b86a6ac29cd55f
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:11:54 +02:00
Sultan Alsawaf
450bb255ca
selinux: Remove audit dependency
Auditing comes with a lot of overhead due to string assembly via
vsnprintf. It isn't actually needed to make SELinux work, so remove
SELinux's artificial dependency on it to make it possible to use SELinux
without the unneeded overhead.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Change-Id: I26a7fc519a36b18defdbc05f74bdbefc57d04d1e
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:11:54 +02:00
Sultan Alsawaf
cd42298e3e
init: Kconfig: Don't force DEBUG_KERNEL when EXPERT is enabled
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Change-Id: I8e3317a9fcc67696054c01313652242f9e52af32
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:11:54 +02:00
Sultan Alsawaf
687707ac5f
Makefile: Disable stack conservation
There's plenty of room on the stack for a few more inlined bytes here
and there. The measured stack usage at runtime is still safe without
this, and performance is surely improved at a microscopic level, so
remove it.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Change-Id: Ifb7e9ee35b7f9f3d9bc6c38db763b0b0e749905e
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:11:54 +02:00
Sultan Alsawaf
467e04cbac
kbuild: Silence noisy GCC warnings up to GCC 10
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Change-Id: I400efda38e7909c6b86847f4abe0b381c1f1cb72
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:11:54 +02:00
Sultan Alsawaf
d0b023cafc
Makefile: Force ARCH to be arm64
This kernel isn't going to be compiled for any other architecture...

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Change-Id: I50401dec0201b2db1ea299828002552bcbe990d2
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:11:54 +02:00
Danny Lin
f9681240cf
Makefile: Use pipes rather than temporary files for intermediate steps
GCC supports the use of pipes for intermediate compilation steps (e.g.
passing the generated assembly code to the assembler) as a replacement for
temporary files. This bypasses VFS and other layers which can introduce
substantial amounts of overhead and instead redirects data directly
between processes.

The final product and generated code are unaffected. Memory usage while
compiling is slightly higher.

Tests showed a substantial reduction in build time when using GCC to
compile an x86 4.19 kernel:
Using temporary files in tmpfs: 2m41s
Using pipes:                    2m36s

Similar benefits were observed with an Android arm64 4.9 kernel:
Using tmpfs: 5m34s
Using pipes: 4m33s

Enable the feature when possible (i.e. when the compiler supports it) to
speed up builds at effectively no cost for many setups, particularly
those with weaker CPUs.

Test: kernel compiles and boots
Signed-off-by: Danny Lin <danny@kdrag0n.dev>

Signed-off-by: Carlos Jimenez (JavaShin-X) <javashin1986@gmail.com>
Change-Id: Id7860154edd5547dc686e1320a25892e8c4906a6
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:11:53 +02:00
LibXZR
98f2aee7a5
arm64: Makefile: Remove "-z norelro" from vmlinux ldflags
* This spams warnings
* aarch64-linux-gnu-ld: warning: -z norelro ignored

Signed-off-by: sohamxda7 <sensoham135@gmail.com>
Change-Id: Icec4c3b69c7fa275aab55d0a0182afd214c402bf
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:11:53 +02:00
starlight5234
8748de67d3
Revert "msm: kgsl: Mark the scratch buffer as privileged"
This reverts commit 21dc7da573.

Change-Id: Ie41e862c7d423919d5f8598d66117d59783ba2c3
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:11:53 +02:00
Park Ju Hyung
bbd50ae63a
trace: Add a CONFIG_DISABLE_TRACE_PRINTK option.
* Poorly made kernel trees often use trace_printk() without
   properly guarding them in a #ifdef macro.

 * Such usage of trace_printk() causes a warning at
   boot and additional memory allocation.

This option serves to disable those all at once with ease.

Change-Id: I3edd80bdc0cc6763c7184017f8c0a15de06952bb
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:10:48 +02:00
atndko
10cfe39404
block: blk-mq: Silence align-mismatch warning
Clang warns:

block/blk-mq.c:567:44: warning: passing 8-byte aligned argument to 32-byte aligned parameter 2 of 'smp_call_function_single_async' may result in an unaligned pointer access [-Walign-mismatch]
                smp_call_function_single_async(ctx->cpu, &rq->csd);
                                                         ^
1 warning generated.

Link: https://lore.kernel.org/r/20210310225240.4epj2mdmzt4vurr3@archlinux-ax161/
Signed-off-by: atndko <z1281552865@gmail.com>
Signed-off-by: Gagan Malvi <gagan.malvi2020@vitstudent.ac.in>
Change-Id: I7adc39e0f814fd250f7357c37fee45a7e76eee75
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:10:47 +02:00
Khusika Dhamar Gusti
759df8395f
drivers: input: ts: NT3667A: Fix snprintf warnings
Change-Id: Ieb3331a226cb6e183aaac2f22e7e8dccf27af7fc
Signed-off-by: Khusika Dhamar Gusti <khusikadhamar@gmail.com>
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:10:47 +02:00
Saalim Quadri
f40a5d5deb
drivers: base: Add /vendor/firmware as a fallback
Change-Id: I31c3e8a72164b35e45e8b1595e619c534341a870
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:10:47 +02:00
UtsavBalar1231
1d26b3565f
scripts: use python rewrite in libfdt for mkdtimg
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Signed-off-by: Carlos Jimenez (JavaShin-X) <javashin1986@gmail.com>
Change-Id: I9ac6e8a134caed966de8045707926bc470b7bab8
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:10:47 +02:00
Woody Lin
22f10659be
dtbo.img: build device tree overlay partition image
Inspired by "828e0b45 yueyao@ build device tree overlay partition
image", integrating the same feature into floral kernel. The difference
is all build-time generated *.dtbo are packed into dtbo.img instead of
packing only the dtbos specified by the dtboimg.cfg.

dtbo.img is built only when CONFIG_BUILD_ARM64_DT_OVERLAY is set.

Change-Id: Ic0ed97fe699ee56e7272001064abb584690aa40a
Signed-off-by: Woody Lin <woodylin@google.com>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Signed-off-by: Carlos Jimenez (JavaShin-X) <javashin1986@gmail.com>
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:10:47 +02:00
Kristof Petho
532a685ebb
security: default to INIT_STACK_NONE
Change-Id: Id99590053310cf797a30897354cf1e1e1f761be1
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:10:47 +02:00
klozz
89a41e23f9
partially revert UPSTREAM: PM / wakeup: Drop wakeup_source_init(), wakeup_source_prepare()
this will be reverted by caf in some newer updates
see: https://source.codeaurora.org/quic/la/kernel/msm-4.19/commit/include/linux/pm_wakeup.h?h=LA.UM.9.15.r1-02100-KAMORTA.0&id=45417b13166cf29949e9da42a79708284cfab465

Signed-off-by: klozz <klozz@TheXPerienceProject.org>
Signed-off-by: sohamxda7 <sensoham135@gmail.com>
Change-Id: Ieadf20144716193acf2815f08d919cd92aa878c0
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:10:47 +02:00
starlight5234
1486a406cb
techpack: display: Import xiaomi changes
The Patch based on QualComm release TAG:LA.UM.8.15.r1-06600-KAMORTA.0

Change-Id: I1f98410528de75bb7c87b12ae7666769945e9ad9
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:10:47 +02:00
starlight5234
1509ecd407
drivers: Import lastkmsg drivers from Xiaomi
The Patch based on QualComm release TAG:LA.UM.8.15.r1-06600-KAMORTA.0

Change-Id: I8331b7e35c3d5a3de88a701474ae4041e618cfcb
Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
2021-08-21 16:10:46 +02:00