Commit Graph

883270 Commits

Author SHA1 Message Date
Masahiro Yamada
eed9382d52 UPSTREAM: kbuild: ensure full rebuild when the compiler is updated
Commit 21c54b7747 ("kconfig: show compiler version text in the top
comment") added the environment variable, CC_VERSION_TEXT in the comment
of the top Kconfig file. It can detect the compiler update, and invoke
the syncconfig because all environment variables referenced in Kconfig
files are recorded in include/config/auto.conf.cmd

This commit makes it a CONFIG option in order to ensure the full rebuild
when the compiler is updated.

This works like follows:

include/config/kconfig.h contains "CONFIG_CC_VERSION_TEXT" in the comment
block.

The top Makefile specifies "-include $(srctree)/include/linux/kconfig.h"
to guarantee it is included from all kernel source files.

fixdep parses every source file and all headers included from it,
searching for words prefixed with "CONFIG_". Then, fixdep finds
CONFIG_CC_VERSION_TEXT in include/config/kconfig.h and adds
include/config/cc/version/text.h into every .*.cmd file.

When the compiler is updated, syncconfig is invoked because init/Kconfig
contains the reference to the environment variable CC_VERTION_TEXT.
CONFIG_CC_VERSION_TEXT is updated to the new version string, and
include/config/cc/version/text.h is touched.

In the next rebuild, Make will rebuild every files since the timestamp
of include/config/cc/version/text.h is newer than that of target.

Bug: 168274246

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
(cherry picked from commit 8b59cd81dc5e724eaea283fa6006985891c7bff4)
Signed-off-by: Mars Lin <marslin@google.com>
Change-Id: Ie52bb8e33b95d0e97998024d28c0d8d7caf8aa59
2020-09-24 10:02:38 +00:00
Yongqin Liu
3a95b9057a ANDROID: abi: update for hikey960
Leaf changes summary: 9 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 9 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

9 Added functions:

  [A] 'function void tcpm_cc_change(tcpm_port*)'
  [A] 'function void tcpm_pd_hard_reset(tcpm_port*)'
  [A] 'function void tcpm_pd_receive(tcpm_port*, const pd_message*)'
  [A] 'function void tcpm_pd_transmit_complete(tcpm_port*, tcpm_transmit_status)'
  [A] 'function tcpm_port* tcpm_register_port(device*, tcpc_dev*)'
  [A] 'function void tcpm_tcpc_reset(tcpm_port*)'
  [A] 'function void tcpm_unregister_port(tcpm_port*)'
  [A] 'function void tcpm_vbus_change(tcpm_port*)'
  [A] 'function usb_role usb_role_switch_get_role(usb_role_switch*)'

and fix insmod failures reported like the following when use the gki kernel:
    [    5.829264] hisi_hikey_usb: Unknown symbol usb_role_switch_get_role (err -2)

    [    7.989462] tcpci: Unknown symbol tcpm_cc_change (err -2)
    [    7.994896] tcpci: Unknown symbol tcpm_tcpc_reset (err -2)
    [    8.000384] tcpci: Unknown symbol tcpm_vbus_change (err -2)
    [    8.005961] tcpci: Unknown symbol tcpm_pd_receive (err -2)
    [    8.011462] tcpci: Unknown symbol tcpm_pd_hard_reset (err -2)
    [    8.017221] tcpci: Unknown symbol tcpm_pd_transmit_complete (err -2)
    [    8.023576] tcpci: Unknown symbol tcpm_register_port (err -2)
    [    8.029323] tcpci: Unknown symbol tcpm_unregister_port (err -2)

Via the following commands:
    $ ./build/abi/bootstrap
    <follow instructions for adding needed path variables>
    $ BUILD_CONFIG=common/build.config.hikey960 build/build_abi.sh --update --print-report
    $ BUILD_CONFIG=common/build.config.gki.aarch64 build/build_abi.sh --update --print-report

Test: boot tested with hikey960 android11 builds

Fixes: bb765ef8427e ("ANDROID: GKI: enable QCOM and HISI UFS drivers")
Fixes: 5625a6460e96 ("ANDROID: GKI: enable CONFIG_TYPEC_TCPM")
Fixes: f82716d6b7 ("ANDROID: hikey960_gki.fragment: Remove UFS and USB bits")

Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Change-Id: I700cc535d7281ea43b72a5268493656151c77d3d
2020-09-23 18:23:27 +00:00
John Stultz
1d65a4b7a6 ANDROID: dts: hi3660: Fix duplicate adv7533 nodes
The adv7533 node had a duplicate entry in the hi3660.dtsi
which is misplaced as that hardware is board specific and
not soc specific.

A recent changes upstream were backported to -stable which
recently broke the driver from loading properly, so this
patch moves the details from the incorrect node into its
proper place, resolving the issue.

Fixes: 274f4e9c57 ("arm64: dts: hisilicon: hikey: fixes to comply with adi, adv7533 DT binding")
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: Iffe78badb08a1a49ed99fb8ab2257cb95e368f3f
(cherry picked from commit 623715b470c6c51e54344a274ca90df19556b56a)
2020-09-23 07:34:28 +00:00
Jack Pham
eaf38dc2bb ANDROID: kallsyms: ignore ThinLTO+CFI hash suffix in kallsyms_lookup_name()
Similar to commit f683c8dc7f ("ANDROID: kallsyms: strip hashes from
static functions with ThinLTO and CFI"), since LLVM adds a hash to
static function names when CONFIG_THINLTO and CFI are enabled, callers
of kallsyms_lookup_name() which aren't aware of the additional suffix
will fail to find the symbol. One example is kprobes (both compiled
and the dynamic events) which rely on this to resolve the function
name to attach a kprobe/kretprobe to.

Address this by also calling the cleanup_symbol_name() helper from
kallsyms_lookup_name() when failing to match a symbol by name.
This will strip off the hash suffix, if any, and attempt the
strcmp() again.

Bug: 167595670
Change-Id: I4c79c818c29b4b82a94a5a7e86ae9783a41e853d
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2020-09-22 20:17:26 +00:00
Matthias Maennich
1bb4dcbb7a ANDROID: Refresh ABI.xmls with libabigail 1.8.0-1dca710a
This upgrades some types from declaration-only tracking to full type
tracking, but creates this one-time churn.

Bug: 158736583
Signed-off-by: Matthias Maennich <maennich@google.com>
Change-Id: I39f778d7660fb4065eec2ecb6dd1ed47816e25b6
2020-09-22 17:44:09 +01:00
Mayank Grover
1944a78d12 ANDROID: ABI: update allowed list for QCOM
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
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function void devm_of_clk_del_provider(device*)'

Bug: 169127322
Change-Id: I7a05b43ba95bcde895cff221727fcc36ea7b5468
Signed-off-by: Mayank Grover <groverm@codeaurora.org>
Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
2020-09-22 18:18:09 +05:30
Matthias Maennich
e83321764f ANDROID: KMI symbol lists: migrate section name
Libabigail learned to accept 'symbol_list' as a valid suffix for symbol
list sections. Hence make use of it consistently.

Bug: 162536543
Signed-off-by: Matthias Maennich <maennich@google.com>
Change-Id: I1454b0068769c9e57a533dafb6267e63adb7ceb0
2020-09-17 13:14:10 +00:00
Jeehong Kim
ba4ec0ee1b ANDROID: ABI: Update allowed list for GALAXY
Leaf changes summary: 10 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 8 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 2 Added variables

8 Added functions:

  [A] 'function void __napi_schedule_irqoff(napi_struct*)'
  [A] 'function void drm_edid_get_monitor_name(edid*, char*, int)'
  [A] 'function char* get_options(const char*, int, int*)'
  [A] 'function packet_offload* gro_find_complete_by_type(unsigned short int)'
  [A] 'function packet_offload* gro_find_receive_by_type(unsigned short int)'
  [A] 'function __be32 in_aton(const char*)'
  [A] 'function void kfree_skb_partial(sk_buff*, bool)'
  [A] 'function int smp_call_function_single_async(int, __call_single_data*)'

2 Added variables:

  [A] 'tracepoint __tracepoint_android_vh_kfree_skb'
  [A] 'tracepoint __tracepoint_android_vh_ptype_head'

Bug: 168666995

Signed-off-by: Jeehong Kim <jhez.kim@samsung.com>
Change-Id: Ie93e39ef988e2287741819a81cd44d41d7f0fcd7
2020-09-16 15:14:34 +00:00
John Stultz
f82716d6b7 ANDROID: hikey960_gki.fragment: Remove UFS and USB bits
Remove CONFIG_SCSI_UFS_HISI=m and CONFIG_TYPEC_TCPM=m
from the hikey960_gki.fragment, as those configs have
been added to the gki_defconfig

Fixes: bb765ef8427e ("ANDROID: GKI: enable QCOM and HISI UFS drivers")
Fixes: 5625a6460e96 ("ANDROID: GKI: enable CONFIG_TYPEC_TCPM")
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I124a0d050c7170557d9672968729af196ad2f81c
(cherry picked from commit ae78c73104aa2fa957cbb7b4524c3e3e862174fd)
2020-09-16 03:32:40 +00:00
Prasad Sodagudi
5d5378d608 ANDROID: lkdtm/usercopy: Use __va_function to find proper vm_mmap address
With CFI enabled compiler replacing the reference to vm_mmap
passed to copy_to_user with a pointer to the CFI jump table
in the module itself. So use the __va_function API for
finding the proper address of vm_mmap.

Bug: 166220312
Suggested-by: Sami Tolvanen <samitolvanen@google.com>
Change-Id: Id5bd96cc9bfa1aa99f34bd4785792e0a4eeae5b1
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
2020-09-15 13:01:00 -07:00
Sami Tolvanen
a3cb7a0327 ANDROID: mm: add generic __va_function and __pa_function
We use non-canonical CFI jump tables with CONFIG_CFI_CLANG, which
means the compiler replaces function address references with the
address of the function's CFI jump table entry. This results in
__pa_symbol(function), for example, returning the physical address
of the jump table entry, which can lead to address space confusion
since the jump table itself points to a virtual address.

This change adds generic definitions for __pa/va_function, which
architectures that support CFI can override.

Bug: 166220312
Change-Id: If4a162de7854547d8437bf59be03eb6d16220832
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2020-09-15 18:20:31 +00:00
yong qian
802f342713 ANDROID: vendor_hooks: Add hooks for debugging exception context
When some processes crashed, we want to save cpu regs(x0-x30、pc、sp),
and context(task_struct、thread_info) to log for debugging

Bug: 166228327

Signed-off-by: yong qian <qianyong@oppo.com>
Change-Id: I4f49ffed583a0e20f1aaa7e445e85a0cbb603bbe
2020-09-15 18:02:49 +00:00
Suren Baghdasaryan
40f057fb2d FROMGIT: mm, oom_adj: don't loop through tasks in __set_oom_adj when not necessary
Currently __set_oom_adj loops through all processes in the system to
keep oom_score_adj and oom_score_adj_min in sync between processes
sharing their mm. This is done for any task with more that one mm_users,
which includes processes with multiple threads (sharing mm and signals).
However for such processes the loop is unnecessary because their signal
structure is shared as well.
Android updates oom_score_adj whenever a tasks changes its role
(background/foreground/...) or binds to/unbinds from a service, making
it more/less important. Such operation can happen frequently.
We noticed that updates to oom_score_adj became more expensive and after
further investigation found out that the patch mentioned in "Fixes"
introduced a regression. Using Pixel 4 with a typical Android workload,
write time to oom_score_adj increased from ~3.57us to ~362us. Moreover
this regression linearly depends on the number of multi-threaded
processes running on the system.
Mark the mm with a new MMF_MULTIPROCESS flag bit when task is created with
(CLONE_VM && !CLONE_THREAD && !CLONE_VFORK). Change __set_oom_adj to use
MMF_MULTIPROCESS instead of mm_users to decide whether oom_score_adj
update should be synchronized between multiple processes. To prevent
races between clone() and __set_oom_adj(), when oom_score_adj of the
process being cloned might be modified from userspace, we use
oom_adj_mutex. Its scope is changed to global. The combination of
(CLONE_VM && !CLONE_THREAD) is rarely used except for the case of vfork().
To prevent performance regressions of vfork(), we skip taking oom_adj_mutex
and setting MMF_MULTIPROCESS when CLONE_VFORK is specified. Clearing the
MMF_MULTIPROCESS flag (when the last process sharing the mm exits) is left
out of this patch to keep it simple and because it is believed that this
threading model is rare. Should there ever be a need for optimizing that
case as well, it can be done by hooking into the exit path, likely
following the mm_update_next_owner pattern.
With the combination of (CLONE_VM && !CLONE_THREAD && !CLONE_VFORK) being
quite rare, the regression is gone after the change is applied.

Fixes: 44a70adec9 ("mm, oom_adj: make sure processes sharing mm have same view of oom_score_adj")
Reported-by: Tim Murray <timmurray@google.com>
Debugged-by: Minchan Kim <minchan@kernel.org>
Suggested-by: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Bug: 168521639
Link: https://lore.kernel.org/linux-fsdevel/20200902012558.2335613-1-surenb@google.com/
[isaacm: upstream bound, no cherry-pick info because patch is in mm tree]
Change-Id: I20352a77815fbc358c36e686bb1503fdeea658ed
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2020-09-15 09:34:00 -07:00
Giuliano Procida
45adb8186e ANDROID: ABI: refresh with latest libabigail 94f5d4ae
This is a one-off change that updates the type ids of anonymous
structs and unions to a more stable id.

Bug: 163532421
Change-Id: I2ae8b1fa19fab489412fca3f83fa9e2c7361c2b7
Signed-off-by: Giuliano Procida <gprocida@google.com>
2020-09-15 10:56:02 +00:00
Changki Kim
bad091cc4b ANDROID: vendor_hooks: Add vendor hooks for getting printk messages
When sudden reset by watchdog occurs, kernel log is very helpful.
But the log has saved structure type in log_buf.
So we want to collect the log on runtime to string format at other
reserved memory.

Bug: 167766040

Change-Id: Ic9686acc7c284e2ab81395fb9cc076fafe142bf9
Signed-off-by: Changki Kim <changki.kim@samsung.com>
2020-09-14 14:42:20 +00:00
Liangcai Fan
8a8be5c013 ANDROID: ABI: add already existing symbols of mali_gondul.ko to unisoc
Bug: 160255258
Change-Id: I891eab1de6d3f0973501ee1199566978475fafff
Signed-off-by: Liangcai Fan <liangcai.fan@unisoc.com>
2020-09-14 11:28:08 +08:00
Changki Kim
bb168ca180 Revert "ANDROID: vendor_hooks: Add vendor hooks for key combination"
This reverts commit 72f2bc5fc2.

You can use input_handle_event instead of this vendor hook.

Change-Id: I8c6c5705f07181710c99a01239d75ecf43f9c5bf
Signed-off-by: Changki Kim <changki.kim@samsung.com>
2020-09-11 11:47:54 +09:00
Haitao Shan
a52bcdb85f ANDROID: Setting up GS before calling __restore_processor_state.
Android Common Kernel compiled by clang with Shadow Call Stack will
use GS segment. However, __restore_processor_state is called when
system wakes up from S3 and at the moment GS is not restored yet.

This is a hack by copying a small code snippet(setting gs base) from
__restore_processor_state to restore_processor_state. It prepares GS
before __restore_processor_state is called. At the same time,
restore_processor_state is still small enough so that SCS is not on,
as SCS seems to be on only for large functions.

Bug: 166163480
Change-Id: I3bfe4ac61dee876da57de6578c9a7f01431a1743
Signed-off-by: Haitao Shan <hshan@google.com>
2020-09-10 20:16:24 +00:00
Martijn Coenen
dea54268fb FROMGIT: binder: print warnings when detecting oneway spamming.
The most common cause of the binder transaction buffer filling up is a
client rapidly firing oneway transactions into a process, before it has
a chance to handle them. Yet the root cause of this is often hard to
debug, because either the system or the app will stop, and by that time
binder debug information we dump in bugreports is no longer relevant.

This change warns as soon as a process dips below 80% of its oneway
space (less than 100kB available in the configuration), when any one
process is responsible for either more than 50 transactions, or more
than 50% of the oneway space.

Signed-off-by: Martijn Coenen <maco@android.com>
Signed-off-by: Martijn Coenen <maco@google.com>
Acked-by: Todd Kjos <tkjos@google.com>
Link: https://lore.kernel.org/r/20200821122544.1277051-1-maco@android.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 261e7818f06ec51e488e007f787ccd7e77272918
git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/
char-misc-next)
Signed-off-by: Martijn Coenen <maco@android.com>

Bug: 147795659
Change-Id: Idc2b03ddc779880ca4716fdae47a70df43211f25
2020-09-10 15:52:35 +00:00
Matthias Maennich
415c56cf53 ANDROID: Address flaky behaviour in genksyms affecting CRC stability.
Commit 1278a5bf16 ("ANDROID: ABI: Added symbols for allwinner")
introduced ehci_* symbols to the symbol list. Due to a bug in genksyms,
the CRC of those is not resilient to whether other symbols are exported
as well. In particular, the CRC changes with the export/trimming of
ehci_handshake. Add an artificial symbol list to contain ehci_handshake
to make this stable.

Also update the ABI representation accordingly:

1 Added function:

  [A] 'function int ehci_handshake(ehci_hcd*, void*, u32, u32, int)'

Bug: 167230325
Signed-off-by: Matthias Maennich <maennich@google.com>
Change-Id: I58d3a93f49e70a66f34b66f9f8784b9c19c5a58b
2020-09-10 13:46:00 +00:00
Greg Kroah-Hartman
54d9896ccd Revert "Revert "BACKPORT: net: core: use listified Rx for GRO_NORMAL in napi_gro_receive()""
This reverts commit a81a69408b as it is needed, and is in the upstream 5.4.y tree now.

Bug: 167477898
Change-Id: Ica5a915027546a7f6f655c336db2489897b007f0
Cc: Hyunsoon Kim <h10.kim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-09-10 11:56:32 +00:00
Subbaraman Narayanamurthy
1869fba86a ANDROID: ABI: update allowed list for QCOM
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 int led_classdev_flash_register_ext(device*, led_classdev_flash*, led_init_data*)'
  [A] 'function void led_classdev_flash_unregister(led_classdev_flash*)'

Bug: 168090628
Change-Id: I4006604af3341a67a253ca4184ed9daff2990cba
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2020-09-09 10:31:50 -07:00
Xin Long
3a3ba4b7dd UPSTREAM: udp: initialize is_flist with 0 in udp_gro_receive
Without NAPI_GRO_CB(skb)->is_flist initialized, when the dev doesn't
support NETIF_F_GRO_FRAGLIST, is_flist can still be set and fraglist
will be used in udp_gro_receive().

So fix it by initializing is_flist with 0 in udp_gro_receive.

Fixes: 9fd1ff5d2ac7 ("udp: Support UDP fraglist GRO/GSO.")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Bug: 167707933
Change-Id: Icd2977dfb7506ce0f83d88f52184aa282bc2cac3
(cherry picked from commit bde1b56f898ca8112912d7b36e55e1543b3be0cf)
Signed-off-by: Hyunsoon Kim <h10.kim@samsung.com>
2020-09-09 08:48:11 +00:00
Steffen Klassert
88ca8b3fc2 UPSTREAM: udp: Support UDP fraglist GRO/GSO.
This patch extends UDP GRO to support fraglist GRO/GSO
by using the previously introduced infrastructure.
If the feature is enabled, all UDP packets are going to
fraglist GRO (local input and forward).

After validating the csum,  we mark ip_summed as
CHECKSUM_UNNECESSARY for fraglist GRO packets to
make sure that the csum is not touched.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Bug: 167707933
Change-Id: I7756cb47212713efde64a246a42c88d0b0f5521a
(cherry picked from commit 9fd1ff5d2ac7181844735806b0a703c942365291)
Signed-off-by: Hyunsoon Kim <h10.kim@samsung.com>
2020-09-09 08:48:03 +00:00
Steffen Klassert
02803b1ce4 UPSTREAM: net: Support GRO/GSO fraglist chaining.
This patch adds the core functions to chain/unchain
GSO skbs at the frag_list pointer. This also adds
a new GSO type SKB_GSO_FRAGLIST and a is_flist
flag to napi_gro_cb which indicates that this
flow will be GROed by fraglist chaining.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Bug: 167707933
Change-Id: I4bb29cfcd13ccb48871070bf94ea5b87160d65d4
(cherry picked from commit 3a1296a38d0cf62bffb9a03c585cbd5dbf15d596)
Signed-off-by: Hyunsoon Kim <h10.kim@samsung.com>
2020-09-09 08:47:55 +00:00
Steffen Klassert
d106e05d02 UPSTREAM: net: Add a netdev software feature set that defaults to off.
The previous patch added the NETIF_F_GRO_FRAGLIST feature.
This is a software feature that should default to off.
Current software features default to on, so add a new
feature set that defaults to off.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Bug: 167707933
Change-Id: Ie56e82a2b2ba3ebd4fded1d865070ddcd311a26a
(cherry picked from commit 1a3c998f3a27ab6ecf56bdbb17e27e55fd6d47cd)
Signed-off-by: Hyunsoon Kim <h10.kim@samsung.com>
2020-09-09 08:47:47 +00:00
Steffen Klassert
e1f9bf0782 BACKPORT: net: Add fraglist GRO/GSO feature flags
This adds new Fraglist GRO/GSO feature flags. They will be used
to configure fraglist GRO/GSO what will be implemented with some
followup paches.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Bug: 167707933
Change-Id: I65a4b9fc631c88cd20c1b101fee70e864c2c4502
(cherry picked from commit 3b33583265ed3b0ae76eddbabf9d038b4076d1a9)
[hyunsoon: removed patch in net/ethtool/common.c which is not in android branch]
Signed-off-by: Hyunsoon Kim <h10.kim@samsung.com>
2020-09-09 08:47:35 +00:00
Greg Kroah-Hartman
a81a69408b Revert "BACKPORT: net: core: use listified Rx for GRO_NORMAL in napi_gro_receive()"
This reverts commit 2d5d56df7f.

Upstream reported that other fixes are required after this, and asked
why it is really needed here.

So get those answers first before accepting this patch, as we can not
take known-buggy patches into the tree.

Bug: 167477898
Cc: Hyunsoon Kim <h10.kim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: If795972972fdd17ad85a50f460ce79e00baffb54
2020-09-09 08:42:17 +02:00
Changki Kim
72f2bc5fc2 ANDROID: vendor_hooks: Add vendor hooks for key combination
When some problems happened in android, we can't use adb command because
android can be abnormal state. And we can't use uart because
uart pin is not connected in the board. So we need key combination
functions for debugging.
This function should only use in development environment.
In the market, this will be disabled.

Bug: 167516783

Signed-off-by: Changki Kim <changki.kim@samsung.com>
Change-Id: I1cbbc93642fb45da161eee983380e48045153a66
[ Added "#ifdef __GENKSYMS__" around the include <<trace/hooks/debug.h>
to prevent CRC errors due to visibility of struct trace_eval_map ]
Signed-off-by: Todd Kjos <tkjos@google.com>
2020-09-08 18:04:18 +00:00
Alexander Potapenko
a564726277 ANDROID: gki_defconfig: initialize locals with zeroes
This patch switches compiler-based stack initialization from 0xAA
to zero pattern, resulting in much more efficient code and saner
defaults for uninitialized local variables.

Bug: 154198143
Test: run cuttlefish and observe the following lines in dmesg:
      test_stackinit: all tests passed!
      test_meminit: all 130 tests passed!

Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: If9f2047fcbee58b90dbd8ad45707c5b40a654e2d
2020-09-08 15:12:54 +00:00
glider@google.com
1b6a6a2efe UPSTREAM: security: allow using Clang's zero initialization for stack variables
Upstream commit f0fe00d4972a8cd4b98cc2c29758615e4d51cdfe.

In addition to -ftrivial-auto-var-init=pattern (used by
CONFIG_INIT_STACK_ALL now) Clang also supports zero initialization for
locals enabled by -ftrivial-auto-var-init=zero. The future of this flag
is still being debated (see https://bugs.llvm.org/show_bug.cgi?id=45497).
Right now it is guarded by another flag,
-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang,
which means it may not be supported by future Clang releases. Another
possible resolution is that -ftrivial-auto-var-init=zero will persist
(as certain users have already started depending on it), but the name
of the guard flag will change.

In the meantime, zero initialization has proven itself as a good
production mitigation measure against uninitialized locals. Unlike pattern
initialization, which has a higher chance of triggering existing bugs,
zero initialization provides safe defaults for strings, pointers, indexes,
and sizes. On the other hand, pattern initialization remains safer for
return values. Chrome OS and Android are moving to using zero
initialization for production builds.

Performance-wise, the difference between pattern and zero initialization
is usually negligible, although the generated code for zero
initialization is more compact.

This patch renames CONFIG_INIT_STACK_ALL to CONFIG_INIT_STACK_ALL_PATTERN
and introduces another config option, CONFIG_INIT_STACK_ALL_ZERO, that
enables zero initialization for locals if the corresponding flags are
supported by Clang.

Cc: Kees Cook <keescook@chromium.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Alexander Potapenko <glider@google.com>
Link: https://lore.kernel.org/r/20200616083435.223038-1-glider@google.com
Reviewed-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Change-Id: I3c69570e7e3d3bbb666709de6feb531000bce2bf
2020-09-08 15:12:44 +00:00
Alexander Lobakin
2d5d56df7f BACKPORT: net: core: use listified Rx for GRO_NORMAL in napi_gro_receive()
Commit 323ebb61e3 ("net: use listified RX for handling GRO_NORMAL
skbs") made use of listified skb processing for the users of
napi_gro_frags().
The same technique can be used in a way more common napi_gro_receive()
to speed up non-merged (GRO_NORMAL) skbs for a wide range of drivers
including gro_cells and mac80211 users.
This slightly changes the return value in cases where skb is being
dropped by the core stack, but it seems to have no impact on related
drivers' functionality.
gro_normal_batch is left untouched as it's very individual for every
single system configuration and might be tuned in manual order to
achieve an optimal performance.

Signed-off-by: Alexander Lobakin <alobakin@dlink.ru>
Acked-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Bug: 167477898
Change-Id: Ie9e079cf9a5799ca2c4924848ca6b3caeef056d7
(cherry picked from commit 6570bc79c0dfff0f228b7afd2de720fb4e84d61d)
[hyunsoon: fix conflicts in net/core/dev.c]
Signed-off-by: Hyunsoon Kim <h10.kim@samsung.com>
2020-09-08 17:14:13 +09:00
Luhua Xu
987c7b940b UPSTREAM: spi: add power control when set_cs
As to set_cs takes effect immediately, power spi
is needed when setup spi.

Bug: 167938264
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Luhua Xu <luhua.xu@mediatek.com>
Link: https://lore.kernel.org/r/1572426234-30019-1-git-send-email-luhua.xu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit d948e6ca189985495a21cd622c31e30e72b6b688)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I4ed7f854419901f9537916096b941135796956d1
2020-09-07 10:13:03 +02:00
Johannes Berg
6d9aec4bc5 UPSTREAM: nl80211: fix NL80211_ATTR_HE_6GHZ_CAPABILITY usage
commit fce2ff728f95b8894db14f51c9274dc56c37616f upstream.

In nl80211_set_station(), we check NL80211_ATTR_HE_6GHZ_CAPABILITY
and then use NL80211_ATTR_HE_CAPABILITY, which is clearly wrong.
Fix this to use NL80211_ATTR_HE_6GHZ_CAPABILITY as well.

Cc: stable@vger.kernel.org
Fixes: 43e64bf301fd ("cfg80211: handle 6 GHz capability of new station")
Link: https://lore.kernel.org/r/20200805153516.310cef625955.I0abc04dc8abb2c7c005c88ef8fa2d0e3c9fb95c4@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit fce2ff728f95b8894db14f51c9274dc56c37616f)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ib3951a485537514e26a9ac70ad9773580ecc4f53
2020-09-05 11:19:47 +02:00
Raghavendra Rao Ananta
2bcdc156d9 ANDROID: ABI: Update allowed list for QCOM
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 void regmap_mmio_detach_clk(regmap*)'

1 Added variable:

  [A] 'const vb2_mem_ops vb2_vmalloc_memops'

Bug: 167839566
Change-Id: I503d09516e077a354ee7380597a4015baf80d75f
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2020-09-04 15:47:26 -07:00
hajun.sung
54e6ca5c23 ANDROID: ABI: Update allowed list for EXYNOS
Leaf changes summary: 8 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 8 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

8 Added functions:

  [A] 'function void cpuidle_pause_and_lock()'
  [A] 'function void cpuidle_resume_and_unlock()'
  [A] 'function int tcp_register_congestion_control(tcp_congestion_ops*)'
  [A] 'function void tcp_reno_cong_avoid(sock*, u32, u32)'
  [A] 'function u32 tcp_reno_ssthresh(sock*)'
  [A] 'function u32 tcp_reno_undo_cwnd(sock*)'
  [A] 'function unsigned int tcp_slow_start(tcp_sock*, unsigned int)'
  [A] 'function void tcp_unregister_congestion_control(tcp_congestion_ops*)'

Bug: 167787841

Change-Id: I0b3569e73ecd45d9759e32e0819a94ef19e2a481
Signed-off-by: hajun.sung <hajun.sung@samsung.com>
2020-09-04 17:06:01 +00:00
Peter Wuw
71692ac54d ANDROID: GKI: add abi_gki_aarch64_oneplus
Add some symbols to symbol list included by oem modules.

Bug: 165594476
Change-Id: Ib6113961bd18f8ca0c6e41fe30768fd3fba3d2ea
Signed-off-by: Peter Wuw <peter.wuw@oneplus.com>
[ shorted the list to get the initial file mergable, more symbols can be
  added later - gregkh]
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-09-04 15:33:39 +02:00
Giuliano Procida
7b433370b3 ANDROID: GKI: prevent removal of monitored symbols
For aarch64 GKI builds, enable KMI_SYMBOL_LIST_ADD_ONLY.

Bug: 165839948
Change-Id: I5564da9ec054ae003a28f01a41dbeede6ab23afb
Signed-off-by: Giuliano Procida <gprocida@google.com>
2020-09-04 08:08:40 +00:00
Raghavendra Rao Ananta
260bc57301 ANDROID: ABI: Update allowed list for QCOM
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
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function void kernel_restart(char*)'

Bug: 167655719
Change-Id: I77ebb52869d4ea3b75d41c8a6c7ba47f3291bedb
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-09-03 22:30:48 +02:00
hajun.sung
3eb3ff0201 ANDROID: ABI: Update allowed list for EXYNOS
Leaf changes summary: 1 artifact changed (15 filtered out)
Changed leaf types summary: 0 (2 filtered out) leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed (13 filtered out), 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 1 Added variable

1 Added variable:

  [A] 'tracepoint __tracepoint_android_vh_ipi_stop'

Bug: 167650864

Change-Id: I3e50429eb5a1417c64f66f08e7d70a646038f8a5
Signed-off-by: hajun.sung <hajun.sung@samsung.com>
2020-09-03 18:04:05 +00:00
Jungrae Kim
3d6b9391da ANDROID: GKI: add abi_gki_aarch64_galaxy
Add initial abi_gki_aarch64_galaxy file, with no new symbols being
needed, they will be added later.

Bug: 166527556
Change-Id: I09a44ce129fc8d689150303887d5ba6c5e2bffce
Signed-off-by: Jungrae Kim <jryu.kim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-09-03 16:25:18 +02:00
Kees Cook
898e9be82a UPSTREAM: module: Correctly truncate sysfs sections output
commit 11990a5bd7e558e9203c1070fc52fb6f0488e75b upstream.

The only-root-readable /sys/module/$module/sections/$section files
did not truncate their output to the available buffer size. While most
paths into the kernfs read handlers end up using PAGE_SIZE buffers,
it's possible to get there through other paths (e.g. splice, sendfile).
Actually limit the output to the "count" passed into the read function,
and report it back correctly. *sigh*

Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/lkml/20200805002015.GE23458@shao2-debian
Fixes: ed66f991bb19 ("module: Refactor section attr into bin attribute")
Cc: stable@vger.kernel.org
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Jessica Yu <jeyu@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 163100336
Cc: Saravana Kannan <saravanak@google.com
(cherry picked from commit 11990a5bd7e558e9203c1070fc52fb6f0488e75b)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I61cd70ce32bf06a6ec1be971a60101729606cd32
2020-09-03 14:26:03 +02:00
Greg Kroah-Hartman
44c13f4537 Revert "ANDROID: Revert "module: Do not expose section addresses to non-CAP_SYSLOG""
This reverts commit d837f090a6  as the
ramdump tooling is now fixed.

Bug: 163100336
Cc: Saravana Kannan <saravanak@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I4d0917beb848563270343515c49e0d6ad055c917
2020-09-03 14:24:54 +02:00
Greg Kroah-Hartman
94f8e7236d Revert "ANDROID: Revert "module: Refactor section attr into bin attribute""
This reverts commit ae8f7f7807 as the
ramdump tooling is now fixed.

Bug: 163100336
Cc: Saravana Kannan <saravanak@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I51d7b6ddb1e26602e53bf4fbfbfde72ca294246d
2020-09-03 14:24:53 +02:00
Todd Kjos
9d8606b94c Revert "ANDROID: vendor_hooks: Add vendor hooks for key combination"
This reverts commit ab2d60d901.

Caused KMI break (not detected by TH until after it was merged)

Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: If1b10072bf3758fdbb6e0e4e2cdacbcf010ab44d
2020-09-02 21:08:13 -07:00
Todd Kjos
de039a31d6 Revert "ANDROID: fix i386 build break"
This reverts commit 2e9d469846.

Reverted since it's parent needed to be reverted.

Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: Ibb438ae55788accc45e7f1a60b45f21f4655c883
2020-09-02 21:07:59 -07:00
Todd Kjos
2e9d469846 ANDROID: fix i386 build break
Fix declaration issue found by 0-day bot.

Fixes: ab2d60d901 ("ANDROID: vendor_hooks: Add vendor hooks for key combination")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: I2728fc009489a764b617e6c87ac52db37f6ce016
2020-09-03 00:12:51 +00:00
Changki Kim
ab2d60d901 ANDROID: vendor_hooks: Add vendor hooks for key combination
When some problems happened in android, we can't use adb command because
android can be abnormal state. And we can't use uart because
uart pin is not connected in the board. So we need key combination
functions for debugging.
This function should only use in development environment.
In the market, this will be disabled.

Bug: 167516783

Change-Id: I82e096526b06570b4cc55bf04dc945940d1dd91a
Signed-off-by: Changki Kim <changki.kim@samsung.com>
2020-09-02 19:49:53 +00:00
Jeevan Shriram
054b210d81 ANDROID: ABI: Update allowed list for QCOM
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
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added
variable

1 Added function:

  [A] 'function void wireless_send_event(net_device*, unsigned int,
  iwreq_data*, const char*)'

Bug: 167482009
Change-Id: Ic21292217d9a20d8eb9128f8908816d8a4d8e084
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
2020-09-02 15:54:03 +00:00
Qiwu Huang
72a8e256c3 FROMLIST: power: supply: core: property to control reverse charge
Interface to control wireless reverse charge.

Bug: 159767865

Signed-off-by: Qiwu Huang <huangqiwu@xiaomi.com>
Link: https://lore.kernel.org/lkml/d2a4960e5641c4360a9360f438669ec03a2c3d0d.1598349907.git.huangqiwu@xiaomi.com/
Change-Id: Iddf4a9efe23180750c8f82709da659a1cf50ff0d
2020-09-01 17:57:03 +00:00