Commit graph

883,311 commits

Author SHA1 Message Date
Raviteja Tamatam
c2ad8d4b00 ANDROID: ABI: update allowed list for QCOM
Update the android/abi_gki_aarch64_qcom with recent symbol additions.

No need to update the .xml file, as no new symbol addition.

Bug: 171024164
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
Change-Id: I38fdb82878c578a19fb01df1e97eb7fafd7dac06
2020-10-16 15:29:18 +05:30
Todd Kjos
a2114d2456 ANDROID: Update KMI_GENERATION after KMI change
The KMI was changed by several patches on Oct 15. Update the
generation number.

Bug: 161946584
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: If641819d24743f319cfe704b79ec479be8aae78f
2020-10-15 10:58:29 -07:00
Greg Kroah-Hartman
9bb683349b ANDROID: GKI: update the .xml file with the October 15 ABI breakages
Leaf changes summary: 3291 artifacts changed (10 filtered out)
Changed leaf types summary: 5 (1 filtered out) leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 3237 Changed (9 filtered out), 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 49 Changed, 0 Added variable

3237 functions with some sub-type change:

49 Changed variables:
   type of variable changed:
      type size hasn't changed
      1 data member insertion:
        'deferred_split pglist_data::deferred_split_queue', at offset 42048 (in bits) at mmzone.h:785:1
      there are data member changes:
        'lruvec pglist_data::lruvec' offset changed from 42048 to 42304 (in bits) (by +256 bits)
        'unsigned long int pglist_data::flags' offset changed from 43136 to 43392 (in bits) (by +256 bits)
      3325 impacted interfaces

    type of variable changed:
      type size hasn't changed
      there are data member changes:
        type 'u64[2]' of 'task_struct::android_vendor_data1' changed:
          type name changed from 'u64[2]' to 'u64[3]'
          array type size changed from 128 to 192
          array type subrange 1 changed length from 2 to 3
        'u64 task_struct::android_kabi_reserved1' offset changed from 21312 to 21376 (in bits) (by +64 bits)
        'u64 task_struct::android_kabi_reserved2' offset changed from 21376 to 21440 (in bits) (by +64 bits)
        'u64 task_struct::android_kabi_reserved3' offset changed from 21440 to 21504 (in bits) (by +64 bits)
        'u64 task_struct::android_kabi_reserved4' offset changed from 21504 to 21568 (in bits) (by +64 bits)
        'u64 task_struct::android_kabi_reserved5' offset changed from 21568 to 21632 (in bits) (by +64 bits)
        'u64 task_struct::android_kabi_reserved6' offset changed from 21632 to 21696 (in bits) (by +64 bits)
        'u64 task_struct::android_kabi_reserved7' offset changed from 21696 to 21760 (in bits) (by +64 bits)
        'u64 task_struct::android_kabi_reserved8' offset changed from 21760 to 21824 (in bits) (by +64 bits)
      3325 impacted interfaces

'struct file at fs.h:955:1' changed:
  type size changed from 2048 to 2176 (in bits)
  2 data member insertions:
    'u64 file::android_kabi_reserved1', at offset 2048 (in bits) at fs.h:995:1
    'u64 file::android_vendor_data1', at offset 2112 (in bits) at fs.h:996:1
  3325 impacted interfaces

