Commit graph

883,371 commits

Author SHA1 Message Date
Cheng Jui Wang
ee9ce093d6 ANDROID: arm64: smp: fix Lockdep warning: RCU used illegally from idle CPU.
This problem will happened if handle_IPI is called from idle CPU.
Use trace_android_vh_ipi_stop_rcuidle() to fix this issue

Bug: 171683158
Change-Id: Ic49fc1ddc19a54415dec3f28b68f42fa258ffeea
Signed-off-by: Cheng Jui Wang <cheng-jui.wang@mediatek.com>
Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
2020-11-03 11:08:15 +08:00
Todd Kjos
7a0b784363 ANDROID: Fix build-break caused by android_rvh_nf_conn_alloc hook
The new android_rvh_nf_conn_alloc hook was not declared properly
so kernelci builds break if !CONFIG_ANDROID_VENDOR_HOOKS.

Fixes: 01435b2e91 ("ANDROID: GKI: net: add vendor hooks
for 'struct nf_conn' lifecycle")
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: I1208dc440836687a9c5621323ff1cf5a5bec862b
2020-11-02 23:40:43 +00:00
Alistair Delva
23277e6506 ANDROID: GKI: Enable DEBUG_INFO_DWARF4
This is useful for debuggers, and is already the default for clang
(incidentally). Make sure it is on for all users/compilers.

Bug: 160841764
Change-Id: Ibb9a0c6900728d4cce3eccb57fb4c38268a89f24
Signed-off-by: Alistair Delva <adelva@google.com>
2020-11-02 19:24:27 +00:00
Sami Tolvanen
d0dc5d8586 ANDROID: cfi: ensure RCU is watching in __cfi_slowpath
Indirect calls can happen when RCU is not watching, so we need to wake
it up again for the CFI shadow and __module_address. As these calls can
happen anywhere, use rcu_nmi_enter() similarly to kernel_text_address(),
and switch to rcu_read_lock_sched() for shadow access.

Bug: 169017431
Change-Id: Iebb857df898e644b4952a62d86fa5ff9852b5711
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2020-11-02 18:55:52 +00:00
Daniel Vetter
77bc008d89 UPSTREAM: mm/sl[uo]b: export __kmalloc_track(_node)_caller
slab does this already, and I want to use this in a memory allocation
tracker in drm for stuff that's tied to the lifetime of a drm_device,
not the underlying struct device. Kinda like devres, but for drm.

Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
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>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-2-daniel.vetter@ffwll.ch
(cherry picked from commit fd7cb5753ef49964ea9db5121c3fc9a4ec21ed8e)
Bug: 163141236
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: I10790befc779311a5f2ee441e4d073e51a5a7a62
2020-11-02 16:12:00 +00:00
Dmitry Safonov
a7982ced0c BACKPORT: xfrm/compat: Translate 32-bit user_policy from sockptr
Provide compat_xfrm_userpolicy_info translation for xfrm setsocketopt().
Reallocate buffer and put the missing padding for 64-bit message.

Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit 96392ee5a13b992563cfe07d23ee30d333b89126)
[adelva: Edited around removed compat check in Android kernels]
Bug: 163141236
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: I32a6495cd92fa13c956fca88aa5d80716155b8ae
2020-11-02 15:48:58 +00:00
Dmitry Safonov
6a2b428110 UPSTREAM: xfrm/compat: Add 32=>64-bit messages translator
Provide the user-to-kernel translator under XFRM_USER_COMPAT, that
creates for 32-bit xfrm-user message a 64-bit translation.
The translation is afterwards reused by xfrm_user code just as if
userspace had sent 64-bit message.

Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit 5106f4a8acff480e244300bc5097c0ad7048c3a2)
Bug: 163141236
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: If15999b86e4704b75307fbcc3d7f0c8d8bc89e7a
2020-11-02 15:48:50 +00:00
Dmitry Safonov
da1cd0d7ab UPSTREAM: xfrm/compat: Attach xfrm dumps to 64=>32 bit translator
Currently nlmsg_unicast() is used by functions that dump structures that
can be different in size for compat tasks, see dump_one_state() and
dump_one_policy().

The following nlmsg_unicast() users exist today in xfrm:

         Function                          |    Message can be different
                                           |       in size on compat
-------------------------------------------|------------------------------
    xfrm_get_spdinfo()                     |               N
    xfrm_get_sadinfo()                     |               N
    xfrm_get_sa()                          |               Y
    xfrm_alloc_userspi()                   |               Y
    xfrm_get_policy()                      |               Y
    xfrm_get_ae()                          |               N

Besides, dump_one_state() and dump_one_policy() can be used by filtered
netlink dump for XFRM_MSG_GETSA, XFRM_MSG_GETPOLICY.

Just as for xfrm multicast, allocate frag_list for compat skb journey
down to recvmsg() which will give user the desired skb according to
syscall bitness.

Signed-off-by: Dmitry Safonov <dima@arista.com>

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit 5f3eea6b7e8f58cf5c8a9d4b9679dc19e9e67ba3)
Bug: 163141236
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: Id1a606ddd9d7dfe73a448eeb252b1bfd8dbd2fcb
2020-11-02 15:48:41 +00:00
Dmitry Safonov
1d5f89e524 UPSTREAM: xfrm/compat: Add 64=>32-bit messages translator
Provide the kernel-to-user translator under XFRM_USER_COMPAT, that
creates for 64-bit xfrm-user message a 32-bit translation and puts it
in skb's frag_list. net/compat.c layer provides MSG_CMSG_COMPAT to
decide if the message should be taken from skb or frag_list.
(used by wext-core which has also an ABI difference)

Kernel sends 64-bit xfrm messages to the userspace for:
- multicast (monitor events)
- netlink dumps

