Commit Graph

979182 Commits

Author SHA1 Message Date
Jaegeuk Kim
72fa98b514 FROMLIST: scsi: ufs: add missing host_lock in setup_xfer_req
This patch adds a host_lock which existed before on ufshcd_vops_setup_xfer_req.

Bug: 190637035
Cc: Stanley Chu <stanley.chu@mediatek.com>
Cc: Can Guo <cang@codeaurora.org>
Cc: Bean Huo <beanhuo@micron.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Asutosh Das <asutoshd@codeaurora.org>
Link: https://lore.kernel.org/linux-scsi/20210701005117.3846179-1-jaegeuk@kernel.org/T/#u
Fixes: 7613068f95 ("BACKPORT: FROMGIT: scsi: ufs: Optimize host lock on transfer requests send/compl paths")
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I0e5f9ec11fa62a074bca5feb5638e8d04cf858ee
2021-07-02 03:26:42 +00:00
Jaegeuk Kim
e0288fd779 Revert "Revert "FROMGIT: scsi: ufs: Utilize Transfer Request List Completion Notification Register""
This reverts commit 83d653257a.

We need to go back upstream version with right fix.

Bug: 192088222
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I7a52e161e5c82a13304fb5ba96bb6a5c6dacd06a
2021-07-02 03:26:35 +00:00
Jaegeuk Kim
9c0d749a4b Revert "Revert "BACKPORT: FROMGIT: scsi: ufs: Optimize host lock on transfer requests send/compl paths""
This reverts commit 46575badbb.

We need to go back upstream version with right fix.

Bug: 192095860
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I3dd1eb638bb3a95b3c8d40673f0821afdeb74f96
2021-07-02 03:26:30 +00:00
Jaegeuk Kim
3b3bec8866 Revert "Revert "KMI: BACKPORT: FROMGIT: scsi: ufs: Optimize host lock on transfer requests send/compl paths""
This reverts commit 850f11aa85.

We need to go back upstream version with right fix.

Bug: 192095860
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I26bf924125f06e97c1262578c99a2dbb58394235
2021-07-02 03:26:24 +00:00
Rick Yiu
8d2e1c8a3e ANDROID: Update the ABI representation
Leaf changes summary: 2 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 1 Added variable

1 Added function:

  [A] 'function int __traceiter_android_vh_setscheduler_uclamp(void*, task_struct*, int, unsigned int)'

1 Added variable:

  [A] 'tracepoint __tracepoint_android_vh_setscheduler_uclamp'

Bug: 191973176
Signed-off-by: Rick Yiu <rickyiu@google.com>
Change-Id: Id8c2dd8a1201b1adaa84e9635331b5c703c742bd
2021-07-01 23:58:44 +00:00
Prakash Gupta
aebdd1ae36 ANDROID: GKI: Update abi_gki_aarch64_qcom for oom_check_panic symbol
Whitelist the symbol __tracepoint_android_vh_oom_check_panic

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

1 Added variable:

  [A] 'tracepoint __tracepoint_android_vh_oom_check_panic'

Bug: 186875166
Change-Id: Ie54977a3fad4645a6d55c87f2c36ae4a0347c59b
Signed-off-by: Prakash Gupta <guptap@codeaurora.org>
2021-07-01 16:33:14 +00:00
Rick Yiu
22a57c542b ANDROID: sched: Add trace for __setscheduler_uclamp
To know per-task uclamp request.

Bug: 191973176
Signed-off-by: Rick Yiu <rickyiu@google.com>
Change-Id: Ibd40391f2228db5daa410198339237879e67a078
2021-07-01 12:31:33 +00:00
chihhao.chen
5eb3930a32 ANDROID: usb: export built-in tracepoint functions
Export these tracepoint functions to track USB data flow
for performance tuning.

Bug: 192512300

Signed-off-by: chihhao.chen <chihhao.chen@mediatek.com>
Change-Id: I37ae07e87b5b2d0fb24c1e0a2e83954ceb4aa4f9
2021-07-01 13:39:02 +08:00
Liujie Xie
7d216e2512 ANDROID: Fix lost track action type in save_track_hash
Transmit the track action type to save_track_hash, otherwise we do not know it is allocation stack or free stack.

Fixes: 8bc6337823 ("ANDROID: vendor_hooks: add hooks for slab memory leak debugging")
Bug: 184928480
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: I74c50c02cfb4ebbf3e9fecdf125e76946ff4e7d1
2021-07-01 00:52:06 +00:00
Todd Kjos
06d75deb06 ANDROID: ABI: update for new qcom symbols
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_vh_logbuf_pr_cont(void*, printk_record*, size_t)'
  [A] 'function int __traceiter_android_vh_ufs_update_sdev(void*, scsi_device*)'

2 Added variables:

  [A] 'tracepoint __tracepoint_android_vh_logbuf_pr_cont'
  [A] 'tracepoint __tracepoint_android_vh_ufs_update_sdev'

Bug: 191951106
Bug: 185182649
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: Iefdbf957fd40caeb767d2f50dca1e79ba4846582
2021-06-30 13:55:16 -07:00
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 626c30f9e7 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 fa7b83bf3b) 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 364745fbe9 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 a1319260bf)
[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 d2602bb4f5)
[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 cc427cbb15)
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