Commit Graph

979172 Commits

Author SHA1 Message Date
Asutosh Das
1eda1085fe ANDROID: abi_gki_aarch64_qcom: Update ufs symbol list
Update ufs tracepoint symbol list for QCOM.

Bug: 191951106
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Change-Id: Ia95f3bc6d02775fb435e5fd854e355838e8500b1
2021-06-30 13:15:39 -07:00
Mukesh Ojha
a97617ccb4 ANDROID: GKI: Update abi_gki_aarch64_qcom for logbuf_pr_cont tracepoint
Add __tracepoint_android_vh_logbuf_pr_cont symbol.

Bug: 185182649
Change-Id: If1999b5d5df20b532003cd005ba2f60cb8288346
Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
2021-06-30 13:15:38 -07:00
Guangming Cao
872e0b9f75 ANDROID: Update symbol list for mtk
1. Generated with:
  BUILD_CONFIG=common/build.config.gki.aarch64 build/build_abi.sh --update

Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function

1 New exported function:

  [A] 'function unsigned long get_freelist_nr_pages(void)'

Bug: 192041645

Change-Id: I387b0e193ff2160783a4c69b702fd08b97f0153d
Signed-off-by: Guangming Cao <Guangming.Cao@mediatek.com>
2021-06-30 20:12:56 +00:00
Guangming Cao
f32369e83f ANDROID: dma-buf: heaps: export defer-free list size
For memory analysis, need to know all memory-consuming of dma-buf heaps.
But now, other modules can't get defer-free list size.

Export get_freelist_nr_pages to let other modules can get
defer-free list total size.

Bug: 192041645

Change-Id: Icaa1b98e9ab7e330141a92ad147a4e2150c2534b
Signed-off-by: Guangming Cao <Guangming.Cao@mediatek.com>
2021-06-30 20:12:43 +00:00
Louis Kuo
e0a9556041 ANDROID: media: v4l2-core: extend the v4l2 subdev ioctl to support request
This patch is based on 1699785. It uses to extend the related interface
to support the request-based operations. We use extension fields in the
parameters of VIDIOC_SUBDEV_S_SELECTION, VIDIOC_SUBDEV_S_FMT and
VIDIOC_SUBDEV_S_FRAME_INTERVAL as request fd.
The driver uses media_request_get_by_fd() to retrieve the media request and
save the pending change in it, so that we can apply the pending change in
req_queue() callback then.

Bug: 191903073