'struct mem_cgroup at memcontrol.h:208:1' changed:
  type size changed from 21504 to 22528 (in bits)
  1 data member insertion:
    'deferred_split mem_cgroup::deferred_split_queue', at offset 22144 (in bits) at memcontrol.h:334:1
  there are data member changes:
    type 'atomic_long_t[56]' of 'mem_cgroup::vmevents' changed:
      type name changed from 'atomic_long_t[56]' to 'atomic_long_t[70]'
      array type size changed from 3584 to 4480
      array type subrange 1 changed length from 56 to 70
    'atomic_long_t mem_cgroup::memory_events[7]' offset changed from 17280 to 18176 (in bits) (by +896 bits)
    'atomic_long_t mem_cgroup::memory_events_local[7]' offset changed from 17728 to 18624 (in bits) (by +896 bits)
    'unsigned long int mem_cgroup::socket_pressure' offset changed from 18176 to 19072 (in bits) (by +896 bits)
    'bool mem_cgroup::tcpmem_active' offset changed from 18240 to 19136 (in bits) (by +896 bits)
    'int mem_cgroup::tcpmem_pressure' offset changed from 18272 to 19168 (in bits) (by +896 bits)
    'int mem_cgroup::kmemcg_id' offset changed from 18304 to 19200 (in bits) (by +896 bits)
    'memcg_kmem_state mem_cgroup::kmem_state' offset changed from 18336 to 19232 (in bits) (by +896 bits)
    'list_head mem_cgroup::kmem_caches' offset changed from 18368 to 19264 (in bits) (by +896 bits)
    'int mem_cgroup::last_scanned_node' offset changed from 18496 to 19392 (in bits) (by +896 bits)
    'list_head mem_cgroup::cgwb_list' offset changed from 18560 to 19456 (in bits) (by +896 bits)
    'wb_domain mem_cgroup::cgwb_domain' offset changed from 18688 to 19584 (in bits) (by +896 bits)
    'memcg_cgwb_frn mem_cgroup::cgwb_frn[4]' offset changed from 19776 to 20672 (in bits) (by +896 bits)
    'list_head mem_cgroup::event_list' offset changed from 21056 to 21952 (in bits) (by +896 bits)
    'spinlock_t mem_cgroup::event_list_lock' offset changed from 21184 to 22080 (in bits) (by +896 bits)
    'mem_cgroup_per_node* mem_cgroup::nodeinfo[]' offset changed from 21248 to 22400 (in bits) (by +1152 bits)
  420 impacted interfaces

'struct memcg_vmstats_percpu at memcontrol.h:88:1' changed:
  type size changed from 6272 to 7168 (in bits)
  there are data member changes:
    type 'unsigned long int[56]' of 'memcg_vmstats_percpu::events' changed:
      type name changed from 'unsigned long int[56]' to 'unsigned long int[70]'
      array type size changed from 3584 to 4480
      array type subrange 1 changed length from 56 to 70
    'unsigned long int memcg_vmstats_percpu::nr_page_events' offset changed from 6016 to 6912 (in bits) (by +896 bits)
    'unsigned long int memcg_vmstats_percpu::targets[3]' offset changed from 6080 to 6976 (in bits) (by +896 bits)
  420 impacted interfaces

'struct pglist_data at mmzone.h:713:1' changed:
  details were reported earlier

'struct task_struct at sched.h:636:1' changed:
  details were reported earlier

Bug: 161946584
Change-Id: I84324ddd226df0c756d61fc02081dc4bc37f36b1
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-10-15 17:59:17 +02:00
Greg Kroah-Hartman
b7d30a3293 ANDROID: GKI: fs.h: add Android ABI padding to struct file
Try to mitigate potential future driver core api changes by adding
padding to struct file;

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iba08ecfbd9cf365fe867cb57dbadf2eea00eaf0c
2020-10-15 17:21:03 +02:00
Egor Uleyskiy
3b300ff4c5 ANDROID: vendor_hooks: Add a vendor data to file struct
Add ANDROID_VENDOR_DATA(1) to struct file

Bug: 169343953
Signed-off-by: Egor Uleyskiy <e.uleyskiy@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I1afc259f2bd02fee76b20802dda74cbe79658534
2020-10-15 17:21:03 +02:00
Egor Uleyskiy
e89b05984d ANDROID: vendor_hooks: Extend the vendor data array in task_struct
Add an element to ANDROID_VENDOR_DATA_ARRAY(1,2) in task_struct

Bug: 169343953
Signed-off-by: Egor Uleyskiy <e.uleyskiy@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iee22bb544da5cc355d162d7a966c656f453c8a33
2020-10-15 17:21:03 +02:00
Suren Baghdasaryan
7ee8b58cc1 ANDROID: GKI: add fields required to enable CONFIG_TRANSPARENT_HUGEPAGE
Devices with plenty of RAM might benefit from THP usage. Added fields
would allow to enable CONFIG_TRANSPARENT_HUGEPAGE without affecting ABI.