Wire up the translator to xfrm_nlmsg_multicast().

Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit 5461fc0c8d9f23956b99f5907f69726a293ccb67)
Bug: 163141236
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: Id8b59587d60feb9b9f0ce96be9d140d694573fe3
2020-11-02 15:48:33 +00:00
Dmitry Safonov
1fa8e68398 BACKPORT: xfrm: Provide API to register translator module
Add a skeleton for xfrm_compat module and provide API to register it in
xfrm_state.ko. struct xfrm_translator will have function pointers to
translate messages received from 32-bit userspace or to be sent to it
from 64-bit kernel.
module_get()/module_put() are used instead of rcu_read_lock() as the
module will vmalloc() memory for translation.
The new API is registered with xfrm_state module, not with xfrm_user as
the former needs translator for user_policy set by setsockopt() and
xfrm_user already uses functions from xfrm_state.

Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit c9e7c76d70fa50582ca96759829c93d0dd024662)
[adelva: Edited around some context changes]
Bug: 163141236
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: Ic825c6a0367fa192cc3f7af6b7d2682ef8f9d58b
2020-11-02 15:48:23 +00:00
Jeehong Kim
a10e83bb35 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, 9 Added functions
 Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 1 Added variable

 9 Added functions:

   [A] 'function char* kstrdup_quotable(const char*, gfp_t)'
   [A] 'function void netdev_state_change(net_device*)'
   [A] 'function int param_get_uint(char*, const kernel_param*)'
   [A] 'function int public_key_verify_signature(const public_key*, const public_key_signature*)'
   [A] 'function void tty_encode_baud_rate(tty_struct*, speed_t, speed_t)'
   [A] 'function int tty_termios_hw_change(const ktermios*, const ktermios*)'
   [A] 'function void usbnet_cdc_unbind(usbnet*, usb_interface*)'
   [A] 'function void usbnet_device_suggests_idle(usbnet*)'
   [A] 'function int usbnet_generic_cdc_bind(usbnet*, usb_interface*)'

 1 Added variable:

   [A] 'const ipv6_stub* ipv6_stub'

Bug: 171954519

Signed-off-by: Jeehong Kim <jhez.kim@samsung.com>
Change-Id: I9066e222d3e30a9434d36c22e4e77159bd57a347
2020-11-02 16:55:00 +09:00
Greg Kroah-Hartman
ea5b4af68f ANDROID: Update the KMI_GENERATION after KMI changes on October 31
The KMI was changed by several patches on October 31.  Update the
generation number to notify all tools of this.

Bug: 161946584
Cc: Todd Kjos <tkjos@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5d96ec5e4fe3ead9aedf19bdedf731b3ee28746a
2020-10-31 12:37:57 +01:00
Greg Kroah-Hartman
40799f06ce ANDROID: Input: bump SW_MAX up to 0x3f
Bump the userspace-facing value of SW_MAX from 0x10 to 0x3f, allowing
out-of-tree input drivers to use the increased space to send input codes
to userspace safely.

Note, there are no new reserved input code values, so any out-of-tree
numbers are not guaranteed to ever remain stable over time, but this
allows those drivers to work properly before they get merged upstream to
claim a reserved number.

Be aware that if you use this increased numberspace, your values will
change going forward to new Android and kernel versions, you have been
warned.

This gives us the free-space for 0x2f new values, which should be enough
for a few years grace-period :)

This changes the CRC of a number of functions, but no variable sizes
have changed:

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

36 functions with some sub-type change:

  [C] 'function cec_adapter* cec_allocate_adapter(const cec_adap_ops*, void*, const char*, u32, u8)' at cec-core.c:253:1 has some sub-type changes:
  [C] 'function void cec_delete_adapter(cec_adapter*)' at cec-core.c:431:1 has some sub-type changes:
  [C] 'function void cec_received_msg_ts(cec_adapter*, cec_msg*, ktime_t)' at cec-adap.c:1036:1 has some sub-type changes:
  [C] 'function int cec_register_adapter(cec_adapter*, device*)' at cec-core.c:342:1 has some sub-type changes:
  [C] 'function void cec_s_phys_addr(cec_adapter*, unsigned short int, bool)' at cec.h:279:1 has some sub-type changes:
  [C] 'function void cec_s_phys_addr_from_edid(cec_adapter*, const edid*)' at cec-adap.c:1616:1 has some sub-type changes:
  [C] 'function void cec_transmit_attempt_done_ts(cec_adapter*, u8, ktime_t)' at cec-adap.c:688:1 has some sub-type changes:
  [C] 'function void cec_transmit_done_ts(cec_adapter*, u8, u8, u8, u8, u8, ktime_t)' at cec-adap.c:591:1 has some sub-type changes:
  [C] 'function void cec_unregister_adapter(cec_adapter*)' at cec-core.c:412:1 has some sub-type changes:
  [C] 'function input_dev* devm_input_allocate_device(device*)' at input.h:352:1 has some sub-type changes:
  [C] 'function void input_alloc_absinfo(input_dev*)' at input.h:466:1 has some sub-type changes:
  [C] 'function input_dev* input_allocate_device()' at input.h:351:1 has some sub-type changes:
  [C] 'function void input_close_device(input_handle*)' at input.h:404:1 has some sub-type changes:
  [C] 'function void input_event(input_dev*, unsigned int, unsigned int, int)' at input.h:411:1 has some sub-type changes:
  [C] 'function int input_ff_create(input_dev*, unsigned int)' at input.h:555:1 has some sub-type changes:
  [C] 'function int input_ff_create_memless(input_dev*, void*, int (input_dev*, void*, ff_effect*)*)' at input.h:564:1 has some sub-type changes:
  [C] 'function void input_ff_destroy(input_dev*)' at input.h:556:1 has some sub-type changes:
  [C] 'function void input_free_device(input_dev*)' at input.h:353:1 has some sub-type changes:
  [C] 'function void input_mt_destroy_slots(input_dev*)' at mt.h:78:1 has some sub-type changes:
  [C] 'function int input_mt_get_slot_by_key(input_dev*, int)' at mt.h:122:1 has some sub-type changes:
  [C] 'function int input_mt_init_slots(input_dev*, unsigned int, unsigned int)' at mt.h:76:1 has some sub-type changes:
  [C] 'function void input_mt_report_pointer_emulation(input_dev*, bool)' at mt.h:104:1 has some sub-type changes:
  [C] 'function bool input_mt_report_slot_state(input_dev*, unsigned int, bool)' at mt.h💯1 has some sub-type changes:
  [C] 'function void input_mt_sync_frame(input_dev*)' at mt.h:107:1 has some sub-type changes:
  [C] 'function int input_open_device(input_handle*)' at input.h:403:1 has some sub-type changes:
  [C] 'function int input_register_device(input_dev*)' at input.h:376:1 has some sub-type changes:
  [C] 'function int input_register_handle(input_handle*)' at input.h:397:1 has some sub-type changes:
  [C] 'function int input_register_handler(input_handler*)' at input.h:387:1 has some sub-type changes:
  [C] 'function void input_set_abs_params(input_dev*, unsigned int, int, int, int, int)' at input.h:467:1 has some sub-type changes:
  [C] 'function void input_set_capability(input_dev*, unsigned int, unsigned int)' at input.h:449:1 has some sub-type changes:
  [C] 'function void input_unregister_device(input_dev*)' at input.h:377:1 has some sub-type changes:
  [C] 'function void input_unregister_handle(input_handle*)' at input.h:398:1 has some sub-type changes:
  [C] 'function void input_unregister_handler(input_handler*)' at input.h:388:1 has some sub-type changes:
  [C] 'function int snd_jack_new(snd_card*, const char*, int, snd_jack**, bool, bool)' at jack.c:198:1 has some sub-type changes:
  [C] 'function void snd_jack_report(snd_jack*, int)' at jack.c:340:1 has some sub-type changes:
  [C] 'function int snd_jack_set_key(snd_jack*, snd_jack_types, int)' at jack.c:317:1 has some sub-type changes:

