Commit Graph

1139941 Commits

Author SHA1 Message Date
Greg Kroah-Hartman
02de87682c Merge f1947d7c8a ("Merge tag 'random-6.1-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random") into android-mainline
Steps on the way to 6.1-rc1

Resolves merge conflicts in:
	block/blk-crypto-fallback.c

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I8bc1919753d4664d1d37df82a6e1b82f7b591192
2022-10-25 15:59:10 +02:00
Greg Kroah-Hartman
496fc3fc2a Merge 8636df94ec ("Merge tag 'perf-tools-for-v6.1-2-2022-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I61c6e5e9c1aade3985d36aa0cf783c1d4e458fd2
2022-10-25 15:55:45 +02:00
Greg Kroah-Hartman
2024745758 Merge 2fcd8f108f ("Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux") into android-mainline
Steps on the way to 6.1-rc1

Resolves merge conflicts in:
	drivers/clk/clk.c

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I297a74b292ab84646a3051d502965a929260754d
2022-10-25 15:55:00 +02:00
Greg Kroah-Hartman
32f65bc827 Merge b08cd74448 ("Merge tag '6.1-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iec1cd89e0e3ba043f7fe48c8b33293282d3b9a51
2022-10-25 15:53:58 +02:00
Greg Kroah-Hartman
5bba6298e8 Merge 36d8a3edf8 ("Merge tag 'for-linus' of https://github.com/openrisc/linux") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ic2c81d177717f9d031ff2eb184091de227e80fe4
2022-10-25 15:51:52 +02:00
Greg Kroah-Hartman
ff19fc9043 Merge 41410965c3 ("Merge tag 'pci-v6.1-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ieb81934101707565f273f63e998714a8b3bd2ba9
2022-10-25 15:47:32 +02:00
Greg Kroah-Hartman
31142e1843 Merge ca1aaf9937 ("Merge tag 'arm-fixes-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I9c78d6a6dfd5ae5cc63d7e7f0f0aaa31a9a1e907
2022-10-25 15:38:09 +02:00
Greg Kroah-Hartman
78390e13d9 Merge 9c9155a350 ("Merge tag 'drm-next-2022-10-14' of git://anongit.freedesktop.org/drm/drm") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I09cdbeb058c382776865996d2aff5955d16d1833
2022-10-25 15:15:07 +02:00
Greg Kroah-Hartman
79b5e8189e Merge a521fc3cfb ("Merge tag 'block-6.1-2022-10-13' of git://git.kernel.dk/linux") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Icab63d7ed4dfe1c8f8d5b17943c20d0cb35a096f
2022-10-25 15:14:39 +02:00
Greg Kroah-Hartman
8d5ee251b9 Merge aa41478a57 ("Merge tag 'trace-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5933c83ae774e2e79206651026c48cca2693a8d3
2022-10-25 15:13:44 +02:00
Greg Kroah-Hartman
3f014522eb Merge 676cb49573 ("Merge tag 'mm-nonmm-stable-2022-10-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm") into android-mainline
Steps on the way to 6.1-rc1

Resolves merge conflicts in:
	kernel/fork.c

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I187afe0c9a9604d3e5acb5134f0ee65de850e9f1
2022-10-25 15:13:11 +02:00
Greg Kroah-Hartman
6b6a872574 Merge 95b8b5953a ("Merge tag 'loongarch-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ied380312b85d1e87f96950aeb4daa6d723d0c919
2022-10-25 14:54:33 +02:00
Greg Kroah-Hartman
2ee894aad3 Merge 041bc24d86 ("Merge tag 'pci-v6.1-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I0888c8944ad4ba5a269b7d7783be4c7690036f53
2022-10-25 14:52:46 +02:00
Greg Kroah-Hartman
71f335db47 Merge f721d24e5d ("Merge tag 'pull-tmpfile' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs") into android-mainline
Steps on the way to 6.1-rc1

Resolves merge conflicts in:
	include/uapi/linux/fuse.h

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I9c642d47e57e26958f55f8e9ef6920594631531b
2022-10-25 14:51:37 +02:00
Will McVicker
0291c4ad93 ANDROID: mm: export vm_unmapped_area()
The mali GPU device needs to have a custom get_unmapped_area() file
operation [1] in order to align GPU VA memory to a 2MB boundary for
64-bit processes. Since the GPU driver is a module, we need to export
vm_unmapped_area() to call it from the device's get_unmapped_area() file
op.

[1] https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-mainline/mali_kbase/thirdparty/mali_kbase_mmap.c#237

Bug: 254386546
Signed-off-by: Will McVicker <willmcvicker@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I08a1247e215a46fa0ca1a0d61f63be4fa8375ee4
2022-10-25 14:50:09 +02:00
Greg Kroah-Hartman
de07798cf0 Merge 27bc50fc90 ("Merge tag 'mm-stable-2022-10-08' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3a6855cb0e3a54f605ccb92af058088f280e0349
2022-10-25 14:49:20 +02:00
Prasad Sodagudi
fd2fde9864 ANDROID: GKI: Enable TRACE_MMIO_ACCESS config for gki_defconfig
Enable TRACE_MMIO_ACCESS config for memory mapped io
register read and write tracing support in GKI image.

Bug: 169045115
Change-Id: I27d115092789303a4c8f0c99d9bcb887ef3cc163
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Vamsi Krishna Lanka <quic_vamslank@quicinc.com>
Signed-off-by: Naman Jain <quic_namajain@quicinc.com>
Signed-off-by: Alistair Delva <adelva@google.com>
2022-10-24 08:06:03 +00:00
Ramji Jiyani
e9669eeb2f ANDROID: GKI: Add module load time symbol protection
Add CONFIG_MODULE_SIG_PROTECT to enable lookup for the unprotected
symbols from the build time generated list of symbols.

Module loading behavior will change as follows:
- Allows Android GKI Modules signed using MODULE_SIG_ALL during build.
- Allows other modules to load if they don't violate the access to
  Android GKI protected symbols. Loading will fail and return
  -EACCES (Permission denied) if these modules access the symbol which
  is not allowlisted via symbol list or exported by a GKI module.

Bug: 232430739
Test: TH
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
Change-Id: I751b1951241b45712c20ac0e3878abd2152dd002
2022-10-21 02:21:06 +00:00
Ramji Jiyani
bf7b376659 Revert "ANDROID: GKI: Add script to generate symbol protection headers"
This reverts commit 31d5735baf.

Reason for revert: Part of old protected/unprotected module implemenation.
It is being replaced by a new design listed as option 2A at
go/gki-modules-build-integration

Bug: 232430739
Test: TH
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
Change-Id: I649c57196b167d9452e5e6d3b2af2dd8c1d4bcdd
2022-10-21 02:10:35 +00:00
Ramji Jiyani
3a7201f826 Revert "ANDROID: GKI: remove info print for header generation"
This reverts commit 438c43687f.

Reason for revert: Part of old protected/unprotected module implemenation.
It is being replaced by a new design listed as option 2A at
go/gki-modules-build-integration

Bug: 232430739
Test: TH

Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
Change-Id: I994b0ce0f30c4098bc5d3d2560b10a117486cc1f
2022-10-21 02:10:12 +00:00
Ramji Jiyani
452678e272 Revert "ANDROID: GKI: Add module load time protected symbol lookup"
This reverts commit f5794dc184.

Reason for revert: Upstream mainline module code has been refactored;
and gki-modules implementation has changed, too. So, reverting all
old stuff and adding the new with rebase as single patch via
aosp/2260477.

Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
Change-Id: I095a6bb8644a81703c3fbb273845a8d0a2c6e912
2022-10-21 02:08:56 +00:00
Greg Kroah-Hartman
d7b5f1b219 Merge 0c563f1480 ("proc: remove VMA rbtree use from nommu") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5edff6b45f59f4eed3422bb2e2079c54af885e3f
2022-10-20 14:21:03 +02:00
Greg Kroah-Hartman
cd41ea0975 Merge e15e06a839 ("lib/test_maple_tree: add testing for maple tree") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Id639701170c1b427abbd641d3f133dbdc1d93e06
2022-10-20 14:19:47 +02:00
Greg Kroah-Hartman
61869b3bb6 Merge 9832fb8783 ("mm/demotion: expose memory tier details via sysfs") into android-mainline
Steps on the way to 6.1-rc1

resolves conflicts in:
	include/linux/nodemask.h

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I05f94636e62c86dbab41bdcee21f2449f341cf2d
2022-10-20 14:17:08 +02:00
Greg Kroah-Hartman
15f46fd6cb Merge 8be976a093 ("mm: multi-gen LRU: design doc") into android-mainline
Steps on the way to 6.1-rc1

Resolves conflicts in:
	fs/exec.c

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia649390f891780ed03530adcf0fac9560635e58f
2022-10-20 14:15:01 +02:00
Greg Kroah-Hartman
6a8e52b0ec Merge aa1b67903a ("Revert "include/linux/mm_inline.h: fold __update_lru_size() into its sole caller"") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iaa91521d917512387a06206a1872bfa66f8be6ae
2022-10-20 11:56:53 +02:00
Greg Kroah-Hartman
3956baa5d0 Merge 5154e60796 ("mm/swap: cache swap migration A/D bits support") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I323198adbfd3a7009a23ca058a5a592786ee7737
2022-10-20 11:56:39 +02:00
Greg Kroah-Hartman
22754e80f7 Merge f8142cf94d ("hugetlb: make hugetlb depends on SYSFS or SYSCTL") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I47466de91cf736e2f4b76988f029482ebf963051
2022-10-20 11:56:25 +02:00
Greg Kroah-Hartman
aa321be667 Merge bd1264c37c ("mm/vmalloc: extend find_vmap_lowest_match_check with extra arguments") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie7d9250fea0211ee371a70d50b4d126ee59d2e78
2022-10-20 11:56:09 +02:00
Greg Kroah-Hartman
52792ee4c5 Merge 6d2453c3db ("drivers/block/zram/zram_drv.c: do not keep dangling zcomp pointer after zram reset") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I6564be3323a42b38af91f7d78e551dd17b6f242c
2022-10-20 11:55:55 +02:00
Greg Kroah-Hartman
61171e0a5e Merge 0192445cb2 ("arch: mm: rename FORCE_MAX_ZONEORDER to ARCH_FORCE_MAX_ORDER") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I34721a15487300220b6285c2cc315ba8e4cef033
2022-10-20 11:55:38 +02:00
Greg Kroah-Hartman
f7356e370b Merge 57eb60c04d ("tools/vm/page_owner_sort: fix -f option") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I106856c416425a16c8aa8851e19d2f4f9e9efc51
2022-10-20 11:55:25 +02:00
Greg Kroah-Hartman
5718280290 Merge 70442fc54e ("Merge tag 'x86_mm_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3f7452d728c89c529b3f489947fea424d3561fb4
2022-10-20 09:23:53 +02:00
Greg Kroah-Hartman
9d0c14f25d Merge e2302539dd ("Merge tag 'xtensa-20221010' of https://github.com/jcmvbkbc/linux-xtensa") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ifbb5042c9a932ed1cb0c9edb0e3ae5cace590396
2022-10-20 09:23:44 +02:00
Greg Kroah-Hartman
2987067062 Merge 34fdd22c8f ("Merge tag 'm68knommu-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ibde4946deae3fa8355aefb59ab664dd996460620
2022-10-20 09:23:35 +02:00
Greg Kroah-Hartman
ce6d028ec9 Merge 8aeab132e0 ("Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I929310d023864a58ab8b416d0de9b1d6aa2d53de
2022-10-20 09:23:27 +02:00
Greg Kroah-Hartman
68051b9d57 Merge 0e0073eb1b ("Merge tag 'hyperv-next-signed-20221009' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Icf501c4029d2edca6925b30fa59649981bfc64b8
2022-10-19 21:18:00 +02:00
Greg Kroah-Hartman
612bb4434d Merge f848b3cda3 ("Merge tag 'pm-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia447e0f6693aa02fb6833f9c25a6d7fed540cd8b
2022-10-19 17:54:04 +02:00
Greg Kroah-Hartman
b51103d54d Merge 10b22b533e ("Merge tag 'dma-mapping-6.1-2022-10-10' of git://git.infradead.org/users/hch/dma-mapping") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I4453968fc51ad64219f22bb424944a6a35c51d49
2022-10-19 17:53:48 +02:00
Greg Kroah-Hartman
e5386cc054 Merge f23cdfcd04 ("Merge tag 'iommu-updates-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: If9754a899b158a64b06c36a5e9340967d326d55a
2022-10-19 17:53:34 +02:00
Greg Kroah-Hartman
4bd149e049 Merge 706eacadd5 ("Merge tag 'devicetree-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia451144e0d921e2852de2b6e036edfb7417c3f50
2022-10-19 17:53:24 +02:00
Greg Kroah-Hartman
e4e0e147bb Merge ada3bfb649 ("Merge tag 'tpmdd-next-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I4b3f7b19d03b0275fee97573a7fbe60d4b9a1ccd
2022-10-19 17:53:13 +02:00
Will McVicker
231aa95f2d ANDROID: gki_defconfig: update for 6.1-rc1
Based on the merges, configs in the gki_defconfig got shuffled around.
Fix this.

Fixes: 7d2521f10a ("Merge 3604a7f568 ("Merge tag 'v6.1-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6") into android-mainline")
Signed-off-by: Will McVicker <willmcvicker@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5e4c534b39d459a3906ce6f6dc99946251766070
2022-10-19 13:51:23 +02:00
Greg Kroah-Hartman
7d2521f10a Merge 3604a7f568 ("Merge tag 'v6.1-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I39e79973f08546aa396ab50404693f9984c5f2b0
2022-10-19 13:24:27 +02:00
Greg Kroah-Hartman
6a93ec7a73 Merge d4013bc4d4 ("Merge tag 'bitmap-6.1-rc1' of https://github.com/norov/linux") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I8a66db240f9fecd3e0b3e01ffbd7015a264852a2
2022-10-19 13:22:10 +02:00
Will McVicker
54748c98d2 ANDROID: kbuild: fix typo in modpost
Commit f73edc8951 ("kbuild: unify two modpost invocations") introduced
a typo (moudle.symvers-if-present) which results in the kernel's
Module.symvers to not be included as a prerequisite for
$(KBUILD_EXTMOD)/Module.symvers. Fix the typo to restore the intended
functionality.

Bug: 253726452
Signed-off-by: Will McVicker <willmcvicker@google.com>
Change-Id: Ib8d739744f0f3c925a031ad501535537e351f3bd
2022-10-18 09:07:44 -07:00
Will McVicker
1efbef6143 ANDROID: kbuild: Use '-f' instead of '--file=' for grep
The toybox grep doesn't support the longer '--file=FILE' command line
argument which was introduced in commit ce697ccee1 ("kbuild: remove
head-y syntax"). So update Makefile to use '-f FILE' to fix the
compiling error:

  grep: Unknown option 'file=.../common/scripts/head-object-list.txt'
  (see "grep --help")

Bug: 253726452
Signed-off-by: Will McVicker <willmcvicker@google.com>
Change-Id: Ie42b9edfafc04c37f657dc07f04af39d20aa8248
2022-10-18 09:07:44 -07:00
Will McVicker
d624007eb1 ANDROID: kbuild: re-add vmlinux.symvers for mixed building
The modpost build phase was refactored upstream in commit f73edc8951
("kbuild: unify two modpost invocations"). The new implementation does
not generate a vmlinux.symvers which our existing mixed build
implementation depends upon to match the KMI between the modules and GKI
kernel (via depmod). Since the Module.symvers is equal to the
vmlinux.symvers + modules-only.symvers, this patch adds support to
generate the vmlinux.symvers in order to continue using the existing
mixed build implementation.

Just a couple of notes:
  1) This allows us to use the same mixed build implementation for
     android14-6.1 and android14-5.15 without making any build tooling
     changes.
  2) This implementation won't catch build-time vendor changes to GKI
     Module CRCs during modpost. This is due to the fact that we are
     only using the vmlinux.symvers from the GKI kernel pass and not
     including the CRCs for the GKI modules.

Bug: 253726452
Signed-off-by: Will McVicker <willmcvicker@google.com>
Change-Id: I4b964434d02abbcdb694d3e03bfa4dc2d5a81f85
2022-10-18 09:07:37 -07:00
Linus Torvalds
f1947d7c8a Merge tag 'random-6.1-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random
Pull more random number generator updates from Jason Donenfeld:
 "This time with some large scale treewide cleanups.

  The intent of this pull is to clean up the way callers fetch random
  integers. The current rules for doing this right are:

   - If you want a secure or an insecure random u64, use get_random_u64()

   - If you want a secure or an insecure random u32, use get_random_u32()

     The old function prandom_u32() has been deprecated for a while
     now and is just a wrapper around get_random_u32(). Same for
     get_random_int().

   - If you want a secure or an insecure random u16, use get_random_u16()

   - If you want a secure or an insecure random u8, use get_random_u8()

   - If you want secure or insecure random bytes, use get_random_bytes().

     The old function prandom_bytes() has been deprecated for a while
     now and has long been a wrapper around get_random_bytes()

   - If you want a non-uniform random u32, u16, or u8 bounded by a
     certain open interval maximum, use prandom_u32_max()

     I say "non-uniform", because it doesn't do any rejection sampling
     or divisions. Hence, it stays within the prandom_*() namespace, not
     the get_random_*() namespace.

     I'm currently investigating a "uniform" function for 6.2. We'll see
     what comes of that.

  By applying these rules uniformly, we get several benefits:

   - By using prandom_u32_max() with an upper-bound that the compiler
     can prove at compile-time is ≤65536 or ≤256, internally
     get_random_u16() or get_random_u8() is used, which wastes fewer
     batched random bytes, and hence has higher throughput.

   - By using prandom_u32_max() instead of %, when the upper-bound is
     not a constant, division is still avoided, because
     prandom_u32_max() uses a faster multiplication-based trick instead.

   - By using get_random_u16() or get_random_u8() in cases where the
     return value is intended to indeed be a u16 or a u8, we waste fewer
     batched random bytes, and hence have higher throughput.

  This series was originally done by hand while I was on an airplane
  without Internet. Later, Kees and I worked on retroactively figuring
  out what could be done with Coccinelle and what had to be done
  manually, and then we split things up based on that.

  So while this touches a lot of files, the actual amount of code that's
  hand fiddled is comfortably small"

* tag 'random-6.1-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random:
  prandom: remove unused functions
  treewide: use get_random_bytes() when possible
  treewide: use get_random_u32() when possible
  treewide: use get_random_{u8,u16}() when possible, part 2
  treewide: use get_random_{u8,u16}() when possible, part 1
  treewide: use prandom_u32_max() when possible, part 2
  treewide: use prandom_u32_max() when possible, part 1
2022-10-16 15:27:07 -07:00
Linus Torvalds
8636df94ec Merge tag 'perf-tools-for-v6.1-2-2022-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
Pull more perf tools updates from Arnaldo Carvalho de Melo:

 - Use BPF CO-RE (Compile Once, Run Everywhere) to support old kernels
   when using bperf (perf BPF based counters) with cgroups.

 - Support HiSilicon PCIe Performance Monitoring Unit (PMU), that
   monitors bandwidth, latency, bus utilization and buffer occupancy.

   Documented in Documentation/admin-guide/perf/hisi-pcie-pmu.rst.

 - User space tasks can migrate between CPUs, so when tracing selected
   CPUs, system-wide sideband is still needed, fix it in the setup of
   Intel PT on hybrid systems.

 - Fix metricgroups title message in 'perf list', it should state that
   the metrics groups are to be used with the '-M' option, not '-e'.

 - Sync the msr-index.h copy with the kernel sources, adding support for
   using "AMD64_TSC_RATIO" in filter expressions in 'perf trace' as well
   as decoding it when printing the MSR tracepoint arguments.

 - Fix program header size and alignment when generating a JIT ELF in
   'perf inject'.

 - Add multiple new Intel PT 'perf test' entries, including a jitdump
   one.

 - Fix the 'perf test' entries for 'perf stat' CSV and JSON output when
   running on PowerPC due to an invalid topology number in that arch.

 - Fix the 'perf test' for arm_coresight failures on the ARM Juno
   system.

 - Fix the 'perf test' attr entry for PERF_FORMAT_LOST, adding this
   option to the or expression expected in the intercepted
   perf_event_open() syscall.

 - Add missing condition flags ('hs', 'lo', 'vc', 'vs') for arm64 in the
   'perf annotate' asm parser.

 - Fix 'perf mem record -C' option processing, it was being chopped up
   when preparing the underlying 'perf record -e mem-events' and thus
   being ignored, requiring using '-- -C CPUs' as a workaround.

 - Improvements and tidy ups for 'perf test' shell infra.

 - Fix Intel PT information printing segfault in uClibc, where a NULL
   format was being passed to fprintf.

* tag 'perf-tools-for-v6.1-2-2022-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (23 commits)
  tools arch x86: Sync the msr-index.h copy with the kernel sources
  perf auxtrace arm64: Add support for parsing HiSilicon PCIe Trace packet
  perf auxtrace arm64: Add support for HiSilicon PCIe Tune and Trace device driver
  perf auxtrace arm: Refactor event list iteration in auxtrace_record__init()
  perf tests stat+json_output: Include sanity check for topology
  perf tests stat+csv_output: Include sanity check for topology
  perf intel-pt: Fix system_wide dummy event for hybrid
  perf intel-pt: Fix segfault in intel_pt_print_info() with uClibc
  perf test: Fix attr tests for PERF_FORMAT_LOST
  perf test: test_intel_pt.sh: Add 9 tests
  perf inject: Fix GEN_ELF_TEXT_OFFSET for jit
  perf test: test_intel_pt.sh: Add jitdump test
  perf test: test_intel_pt.sh: Tidy some alignment
  perf test: test_intel_pt.sh: Print a message when skipping kernel tracing
  perf test: test_intel_pt.sh: Tidy some perf record options
  perf test: test_intel_pt.sh: Fix return checking again
  perf: Skip and warn on unknown format 'configN' attrs
  perf list: Fix metricgroups title message
  perf mem: Fix -C option behavior for perf mem record
  perf annotate: Add missing condition flags for arm64
  ...
2022-10-16 15:14:29 -07:00