Bug: 168269341
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ieb644a8da5377383d514197ee02d7bfd6f1d346d
2020-10-15 17:21:03 +02:00
Quentin Perret
0ce2100bcf ANDROID: Drop abi_gki_aarch64_workarounds
ehci_handshake was added to the symbol list as a temporary workaround
for CRC-related issues in the ehci code. But since this has now been
fixed, let's drop the unnecessary symbol list altogether.

Bug: 167230325
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I8f56b01ff9bed8e0d417f8c90adb7c32480d55cf
2020-10-15 17:21:03 +02:00
Quentin Perret
f0c4a768cf UPSTREAM: ehci-hcd: Move include to keep CRC stable
The CRC calculation done by genksyms is triggered when the parser hits
EXPORT_SYMBOL*() macros. At this point, genksyms recursively expands the
types of the function parameters, and uses that as the input for the CRC
calculation. In the case of forward-declared structs, the type expands
to 'UNKNOWN'. Following this, it appears that the result of the
expansion of each type is cached somewhere, and seems to be re-used
when/if the same type is seen again for another exported symbol in the
same C file.

Unfortunately, this can cause CRC 'stability' issues when a struct
definition becomes visible in the middle of a C file. For example, let's
assume code with the following pattern:

    struct foo;

    int bar(struct foo *arg)
    {
	/* Do work ... */
    }
    EXPORT_SYMBOL_GPL(bar);

    /* This contains struct foo's definition */
    #include "foo.h"

    int baz(struct foo *arg)
    {
	/* Do more work ... */
    }
    EXPORT_SYMBOL_GPL(baz);

Here, baz's CRC will be computed using the expansion of struct foo that
was cached after bar's CRC calculation ('UNKOWN' here). But if
EXPORT_SYMBOL_GPL(bar) is removed from the file (because of e.g. symbol
trimming using CONFIG_TRIM_UNUSED_KSYMS), struct foo will be expanded
late, during baz's CRC calculation, which now has visibility over the
full struct definition, hence resulting in a different CRC for baz.

The proper fix for this certainly is in genksyms, but that will take me
some time to get right. In the meantime, we have seen one occurrence of
this in the ehci-hcd code which hits this problem because of the way it
includes C files halfway through the code together with an unlucky mix
of symbol trimming.

In order to workaround this, move the include done in ehci-hub.c early
in ehci-hcd.c, hence making sure the struct definitions are visible to
the entire file. This improves CRC stability of the ehci-hcd exports
even when symbol trimming is enabled.

Bug: 167230325
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Link: https://lore.kernel.org/r/20200916171825.3228122-1-qperret@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 29231826f3bd65500118c473fccf31c0cf14dbc0)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie56a4deee980652e5285a0744a8bcc2c9e60db73
2020-10-15 17:21:03 +02:00
wangting11
5427f8b72f ANDROID: GKI: update xiaomi symbol list
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 int snd_soc_dapm_del_routes(snd_soc_dapm_context*, const snd_soc_dapm_route*, int)'

Bug: 170934475

Signed-off-by: wangting11 <wangting11@xiaomi.com>
Change-Id: I41e9e29e5f47345ae690a005630e00670285a20a
Signed-off-by: wangting11 <wangting11@xiaomi.com>
2020-10-15 12:51:24 +00:00
Chenggang Wang
ecb88922f5 ANDROID: GKI: update Vivo symbol list
Update the Vivo symbol list to come up to date with some more modules.

No new symbols are exported from the system, so no .xml file change
needed.

Bug: 170931247
Change-Id: I21e8ce22e327f315efecb9c4597560239b1e0aae
Signed-off-by: Chenggang Wang <wangchenggang@vivo.com>
2020-10-15 16:30:53 +08:00
Sangmoon Kim
32b2423372 ANDROID: sysrq: add vendor hook for sysrq crash information
- Add the hook to provide additional information
   of sysrq crash.

Bug: 170234110

Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: Ib8f14eaa639b2ef959e911d611515868ff9f193d
2020-10-13 14:46:48 +09:00
Jeehong Kim
42e516f6b2 ANDROID: ABI: update allowed list for galaxy
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 int i2c_bit_add_numbered_bus(i2c_adapter*)'

Bug: 170575183

Signed-off-by: Jeehong Kim <jhez.kim@samsung.com>
Change-Id: I300ccb7a97d0671037f3af1fc81f0fa41419e3f0
2020-10-12 14:05:09 +09:00
Greg Kroah-Hartman
de198b0f2d ANDROID: GKI: update Vivo symbol list
Update the Vivo symbol list to come up to date with some more modules.