Bug: 170534200
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I28c8b49ac37f42d3ff89554e18fe042a44f5704a
2020-10-31 12:21:18 +01:00
Greg Kroah-Hartman
d1f4f1327d ANDROID: GKI: ABI update for Oct 31 KABI break
Leaf changes summary: 3380 artifacts changed (154 filtered out)
Changed leaf types summary: 282 (120 filtered out) leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 3052 Changed (32 filtered out), 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 46 Changed (2 filtered out), 0 Added variable

3052 functions with some sub-type change:
46 Changed variables:
'struct dentry_operations at dcache.h:139:1' changed:
  type size hasn't changed
  1 data member insertion:
    'void (const path*, path*)* dentry_operations::d_canonical_path', at offset 832 (in bits) at dcache.h:154:1
  there are data member changes:
    'u64 dentry_operations::android_kabi_reserved1' offset changed from 832 to 896 (in bits) (by +64 bits)
    'u64 dentry_operations::android_kabi_reserved2' offset changed from 896 to 960 (in bits) (by +64 bits)
    'u64 dentry_operations::android_kabi_reserved3' offset changed from 960 to 1024 (in bits) (by +64 bits)
    'u64 dentry_operations::android_kabi_reserved4' offset changed from 1024 to 1088 (in bits) (by +64 bits)
  3330 impacted interfaces

'struct inet_connection_sock at inet_connection_sock.h:87:1' changed (indirectly):
  type size changed from 11840 to 11904 (in bits)
  there are data member changes:
    type 'struct inet_sock' of 'inet_connection_sock::icsk_inet' changed:
      type size changed from 8320 to 8384 (in bits)
      there are data member changes:
        type 'struct sock' of 'inet_sock::sk' changed:
          type size changed from 6656 to 6720 (in bits)
          1 data member insertion:
            'u64 sock::android_vendor_data1', at offset 6656 (in bits) at sock.h:526:1
          422 impacted interfaces
        'ipv6_pinfo* inet_sock::pinet6' offset changed from 6656 to 6720 (in bits) (by +64 bits)
        '__be32 inet_sock::inet_saddr' offset changed from 6720 to 6784 (in bits) (by +64 bits)
        '__s16 inet_sock::uc_ttl' offset changed from 6752 to 6816 (in bits) (by +64 bits)
        '__u16 inet_sock::cmsg_flags' offset changed from 6768 to 6832 (in bits) (by +64 bits)
        '__be16 inet_sock::inet_sport' offset changed from 6784 to 6848 (in bits) (by +64 bits)
        '__u16 inet_sock::inet_id' offset changed from 6800 to 6864 (in bits) (by +64 bits)
        'ip_options_rcu* inet_sock::inet_opt' offset changed from 6848 to 6912 (in bits) (by +64 bits)
        'int inet_sock::rx_dst_ifindex' offset changed from 6912 to 6976 (in bits) (by +64 bits)
        '__u8 inet_sock::tos' offset changed from 6944 to 7008 (in bits) (by +64 bits)
        '__u8 inet_sock::min_ttl' offset changed from 6952 to 7016 (in bits) (by +64 bits)
        '__u8 inet_sock::mc_ttl' offset changed from 6960 to 7024 (in bits) (by +64 bits)
        '__u8 inet_sock::pmtudisc' offset changed from 6968 to 7032 (in bits) (by +64 bits)
        '__u8 inet_sock::nodefrag' offset changed from 6976 to 7040 (in bits) (by +64 bits)
        '__u8 inet_sock::rcv_tos' offset changed from 6992 to 7056 (in bits) (by +64 bits)
        '__u8 inet_sock::convert_csum' offset changed from 7000 to 7064 (in bits) (by +64 bits)
        'int inet_sock::uc_index' offset changed from 7008 to 7072 (in bits) (by +64 bits)
        'int inet_sock::mc_index' offset changed from 7040 to 7104 (in bits) (by +64 bits)
        '__be32 inet_sock::mc_addr' offset changed from 7072 to 7136 (in bits) (by +64 bits)
        'ip_mc_socklist* inet_sock::mc_list' offset changed from 7104 to 7168 (in bits) (by +64 bits)
        'inet_cork_full inet_sock::cork' offset changed from 7168 to 7232 (in bits) (by +64 bits)
      2 impacted interfaces
    'request_sock_queue inet_connection_sock::icsk_accept_queue' offset changed from 8320 to 8384 (in bits) (by +64 bits)
    'inet_bind_bucket* inet_connection_sock::icsk_bind_hash' offset changed from 8960 to 9024 (in bits) (by +64 bits)
    'unsigned long int inet_connection_sock::icsk_timeout' offset changed from 9024 to 9088 (in bits) (by +64 bits)
    'timer_list inet_connection_sock::icsk_retransmit_timer' offset changed from 9088 to 9152 (in bits) (by +64 bits)
    'timer_list inet_connection_sock::icsk_delack_timer' offset changed from 9536 to 9600 (in bits) (by +64 bits)
    '__u32 inet_connection_sock::icsk_rto' offset changed from 9984 to 10048 (in bits) (by +64 bits)
    '__u32 inet_connection_sock::icsk_pmtu_cookie' offset changed from 10016 to 10080 (in bits) (by +64 bits)
    'const tcp_congestion_ops* inet_connection_sock::icsk_ca_ops' offset changed from 10048 to 10112 (in bits) (by +64 bits)
    'const inet_connection_sock_af_ops* inet_connection_sock::icsk_af_ops' offset changed from 10112 to 10176 (in bits) (by +64 bits)
    'const tcp_ulp_ops* inet_connection_sock::icsk_ulp_ops' offset changed from 10176 to 10240 (in bits) (by +64 bits)
    'void* inet_connection_sock::icsk_ulp_data' offset changed from 10240 to 10304 (in bits) (by +64 bits)
    'void (sock*, typedef u32)* inet_connection_sock::icsk_clean_acked' offset changed from 10304 to 10368 (in bits) (by +64 bits)
    'hlist_node inet_connection_sock::icsk_listen_portaddr_node' offset changed from 10368 to 10432 (in bits) (by +64 bits)
    'unsigned int (sock*, typedef u32)* inet_connection_sock::icsk_sync_mss' offset changed from 10496 to 10560 (in bits) (by +64 bits)
    '__u8 inet_connection_sock::icsk_ca_dst_locked' offset changed from 10560 to 10624 (in bits) (by +64 bits)
    '__u8 inet_connection_sock::icsk_retransmits' offset changed from 10568 to 10632 (in bits) (by +64 bits)
    '__u8 inet_connection_sock::icsk_pending' offset changed from 10576 to 10640 (in bits) (by +64 bits)
    '__u8 inet_connection_sock::icsk_backoff' offset changed from 10584 to 10648 (in bits) (by +64 bits)
    '__u8 inet_connection_sock::icsk_syn_retries' offset changed from 10592 to 10656 (in bits) (by +64 bits)
    '__u8 inet_connection_sock::icsk_probes_out' offset changed from 10600 to 10664 (in bits) (by +64 bits)
    '__u16 inet_connection_sock::icsk_ext_hdr_len' offset changed from 10608 to 10672 (in bits) (by +64 bits)
    'struct {__u8 pending; __u8 quick; __u8 pingpong; __u8 blocked; __u32 ato; unsigned long int timeout; __u32 lrcvtime; __u16 last_seg_size; __u16 rcv_mss;} inet_connection_sock::icsk_ack' offset changed from 10624 to 10688 (in bits) (by +64 bits)
    'struct {int enabled; int search_high; int search_low; int probe_size; u32 probe_timestamp;} inet_connection_sock::icsk_mtup' offset changed from 10816 to 10880 (in bits) (by +64 bits)
    'u32 inet_connection_sock::icsk_user_timeout' offset changed from 10976 to 11040 (in bits) (by +64 bits)
    'u64 inet_connection_sock::icsk_ca_priv[13]' offset changed from 11008 to 11072 (in bits) (by +64 bits)
  2 impacted interfaces