CR-Id:
Signed-off-by: Louis Kuo <louis.kuo@mediatek.com>
Change-Id: Idb7921724cf8febc44b01880a4ad8b7c9272ba6a
2021-06-30 15:56:19 +00:00
Nathan Chancellor
de1a0ea811 ANDROID: logbuf: Remove if directive for vendor hooks
When CONFIG_TRACEPOINTS or CONFIG_ANDROID_VENDOR_HOOKS is not set, there
is a build error after commit 01f2392e13 ("ANDROID: logbuf: Add new
logbuf vendor hook to support pr_cont()"):

kernel/printk/printk.c:1962:4: error: implicit declaration of function
'trace_android_vh_logbuf_pr_cont'
[-Werror,-Wimplicit-function-declaration]
                        trace_android_vh_logbuf_pr_cont(&r, text_len);
                        ^
1 error generated.

Remove the #if directive so that this code always builds properly, which
is possible after commit ba75b92fef ("ANDROID: simplify vendor hooks
for non-GKI builds").

Change-Id: Icc7f55af1becab5a8833b0651402845559b6b56f
Fixes: 01f2392e13 ("ANDROID: logbuf: Add new logbuf vendor hook to support pr_cont()")
Link: https://github.com/ClangBuiltLinux/continuous-integration2/runs/2948254099
Suggested-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
2021-06-30 08:55:48 +00:00
Patrick Daly
3b6916b4d4 ANDROID: iommu/io-pgtable-arm: Add IOMMU_CACHE_ICACHE_OCACHE_NWA
Allow io-coherent devices to use a inner writeback read/write allocate,
outer writeback read allocate, no-write allocate cache policy. The outer
cache policy affects the behavior of a system cache, at least on qcom
boards which have one.

The rational follows that of IOMMU_SYS_CACHE_ONLY_NWA. Certain gpu
usecases perform better when using a no-write allocate policy.

Rename the IOMMU_SYS_CACHE_* flags to better reflect that they are not
exclusive with IOMMU_CACHE.

Bug: 191811876
Change-Id: Ic91616a148f39fead008a5b87a54ffd781fee734
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
2021-06-30 08:29:33 +00:00
Weilun Du
2e289f3641 FROMGIT: mac80211_hwsim: add concurrent channels scanning support over virtio
This fixed the crash when setting channels to 2 or more when
communicating over virtio.

Signed-off-by: Weilun Du <wdu@google.com>
Link: https://lore.kernel.org/r/20210506180530.3418576-1-wdu@google.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

(cherry picked from commit 626c30f9e77354301ff9162c3bdddaf92d9b5cf3 https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=626c30f9e77354301ff9162c3bdddaf92d9b5cf3)
Bug: 182576217
Signed-off-by: Weilun Du <wdu@google.com>
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ia9be6c1d962b941a92f4e1be41e874dbe08024e5
2021-06-29 14:17:14 -07:00
Chanho Park
5b1baee639 ANDROID: GKI: update allowed symbols for exynosauto soc
This patch updates ABI allowed symbol list for exynosauto soc.

Notable changes:
- *drm* and *display* symbols are required for DRM display vendor module.
- blk_ksm_init_passthrough: use passthrough mode of keyslot manager
- kmsg_dump_get_line to dump kmsg as line by line

Leaf changes summary: 28 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 27 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 1 Added variable

27 Added functions:

  [A] 'function int __bitmap_and(unsigned long int*, const unsigned long int*, const unsigned long int*, unsigned int)'
  [A] 'function void __drm_atomic_helper_plane_reset(drm_plane*, drm_plane_state*)'
  [A] 'function int __traceiter_android_vh_show_mem(void*, unsigned int, nodemask_t*)'
  [A] 'function void blk_ksm_init_passthrough(blk_keyslot_manager*)'
  [A] 'function int default_wake_function(wait_queue_entry_t*, unsigned int, int, void*)'
  [A] 'function void display_timings_release(display_timings*)'
  [A] 'function void drm_atomic_bridge_chain_enable(drm_bridge*, drm_atomic_state*)'
  [A] 'function void drm_atomic_bridge_chain_pre_enable(drm_bridge*, drm_atomic_state*)'
  [A] 'function void drm_atomic_helper_disable_planes_on_crtc(drm_crtc_state*, bool)'
  [A] 'function wait_queue_head_t* drm_crtc_vblank_waitqueue(drm_crtc*)'
  [A] 'function void drm_display_mode_from_videomode(const videomode*, drm_display_mode*)'
  [A] 'function void drm_dp_downstream_debug(seq_file*, const u8*, const u8*, const edid*, drm_dp_aux*)'
  [A] 'function u8 drm_dp_dsc_sink_line_buf_depth(const u8*)'
  [A] 'function u8 drm_dp_dsc_sink_max_slice_count(const u8*, bool)'
  [A] 'function void drm_dp_mst_dump_topology(seq_file*, drm_dp_mst_topology_mgr*)'
  [A] 'function int drm_dsc_compute_rc_parameters(drm_dsc_config*)'
  [A] 'function void drm_dsc_pps_payload_pack(drm_dsc_picture_parameter_set*, const drm_dsc_config*)'
  [A] 'function uint32_t drm_of_crtc_port_mask(drm_device*, device_node*)'
  [A] 'function int drm_plane_create_zpos_immutable_property(drm_plane*, unsigned int)'
  [A] 'function void iommu_group_remove_device(device*)'
  [A] 'function bool kmsg_dump_get_line(kmsg_dumper*, bool, char*, size_t, size_t*)'
  [A] 'function void kset_unregister(kset*)'
  [A] 'function display_timings* of_get_display_timings(const device_node*)'
  [A] 'function int of_get_drm_display_mode(device_node*, drm_display_mode*, u32*, int)'
  [A] 'function device_node* of_graph_get_port_by_id(device_node*, u32)'
  [A] 'function int v4l2_m2m_querybuf(file*, v4l2_m2m_ctx*, v4l2_buffer*)'
  [A] 'function int videomode_from_timings(const display_timings*, videomode*, unsigned int)'

1 Added variable:

  [A] 'tracepoint __tracepoint_android_vh_show_mem'

Bug: 192103187
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Change-Id: I1a2697c61f31aa857ea2cbff46ead13719918db1
2021-06-29 18:12:42 +00:00
Chanho Park
961be31178 ANDROID: GKI: initial upload list for exynosauto soc
This patch adds to upload initial symbol list for Exynosauto SoC.
To find what has updated from GKI symbol easily, this list does not
include full list of symbol. So, nothing has added to GKI ABI symbols.

Bug: 192103187
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Change-Id: Iae46da79e06d1081199a8db014b892c74887cbf8
2021-06-29 18:12:30 +00:00
Mukesh Ojha
01f2392e13 ANDROID: logbuf: Add new logbuf vendor hook to support pr_cont()
Add new logbuf vendor hook android_vh_logbuf_pr_cont()
to capture pr_cont logs.

Bug: 185182649
Change-Id: I76b310fc9caac71b344b6cc25ea36f7f81cb7148
Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
2021-06-29 17:25:52 +00:00
Georgi Djakov
3cd04ea95a ANDROID: lib: Export show_mem() for vendor module usage
There are debugging modules that monitor the memory usage of tasks
and report memory parameters in some situations (such as OOM).

Bug: 189595202
Change-Id: I6cc405b0f4cbe1706857fc3b2f8da83ea981818d
Signed-off-by: Georgi Djakov <quic_c_gdjako@quicinc.com>
2021-06-29 16:39:50 +00:00
Siddharth Gupta
ba085dd70a FROMLIST: remoteproc: core: Export the rproc coredump APIs
The remoteproc coredump APIs are currently only part of the internal
remoteproc header. This prevents the remoteproc platform drivers from
using these APIs when needed. This change moves the rproc_coredump()
and rproc_coredump_cleanup() APIs to the linux header and marks them
as exported symbols.

Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>

Bug: 188764827
Link: https://lore.kernel.org/linux-remoteproc/1623722930-29354-2-git-send-email-sidgup@codeaurora.org/
Change-Id: I8333774acb748fae10e0fd5146b747c4cf2ea6c7
Signed-off-by: Siddharth Gupta <quic_sidgup@quicinc.com>
2021-06-29 14:29:41 +00:00
Stephen Dickey
1093a9bfdb ANDROID: sched: select fallback rq must check for allowed cpus
select_fallback_rq() must return a cpu that is valid for the task.
However, when nid is not -1, it skips checking for
task_cpu_possible_mask().

This causes a problem when execve-ing 32 bit apps on an asymmetric
system where not all cpus are 32 bit capable. During execve-ing
the task is marked as 32 bit long before its affinity mask is
restricted.

If the cpu goes offline during this time, select_fallback_rq()
could return a 64 bit only cpu, which __migrate_tasks()/
is_cpu_allowed() rejects.

migrate_tasks() will therefore continue to pick the same task
repeatedly, where __migrate_tasks() rejects the cpu chosen
by select_fallback_rq() every time, leading to an infinite loop.

Correct the issue by updating select_fallback_rq() for the case
where nid is not -1, ensuring that the returned cpu is always
valid for this task.

Bug: 192050156
Change-Id: Ia073a8395a02485f6d1c1daa0f3ce9e2029cb1f4
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
2021-06-29 10:57:22 +00:00
Liujie Xie
8943a2e7a3 ANDROID: android: Export symbols for invoking cpufreq_update_util()
In order to update cpufreq, vendor modules invoke cpufreq_update_util(),
but when we build our modules, report error:
ERROR: modpost: "cpufreq_update_util_data" [xxx.ko] undefined!

Bug: 192218676
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: Ib1da70229f04b08d8d812d065021dec0bf891e0e
2021-06-29 10:44:12 +00:00
Chun-Hung Wu
e7cf28a1a4 ANDROID: Update symbol list for mtk
1. Generated with:
  BUILD_CONFIG=out/build.config OUT_DIR=out ./build/build_abi.sh --update

Leaf changes summary: 3 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 3 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

3 Added functions:

  [A] 'function regmap* rdev_get_regmap(regulator_dev*)'
  [A] 'function int regulator_set_active_discharge_regmap(regulator_dev*, bool)'
  [A] 'function void ufshcd_hba_stop(ufs_hba*)'

Bug: 191726929
Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
Change-Id: I2fe2e077cdd575bc3b89f4d0d8b08842f432c276
2021-06-29 04:27:16 +00:00
Jone Chou
c685777105 ANDROID: kernel: add module info for debug_kinfo
Backup module range for bootloader usage

Bug: 191677481
Bug: 191767613
Signed-off-by: Jone Chou <jonechou@google.com>
Change-Id: I4f11c5d44b454aff604670d40b1981172a14159c
2021-06-29 01:08:31 +00:00
Maciej Żenczykowski
ea53c24cb0 FROMGIT: bpf: Do not change gso_size during bpf_skb_change_proto()
This is technically a backwards incompatible change in behaviour, but I'm
going to argue that it is very unlikely to break things, and likely to fix
*far* more then it breaks.

In no particular order, various reasons follow:

(a) I've long had a bug assigned to myself to debug a super rare kernel crash
on Android Pixel phones which can (per stacktrace) be traced back to BPF clat
IPv6 to IPv4 protocol conversion causing some sort of ugly failure much later
on during transmit deep in the GSO engine, AFAICT precisely because of this
change to gso_size, though I've never been able to manually reproduce it. I
believe it may be related to the particular network offload support of attached
USB ethernet dongle being used for tethering off of an IPv6-only cellular
connection. The reason might be we end up with more segments than max permitted,
or with a GSO packet with only one segment... (either way we break some
assumption and hit a BUG_ON)

(b) There is no check that the gso_size is > 20 when reducing it by 20, so we
might end up with a negative (or underflowing) gso_size or a gso_size of 0.
This can't possibly be good. Indeed this is probably somehow exploitable (or
at least can result in a kernel crash) by delivering crafted packets and perhaps
triggering an infinite loop or a divide by zero... As a reminder: gso_size (MSS)
is related to MTU, but not directly derived from it: gso_size/MSS may be
significantly smaller then one would get by deriving from local MTU. And on
some NICs (which do loose MTU checking on receive, it may even potentially be
larger, for example my work pc with 1500 MTU can receive 1520 byte frames [and
sometimes does due to bugs in a vendor plat46 implementation]). Indeed even just
going from 21 to 1 is potentially problematic because it increases the number
of segments by a factor of 21 (think DoS, or some other crash due to too many
segments).

(c) It's always safe to not increase the gso_size, because it doesn't result in
the max packet size increasing.  So the skb_increase_gso_size() call was always
unnecessary for correctness (and outright undesirable, see later). As such the
only part which is potentially dangerous (ie. could cause backwards compatibility
issues) is the removal of the skb_decrease_gso_size() call.

(d) If the packets are ultimately destined to the local device, then there is
absolutely no benefit to playing around with gso_size. It only matters if the
packets will egress the device. ie. we're either forwarding, or transmitting
from the device.

(e) This logic only triggers for packets which are GSO. It does not trigger for
skbs which are not GSO. It will not convert a non-GSO MTU sized packet into a
GSO packet (and you don't even know what the MTU is, so you can't even fix it).
As such your transmit path must *already* be able to handle an MTU 20 bytes
larger then your receive path (for IPv4 to IPv6 translation) - and indeed 28
bytes larger due to IPv4 fragments. Thus removing the skb_decrease_gso_size()
call doesn't actually increase the size of the packets your transmit side must
be able to handle. ie. to handle non-GSO max-MTU packets, the IPv4/IPv6 device/
route MTUs must already be set correctly. Since for example with an IPv4 egress
MTU of 1500, IPv4 to IPv6 translation will already build 1520 byte IPv6 frames,
so you need a 1520 byte device MTU. This means if your IPv6 device's egress
MTU is 1280, your IPv4 route must be 1260 (and actually 1252, because of the
need to handle fragments). This is to handle normal non-GSO packets. Thus the
reduction is simply not needed for GSO packets, because when they're correctly
built, they will already be the right size.

(f) TSO/GSO should be able to exactly undo GRO: the number of packets (TCP
segments) should not be modified, so that TCP's MSS counting works correctly
(this matters for congestion control). If protocol conversion changes the
gso_size, then the number of TCP segments may increase or decrease. Packet loss
after protocol conversion can result in partial loss of MSS segments that the
sender sent. How's the sending TCP stack going to react to receiving ACKs/SACKs
in the middle of the segments it sent?

(g) skb_{decrease,increase}_gso_size() are already no-ops for GSO_BY_FRAGS
case (besides triggering WARN_ON_ONCE). This means you already cannot guarantee
that gso_size (and thus resulting packet MTU) is changed. ie. you must assume
it won't be changed.

(h) changing gso_size is outright buggy for UDP GSO packets, where framing
matters (I believe that's also the case for SCTP, but it's already excluded
by [g]).  So the only remaining case is TCP, which also doesn't want it
(see [f]).

(i) see also the reasoning on the previous attempt at fixing this
(commit fa7b83bf3b156c767f3e4a25bbf3817b08f3ff8e) which shows that the current
behaviour causes TCP packet loss:

  In the forwarding path GRO -> BPF 6 to 4 -> GSO for TCP traffic, the
  coalesced packet payload can be > MSS, but < MSS + 20.

  bpf_skb_proto_6_to_4() will upgrade the MSS and it can be > the payload
  length. After then tcp_gso_segment checks for the payload length if it
  is <= MSS. The condition is causing the packet to be dropped.

  tcp_gso_segment():
    [...]
    mss = skb_shinfo(skb)->gso_size;
    if (unlikely(skb->len <= mss)) goto out;
    [...]

Thus changing the gso_size is simply a very bad idea. Increasing is unnecessary
and buggy, and decreasing can go negative.

Fixes: 6578171a7f ("bpf: add bpf_skb_change_proto helper")
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Dongseok Yi <dseok.yi@samsung.com>
Cc: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/bpf/CANP3RGfjLikQ6dg=YpBU0OeHvyv7JOki7CyOUS9modaXAi-9vQ@mail.gmail.com
Link: https://lore.kernel.org/bpf/20210617000953.2787453-2-zenczykowski@gmail.com

(cherry picked from commit 364745fbe981a4370f50274475da4675661104df https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=364745fbe981a4370f50274475da4675661104df )
Test: builds, TreeHugger
Bug: 188690383
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0ef3174cbd3caaa42d5779334a9c0bfdc9ab81f5
2021-06-28 21:04:04 +00:00
Faiyaz Mohammed
b007e43692 FROMGIT: mm: slub: fix the leak of alloc/free traces debugfs interface
Fix the leak of alloc/free traces debugfs interface, reported by kmemleak
like below,

unreferenced object 0xffff00091ae1b540 (size 64):
  comm "lsbug", pid 1607, jiffies 4294958291 (age 1476.340s)
  hex dump (first 32 bytes):
    02 00 00 00 00 00 00 00 6b 6b 6b 6b 6b 6b 6b 6b  ........kkkkkkkk
    6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
  backtrace:
    [<ffff8000106b06b8>] slab_post_alloc_hook+0xa0/0x418
    [<ffff8000106b5c7c>] kmem_cache_alloc_trace+0x1e4/0x378
    [<ffff8000106b5e40>] slab_debugfs_start+0x30/0x50
    slab_debugfs_start at mm/slub.c:5831
    [<ffff8000107b3dbc>] seq_read_iter+0x214/0xd50
    [<ffff8000107b4b84>] seq_read+0x28c/0x418
    [<ffff8000109560b4>] full_proxy_read+0xdc/0x148
    [<ffff800010738f24>] vfs_read+0x104/0x340
    [<ffff800010739ee0>] ksys_read+0xf8/0x1e0
    [<ffff80001073a03c>] __arm64_sys_read+0x74/0xa8

Link: https://lkml.kernel.org/r/1624248060-30286-1-git-send-email-faiyazm@codeaurora.org
Fixes: 3589836402ca ("mm: slub: move sysfs slab alloc/free interfaces to debugfs")
Link: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/slub.c?h=next-20210617&id=84a2bdb1b458fc968d6d9e07dab388dc679bd747
Signed-off-by: Faiyaz Mohammed <faiyazm@codeaurora.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
BUG: 176858818
(cherry picked from commit 29d055e7966b5beae75db7980df78f99344f74ae
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/slub.c?h=next-20210624&id=29d055e7966b5beae75db7980df78f99344f74ae)

Change-Id: I26fd4285b3e8f2a48f7c1320adceb0208e0fbc45
Signed-off-by: Faiyaz Mohammed <faiyazm@codeaurora.org>
2021-06-28 16:17:37 +00:00
Jaegeuk Kim
850f11aa85 Revert "KMI: BACKPORT: FROMGIT: scsi: ufs: Optimize host lock on transfer requests send/compl paths"
This patch avoids KMI, so later should be reverted to sync with upstream in
next KMI update.

Bug: 192095860
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: If861ecde381f23b5d5f18005063ec55356673fdb
2021-06-25 23:58:35 -07:00
Jaegeuk Kim
46575badbb Revert "BACKPORT: FROMGIT: scsi: ufs: Optimize host lock on transfer requests send/compl paths"
This reverts commit 7613068f95.

 Call trace:
  __switch_to+0x16c/0x2f8
  __schedule+0x4d0/0x94c
  schedule+0x80/0x100
  schedule_timeout+0x94/0x140
  io_schedule_timeout+0x48/0x70
  wait_for_common_io+0x80/0x108
  wait_for_completion_io_timeout+0x14/0x24
  blk_execute_rq+0xac/0x104
  __scsi_execute+0x104/0x1c8
  ufshcd_clear_ua_wlun+0x128/0x1cc
  ufshcd_err_handling_unprepare+0xd8/0x178
  ufshcd_err_handler+0x7d8/0x9d0
  process_one_work+0x218/0x634
  worker_thread+0x34c/0x588
  kthread+0x158/0x1b0
  ret_from_fork+0x10/0

Bug: 192095860
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Ifaa166902daa9dbd340fab68987200c5bf3009d9
2021-06-25 23:17:35 -07:00
Jaegeuk Kim
83d653257a Revert "FROMGIT: scsi: ufs: Utilize Transfer Request List Completion Notification Register"
This reverts commit ae618c699c.

It causes early device being stuck.

Bug: 192088222
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I5117e7f8aaa9433b74f1531619cdc1b687d02b41
2021-06-25 17:25:54 -07:00
Thierry Strudel
9f8f2ea03e ANDROID: power: wakeup_reason: change abort log
Logging callback symbolic name is generating too many different
messages making Abort analysis miss big trends.
Stick to console reported message providing sufficient information.

Bug: 120445600
Signed-off-by: Thierry Strudel <tstrudel@google.com>
Change-Id: Ic0ea662a60919454060e3a085aeabd8a4099e0b4
2021-06-25 16:31:57 +00:00
Huang Yiwei
d5a092726b ANDROID: GKI: Update abi_gki_aarch64_qcom list for rwsem list add
Add the rwsem list add vendor hook symbol which is needed for
vendor modules.

Bug: 192041655
Signed-off-by: Huang Yiwei <hyiwei@codeaurora.org>
Change-Id: I838fbb9d067d940e962eff94e8c875c30e153ee1
2021-06-25 20:08:43 +08:00
zhang chuang
eabe9707f2 ANDROID: Add hook to show vendor info for transactions
When watchdog or anr occur, we need to read
dev/binderfs/binder_logs/proc/pid or dev/binderfs/binder_logs/state
node to know the time-consuming information of the binder call.
We need to add the time-consuming information of binder transaction.

Bug: 190413570

Signed-off-by: zhang chuang <zhangchuang3@xiaomi.com>
Change-Id: I0423d4e821d5cd725a848584133dc7245cbc233a
2021-06-24 17:40:34 -07:00
Martin Liu
12902c9996 ANDROID: vendor_hooks: Export direct reclaim trace points
Get direct reclaim info.

Bug: 190795589
Signed-off-by: Martin Liu <liumartin@google.com>
Change-Id: Ie66a3c87484a364a918c19b8e044c82f1afd6749
2021-06-24 17:05:05 +00:00
Martin Liu
cea24faf98 ANDROID: Update the ABI representation
Leaf changes summary: 4 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 2 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 2 Added variables

2 Added functions:

  [A] 'function int __traceiter_mm_vmscan_direct_reclaim_begin(void*, int, gfp_t)'
  [A] 'function int __traceiter_mm_vmscan_direct_reclaim_end(void*, unsigned long int)'

2 Added variables:

  [A] 'tracepoint __tracepoint_mm_vmscan_direct_reclaim_begin'
  [A] 'tracepoint __tracepoint_mm_vmscan_direct_reclaim_end'

Bug: 190795589
Signed-off-by: Martin Liu <liumartin@google.com>
Change-Id: Ibabb7f6ffdc298ee8ff860457e0fada402ce1a34
2021-06-24 15:22:11 +00:00
Subash Abhinov Kasiviswanathan
c0e8aae5c5 ANDROID: qcom: Add xfrm and skb related symbols
Add __xfrm_decode_session, xfrm_lookup, xfrm_output and kfree_skb_list
which are needed by rmnet modules.

Leaf changes summary: 4 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 4 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

4 Added functions:

  [A] 'function int __xfrm_decode_session(sk_buff*, flowi*, unsigned int, int)'
  [A] 'function void kfree_skb_list(sk_buff*)'
  [A] 'function dst_entry* xfrm_lookup(net*, dst_entry*, const flowi*, const sock*, int)'
  [A] 'function int xfrm_output(sock*, sk_buff*)'

Bug: 191435348
Change-Id: Ib61aaf84ed145c3f87015c890f6c9e6d5ae722f6
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2021-06-24 15:03:12 +00:00
Jaegeuk Kim
8102df91f2 Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-5.10.y' into android12-5.10
* aosp/upstream-f2fs-stable-linux-5.10.y:
  Revert "f2fs: avoid attaching SB_ACTIVE flag during mount/remount"
  f2fs: remove false alarm on iget failure during GC
  f2fs: enable extent cache for compression files in read-only
  f2fs: fix to avoid adding tab before doc section
  f2fs: introduce f2fs_casefolded_name slab cache
  f2fs: swap: support migrating swapfile in aligned write mode
  f2fs: swap: remove dead codes
  f2fs: compress: add compress_inode to cache compressed blocks
  f2fs: clean up /sys/fs/f2fs/<disk>/features
  f2fs: add pin_file in feature list
  f2fs: Advertise encrypted casefolding in sysfs
  f2fs: Show casefolding support only when supported
  f2fs: support RO feature
  f2fs: logging neatening

Bug: 186107892
Bug: 190759634
Bug: 190517210
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I8eb93d8a43304b98166676da52a9c2434b15b942
2021-06-23 19:54:41 -07:00
Guangming Cao
b70055f85a ANDROID: iommu: Revise vendor hook param for iova free tracking
Iova is identified in the alloc vendor hook by its pfn (iova->pfn_lo)
and in free vendor hook by its address (iova->pfn_lo << iova_shift(iovad)).

Change alloc vendor hook to use address as well for consistency.

Bug: 187861158

Change-Id: I8255f3e5899008b80a9f8ed960e2ba948ba13cc2
Signed-off-by: Guangming Cao <Guangming.Cao@mediatek.com>
2021-06-24 01:15:10 +00:00
Shaleen Agrawal
a985701859 ANDROID: abi_gki_aarch64_qcom: Add additional symbols for 32bit execve
Additional restricted vendor hooks have been added.

Leaf changes summary: 4 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 2 Added
functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 2 Added
variables

2 Added functions:

[A] 'function int __traceiter_android_rvh_force_compatible_post(void*, void*)'
[A] 'function int __traceiter_android_rvh_force_compatible_pre(void*, void*)'

2 Added variables:

[A] 'tracepoint __tracepoint_android_rvh_force_compatible_post'
[A] 'tracepoint __tracepoint_android_rvh_force_compatible_pre'

Bug: 187917024
Change-Id: Ib9cd475ed63448f3befa581b26bcdfb4a75e8faf
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2021-06-23 17:05:33 -07:00
Shaleen Agrawal
c7c351ab3f ANDROID: sched: add restricted tracehooks for 32bit execve
Pre and post tracepoints in force_compatible_cpus_allowed_ptr() need
to be restricted hooks so that they can sleep.

The old non-restricted versions need to stay in place temporarily for
KMI stability. They will be removed by aosp/1742588.

Bug: 187917024
Change-Id: If630554b1c8fa2e8ccb79c89945c55e17756e6a8
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2021-06-23 17:05:12 -07:00
wangchenggang
f502bc761a ANDROID: GKI: Update symbols to symbol list
Update symbols to symbol list externed by oem modules.

Leaf changes summary: 0 artifact changed (1 filtered out)
Changed leaf types summary: 0 (1 filtered out) leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added
function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added
variable

Bug: 191844515

Change-Id: Ifbf1d9bdf30bac43342ae8987aba0d937657d983
Signed-off-by: Chenggang Wang <wangchenggang@vivo.com>
Signed-off-by: wangchenggang <11061793@bbktel.com>
2021-06-23 23:39:48 +00:00
Qais Yousef
4198bdb2cf ANDROID: coresight: Update ETE DT yaml file
Update ETE yaml file to bring it inline with upstream.

The change is minor and updates the ports property.

Bug: 174685394
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: Ia5bb2ddcbdfa171e998f4f023a0a164ac14f5dd3
2021-06-23 22:48:24 +00:00
Qais Yousef
6f1bd7583f ANDROID: coresight: Update ETE/TRBE to v6 merged upstream
Mark the buffer as truncated in irq + minor cleanups picked along the
way.

Bug: 174685394
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: I36111a14ef066b579a28c39e265f3d601a82e18a
2021-06-23 22:48:15 +00:00
Suzuki K Poulose
ce71010347 ANDROID: kvm: arm64: Clarify the comment for SPE save context
Make the comment in line with the upstream version.

Bug: 174685394
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: I8c239d37c96c0c8de1261df6d2a5a2defd43ccfb
2021-06-23 22:48:05 +00:00
Suzuki K Poulose
ee7e80c81b BACKPORT: arm64: KVM: Enable access to TRBE support for host
For a nvhe host, the EL2 must allow the EL1&0 translation
regime for TraceBuffer (MDCR_EL2.E2TB == 0b11). This must
be saved/restored over a trip to the guest. Also, before
entering the guest, we must flush any trace data if the
TRBE was enabled. And we must prohibit the generation
of trace while we are in EL1 by clearing the TRFCR_EL1.

For vhe, the EL2 must prevent the EL1 access to the Trace
Buffer.

The MDCR_EL2 bit definitions for TRBE are available here :

  https://developer.arm.com/documentation/ddi0601/2020-12/AArch64-Registers/

Bug: 174685394
Cc: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210405164307.1720226-8-suzuki.poulose@arm.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
(cherry picked from commit a1319260bf62951e279ea228f682bf4b8834a3c2)
[Conflict:
 - arch/arm64/kvm/debug.c
 - arch/arm64/kvm/hyp/nvhe/debug-sr.c

Trivial conflicts except for one  which tried to replce

	kvm_arm_setup_mdcr_el2(vcpu);

we rejected that hunk.]
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: I88316a7b2d7b7b23a01914a7de0a2898c4a66afa
2021-06-23 22:47:56 +00:00
Suzuki K Poulose
b6b0927eac BACKPORT: KVM: arm64: Move SPE availability check to VCPU load
At the moment, we check the availability of SPE on the given
CPU (i.e, SPE is implemented and is allowed at the host) during
every guest entry. This can be optimized a bit by moving the
check to vcpu_load time and recording the availability of the
feature on the current CPU via a new flag. This will also be useful
for adding the TRBE support.

Bug: 174685394
Cc: Marc Zyngier <maz@kernel.org>
Cc: Will Deacon <will@kernel.org>
Cc: Alexandru Elisei <Alexandru.Elisei@arm.com>
Cc: James Morse <james.morse@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210405164307.1720226-7-suzuki.poulose@arm.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
(cherry picked from commit d2602bb4f5a450642b96d467e27e6d5d3ef7fa54)
[Conflict in: arch/arm64/kvm/hyp/nvhe/debug-sr.c
Trivial conflict because of an additional __debug_save_trace() call
since a previous version of the series was backported already.]
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: I4ca2bb14f7b647a1e118ea4a8c4313154a482685
2021-06-23 22:47:43 +00:00
Suzuki K Poulose
dde40c1089 UPSTREAM: KVM: arm64: Handle access to TRFCR_EL1
Rather than falling to an "unhandled access", inject add an explicit
"undefined access" for TRFCR_EL1 access from the guest.

Bug: 174685394
Cc: Marc Zyngier <maz@kernel.org>
Cc: Will Deacon <will@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210405164307.1720226-6-suzuki.poulose@arm.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
(cherry picked from commit cc427cbb15375f1229e78908064cdff98138b8b1)
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: If0efe01af21894ed29cb85338f802ac1f6a194fc
2021-06-23 22:47:18 +00:00
Orson Zhai
ee682ec766 ANDROID: GKI: Enable ARCH_SPRD and SPRD_TIMER
Add SPRD_TIMER config into GKI for the same reason as other vendors have
described before.

Bug: 188373235
Change-Id: I70f1296f11759d9010252a52a88f9329744172f6
Signed-off-by: Orson Zhai <orson.zhai@unisoc.com>
2021-06-23 22:42:07 +00:00
Tor Vic
39147716e8 UPSTREAM: x86, lto: Pass -stack-alignment only on LLD < 13.0.0
Since LLVM commit 3787ee4, the '-stack-alignment' flag has been dropped
[1], leading to the following error message when building a LTO kernel
with Clang-13 and LLD-13:

    ld.lld: error: -plugin-opt=-: ld.lld: Unknown command line argument
    '-stack-alignment=8'.  Try 'ld.lld --help'
    ld.lld: Did you mean '--stackrealign=8'?

It also appears that the '-code-model' flag is not necessary anymore
starting with LLVM-9 [2].

Drop '-code-model' and make '-stack-alignment' conditional on LLD < 13.0.0.

These flags were necessary because these flags were not encoded in the
IR properly, so the link would restart optimizations without them. Now
there are properly encoded in the IR, and these flags exposing
implementation details are no longer necessary.

[1] https://reviews.llvm.org/D103048
[2] https://reviews.llvm.org/D52322

Cc: stable@vger.kernel.org
Link: https://github.com/ClangBuiltLinux/linux/issues/1377
Signed-off-by: Tor Vic <torvic9@mailbox.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/f2c018ee-5999-741e-58d4-e482d5246067@mailbox.org
(cherry picked from commit 2398ce80152aae33b9501ef54452e09e8e8d4262)
Change-Id: Icebcd5669e851e2c26e9f807b9d1aeb86e95dcea
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
2021-06-23 21:12:09 +00:00
Minchan Kim
7d3618b8b9 ANDROID: fix permission error of page_pinner
longterm_pinner/alloc_contig_failed should be 444
for reading for everyone and threshold/failure_traking
should be 644 to allow read/write root.

Bug: 191827366
Signed-off-by: Minchan Kim <minchan@google.com>
Change-Id: I5493c6ae6d39b692282e5428416da80a7d555aa0
2021-06-23 18:36:15 +00:00
Suren Baghdasaryan
cfe1f5aea6 ANDROID: gki_config: disable per-cgroup pressure tracking
Disable per-cgroup psi tracking to prevent unnecessary overhead since
Android does not use per-cgroup psi information.

Bug: 178872719
Bug: 191734423
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ic6f84630cd478139fb8cce00410163e4e767c86a
2021-06-23 18:35:42 +00:00
Suren Baghdasaryan
c7186c2c46 FROMGIT: cgroup: make per-cgroup pressure stall tracking configurable
PSI accounts stalls for each cgroup separately and aggregates it at each
level of the hierarchy. This causes additional overhead with psi_avgs_work
being called for each cgroup in the hierarchy. psi_avgs_work has been
highly optimized, however on systems with large number of cgroups the
overhead becomes noticeable.
Systems which use PSI only at the system level could avoid this overhead
if PSI can be configured to skip per-cgroup stall accounting.
Add "cgroup_disable=pressure" kernel command-line option to allow
requesting system-wide only pressure stall accounting. When set, it
keeps system-wide accounting under /proc/pressure/ but skips accounting
for individual cgroups and does not expose PSI nodes in cgroup hierarchy.

Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Link:  https://lore.kernel.org/patchwork/patch/1435705
(cherry picked from commit 3958e2d0c34e18c41b60dc01832bd670a59ef70f
 https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git tj)

Bug: 178872719
Bug: 191734423
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ifc8fbc52f9a1131d7c2668edbb44c525c76c3360
2021-06-23 18:35:35 +00:00
Suren Baghdasaryan
0d054fc5d7 Revert "ANDROID: make per-cgroup PSI tracking configurable"
This reverts commit bd3983c8a8.

Bug: 178872719
Bug: 191734423
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Iae7997d518693f09fcc0bf8a3ee5caac6145ada5
2021-06-23 18:35:27 +00:00
Marc Zyngier
951bdfd077 FROMLIST: arm: Mark the recheduling IPI as raw interrupt
Flag the rescheduling IPI as 'raw', making sure such interrupt
skips both tick management  and irqtime accounting.

Bug: 191808738
Link: https://lore.kernel.org/lkml/20201124141449.572446-5-maz@kernel.org/
Change-Id: Ia9c2b989621eef6f49a1c30a08302a448ae286e6
Signed-off-by: Marc Zyngier <maz@kernel.org>
[minor port to 5.10]
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
2021-06-23 18:12:27 +00:00
Marc Zyngier
42f775df72 FROMLIST: arm64: Mark the recheduling IPI as raw interrupt
Flag the rescheduling IPI as 'raw', making sure such interrupt
skips both tick management  and irqtime accounting.

Bug: 191808738
Link: https://lore.kernel.org/lkml/20201124141449.572446-4-maz@kernel.org/
Change-Id: Ibeda817de7618a98d457d09a6fa7e54f867b72f0
Signed-off-by: Marc Zyngier <maz@kernel.org>
[minor port to 5.10]
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
2021-06-23 18:12:13 +00:00
Marc Zyngier
3f9d45d802 FROMLIST: genirq: Allow an interrupt to be marked as 'raw'
Some interrupts (such as the rescheduling IPI) rely on not going through
the irq_enter()/irq_exit() calls. To distinguish such interrupts, add
a new IRQ flag that allows the low-level handling code to sidestep the
enter()/exit() calls.

Only the architecture code is expected to use this. It will do the wrong
thing on normal interrupts. Note that this is a band-aid until we can
move to some more correct infrastructure (such as kernel/entry/common.c).

Bug: 191808738
Link: https://lore.kernel.org/lkml/20201124141449.572446-3-maz@kernel.org/
Change-Id: I0609a8b689219ba9e769c8b9f7fcf1e77a0ff1ca
Signed-off-by: Marc Zyngier <maz@kernel.org>
[minor port to 5.10]
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
2021-06-23 18:11:55 +00:00
Marc Zyngier
08327b9007 FROMLIST: genirq: Add __irq_modify_status() helper to clear/set special flags
Some arch-specific flags need to be set/cleared, but not exposed to
random device drivers. Introduce a new helper (__irq_modify_status())
that takes an arbitrary mask, and rewrite irq_modify_status() to use
this new helper.

No functionnal change.

Bug: 191808738
Link: https://lore.kernel.org/lkml/20201124141449.572446-5-maz@kernel.org/
Change-Id: I2c2c0d6599d0ab39fad22462bf4c87694362fba8
Signed-off-by: Marc Zyngier <maz@kernel.org>
[minor port to 5.10]
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
2021-06-23 18:11:38 +00:00
Rohan Sethi
77c9f446b6 ANDROID: GKI: Update abi_gki_aarch64_qcom list for shmem allocations
Add support for shmem allocations in kernel. Update allowed list with symbols
for the feature implementation.

Leaf changes summary: 2 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 2 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

2 Added functions:

  [A] 'function struct file* shmem_file_setup(const char*,
					loff_t, unsigned long)

  [A] 'function struct page* shmem_read_mapping_page_gfp(
					struct address_space*, pgoff_t, gfp_t)

Bug: 191813051
Change-Id: I4ca5f36cfac146695b64739b426df71834789d9f
Signed-off-by: Rohan Sethi <rohsethi@codeaurora.org>
2021-06-23 17:51:48 +00:00