No new symbols are exported from the system, so no .xml file change
needed.

New symbol additions should come in their own, separate commit.

Bug: 170441871
Cc: Chenggang Wang <wangchenggang@vivo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ic597312f943fe0dc67199ff1c51cd32ace939abe
2020-10-10 12:10:21 +02:00
rogercl.yang
c37c28d9aa ANDROID: adding __nocfi to cpuidle_enter_state
Background:
  When CPU is going to idle state, it would inform RCU that
current CPU is entering idle through rcu_idle_enter(),
and RCU will ignore read-side critical sections of this CPU.
However, there is CFI check mechanism inside idle flow and
calls rcu_read_lock(), so "rcu_read_lock() used illegally while idle"
in rcu_read_lock() will be triggered because rcu_idle_enter()
was already called before.

  Beside, the pointer of rcu_dereference() might be invalid
due to the RCU read-side critical sections will be ignoring in
this going idle CPU, it might cause problems like:
access the wrong data/address, kernel exception...

Based on above description:
  We will add __nocfi to cpuidle_enter_state to avoid
“rcu_read_lock() used illegally while idle!”
and avoid the usage of invalid pointer of rcu_dereference()
in this situation.

Bug: 169017431
Change-Id: I8bbe25704e18cfde351a8f4277dd4b44b07421f5
Signed-off-by: rogercl.yang <rogercl.yang@mediatek.com>
Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
2020-10-08 12:58:32 +00:00
Jungrae Kim
ebaebc32e5 ANDROID: ABI: update allowed list for galaxy
Leaf changes summary: 28 artifacts changed (1 filtered out)
Changed leaf types summary: 0 (1 filtered out) leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 28 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

28 Added functions:

  [A] 'function vm_struct* __get_vm_area(unsigned long int, unsigned long int, unsigned long int, unsigned long int)'
  [A] 'function int __kfifo_init(__kfifo*, void*, unsigned int, size_t)'
  [A] 'function unsigned int __kfifo_out_peek(__kfifo*, void*, unsigned int)'
  [A] 'function void __kfree_skb(sk_buff*)'
  [A] 'function void argv_free(char**)'
  [A] 'function char** argv_split(unsigned int, const char*, int*)'
  [A] 'function void cfg80211_port_authorized(net_device*, const u8*, gfp_t)'
  [A] 'function void class_dev_iter_exit(class_dev_iter*)'
  [A] 'function void class_dev_iter_init(class_dev_iter*, class*, device*, const device_type*)'
  [A] 'function device* class_dev_iter_next(class_dev_iter*)'
  [A] 'function unsigned int cpufreq_get(unsigned int)'
  [A] 'function device* create_function_device(char*)'
  [A] 'function void emergency_restart()'
  [A] 'function file* get_mm_exe_file(mm_struct*)'
  [A] 'function pid* get_task_pid(task_struct*, pid_type)'
  [A] 'function void gether_get_host_addr_u8(net_device*, u8*)'
  [A] 'function ktime_t ktime_get_coarse_with_offset(tk_offsets)'
  [A] 'function task_struct* pid_task(pid*, pid_type)'
  [A] 'function bool rfkill_set_sw_state(rfkill*, bool)'
  [A] 'function int send_sig(int, task_struct*, int)'
  [A] 'function int skb_copy_ubufs(sk_buff*, unsigned int)'
  [A] 'function void smpboot_unregister_percpu_thread(smp_hotplug_thread*)'
  [A] 'function __anonymous_struct__ sock_i_uid(sock*)'
  [A] 'function void sock_wfree(sk_buff*)'
  [A] 'function unsigned long int strspn(const char*, const char*)'
  [A] 'function int usb_gadget_connect(usb_gadget*)'
  [A] 'function int usb_gadget_disconnect(usb_gadget*)'
  [A] 'function unsigned long int vmalloc_to_pfn(void*)'