'struct module at module.h:354:1' changed:
  type size hasn't changed
  1 data member insertion:
    'bool module::using_gplonly_symbols', at offset 2688 (in bits) at module.h:385:1
  there are data member changes:
    anonymous data member union {module_kabi_preserve_1 m1; struct {u64 android_kabi_reserved1;} __UNIQUE_ID_android_kabi_hide201; union {};} at offset 6848 (in bits) became data member 'u64 module::android_kabi_reserved1'
    'bool module::sig_ok' offset changed from 2688 to 2696 (in bits) (by +8 bits)
    'bool module::async_probe_requested' offset changed from 2696 to 2704 (in bits) (by +8 bits)
  3330 impacted interfaces

'struct nf_conn at nf_conntrack.h:58:1' changed:
  type size changed from 2048 to 2240 (in bits)
  3 data member insertions:
    'u64 nf_conn::android_kabi_reserved1', at offset 2048 (in bits) at nf_conntrack.h:111:1
    'u64 nf_conn::android_kabi_reserved2', at offset 2112 (in bits) at nf_conntrack.h:112:1
    'u64 nf_conn::android_vendor_data1', at offset 2176 (in bits) at nf_conntrack.h:114:1
  422 impacted interfaces

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iec13bb17711b4337d6810b6eac45f755497c6ed8
2020-10-31 09:36:21 +01:00
Greg Kroah-Hartman
95dc566101 ANDROID: GKI: add Android ABI padding to struct nf_conn
Try to mitigate potential future driver core api changes by adding
padding to struct nf_conn;

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ib18a9a929d351c66556f1f27b217cbf22b733a10
2020-10-31 09:30:20 +01:00
Greg Kroah-Hartman
0709341102 ANDROID: GKI: add vendor padding variable in struct skb_shared_info
Some vendors want to add things to 'struct skb_shared_info', so give
them an array to place their data.

Bug: 171013716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ifaa5942550794b747e9624124c785a0bc85dfe17
2020-10-31 09:30:20 +01:00
Greg Kroah-Hartman
01435b2e91 ANDROID: GKI: net: add vendor hooks for 'struct nf_conn' lifecycle
Some vendors want to add a field when a 'sruct nf_conn' is added so give a
hook to handle this.  Any memory allocated when
trace_android_rvh_nf_conn_alloc() is called needs to be freed when
trace_android_rvh_nf_conn_free() is called.

Note, if trace_android_rvh_nf_conn_alloc() fails, be sure to be able to
handle this in trace_android_rvh_nf_conn_free(), but that should not be
an issue as that needs to be addressed in vendor code that runs for
'struct nf_conn' objects that have been created before the vendor code
is loaded no matter what.

Bug: 171013716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I67a9be129150690f8c1961accf7d5cdf0d5d50cc
2020-10-30 10:02:26 +01:00
Greg Kroah-Hartman
0bc7257c7f ANDROID: GKI: add vendor padding variable in struct nf_conn
Some vendors want to add things to 'struct nf_conn', so give them a u64
where they can then have a pointer off to their private data and they
can do whatever they want to do without breaking or changing any abi for
anyone else.

Note, usually an android trace hook is also needed to use this properly,
so be aware that this will be required as well.

Bug: 171013716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I303d237116f2f1ef6035af98f00436278ec1c23b
2020-10-30 10:02:26 +01:00
Greg Kroah-Hartman
20dd49792a ANDROID: GKI: net: add vendor hooks for 'struct sock' lifecycle
Some vendors want to add a field when a 'sruct sock' is added so give a
hook to handle this.  Any memory allocated when
trace_android_rvh_sk_alloc() is called needs to be freed when
trace_android_rvh_sk_free() is called.

Note, if trace_android_rvh_sk_alloc() fails, be sure to be able to
handle this in trace_android_rvh_sk_free(), but that should not be an
issue as that needs to be addressed in vendor code that runs for 'struct
sock' objects that have been created before the vendor code is loaded no
matter what.

Bug: 171013716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I9ed93e8bffef3cd8fbde4d62fc14596764a85304
2020-10-30 10:02:26 +01:00
Greg Kroah-Hartman
b3d5bbd878 ANDROID: GKI: add vendor padding variable in struct sock
Some vendors want to add things to 'struct sock', so give them a u64
where they can then have a pointer off to their private data and they
can do whatever they want to do without breaking or changing any abi for
anyone else.

Note, usually an android trace hook is also needed to use this properly,
so be aware that this will be required as well.

Bug: 171013716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I8fdea13b185fba26010e2a2bf397d7982a8fa16e
2020-10-30 10:02:26 +01:00
Daniel Rosenberg
24ab59f6bb ANDROID: fuse: Add support for d_canonical_path
Allows FUSE to report to inotify that it is acting
as a layered filesystem. The userspace component
returns a string representing the location of the
underlying file. If the string cannot be resolved
into a path, the top level path is returned instead.

Bug: 23904372
Bug: 171780975
Test: inotify on cuttlefish
Change-Id: Iabdca0bbedfbff59e9c820c58636a68ef9683d9f
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-10-30 10:02:26 +01:00
Alessio Balsini
854f380681 ANDROID: vfs: add d_canonical_path for stacked filesystem support
Inotify does not currently know when a filesystem
is acting as a wrapper around another fs. This means
that inotify watchers will miss any modifications to
the base file, as well as any made in a separate
stacked fs that points to the same file.
d_canonical_path solves this problem by allowing the fs
to map a dentry to a path in the lower fs. Inotify
can use it to find the appropriate place to watch to
be informed of all changes to a file.

Test: HiKey/X15 + Pie + android-mainline,
      and HiKey + AOSP Maser + android-mainline,
      directories under /sdcard created,
      output of mount is right,
      CTS test collecting device infor works