Bug: 170065985
Signed-off-by: Jungrae Kim <jryu.kim@samsung.com>
Change-Id: Ic14fc4aa42c42b2346e0235f92ee73fb558b2437
Signed-off-by: Jungrae Kim <jryu.kim@samsung.com>
2020-10-05 22:48:24 +00:00
Sangmoon Kim
2ea974a00c ANDROID: workqueue: add vendor hook for wq lockup information
- Add the hook to provide additional information like
   a task scheduling log.

Bug: 169374262

Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I203dbc6faa77687ea48769f76658d28b29ef46fd
2020-10-05 10:27:15 +09:00
John Stultz
d240b6929c ANDROID: db845c_gki.fragment: Add missing qcom drivers required for cpufreq functionality
Some additional drivers are now needed for cpufreq to work, so
add them to the db845c_gki.fragment

Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: Ie126f4613b9e5e31c9862d3d4b9c2afb4a5562e6
Bug: 146449535
2020-09-30 22:10:23 +00:00
Mayank Grover
81e694dedc 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: 169739756
Change-Id: I3e992c3ecf4a06eed4b3459cb6343cc5a4f8941d
Signed-off-by: Mayank Grover <groverm@codeaurora.org>
2020-09-30 18:03:33 +05:30
wangting11
de645857ee ANDROID: GKI: add allowed list file for xiaomi
add abi_gki_aarch64_xiaomi

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 __kfifo_from_user(__kfifo*, void*, unsigned long int, unsigned int*)'
  [A] 'function int kobject_set_name(kobject*, const char*, ...)'

Bug: 169498251
Change-Id: I43d9c59e8833e76f943e3d1df066165e2fd60dc2
Signed-off-by: wangting11 <wangting11@xiaomi.com>
2020-09-30 12:02:30 +08:00
Daniel Mentz
2318165502 ANDROID: Disable kthread delayed work fp check in CFI builds
With non-canonical CFI, LLVM generates jump table entries for external
symbols in modules and as a result, a function pointer passed from a
module to the core kernel will have a different address.

Disable the warning for now.

Bug: 145210207
Signed-off-by: Daniel Mentz <danielmentz@google.com>
Change-Id: I576a07206a465902773481e51a84529f0ac2e84b
2020-09-29 15:26:34 +00:00
Mayank Grover
f4c28ebfcd 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 hrtimer_init_sleeper(hrtimer_sleeper*, clockid_t, hrtimer_mode)'

Bug: 169648430
Change-Id: I3dd359f8af64fbca2ef364becfb4b1f5f75510c0
Signed-off-by: Mayank Grover <groverm@codeaurora.org>
2020-09-29 17:41:47 +05:30
Abhilasha Rao
92bfdf631e ANDROID: GKI: pid: Export for find_task_by_vpid
- Add EXPORT_SYMBOL_GPL for find_task_by_vpid() so that drivers
    can be loadable as a module.

    - This API is required by loadable driver module from samsung to
    read process related information based on pid and thread id.
    To get information on when a certain process or thread was started,
    duration of run, Average load contributed by it.

Signed-off-by: Abhilasha Rao <abhilasha.hv@samsung.corp-partner.google.com>
Bug: 158067689
Change-Id: I0db9cc50c93eedff0f3e9dea0ac09a5d17d118f0
(cherry picked from commit bee18dd57e89f4e7aa79f6054b9238b99e45c191)
2020-09-28 18:10:49 +00:00
Abhilasha Rao
6765da7d2c ANDROID: GKI: core: Export for runqueues
- Add EXPORT_SYMBOL_GPL for runqueues().

    - This API is required by loadable driver module,to get number of
    jobs in the run queue (state R) or waiting for disk I/O (state D)
    averaged over 1 min.

Signed-off-by: Abhilasha Rao <abhilasha.hv@samsung.corp-partner.google.com>
Bug: 158067689
Change-Id: I3e80a46bef2e7c92714b68cc5b6b617ac50bc478
(cherry picked from commit 6b0a9dc6df8d8be21c8d178a01e0711b0fe6ce73)
2020-09-28 18:10:39 +00:00
Abhilasha Rao
9b5925ce78 ANDROID: GKI: time: Export for nsec_to_clock_t
- Add EXPORT_SYMBOL_GPL for nsec_to_clock_t() so that drivers
    be loadable as a module.

    - This API is required by loadable driver module from samsung to
    fetch process uptime based on CPU clock ticks to get the exact time
    during which app is scheduled in user mode.
Signed-off-by: Abhilasha Rao <abhilasha.hv@samsung.corp-partner.google.com>
Bug: 158067689
Change-Id: I45be5fd7873dc7c21aa583313499f48f8b10bb1b
(cherry picked from commit 0575bec804810d9b8abf533c4ef4a957968553fc)
2020-09-28 18:10:29 +00:00
Abhilasha Rao
c283224524 ANDROID: GKI: signal: Export for __lock_task_sighand
- Add EXPORT_SYMBOL_GPL for __lock_task_sighand()

    - This API is required by loadable driver module from samsung to
      Lock task structure, when reading task/process related information.

Signed-off-by: Abhilasha Rao <abhilasha.hv@samsung.corp-partner.google.com>
Bug: 158067689
Change-Id: Ia54e17b1f2630bcc648e7840cf36e743f08ba9c9
(cherry picked from commit a719abf03114cfc0b9f68937d9cd900d74d65cae)
2020-09-28 18:10:21 +00:00
Abhilasha Rao
91c336eebe ANDROID: GKI: cputime: Export for thread_group_cputime_adjusted
- Add EXPORT_SYMBOL_GPL for thread_group_cputime_adjusted()
    to allow drivers to be loadable as a module.

    - This API is required by loadable driver module from samsung
    to fetch process uptime based on CPU clock ticks to get the
    exact duration of time app is scheduled in user mode.

Signed-off-by: Abhilasha Rao <abhilasha.hv@samsung.corp-partner.google.com>
Bug: 158067689
Change-Id: I1843de08edf5bb2eee806845f4b5e0a305da5fe7
(cherry picked from commit bf679b941237ae76d0bba8d98e670819e029847a)
2020-09-28 18:10:12 +00:00
Abhilasha Rao
a4b35b7869 ANDROID: GKI: loadavg: Export for get_avenrun
- Add EXPORT_SYMBOL_GPL for get_avenrun() so that drivers
    be loadable as a module.

    - This API is required by loadable driver module
    to get Number of jobs in the run queue  (state R) or waiting
    for disk I/O(state D) averaged over 1 min.

Signed-off-by: Abhilasha Rao <abhilasha.hv@samsung.corp-partner.google.com>
Signed-off-by: Todd Kjos <tkjos@google.com>
Bug: 158067689
Change-Id: I56c12c908be068f78e16004df876be3bee0e7229
(cherry picked from commit 64ea6f327359a90eca8ec9fe2a8f0caba0188e45)
2020-09-28 18:10:02 +00:00
Matthias Maennich
527c28ed21 ANDROID: Refresh ABI.xmls with libabigail 1.8.0-98bbf30d
This adds missing anonymous to union types, creating some one-time
churn.

Bug: 167563393
Change-Id: I08f55d48793870c6a82ff2c76d3460733ffdbe41
Signed-off-by: Matthias Maennich <maennich@google.com>
2020-09-28 17:55:13 +00:00
Yun Hsiang
1642b4f813 ANDROID: sched: add cpumask parameter to cpu capacity vendor hook
Different cpu type will have different suppression ration.
So we add cpumask parameter to cpu capacity vendor hook.

Bug: 167126223

Signed-off-by: Yun Hsiang <yun.hsiang@mediatek.com>
Change-Id: I983a3aca2195f7c37c43d31fa588c999a825ee49
2020-09-28 16:04:11 +00:00
黄烁生
2d498bbf53 ANDROID: ABI: Added symbols for allwinner
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 device_node* dev_pm_opp_of_get_opp_desc_node(device*)'
  [A] 'function void dev_pm_opp_put_prop_name(opp_table*)'
  [A] 'function void dev_pm_opp_put_supported_hw(opp_table*)'
  [A] 'function opp_table* dev_pm_opp_set_prop_name(device*, const char*)'

Bug: 169550958
Signed-off-by: huangshuosheng <huangshuosheng@SWCExdroid03.allwinnertech.com>
Signed-off-by: Frank Lee <frank@allwinnertech.com>
Change-Id: I5b97ea1e58825918e19e530fdc9bbda9682ab621
2020-09-28 20:23:09 +08:00
Greg Kroah-Hartman
605376176c ANDROID: ABI: Update allowed list for EXYNOS
Update the android/abi_gki_aarch64_exynos with recent symbol additions.