Bug: 171780975
Change-Id: I09563baffad1711a045e45c1bd0bd8713c2cc0b6
Signed-off-by: Daniel Rosenberg <drosen@google.com>
[astrachan: Folded 34df4102216e ("ANDROID: fsnotify: Notify lower fs of
            open") into this patch]
Signed-off-by: Alistair Strachan <astrachan@google.com>
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-10-30 10:02:25 +01:00
Eric Biggers
aa445f97a0 ANDROID: fscrypt: prevent fscrypt_operations from affecting KMI
'struct fscrypt_operations' is only used by fs/crypto/ (which is always
built-in) and by three filesystems (which are either built-in to GKI, in
the case of ext4 and f2fs, or aren't supported by Android, in the case
of ubifs).  The only way a loadable module could use fscrypt_operations
is if the module were a filesystem that used fs/crypto/, which isn't
possible since KMI symbol list doesn't include anything in fs/crypto/.

However, any change to struct fscrypt_operations changes the symbol CRC
of most of the KMI functions exported by any files fs/*.c that include
<linux/fscrypt.h>.  This is because the definition of fscrypt_operations
is visible to them, and in principle it's possible to get to
fscrypt_operations from most VFS structs (e.g. inode->i_sb->s_cop), even
though there's no reason to do so outside the crypto code.

Work around this by putting the definition of struct fscrypt_operations
behind #ifdef FSCRYPT_NEED_OPS, and only defining this in the files that
actually need the definition.  (It could be moved into a separate header
instead, but this way keeps the diff from upstream smaller.)

This will cause a one-time CRC change of all the affected KMI functions,
but afterwards any changes to fscrypt_operations won't "break the KMI".

Bug: 170265596
Test: re-generated the ABI, changed struct fscrypt_operations (and
      struct fscrypt_info as well, just in case), re-generated the ABI
      again, and verified it didn't change.
Change-Id: Ib5dd49550aec81a64b3d6077a0aeb5747be908ff
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-10-30 10:02:25 +01:00
Greg Kroah-Hartman
d2a52d0eaa Revert "ANDROID: GKI: fix ABI breakage in module.h"
This reverts commit db96212bde as it is
not needed if we are able to update the Android KABI.

Fixes: db96212bde ("ANDROID: GKI: fix ABI breakage in module.h")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ic6f4f449e554240457e1f94c49b53fa158f0d00e
2020-10-30 10:02:25 +01:00
Greg Kroah-Hartman
a273b843ac ANDROID: ABI: update allowed list for galaxy
Update Galaxy list of symbols with ones that are already in the .xml
file to make further patches much smaller and easier to review.

Bug: 171954519
Cc: Jeehong Kim <jhez.kim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ic30a89e6254cddb7669a473e06263d2aef8f9703
2020-10-29 17:42:30 +01:00
Sangmoon Kim
6ca1e28c7f FROMLIST: char: misc: increase DYNAMIC_MINORS value
DYNAMIC_MINORS value has been set to 64.
Due to this reason, we are facing a module loading fail problem of
device driver like below.

 [   45.712771] pdic_misc_init - return error : -16

We need to increase this value for registering more misc devices.

Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>

Bug: 171370390
Link: https://lore.kernel.org/lkml/20201029070552.GA3062343@kroah.com/
Change-Id: I04ab486ce7674dde3118506c3d783f0e4e211bac
Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
2020-10-29 17:07:39 +09:00
Wei Wang
874de1d962 ANDROID: GKI: enable CONFIG_CPU_FREQ_STAT and more thermal configs
Bug: 170274669
Bug: 169727445
Bug: 171854825
Signed-off-by: Wei Wang <wvw@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I20d2848b97d2c3d1d80ad8c6d61d6de2cf306153
2020-10-28 12:18:07 +01:00
Kishore Sri venkata Ganesh Bolisetty
b90aa177cb ANDROID: ABI: Update allowed list for QCOM
Add the following symbols to QCOM allowed-list:
-- cpufreq_get_policy

Bug: 171781675
Change-Id: I11699b631dc61b6ddcb245ae3f01ae41ee1314c7
Signed-off-by: Kishore Sri venkata Ganesh Bolisetty <bsrivenk@codeaurora.org>
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2020-10-27 17:23:27 -07:00
YT Chang
54cf84a595 ANDROID: sched: add restrict vendor hook to modify load balance behavior
For modifying load balance policy, we add the hook on
find_busiest_group().
It allows us to modify load balance paths.

Bug: 168248326
Signed-off-by: YT Chang <yt.chang@mediatek.com>
Change-Id: I77ec043576139806551b978eb1bdf9f637442dfb
(cherry picked from commit a2ca8408de6183364b4c17f341f06e875bc7a1c1)
(cherry picked from commit 489646b879ede582b6b00803edd3f777aede4d85)
2020-10-27 15:11:50 +00:00
Peter Wuw
42a391fef2 ANDROID: GKI: Update abi_gki_aarch64_oneplus
Add some symbols to symbol list included by oem modules.

Bug: 165594476
Change-Id: I2ce478cf2fff9d570122910cc4007523afc8fa9f
Signed-off-by: Peter Wuw <peter.wuw@oneplus.com>
2020-10-27 11:56:40 +08:00
Sami Tolvanen
1eb128820e ANDROID: scs: use vmapped shadow stacks by default
Enable CONFIG_SHADOW_CALL_STACK_VMAP by default, and as we allocate
a full page for the stack, allow the kernel use all of it.

Bug: 169781940
Change-Id: Ie8eaa7f24e9bf10ff28a302ac98ad843b71c9c2a
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2020-10-26 19:41:02 +00:00
Archana Sriram
b494bbca7a ANDROID: ABI: update allowed list for QCOM
Update the android/abi_gki_aarch64_qcom with recent symbol additions.

Simple change and no need to update the .xml file, as no new symbol
addition.

Bug: 171693478
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
Change-Id: Ic105f1f4d3c3409c461e49035cad5806f5fce22c
2020-10-26 22:48:05 +05:30
Patrick Bellasi
d82457153c UPSTREAM: sched/fair/util_est: Implement faster ramp-up EWMA on utilization increases
The estimated utilization for a task:

   util_est = max(util_avg, est.enqueue, est.ewma)

is defined based on:

 - util_avg: the PELT defined utilization
 - est.enqueued: the util_avg at the end of the last activation
 - est.ewma:     a exponential moving average on the est.enqueued samples

According to this definition, when a task suddenly changes its bandwidth
requirements from small to big, the EWMA will need to collect multiple
samples before converging up to track the new big utilization.

This slow convergence towards bigger utilization values is not
aligned to the default scheduler behavior, which is to optimize for
performance. Moreover, the est.ewma component fails to compensate for
temporarely utilization drops which spans just few est.enqueued samples.

To let util_est do a better job in the scenario depicted above, change
its definition by making util_est directly follow upward motion and
only decay the est.ewma on downward.

Bug: 120440300
Signed-off-by: Patrick Bellasi <patrick.bellasi@matbug.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Douglas Raillard <douglas.raillard@arm.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Quentin Perret <qperret@google.com>
Cc: Rafael J . Wysocki <rafael.j.wysocki@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20191023205630.14469-1-patrick.bellasi@matbug.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit b8c96361402aa3e74ad48ceef18aed99153d8da8)
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: Iaa75dec917748375d9043c3ebf21bf272299c8dd
2020-10-26 12:24:35 +00:00
hajun.sung
58e01352ee ANDROID: GKI: Update abi_gki_aarch64_exynos
Leaf changes summary: 1 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, 1 Added variable

1 Added variable:

  [A] 'tracepoint __tracepoint_gpu_mem_total'

Bug: 171536491

Change-Id: I2334f11828c2637c1a85cb7391ef7f4fb2fec902
Signed-off-by: hajun.sung <hajun.sung@samsung.com>
2020-10-23 15:35:44 +00:00
Sami Tolvanen
e675b8a59a ANDROID: kbuild: disable GCOV with CFI
With GCOV enabled, LLVM generates calls to compiler-generated
__llvm_gcov_* functions, but doesn't add them to the CFI jump
table, which trips indirect call checking. Work around the issue
by disabling CFI when GCOV_KERNEL is enabled.

Bug: 169124292
Change-Id: Ifd60cd9eda2bcdd86838ac5ce41bb0dbc00d602f
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
(cherry picked from commit 93a4197bc23a4a6967ff0592d07f3cf4cd69b1d6)
2020-10-23 06:43:31 +00:00
Chanho Park
39133635c5 ANDROID: GKI: add built-in PCIE_DW_PLAT_EP
To build an EP driver which is based on PCIe designware as module, we
need to get some symbols from pcie-designware_ep.c. To select the
source from GKI kernel, we should enable PCIE_DW_PLAT_EP driver as
prebuilt.

Bug: 167931570

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Change-Id: I12f796cb35794e29d1fa425d26e2c9ee2c855da2
2020-10-23 08:44:15 +09:00
Chanho Park
cea56b5c10 ANDROID: PCI: dwc: export symbols for ep driver
Export symbols for building Designware PCIe EP driver as kernel module.
Partially cherry-picked for EXPORT_SYMBOL_GPL part from below patch.

c57247f940e8 ("PCI: tegra: Add support for PCIe endpoint mode in Tegra194")

Bug: 167931570
(partial backport of commit c57247f940e8ea13a0ec33378304dc3cdc5da4a8.
 Didn't backport entier patch because it requires below two precedence
 patchset to avoid patch conflict.
 "Add support to defer core initialization" by Vidya
 "Improvements to PCIe Endpoint Core" by Kishon)
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Change-Id: I4df622d67d4202c650abff6c424d1e3cb30408e2
2020-10-23 08:44:15 +09:00
Danesh Petigara
2f397d4f68 ANDROID: recordmcount: avoid STT_FILE as base for mcount offset relocation
This problem was observed with a kernel built using clang and
LTO.

When the section header index of a section that contains mcount
calls coincides with SHN_ABS, recordmcount ends up selecting a
STT_FILE symbol as the base for mcount offset relocation. Since
the STT_FILE symbol value is 0, it's not a suitable candidate as
the base for relocation and results in the __mcount_loc table
containing an invalid entry causing kernel oops in ftrace_init():

[    0.000000] ftrace: allocating 45789 entries in 179 pages
[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 0 PID: 0 at arch/arm64/kernel/ftrace.c:172 ftrace_make_nop+0x11c/0x150
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.4.69-0-1pre+ #1
[    0.000000] Hardware name: BCM972180HB_V20 (DT)
[    0.000000] pstate: 20400085 (nzCv daIf +PAN -UAO)
[    0.000000] pc : ftrace_make_nop+0x11c/0x150
[    0.000000] lr : ftrace_make_nop+0x5c/0x150
[    0.000000] sp : ffffffc011a43ef0
[    0.000000] x29: ffffffc011a43f00 x28: 0000000000000001
[    0.000000] x27: ffffff8027801380 x26: 0000000000000000
[    0.000000] x25: ffffff8027880008 x24: 0000000000000000
[    0.000000] x23: 0000000000000000 x22: 0000000000000008
[    0.000000] x21: ffffffc010f5acdc x20: 0000000000000000
[    0.000000] x19: 0000000000000020 x18: ffffffc011a79020
[    0.000000] x17: 000000000000003c x16: 0000000000000022
[    0.000000] x15: dead000000000100 x14: 0000000000000001
[    0.000000] x13: 0000000000000000 x12: 0000000000000000
[    0.000000] x11: 0000000000000000 x10: 0000000008000000
[    0.000000] x9 : 0000000000000002 x8 : 0000000000000001
[    0.000000] x7 : 0000000000000000 x6 : 000000000000003f
[    0.000000] x5 : 00000000000235b8 x4 : 0000000000000001
[    0.000000] x3 : 0000000000000001 x2 : ffffffc010f5acdc
[    0.000000] x1 : ffffff8027880000 x0 : 0000000000000001
[    0.000000] Call trace:
[    0.000000]  ftrace_make_nop+0x11c/0x150
[    0.000000]  ftrace_process_locs+0x338/0x3e0
[    0.000000]  ftrace_init+0xac/0xdc
[    0.000000]  start_kernel+0x194/0x43c
[    0.000000] random: get_random_bytes called from __warn+0xe0/0x138 with crng_init=0
[    0.000000] ---[ end trace a8999690c4edae16 ]---
[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 0 PID: 0 at kernel/trace/ftrace.c:2008 ftrace_bug+0x94/0x268
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G        W         5.4.69-0-1pre+ #1
[    0.000000] Hardware name: BCM972180HB_V20 (DT)
[    0.000000] pstate: 60400085 (nZCv daIf +PAN -UAO)
[    0.000000] pc : ftrace_bug+0x94/0x268
[    0.000000] lr : ftrace_process_locs+0x364/0x3e0
[    0.000000] sp : ffffffc011a43ef0
[    0.000000] x29: ffffffc011a43ef0 x28: 0000000000000001
[    0.000000] x27: ffffff8027801380 x26: 0000000000000000
[    0.000000] x25: ffffff8027880008 x24: 0000000000000000
[    0.000000] x23: 0000000000000000 x22: 0000000000000008
[    0.000000] x21: ffffffc010f5acdc x20: 0000000000000020
[    0.000000] x19: ffffff8027880000 x18: ffffffc011a79020
[    0.000000] x17: 000000000000003c x16: 0000000000000022
[    0.000000] x15: dead000000000100 x14: 0000000000000001
[    0.000000] x13: 0000000000000000 x12: ffffffc010f5ed94
[    0.000000] x11: ffffffc011a4f000 x10: ffffffc011a4f000
[    0.000000] x9 : 0000000000000001 x8 : ffffffc011a4f000
[    0.000000] x7 : 0000000000000000 x6 : 000000000000003f
[    0.000000] x5 : 00000000000235b8 x4 : 0000000000000001
[    0.000000] x3 : 0000000000000001 x2 : ffffffc010f5acdc
[    0.000000] x1 : ffffff8027880000 x0 : ffffffc01151ade2
[    0.000000] Call trace:
[    0.000000]  ftrace_bug+0x94/0x268
[    0.000000]  ftrace_process_locs+0x364/0x3e0
[    0.000000]  ftrace_init+0xac/0xdc
[    0.000000]  start_kernel+0x194/0x43c
[    0.000000] ---[ end trace a8999690c4edae17 ]---
[    0.000000] ftrace failed to modify
[    0.000000] [<0000000000000020>] 0x20
[    0.000000]  actual:
[    0.000000] Unable to handle kernel read from unreadable memory at virtual address 0000000000000020
[    0.000000] Mem abort info:
[    0.000000]   ESR = 0x96000005
[    0.000000]   EC = 0x25: DABT (current EL), IL = 32 bits
[    0.000000]   SET = 0, FnV = 0
[    0.000000]   EA = 0, S1PTW = 0
[    0.000000] Data abort info:
[    0.000000]   ISV = 0, ISS = 0x00000005
[    0.000000]   CM = 0, WnR = 0
[    0.000000] [0000000000000020] user address but active_mm is swapper
[    0.000000] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G        W         5.4.69-0-1pre+ #1
[    0.000000] Hardware name: BCM972180HB_V20 (DT)
[    0.000000] pstate: 60400085 (nZCv daIf +PAN -UAO)
[    0.000000] pc : print_ip_ins+0x48/0x80
[    0.000000] lr : print_ip_ins+0x2c/0x80
[    0.000000] sp : ffffffc011a43eb0
[    0.000000] x29: ffffffc011a43eb0 x28: 0000000000000001
[    0.000000] x27: ffffff8027801380 x26: 0000000000000000
[    0.000000] x25: ffffff8027880008 x24: 0000000000000000
[    0.000000] x23: ffffffc0115f1abc x22: ffffffc01160e929
[    0.000000] x21: 0000000000000000 x20: ffffffc011577a9c
[    0.000000] x19: 0000000000000020 x18: ffffffc011a79028
[    0.000000] x17: 000000000000002c x16: ffffffc010f33fec
[    0.000000] x15: 0000000000000004 x14: ffff0000ffffff00
[    0.000000] x13: 0000000000000000 x12: 0000000000000000
[    0.000000] x11: 0000000000000000 x10: 00000000ffffffff
[    0.000000] x9 : 0000000000000000 x8 : 0000000000000000
[    0.000000] x7 : 3030303030303030 x6 : ffffffc011c031a3
[    0.000000] x5 : 000000000000000b x4 : ffffffc011c00866
[    0.000000] x3 : 0000000000000020 x2 : 000000000000000b
[    0.000000] x1 : ffffffc011c00871 x0 : 000000000000000b
[    0.000000] Call trace:
[    0.000000]  print_ip_ins+0x48/0x80
[    0.000000]  ftrace_bug+0xcc/0x268
[    0.000000]  ftrace_process_locs+0x364/0x3e0
[    0.000000]  ftrace_init+0xac/0xdc
[    0.000000]  start_kernel+0x194/0x43c
[    0.000000] Code: aa1f03f5 9124a6d6 912af2f7 912a7294 (38756a62)
[    0.000000] ---[ end trace a8999690c4edae18 ]---
[    0.000000] Kernel panic - not syncing: Attempted to kill the idle task!

This can be fixed by avoiding STT_FILE symbols as the base for
mcount offset relocation.

Bug: 168835511
Signed-off-by: Danesh Petigara <danesh.petigara@broadcom.com>
Signed-off-by: Pierre Couillaud <pierre@broadcom.com>
Change-Id: I9e73706d5104bfa81bccd091e956660364f294de
2020-10-22 19:57:13 +00:00
Chun-Hung Wu
3f0fb2fde0 ANDROID: iommu: Enable CONFIG_IOMMU_IO_PGTABLE_ARMV7S
Enable CONFIG_IOMMU_IO_PGTABLE_ARMV7S in gki_defconfig for MTK
iommu/io-pgtable-arm-v7s.

Bug: 167939345
Link: https://lore.kernel.org/patchwork/patch/1301119/
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Signed-off-by: Chao Hao <chao.hao@mediatek.com>
Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
Change-Id: Ic1f3a9cdf20f49f615f56bd9d9b0899a8f7255f6
2020-10-22 19:44:50 +00:00
Chao Hao
0245f11b47 BACKPORT: FROMLIST: iommu/io-pgtable-arm-v7s: Quad lvl1 pgtable for MediaTek
The standard input iova bits is 32. MediaTek quad the lvl1 pagetable
(4 * lvl1). No change for lvl2 pagetable. Then the iova bits can reach
34bit.

Bug: 167939345
Link: https://lore.kernel.org/patchwork/patch/1301122/
Change-Id: I29095a7f521c73da3fa017e81471ba41db8377ff
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Signed-off-by: Chao Hao <chao.hao@mediatek.com>
Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
2020-10-22 19:44:39 +00:00
Chao Hao
fbf0ae523d BACKPORT: FROMLIST: iommu/io-pgtable-arm-v7s: Add cfg as a param in some macros
Add "cfg" as a parameter for some macros. This is a preparing patch for
mediatek extend the lvl1 pgtable. No functional change.

Bug: 167939345
Link: https://lore.kernel.org/patchwork/patch/1301121/
Change-Id: I1bb072406cd2122446f1db2183a838a56837d7af
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Signed-off-by: Chao Hao <chao.hao@mediatek.com>
Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
2020-10-22 19:44:29 +00:00
Chao Hao
8b6f18592d BACKPORT: FROMLIST: iommu/io-pgtable-arm-v7s: Extend PA34 for MediaTek
MediaTek extend the bit5 in lvl1 and lvl2 descriptor as PA34.

Bug: 167939345
Link: https://lore.kernel.org/patchwork/patch/1301120/
Change-Id: I6bd677285b73271f977f8bdeb4ef6b658b2ea81d
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Signed-off-by: Chao Hao <chao.hao@mediatek.com>
Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
2020-10-22 19:44:19 +00:00
Chao Hao
ba7883760a BACKPORT: FROMLIST: iommu/io-pgtable-arm-v7s: Use ias to check the valid iova in unmap
Use the ias for the valid iova checking in _unmap.
It is a preparing patch for supporting iova 34bit for MediaTek.
BTW, change the ias/oas checking format in v7s_map.

Bug: 167939345
Link: https://lore.kernel.org/patchwork/patch/1301119/
Change-Id: I78a5399fb5f6555ba9aca916393ed62262853e34
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Signed-off-by: Chao Hao <chao.hao@mediatek.com>
Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
2020-10-22 19:44:09 +00:00
Raghavendra Rao Ananta
95bd9e26f2 ANDROID: ABI: Update allowed list for QCOM
Add the following symbols to QCOM allowed-list:
-- amba_driver_register
-- amba_driver_unregister

Bug: 171409550
Change-Id: Iab997df4f8ebb2c39b993b60ee4eb0fa3100fbcd
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2020-10-22 17:46:00 +00:00
Neal Liu
ba2f977129 ANDROID: modules: fix suspicious rcu usage
Use rcu_read_lock_sched() & rcu_read_unlock_sched() to mark the
beginning & end of a RCU-sched critical section instead.

Bug: 171362096
Signed-off-by: Neal Liu <neal.liu@mediatek.com>
Change-Id: Idb40e2c2356621398e06944f7cb9b8bc5ef1d92a
2020-10-22 17:03:51 +00:00
Abdulla Kamar
e17d9fc531 ANDROID: GKI: Enable CONFIG_X86_X2APIC
Enable support for CONFIG_X86_X2APIC, if available. This speeds up
operation in a hypervisor, as APIC is handled via MSRs.

Bug: 171287650
Change-Id: Ie3cf57d07b8dde08ec609dfb031cfb0029218501
Signed-off-by: Abdulla Kamar <abdulla@google.com>
2020-10-20 17:14:24 +00:00
wangzun1
f1ff4a4678 ANDROID: GKI: update xiaomi symbol list
Leaf changes summary: 0 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, 0 Added variable

Bug: 171162194

Signed-off-by: Zun Wang <wangzun1@xiaomi.com>
Change-Id: I169bcdd14878392ef57aec9c303a421800278610
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-10-20 16:50:25 +00:00
Greg Kroah-Hartman
db96212bde ANDROID: GKI: fix ABI breakage in module.h
commit 262e6ae7081d ("modules: inherit TAINT_PROPRIETARY_MODULE")
changes the size of 'struct module' a bit by adding a single boolean
value to the middle.  Move things around a bit and take up a space to
preserve the abi so that nothing changes with the abi before that commit
was merged.

This might be able to be dropped at the next Android KABI "Break", if
one happens.

Bug: 171277690
Fixes: 262e6ae7081d ("modules: inherit TAINT_PROPRIETARY_MODULE")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie31a6fcea384ad665248c87f7abfde4d214da70a
2020-10-20 16:49:28 +02:00
Christoph Hellwig
35b560985b UPSTREAM: modules: inherit TAINT_PROPRIETARY_MODULE
If a TAINT_PROPRIETARY_MODULE exports symbol, inherit the taint flag
for all modules importing these symbols, and don't allow loading
symbols from TAINT_PROPRIETARY_MODULE modules if the module previously
imported gplonly symbols.  Add a anti-circumvention devices so people
don't accidentally get themselves into trouble this way.

Comment from Greg:
  "Ah, the proven-to-be-illegal "GPL Condom" defense :)"

Bug: 171277690
[jeyu: pr_info -> pr_err and pr_warn as per discussion]
Link: http://lore.kernel.org/r/20200730162957.GA22469@lst.de
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
(cherry picked from commit 262e6ae7081df304fc625cf368d5c2cbba2bb991)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Id7c1af6bb8523bc39bda1efc661929d9ea0ccb20
2020-10-20 16:39:18 +02:00
Christoph Hellwig
f39710f356 UPSTREAM: modules: return licensing information from find_symbol
Report the GPLONLY status through a new argument.

Bug: 157965270
Bug: 171277690
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
(cherry picked from commit ef1dac6021cc8ec5de02ce31722bf26ac4ed5523)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I93285e06e380509b11356256da4d3d5a8738e252
2020-10-20 14:28:36 +02:00