Note, no new symbols are needed to be exported here, making this a
simple change and no need to update the .xml file.

Bug: 168666574
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ibe92486f6f84163990b65c75be96236f76f8af1e
2020-09-27 11:59:13 +02:00
Raghavendra Rao Ananta
e1cc5b3eb6 ANDROID: ABI: Update allowed list for QCOM
Add the following symbols to QCOM allowed-list:
- __cfi_slowpath
- of_find_i2c_device_by_node

Bug: 169419618
Change-Id: Ief629d53312c8d843361261454d77638438da6f3
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2020-09-25 13:45:35 -07:00
Will McVicker
b8f04a0f4a ANDROID: drop KERNEL_DIR setting in build.config.common
And replace many references of ${ROOT_DIR}/common with
${ROOT_DIR}/${KERNEL_DIR}, which makes it a lot easier
to branch off of ACK and update the KERNEL_DIR.

The variable of KERNEL_DIR will be set in build/_setup_env.sh
to the directory of the build config file by default if it's
not set explicitly in the build config file or in environment.

Test: build test with following configs
        common/build.config.gki.aarch64
        common/build.config.db845c
        common/build.config.hikey960
        common-modules/virtual-device/build.config.cuttlefish.aarch64
        common-modules/virtual-device/build.config.goldfish.aarch64

Bug: 162785964
Change-Id: I790ac0ded10bd790484f14c6f93d53e06c38b830
Signed-off-by: Will McVicker <willmcvicker@google.com>
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
(cherry picked from commit 931718fa65fe5e34d143250c048f591a7d74e5f8)
2020-09-25 14:50:31 +08:00
Raghavendra Rao Ananta
e32adae0a6 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 int check_zeroed_user(void*, unsigned long int)'

Bug: 169321538
Change-Id: Iaa693ec807daf12485d14c54a7205b4703c12de7
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2020-09-24 11:22:02 -07:00
Greg Kroah-Hartman
7dded4ebf0 Revert "UPSTREAM: ehci-hcd: Move include to keep CRC stable"
Revert submission 1437052

Reason for revert: ABI is changed.  While is is correct, we will hold off doing this for another week.

Reverted Changes:
Iae19ae10f:UPSTREAM: ehci-hcd: Move include to keep CRC stabl...
I85a933434:ANDROID: Update android/abi_gki_aarch64.xml

Change-Id: I2859f7b3ffa293371f842c01ecf433a84d5e1179
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-09-24 16:22:26 +00:00
Greg Kroah-Hartman
a24fabe78a Revert "ANDROID: Update android/abi_gki_aarch64.xml"
Revert submission 1437052

Reason for revert: ABI is changed.  While is is correct, we will hold off doing this for another week.

Reverted Changes:
Iae19ae10f:UPSTREAM: ehci-hcd: Move include to keep CRC stabl...
I85a933434:ANDROID: Update android/abi_gki_aarch64.xml

Change-Id: If22472924ae1a42956123806eeb4fed750db5204
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-09-24 16:21:58 +00:00
Quentin Perret
9ed03658fe ANDROID: Update android/abi_gki_aarch64.xml
Leaf changes summary: 5 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 5 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

5 functions with some sub-type change:

  [C] 'function int ehci_handshake(ehci_hcd*, void*, u32, u32, int)' at ehci-hcd.c:148:1 has some sub-type changes:

    CRC value (modversions) changed from 0xab5f23a3 to 0xe32dc66c

  [C] 'function void ehci_init_driver(hc_driver*, const ehci_driver_overrides*)' at ehci.h:879:1 has some sub-type changes:

    CRC value (modversions) changed from 0x70c01a65 to 0x5bd6ac93

  [C] 'function int ehci_resume(usb_hcd*, bool)' at ehci.h:887:1 has some sub-type changes:

    CRC value (modversions) changed from 0x51dbddda to 0xa250ac83

  [C] 'function int ehci_setup(usb_hcd*)' at ehci.h:881:1 has some sub-type changes:

    CRC value (modversions) changed from 0x175f644c to 0xda517721

  [C] 'function int ehci_suspend(usb_hcd*, bool)' at ehci-hcd.c:1085:1 has some sub-type changes:

    CRC value (modversions) changed from 0x3afe7f3 to 0x5a7df441

Bug: 167230325
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I85a93343482eacce6e989f545dcd89432ad70c85
2020-09-24 13:56:52 +01:00
Quentin Perret
ce50287a2b UPSTREAM: ehci-hcd: Move include to keep CRC stable
The CRC calculation done by genksyms is triggered when the parser hits
EXPORT_SYMBOL*() macros. At this point, genksyms recursively expands the
types of the function parameters, and uses that as the input for the CRC
calculation. In the case of forward-declared structs, the type expands
to 'UNKNOWN'. Following this, it appears that the result of the
expansion of each type is cached somewhere, and seems to be re-used
when/if the same type is seen again for another exported symbol in the
same C file.

Unfortunately, this can cause CRC 'stability' issues when a struct
definition becomes visible in the middle of a C file. For example, let's
assume code with the following pattern:

    struct foo;

    int bar(struct foo *arg)
    {
	/* Do work ... */
    }
    EXPORT_SYMBOL_GPL(bar);

    /* This contains struct foo's definition */
    #include "foo.h"

    int baz(struct foo *arg)
    {
	/* Do more work ... */
    }
    EXPORT_SYMBOL_GPL(baz);

Here, baz's CRC will be computed using the expansion of struct foo that
was cached after bar's CRC calculation ('UNKOWN' here). But if
EXPORT_SYMBOL_GPL(bar) is removed from the file (because of e.g. symbol
trimming using CONFIG_TRIM_UNUSED_KSYMS), struct foo will be expanded
late, during baz's CRC calculation, which now has visibility over the
full struct definition, hence resulting in a different CRC for baz.

The proper fix for this certainly is in genksyms, but that will take me
some time to get right. In the meantime, we have seen one occurrence of
this in the ehci-hcd code which hits this problem because of the way it
includes C files halfway through the code together with an unlucky mix
of symbol trimming.

In order to workaround this, move the include done in ehci-hub.c early
in ehci-hcd.c, hence making sure the struct definitions are visible to
the entire file. This improves CRC stability of the ehci-hcd exports
even when symbol trimming is enabled.

Bug: 167230325
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Link: https://lore.kernel.org/r/20200916171825.3228122-1-qperret@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 29231826f3bd65500118c473fccf31c0cf14dbc0)
Change-Id: Iae19ae10feb15fd775076acdd2e0b29d7ccb6b20
2020-09-24 12:47:37 +00:00
Masahiro Yamada
bc93285fae UPSTREAM: kbuild: use CONFIG_CC_VERSION_TEXT to construct LINUX_COMPILER macro
scripts/mkcompile_h runs $(CC) just for getting the version string.
Reuse CONFIG_CC_VERSION_TEXT for optimization.

For GCC, this slightly changes the version string. I do not think it
is a big deal as we do not have the defined format for LINUX_COMPILER.
In fact, the recent commit 4831f7ad6c ("kbuild: mkcompile_h:
Include $LD version in /proc/version") added the linker version.

Bug: 168274246

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
(cherry picked from commit 9a950154668729a472d17b8e307d92e7c60f45f7)
Signed-off-by: Mars Lin <marslin@google.com>
Change-Id: I66bac5b44bf764e7c0e432ae17bcdf06d79c96d0
2020-09-24 10:02:57 +00:00
Masahiro Yamada
68aee2bc3d UPSTREAM: kbuild: do not pass $(KBUILD_CFLAGS) to scripts/mkcompile_h
scripts/mkcompile_h uses $(CC) only for getting the version string.

I suspected there was a specific reason why the additional flags were
needed, and dug the commit history. This code dates back to at least
2002 [1], but I could not get any more clue.

Just get rid of it.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=29f3df7eba8ddf91a55183f9967f76fbcc3ab742

Bug: 168274246

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
(cherry picked from commit 01a6126b5f7efdf75480a2b970377f5724cb885a)
Signed-off-by: Mars Lin <marslin@google.com>
Change-Id: If887ea1e9e43b9ce83bf8fe9cc0db809818c3bb8
2020-09-24 10:02:48 +00:00
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