Commit Graph

979061 Commits

Author SHA1 Message Date
Chanho Park
79f44ef795 ANDROID: GKI: Kconfig.gki: Add GKI_HIDDEN_ETHERNET_CONFIGS
Add a hidden config option to select PHYLINK which is widely used by
ethernet devices. This also removes PHYLIB=y from gki_defconfig because
it is selected by CONFIG_PHYLINK.

Bug: 190472243
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Change-Id: I590f7576daddab6786d19ffc789e51816770e5e3
2021-06-14 07:09:47 +00:00
Lecopzer Chen
79258e28eb FROMLIST: media: Kconfig: Fix DVB_CORE can't be selected as module
The DVB_CORE now depends on MEDIA_DIGITAL_TV_SUPPORT and
default MEDIA_DIGITAL_TV_SUPPORT, and this makes it can never be =m
since the type of MEDIA_DIGITAL_TV_SUPPORT is bool.

Change MEDIA_DIGITAL_TV_SUPPORT to tristate so it's possible to set
DVB_CORE as =m.

Link: https://lore.kernel.org/lkml/20210608101451.9301-1-lecopzer.chen@mediatek.com/
Bug: 189516917
Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
Change-Id: I3e62e9f6b0e3e42b3ce8b7d179266700bb25e6a0
2021-06-13 11:26:48 +00:00
Rick Yiu
0451e8af91 ANDROID: Update ABI and symbol list
Leaf changes summary: 2 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, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 1 Added variable

1 Added function:

  [A] 'function int __traceiter_android_vh_finish_update_load_avg_se(void*, sched_entity*, int)'

1 Added variable:

  [A] 'tracepoint __tracepoint_android_vh_finish_update_load_avg_se'

Bug: 187146897
Signed-off-by: Rick Yiu <rickyiu@google.com>
Change-Id: I0ab28eeeae64fb07d663191b68d7a84550887888
2021-06-12 16:01:07 +00:00
Greg Kroah-Hartman
1ac622485e Revert "net: usb: cdc_ncm: don't spew notifications"
This reverts commit de658a195ee23ca6aaffe197d1d2ea040beea0a2 as it
breaks the abi at the moment.

We will bring it back in a bit, when the next kabi break happens.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I2bfa5e180f377af552230ff170ea0a45fef1347e
2021-06-12 14:48:15 +02:00
Greg Kroah-Hartman
9e08e97ec6 Merge 5.10.43 into android12-5.10
Changes in 5.10.43
	btrfs: tree-checker: do not error out if extent ref hash doesn't match
	net: usb: cdc_ncm: don't spew notifications
	hwmon: (dell-smm-hwmon) Fix index values
	hwmon: (pmbus/isl68137) remove READ_TEMPERATURE_3 for RAA228228
	netfilter: conntrack: unregister ipv4 sockopts on error unwind
	efi/fdt: fix panic when no valid fdt found
	efi: Allow EFI_MEMORY_XP and EFI_MEMORY_RO both to be cleared
	efi/libstub: prevent read overflow in find_file_option()
	efi: cper: fix snprintf() use in cper_dimm_err_location()
	vfio/pci: Fix error return code in vfio_ecap_init()
	vfio/pci: zap_vma_ptes() needs MMU
	samples: vfio-mdev: fix error handing in mdpy_fb_probe()
	vfio/platform: fix module_put call in error flow
	ipvs: ignore IP_VS_SVC_F_HASHED flag when adding service
	HID: logitech-hidpp: initialize level variable
	HID: pidff: fix error return code in hid_pidff_init()
	HID: i2c-hid: fix format string mismatch
	devlink: Correct VIRTUAL port to not have phys_port attributes
	net/sched: act_ct: Offload connections with commit action
	net/sched: act_ct: Fix ct template allocation for zone 0
	mptcp: always parse mptcp options for MPC reqsk
	nvme-rdma: fix in-casule data send for chained sgls
	ACPICA: Clean up context mutex during object deletion
	perf probe: Fix NULL pointer dereference in convert_variable_location()
	net: dsa: tag_8021q: fix the VLAN IDs used for encoding sub-VLANs
	net: sock: fix in-kernel mark setting
	net/tls: Replace TLS_RX_SYNC_RUNNING with RCU
	net/tls: Fix use-after-free after the TLS device goes down and up
	net/mlx5e: Fix incompatible casting
	net/mlx5: Check firmware sync reset requested is set before trying to abort it
	net/mlx5e: Check for needed capability for cvlan matching
	net/mlx5: DR, Create multi-destination flow table with level less than 64
	nvmet: fix freeing unallocated p2pmem
	netfilter: nft_ct: skip expectations for confirmed conntrack
	netfilter: nfnetlink_cthelper: hit EBUSY on updates if size mismatches
	drm/i915/selftests: Fix return value check in live_breadcrumbs_smoketest()
	bpf: Simplify cases in bpf_base_func_proto
	bpf, lockdown, audit: Fix buggy SELinux lockdown permission checks
	ieee802154: fix error return code in ieee802154_add_iface()
	ieee802154: fix error return code in ieee802154_llsec_getparams()
	igb: add correct exception tracing for XDP
	ixgbevf: add correct exception tracing for XDP
	cxgb4: fix regression with HASH tc prio value update
	ipv6: Fix KASAN: slab-out-of-bounds Read in fib6_nh_flush_exceptions
	ice: Fix allowing VF to request more/less queues via virtchnl
	ice: Fix VFR issues for AVF drivers that expect ATQLEN cleared
	ice: handle the VF VSI rebuild failure
	ice: report supported and advertised autoneg using PHY capabilities
	ice: Allow all LLDP packets from PF to Tx
	i2c: qcom-geni: Add shutdown callback for i2c
	cxgb4: avoid link re-train during TC-MQPRIO configuration
	i40e: optimize for XDP_REDIRECT in xsk path
	i40e: add correct exception tracing for XDP
	ice: simplify ice_run_xdp
	ice: optimize for XDP_REDIRECT in xsk path
	ice: add correct exception tracing for XDP
	ixgbe: optimize for XDP_REDIRECT in xsk path
	ixgbe: add correct exception tracing for XDP
	arm64: dts: ti: j7200-main: Mark Main NAVSS as dma-coherent
	optee: use export_uuid() to copy client UUID
	bus: ti-sysc: Fix am335x resume hang for usb otg module
	arm64: dts: ls1028a: fix memory node
	arm64: dts: zii-ultra: fix 12V_MAIN voltage
	arm64: dts: freescale: sl28: var4: fix RGMII clock and voltage
	ARM: dts: imx7d-meerkat96: Fix the 'tuning-step' property
	ARM: dts: imx7d-pico: Fix the 'tuning-step' property
	ARM: dts: imx: emcon-avari: Fix nxp,pca8574 #gpio-cells
	bus: ti-sysc: Fix flakey idling of uarts and stop using swsup_sidle_act
	tipc: add extack messages for bearer/media failure
	tipc: fix unique bearer names sanity check
	serial: stm32: fix threaded interrupt handling
	riscv: vdso: fix and clean-up Makefile
	io_uring: fix link timeout refs
	io_uring: use better types for cflags
	drm/amdgpu/vcn3: add cancel_delayed_work_sync before power gate
	drm/amdgpu/jpeg2.5: add cancel_delayed_work_sync before power gate
	drm/amdgpu/jpeg3: add cancel_delayed_work_sync before power gate
	Bluetooth: fix the erroneous flush_work() order
	Bluetooth: use correct lock to prevent UAF of hdev object
	wireguard: do not use -O3
	wireguard: peer: allocate in kmem_cache
	wireguard: use synchronize_net rather than synchronize_rcu
	wireguard: selftests: remove old conntrack kconfig value
	wireguard: selftests: make sure rp_filter is disabled on vethc
	wireguard: allowedips: initialize list head in selftest
	wireguard: allowedips: remove nodes in O(1)
	wireguard: allowedips: allocate nodes in kmem_cache
	wireguard: allowedips: free empty intermediate nodes when removing single node
	net: caif: added cfserl_release function
	net: caif: add proper error handling
	net: caif: fix memory leak in caif_device_notify
	net: caif: fix memory leak in cfusbl_device_notify
	HID: i2c-hid: Skip ELAN power-on command after reset
	HID: magicmouse: fix NULL-deref on disconnect
	HID: multitouch: require Finger field to mark Win8 reports as MT
	gfs2: fix scheduling while atomic bug in glocks
	ALSA: timer: Fix master timer notification
	ALSA: hda: Fix for mute key LED for HP Pavilion 15-CK0xx
	ALSA: hda: update the power_state during the direct-complete
	ARM: dts: imx6dl-yapp4: Fix RGMII connection to QCA8334 switch
	ARM: dts: imx6q-dhcom: Add PU,VDD1P1,VDD2P5 regulators
	ext4: fix memory leak in ext4_fill_super
	ext4: fix bug on in ext4_es_cache_extent as ext4_split_extent_at failed
	ext4: fix fast commit alignment issues
	ext4: fix memory leak in ext4_mb_init_backend on error path.
	ext4: fix accessing uninit percpu counter variable with fast_commit
	usb: dwc2: Fix build in periphal-only mode
	pid: take a reference when initializing `cad_pid`
	ocfs2: fix data corruption by fallocate
	mm/debug_vm_pgtable: fix alignment for pmd/pud_advanced_tests()
	mm/page_alloc: fix counting of free pages after take off from buddy
	x86/cpufeatures: Force disable X86_FEATURE_ENQCMD and remove update_pasid()
	x86/sev: Check SME/SEV support in CPUID first
	nfc: fix NULL ptr dereference in llcp_sock_getname() after failed connect
	drm/amdgpu: Don't query CE and UE errors
	drm/amdgpu: make sure we unpin the UVD BO
	x86/apic: Mark _all_ legacy interrupts when IO/APIC is missing
	powerpc/kprobes: Fix validation of prefixed instructions across page boundary
	btrfs: mark ordered extent and inode with error if we fail to finish
	btrfs: fix error handling in btrfs_del_csums
	btrfs: return errors from btrfs_del_csums in cleanup_ref_head
	btrfs: fixup error handling in fixup_inode_link_counts
	btrfs: abort in rename_exchange if we fail to insert the second ref
	btrfs: fix deadlock when cloning inline extents and low on available space
	mm, hugetlb: fix simple resv_huge_pages underflow on UFFDIO_COPY
	drm/msm/dpu: always use mdp device to scale bandwidth
	btrfs: fix unmountable seed device after fstrim
	KVM: SVM: Truncate GPR value for DR and CR accesses in !64-bit mode
	KVM: arm64: Fix debug register indexing
	x86/kvm: Teardown PV features on boot CPU as well
	x86/kvm: Disable kvmclock on all CPUs on shutdown
	x86/kvm: Disable all PV features on crash
	lib/lz4: explicitly support in-place decompression
	i2c: qcom-geni: Suspend and resume the bus during SYSTEM_SLEEP_PM ops
	netfilter: nf_tables: missing error reporting for not selected expressions
	xen-netback: take a reference to the RX task thread
	neighbour: allow NUD_NOARP entries to be forced GCed
	Linux 5.10.43

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I8d7ec0878193e4e454076809b7fb71fcc4e3d810
2021-06-12 14:48:14 +02:00
Matthias Maennich
b9ae3287e3 ANDROID: Fips 140: move fips symbols entirely in own list
Since the fips140 module is not built during the regular GKI kernel
build, it will also not be participating in the symbol list generation.
Yet the symbols were added as if it were built. Fix that by moving the
symbols over to the module specific list for now. Also, update the
symbol list that is updated when using

  BUILD_CONFIG=common/build.config.gki.aarch64.fips140 build/build_abi.sh --update-symbol-list

Fixes: a11dacedd6 ("ANDROID: add fips140.ko symbols to module ABI")
Change-Id: I35730ab72941576d8da699d82b265b2ed1ae6b2b
Signed-off-by: Matthias Maennich <maennich@google.com>
2021-06-11 15:04:07 +00:00
Maciej Żenczykowski
3871aa16fd ANDROID: core of xt_IDLETIMER send_nl_msg support
This was reverted in ee6918c6f7 due to
conflicts with upstream, and this attempts to reapply the majority
of that change in an upstream compatible fashion.

Test: builds, and kernel net tests passes, booted on phone,
  but no real testing
Bug: 183485987
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0fa1da3cb38d37c6888444dc36d49e6d1828a855
2021-06-11 14:54:24 +00:00
Maciej Żenczykowski
b4355a880a ANDROID: start to re-add xt_IDLETIMER send_nl_msg support
This was reverted in ee6918c6f7 due to conflicts with
upstream, this first patch is just the minimum necessary to make the netfilter
IDLETIMER target with --send_nl_msg load successfully:

  phone-5.10:/ # iptables-save | egrep IDLETIMER
  -A idletimer_raw_PREROUTING -i rmnet0 -j IDLETIMER --timeout 10 --label 0 --send_nl_msg
  -A idletimer_mangle_POSTROUTING -o rmnet0 -j IDLETIMER --timeout 10 --label 0 --send_nl_msg
  phone-5.10:/ # ip6tables-save | egrep IDLETIMER
  -A idletimer_raw_PREROUTING -i rmnet0 -j IDLETIMER --timeout 10 --label 0 --send_nl_msg
  -A idletimer_mangle_POSTROUTING -o rmnet0 -j IDLETIMER --timeout 10 --label 0 --send_nl_msg

Test: builds, and kernel net tests passes, booted on phone, observed ip{,6}tables loading rules
Bug: 183485987
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1fe2c4e41a092cc82c3d6d49d1217798b2728bcb
2021-06-11 14:54:06 +00:00
Ard Biesheuvel
a11dacedd6 ANDROID: add fips140.ko symbols to module ABI
Leaf changes summary: 71 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, 61 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 10 Added variables
Function symbols changes summary: 0 Removed, 1 Added function symbol not referenced by debug info
Variable symbols changes summary: 0 Removed, 2 Added variable symbols not referenced by debug info

61 Added functions:

  [A] 'function unsigned long int __crypto_memneq(void*, void*, size_t)'
  [A] 'function void __crypto_xor(u8*, const u8*, const u8*, unsigned int)'
  [A] 'function int __traceiter_android_vh_aes_decrypt(void*, const crypto_aes_ctx*, u8*, const u8*, int*)'
  [A] 'function int __traceiter_android_vh_aes_encrypt(void*, const crypto_aes_ctx*, u8*, const u8*, int*)'
  [A] 'function int __traceiter_android_vh_aes_expandkey(void*, crypto_aes_ctx*, const u8*, unsigned int, int*)'
  [A] 'function int __traceiter_android_vh_sha256(void*, const u8*, unsigned int, u8*, int*)'
  [A] 'function int add_random_ready_callback(random_ready_callback*)'
  [A] 'function int aead_register_instance(crypto_template*, aead_instance*)'
  [A] 'function void aes_decrypt(const crypto_aes_ctx*, unsigned char*, const unsigned char*)'
  [A] 'function int ce_aes_expandkey(crypto_aes_ctx*, const u8*, unsigned int)'
  [A] 'function bool cpu_have_feature(unsigned int)'
  [A] 'function int crypto_aes_set_key(crypto_tfm*, const u8*, unsigned int)'
  [A] 'function int crypto_ahash_finup(ahash_request*)'
  [A] 'function crypto_alg* crypto_alg_mod_lookup(const char*, u32, u32)'
  [A] 'function crypto_rng* crypto_alloc_rng(const char*, u32, u32)'
  [A] 'function const char* crypto_attr_alg_name(rtattr*)'
  [A] 'function int crypto_check_attr_type(rtattr**, u32, u32*)'
  [A] 'function void crypto_drop_spawn(crypto_spawn*)'
  [A] 'function crypto_sync_skcipher* crypto_get_default_null_skcipher()'
  [A] 'function int crypto_grab_aead(crypto_aead_spawn*, crypto_instance*, const char*, u32, u32)'
  [A] 'function int crypto_grab_ahash(crypto_ahash_spawn*, crypto_instance*, const char*, u32, u32)'
  [A] 'function int crypto_grab_shash(crypto_shash_spawn*, crypto_instance*, const char*, u32, u32)'
  [A] 'function int crypto_grab_skcipher(crypto_skcipher_spawn*, crypto_instance*, const char*, u32, u32)'
  [A] 'function void crypto_inc(u8*, unsigned int)'
  [A] 'function int crypto_inst_setname(crypto_instance*, const char*, crypto_alg*)'
  [A] 'function void crypto_put_default_null_skcipher()'
  [A] 'function int crypto_register_shash(shash_alg*)'
  [A] 'function int crypto_register_shashes(shash_alg*, int)'
  [A] 'function int crypto_register_skciphers(skcipher_alg*, int)'
  [A] 'function int crypto_register_template(crypto_template*)'
  [A] 'function int crypto_register_templates(crypto_template*, int)'
  [A] 'function void crypto_remove_final(list_head*)'
  [A] 'function void crypto_remove_spawns(crypto_alg*, list_head*, crypto_alg*)'
  [A] 'function void crypto_req_done(crypto_async_request*, int)'
  [A] 'function int crypto_sha1_finup(shash_desc*, const u8*, unsigned int, u8*)'
  [A] 'function int crypto_sha1_update(shash_desc*, const u8*, unsigned int)'
  [A] 'function bool crypto_shash_alg_has_setkey(shash_alg*)'
  [A] 'function int crypto_shash_tfm_digest(crypto_shash*, const unsigned char*, unsigned int, unsigned char*)'
  [A] 'function void* crypto_spawn_tfm2(crypto_spawn*)'
  [A] 'function void crypto_unregister_shash(shash_alg*)'
  [A] 'function void crypto_unregister_shashes(shash_alg*, int)'
  [A] 'function void crypto_unregister_skciphers(skcipher_alg*, int)'
  [A] 'function void crypto_unregister_template(crypto_template*)'
  [A] 'function void crypto_unregister_templates(crypto_template*, int)'
  [A] 'function void del_random_ready_callback(random_ready_callback*)'
  [A] 'function void gf128mul_lle(be128*, const be128*)'
  [A] 'function void kernel_neon_begin()'
  [A] 'function void kernel_neon_end()'
  [A] 'function void sha1_transform(unsigned int*, const char*, unsigned int*)'
  [A] 'function void sha224_final(sha256_state*, u8*)'
  [A] 'function void sha256(const unsigned char*, unsigned int, unsigned char*)'
  [A] 'function void sha256_final(sha256_state*, u8*)'
  [A] 'function void sha256_update(sha256_state*, const unsigned char*, unsigned int)'
  [A] 'function void shash_free_singlespawn_instance(shash_instance*)'
  [A] 'function int shash_register_instance(crypto_template*, shash_instance*)'
  [A] 'function skcipher_instance* skcipher_alloc_instance_simple(crypto_template*, rtattr**)'
  [A] 'function int skcipher_register_instance(crypto_template*, skcipher_instance*)'
  [A] 'function int skcipher_walk_aead_decrypt(skcipher_walk*, aead_request*, bool)'
  [A] 'function int skcipher_walk_aead_encrypt(skcipher_walk*, aead_request*, bool)'
  [A] 'function int skcipher_walk_done(skcipher_walk*, int)'
  [A] 'function int skcipher_walk_virt(skcipher_walk*, skcipher_request*, bool)'

10 Added variables:

  [A] 'tracepoint __tracepoint_android_vh_aes_decrypt'
  [A] 'tracepoint __tracepoint_android_vh_aes_encrypt'
  [A] 'tracepoint __tracepoint_android_vh_aes_expandkey'
  [A] 'tracepoint __tracepoint_android_vh_sha256'
  [A] 'list_head crypto_alg_list'
  [A] 'rw_semaphore crypto_alg_sem'
  [A] 'const u32 crypto_ft_tab[4][256]'
  [A] 'const u32 crypto_it_tab[4][256]'
  [A] 'bool fpsimd_context_busy'
  [A] 'irq_cpustat_t irq_stat'

1 Added function symbol not referenced by debug info:

  [A] sha256_block_data_order

2 Added variable symbols not referenced by debug info:

  [A] crypto_aes_inv_sbox
  [A] crypto_aes_sbox

Bug: 153614920
Bug: 188620248
Change-Id: I998bca871f6a7c08a78e2537586653bcb0308ed1
Signed-off-by: Ard Biesheuvel <ardb@google.com>
2021-06-11 07:49:59 +00:00
Ard Biesheuvel
868be244bb ANDROID: inject correct HMAC digest into fips140.ko at build time
Inject the HMAC digest into the fips140.ko module once it has been
built. This involves a post-link step, so we need to use a special
Makefile that is wired up in the right way, and includes the special
handling only for fips140.ko in particular.

Bug: 153614920
Bug: 188620248
Change-Id: Ic66086a05fa997850ca15dedbbc14fc73f6f0da6
Signed-off-by: Ard Biesheuvel <ardb@google.com>
2021-06-11 07:49:58 +00:00
Ard Biesheuvel
6be141eb36 ANDROID: crypto: fips140 - perform load time integrity check
In order to comply with FIPS 140-2 requirements, implement a fips140
module that carries all AES, SHA-xxx and DRBG implementations with the
associated chaining mode templates, and perform an integrity selfcheck
at load time. The algorithms contained in the module will be registered
with the crypto API, and will supersede any existing copies of the same
algorithms that were already being provided by the core kernel.

Bug: 153614920
Bug: 188620248
Test: boot tested on Pixel hw both with and without a live algo ('hmac(sha1-ce)')
Change-Id: Ia893d9992fc12e2617d1ed2899c9794859c389d1
Signed-off-by: Ard Biesheuvel <ardb@google.com>
2021-06-11 07:49:58 +00:00
Ard Biesheuvel
0672a69424 FROMLIST: crypto: shash - stop comparing function pointers to avoid breaking CFI
crypto_shash_alg_has_setkey() is implemented by testing whether the
.setkey() member of a struct shash_alg points to the default version
called shash_no_setkey(). As crypto_shash_alg_has_setkey() is a static
inline, this requires shash_no_setkey() to be exported to modules.

Unfortunately, when building with CFI, function pointers are routed
via CFI stubs which are private to each module (or to the kernel proper)
and so this function pointer comparison may fail spuriously.

Let's fix this by turning crypto_shash_alg_has_setkey() into an out of
line function, which makes the problem go away.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Bug: 153614920
Bug: 188620248
Link: https://lore.kernel.org/linux-crypto/20210610062150.212779-1-ardb@kernel.org
Change-Id: Ib94d812e2668020144bf8246ddbbc8b652cdf2b7
Signed-off-by: Ard Biesheuvel <ardb@google.com>
2021-06-11 07:49:58 +00:00
Ard Biesheuvel
254da9ba36 ANDROID: arm64: module: preserve RELA sections for FIPS140 integrity selfcheck
The FIPS 140-2 integrity check compares the runtime code with a digest
that was created at build time. Given that the module's placement in
virtual memory is an a priori unknown, we cannot account for this at
build time, and so we need to do so at runtime instead.

In order to revert the code to the build time state, we need to know
which changes the module loader applied to it. These changes are based
on the RELA ELF section that describes the changes that the module
loader must apply, and so to unapply these changes, we need to preserve
the RELA section when loading the module.

So add a special case for a module called 'fips140' in the module
loader, and copy the RELA sections applying to .text and .rodata to a
temporary buffer that the fips140.ko init code can access.

Bug: 153614920
Bug: 188620248
Change-Id: I97d69053c6657b104a3a9ea10af78a53ce52c6e5
Signed-off-by: Ard Biesheuvel <ardb@google.com>
2021-06-11 07:49:58 +00:00
Ard Biesheuvel
15f0fc91e1 ANDROID: arm64: simd: omit capability check in may_use_simd()
may_use_simd() should only be called by code that may use FP/SIMD when
it is available, and so checking whether the system supports FP/SIMD in
the first place should be redundant - the caller in question (e.g., a
SIMD crypto algorithm) should never be initialized in the first place.

Checking the system capability involves jump labels and therefore code
patching, which interferes with our ability to perform an integrity
check on some of the crypto code. So let's get rid of the capability
check altogether.

Bug: 153614920
Bug: 188620248
Change-Id: Ia8df624f4648cc980a12a44eeb82e8f186d5f961
Signed-off-by: Ard Biesheuvel <ardb@google.com>
2021-06-11 07:49:58 +00:00
Ard Biesheuvel
6772dcc141 ANDROID: kbuild: lto: permit the use of .a archives in LTO modules
Permit the use of AR archives in .a format as input to the partial link
that produces a kernel module. This permits a set of builtin objects to
be bundled with a module object, to create a single module carrying the
payload of several modules. This is used by the FIPS 140 module.

Bug: 153614920
Bug: 188620248
Change-Id: I7183e6922a03aed498f947062bf0d36709371294
Signed-off-by: Ard Biesheuvel <ardb@google.com>
2021-06-11 07:49:58 +00:00
Ard Biesheuvel
ddea30c684 ANDROID: arm64: only permit certain alternatives in the FIPS140 module
The FIPS140 crypto module takes a HMAC digest of its own .text and
.rodata section in its module_init() hook. This digest is compared to a
digest taken at build time, which means that we need to take some extra
care to ensure that the build time and runtime versions line up.

One thing we cannot tolerate in this case is alternatives patching. In
the general case, we cannot simply ignore alternatives, but fortunately,
there is only a small subset that actually gets instantiated in the
FIPS140 module, and all of these can be ignored if we are willing to
accept that the FIPS140 module does not support VHE hardware, and does
not work when running with pseudo-NMI support enabled. None of this is
important for the use case targeted by the FIPS140 module, so this is
something we should be able to live with.

Bug: 153614920
Bug: 188620248
Change-Id: Ie6666e01d5524a3c33aa451609bab2f29b612f8c
Signed-off-by: Ard Biesheuvel <ardb@google.com>
2021-06-11 07:49:57 +00:00
Ard Biesheuvel
9c556792b7 ANDROID: crypto: lib/aes - add vendor hooks for AES library routines
Add vendor hooks that will allow the FIPS140 kernel module to override
the implementations of the AES library routines. The FIPS 140 versions
are identical to the normal ones, but their code and rodata will have been
integrity checked at module load time.

Bug: 153614920
Bug: 188620248
Change-Id: I5711fc42eced903565fd3c8d41ca7cdd82641148
Signed-off-by: Ard Biesheuvel <ardb@google.com>
2021-06-11 07:49:57 +00:00
Ard Biesheuvel
7a689ebc67 ANDROID: crypto: lib/sha256 - add vendor hook for sha256() routine
Add a vendor hook that will allow the FIPS140 kernel module to override
the implementation of the sha256() library routine. The FIPS 140 version
is identical to the normal one, but its code and rodata will have been
integrity checked at module load time.

Bug: 153614920
Bug: 188620248
Change-Id: I8ccc4f0cc8206af39fa922134b438dacac2a614a
Signed-off-by: Ard Biesheuvel <ardb@google.com>
2021-06-11 07:49:57 +00:00
Quentin Perret
4190dbd6ad UPSTREAM: KVM: arm64: Mark the host stage-2 memory pools static
The host stage-2 memory pools are not used outside of mem_protect.c,
mark them static.

Fixes: 1025c8c0c6ac ("KVM: arm64: Wrap the host with a stage 2")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210514085640.3917886-3-qperret@google.com
(cherry picked from commit 3fdc15fe8c6445175d61f0fac111d2ee9354e385)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I33805323f830f541e0c0827947017a3ed53da679
2021-06-10 20:26:56 -07:00
Jisheng Zhang
6288fa47f4 UPSTREAM: arm64: mm: don't use CON and BLK mapping if KFENCE is enabled
When we added KFENCE support for arm64, we intended that it would
force the entire linear map to be mapped at page granularity, but we
only enforced this in arch_add_memory() and not in map_mem(), so
memory mapped at boot time can be mapped at a larger granularity.

When booting a kernel with KFENCE=y and RODATA_FULL=n, this results in
the following WARNING at boot:

[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 0 PID: 0 at mm/memory.c:2462 apply_to_pmd_range+0xec/0x190
[    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.13.0-rc1+ #10
[    0.000000] Hardware name: linux,dummy-virt (DT)
[    0.000000] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO BTYPE=--)
[    0.000000] pc : apply_to_pmd_range+0xec/0x190
[    0.000000] lr : __apply_to_page_range+0x94/0x170
[    0.000000] sp : ffffffc010573e20
[    0.000000] x29: ffffffc010573e20 x28: ffffff801f400000 x27: ffffff801f401000
[    0.000000] x26: 0000000000000001 x25: ffffff801f400fff x24: ffffffc010573f28
[    0.000000] x23: ffffffc01002b710 x22: ffffffc0105fa450 x21: ffffffc010573ee4
[    0.000000] x20: ffffff801fffb7d0 x19: ffffff801f401000 x18: 00000000fffffffe
[    0.000000] x17: 000000000000003f x16: 000000000000000a x15: ffffffc01060b940
[    0.000000] x14: 0000000000000000 x13: 0098968000000000 x12: 0000000098968000
[    0.000000] x11: 0000000000000000 x10: 0000000098968000 x9 : 0000000000000001
[    0.000000] x8 : 0000000000000000 x7 : ffffffc010573ee4 x6 : 0000000000000001
[    0.000000] x5 : ffffffc010573f28 x4 : ffffffc01002b710 x3 : 0000000040000000
[    0.000000] x2 : ffffff801f5fffff x1 : 0000000000000001 x0 : 007800005f400705
[    0.000000] Call trace:
[    0.000000]  apply_to_pmd_range+0xec/0x190
[    0.000000]  __apply_to_page_range+0x94/0x170
[    0.000000]  apply_to_page_range+0x10/0x20
[    0.000000]  __change_memory_common+0x50/0xdc
[    0.000000]  set_memory_valid+0x30/0x40
[    0.000000]  kfence_init_pool+0x9c/0x16c
[    0.000000]  kfence_init+0x20/0x98
[    0.000000]  start_kernel+0x284/0x3f8

Fixes: 840b23986344 ("arm64, kfence: enable KFENCE for ARM64")
Cc: <stable@vger.kernel.org> # 5.12.x
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Marco Elver <elver@google.com>
Tested-by: Marco Elver <elver@google.com>
Link: https://lore.kernel.org/r/20210525104551.2ec37f77@xhacker.debian
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit e69012400b0cb42b2070748322cb72f9effec00f)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I46a49466b8db835a00b635a53bb78d3a12cd0e3b
2021-06-10 20:26:54 -07:00
Nathan Chancellor
e44e1f38be UPSTREAM: x86/build: Fix location of '-plugin-opt=' flags
Commit b33fff07e3e3 ("x86, build: allow LTO to be selected") added a
couple of '-plugin-opt=' flags to KBUILD_LDFLAGS because the code model
and stack alignment are not stored in LLVM bitcode.

However, these flags were added to KBUILD_LDFLAGS prior to the
emulation flag assignment, which uses ':=', so they were overwritten
and never added to $(LD) invocations.

The absence of these flags caused misalignment issues in the
AMDGPU driver when compiling with CONFIG_LTO_CLANG, resulting in
general protection faults.

Shuffle the assignment below the initial one so that the flags are
properly passed along and all of the linker flags stay together.

At the same time, avoid any future issues with clobbering flags by
changing the emulation flag assignment to '+=' since KBUILD_LDFLAGS is
already defined with ':=' in the main Makefile before being exported for
modification here as a result of commit:

  ce99d0bf31 ("kbuild: clear LDFLAGS in the top Makefile")

Fixes: b33fff07e3e3 ("x86, build: allow LTO to be selected")
Reported-by: Anthony Ruhier <aruhier@mailbox.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Anthony Ruhier <aruhier@mailbox.org>
Cc: stable@vger.kernel.org
Link: https://github.com/ClangBuiltLinux/linux/issues/1374
Link: https://lore.kernel.org/r/20210518190106.60935-1-nathan@kernel.org
(cherry picked from commit 0024430e920f2900654ad83cd081cf52e02a3ef5)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I9f9c056829483f341251cc7407d0029c05e8b503
2021-06-10 20:26:52 -07:00
Luca Stefani
5df654d642 UPSTREAM: binder: Return EFAULT if we fail BINDER_ENABLE_ONEWAY_SPAM_DETECTION
All the other ioctl paths return EFAULT in case the
copy_from_user/copy_to_user call fails, make oneway spam detection
follow the same paradigm.

Fixes: a7dc1e6f99df ("binder: tell userspace to dump current backtrace when detected oneway spamming")
Acked-by: Todd Kjos <tkjos@google.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Luca Stefani <luca.stefani.ge1@gmail.com>
Link: https://lore.kernel.org/r/20210506193726.45118-1-luca.stefani.ge1@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ced081a436d21a7d34d4d42acb85058f9cf423f2)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I7c5e6ec7108c42721de6c82f4c1e9ff3d4f0e88d
2021-06-10 20:26:49 -07:00
Zhen Lei
2aee873ab2 UPSTREAM: usb: dwc3: imx8mp: fix error return code in dwc3_imx8mp_probe()
Fix to return a negative error code from the error handling case instead
of 0, as done elsewhere in this function.

Fixes: 6dd2565989b4 ("usb: dwc3: add imx8mp dwc3 glue layer driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210508015310.1627-1-thunder.leizhen@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 0b2b149e918f6dddb4ea53615551bf7bc131f875)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Ib16b20081ca496276a86792a08c039115fd38fd6
2021-06-10 20:26:47 -07:00
Thinh Nguyen
ff1eb3fcd0 UPSTREAM: usb: dwc3: core: Add missing GHWPARAMS9 doc
Add missing documentation for struct dwc3_hwparams new field hwparams9
to avoid kernel doc build warning.

Fixes: 16710380d3aa ("usb: dwc3: Capture new capability register GHWPARAMS9")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/f4c491f7614e623755fafe640b7e690e7c5634e2.1619471127.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9cbc7eb17cdf6d1adaa2aebfe0079077d31d39a9)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Ib912141546f4b90770d2ad1cdc66bf4323bb5970
2021-06-10 20:26:45 -07:00
Wang Wensheng
52ce94e8bf UPSTREAM: KVM: arm64: Fix error return code in init_hyp_mode()
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: eeeee7193df0 ("KVM: arm64: Bootstrap PSCI SMC handler in nVHE EL2")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210406121759.5407-1-wangwensheng4@huawei.com
(cherry picked from commit 52b9e265d22bccc5843e167da76ab119874e2883)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Iaac1f2e2d7f99fe0d2337533eeaf8aa79623e224
2021-06-10 20:26:43 -07:00
David Brazdil
67d005b0ac UPSTREAM: KVM: arm64: Support PREL/PLT relocs in EL2 code
gen-hyprel tool parses object files of the EL2 portion of KVM
and generates runtime relocation data. While only filtering for
R_AARCH64_ABS64 relocations in the input object files, it has an
allow-list of relocation types that are used for relative
addressing. Other, unexpected, relocation types are rejected and
cause the build to fail.

This allow-list did not include the position-relative relocation
types R_AARCH64_PREL64/32/16 and the recently introduced _PLT32.
While not seen used by toolchains in the wild, add them to the
allow-list for completeness.

Fixes: 8c49b5d43d4c ("KVM: arm64: Generate hyp relocation data")
Cc: <stable@vger.kernel.org>
Reported-by: Will Deacon <will@kernel.org>
Signed-off-by: David Brazdil <dbrazdil@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210331133048.63311-1-dbrazdil@google.com
(cherry picked from commit 77e06b300161d41d65950be9c77a785c142b381d)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Ide671e628e7c1bd48079385d0354cc1dafcfb2ef
2021-06-10 20:26:41 -07:00
Dafna Hirschfeld
c04f2026cf UPSTREAM: iommu/mediatek: Always enable the clk on resume
In mtk_iommu_runtime_resume always enable the clk, even
if m4u_dom is null. Otherwise the 'suspend' cb might
disable the clk which is already disabled causing the warning:

[    1.586104] infra_m4u already disabled
[    1.586133] WARNING: CPU: 0 PID: 121 at drivers/clk/clk.c:952 clk_core_disable+0xb0/0xb8
[    1.594391] mtk-iommu 10205000.iommu: bound 18001000.larb (ops mtk_smi_larb_component_ops)
[    1.598108] Modules linked in:
[    1.598114] CPU: 0 PID: 121 Comm: kworker/0:2 Not tainted 5.12.0-rc5 #69
[    1.609246] mtk-iommu 10205000.iommu: bound 14027000.larb (ops mtk_smi_larb_component_ops)
[    1.617487] Hardware name: Google Elm (DT)
[    1.617491] Workqueue: pm pm_runtime_work
[    1.620545] mtk-iommu 10205000.iommu: bound 19001000.larb (ops mtk_smi_larb_component_ops)

[    1.627229] pstate: 60000085 (nZCv daIf -PAN -UAO -TCO BTYPE=--)
[    1.659297] pc : clk_core_disable+0xb0/0xb8
[    1.663475] lr : clk_core_disable+0xb0/0xb8
[    1.667652] sp : ffff800011b9bbe0
[    1.670959] x29: ffff800011b9bbe0 x28: 0000000000000000
[    1.676267] x27: ffff800011448000 x26: ffff8000100cfd98
[    1.681574] x25: ffff800011b9bd48 x24: 0000000000000000
[    1.686882] x23: 0000000000000000 x22: ffff8000106fad90
[    1.692189] x21: 000000000000000a x20: ffff0000c0048500
[    1.697496] x19: ffff0000c0048500 x18: ffffffffffffffff
[    1.702804] x17: 0000000000000000 x16: 0000000000000000
[    1.708112] x15: ffff800011460300 x14: fffffffffffe0000
[    1.713420] x13: ffff8000114602d8 x12: 0720072007200720
[    1.718727] x11: 0720072007200720 x10: 0720072007200720
[    1.724035] x9 : ffff800011b9bbe0 x8 : ffff800011b9bbe0
[    1.729342] x7 : 0000000000000009 x6 : ffff8000114b8328
[    1.734649] x5 : 0000000000000000 x4 : 0000000000000000
[    1.739956] x3 : 00000000ffffffff x2 : ffff800011460298
[    1.745263] x1 : 1af1d7de276f4500 x0 : 0000000000000000
[    1.750572] Call trace:
[    1.753010]  clk_core_disable+0xb0/0xb8
[    1.756840]  clk_core_disable_lock+0x24/0x40
[    1.761105]  clk_disable+0x20/0x30
[    1.764501]  mtk_iommu_runtime_suspend+0x88/0xa8
[    1.769114]  pm_generic_runtime_suspend+0x2c/0x48
[    1.773815]  __rpm_callback+0xe0/0x178
[    1.777559]  rpm_callback+0x24/0x88
[    1.781041]  rpm_suspend+0xdc/0x470
[    1.784523]  rpm_idle+0x12c/0x170
[    1.787831]  pm_runtime_work+0xa8/0xc0
[    1.791573]  process_one_work+0x1e8/0x360
[    1.795580]  worker_thread+0x44/0x478
[    1.799237]  kthread+0x150/0x158
[    1.802460]  ret_from_fork+0x10/0x30
[    1.806034] ---[ end trace 82402920ef64573b ]---
[    1.810728] ------------[ cut here ]------------

In addition, we now don't need to enable the clock from the
function mtk_iommu_hw_init since it is already enabled by the resume.

Fixes: c0b57581b73b ("iommu/mediatek: Add power-domain operation")
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Reviewed-by: Yong Wu <yong.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210416105449.4744-1-dafna.hirschfeld@collabora.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
(cherry picked from commit b34ea31fe013569d42b7e8681ef3f717f77c5b72)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: If9eb88adbbde95ace7b61c212938b109929c3fe3
2021-06-10 20:26:38 -07:00
Sergei Trofimovich
c46f002566 UPSTREAM: mm: page_alloc: ignore init_on_free=1 for debug_pagealloc=1
On !ARCH_SUPPORTS_DEBUG_PAGEALLOC (like ia64) debug_pagealloc=1 implies
page_poison=on:

    if (page_poisoning_enabled() ||
         (!IS_ENABLED(CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC) &&
          debug_pagealloc_enabled()))
            static_branch_enable(&_page_poisoning_enabled);

page_poison=on needs to override init_on_free=1.

Before the change it did not work as expected for the following case:
- have PAGE_POISONING=y
- have page_poison unset
- have !ARCH_SUPPORTS_DEBUG_PAGEALLOC arch (like ia64)
- have init_on_free=1
- have debug_pagealloc=1

That way we get both keys enabled:
- static_branch_enable(&init_on_free);
- static_branch_enable(&_page_poisoning_enabled);

which leads to poisoned pages returned for __GFP_ZERO pages.

After the change we execute only:
- static_branch_enable(&_page_poisoning_enabled);
  and ignore init_on_free=1.

Link: https://lkml.kernel.org/r/20210329222555.3077928-1-slyfox@gentoo.org
Link: https://lkml.org/lkml/2021/3/26/443
Fixes: 8db26a3d4735 ("mm, page_poison: use static key more efficiently")
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 9df65f522536719682bccd24245ff94db956256c)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I6c91221b58123dfd820c493442ad6060de9f4704
2021-06-10 20:26:36 -07:00
Mauro Carvalho Chehab
282faf9977 UPSTREAM: dt-bindings: iommu: mediatek: update mediatek,iommu.yaml references
Changeset bca28426805d ("dt-bindings: iommu: mediatek: Convert IOMMU to DT schema")
renamed: Documentation/devicetree/bindings/iommu/mediatek,iommu.txt
to: Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml.

Update the cross-references accordingly.

Fixes: bca28426805d ("dt-bindings: iommu: mediatek: Convert IOMMU to DT schema")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
(cherry picked from commit 0378027396a1115267d15f42fe55cee4c932f0e9)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Iaf920c9e9ac771e981c92a9018da9f160e75df63
2021-06-10 20:26:34 -07:00
Arnd Bergmann
db8e491a1b UPSTREAM: media: mtk: fix mtk-smi dependency
The mtk-smi driver can now be built as a loadable module, but
this leads to a build time regression when the drivers that
depend on it are built-in:

aarch64-linux-ld: drivers/media/platform/mtk-mdp/mtk_mdp_comp.o: in function `mtk_mdp_comp_clock_on':
mtk_mdp_comp.c:(.text.mtk_mdp_comp_clock_on+0x54): undefined reference to `mtk_smi_larb_get'
aarch64-linux-ld: drivers/media/platform/mtk-mdp/mtk_mdp_comp.o: in function `mtk_mdp_comp_clock_off':
mtk_mdp_comp.c:(.text.mtk_mdp_comp_clock_off+0x12c): undefined reference to `mtk_smi_larb_put'

Add a dependency on the interface, but keep allowing
compile-testing without that driver, as it was originally
intended.

Fixes: 50fc8d9232cd ("memory: mtk-smi: Allow building as module")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
(cherry picked from commit 4fade8329ab2be2b902fce8db3625fd12234b873)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I633614c76aa15a9320d365850bddc1e1e4c06bee
2021-06-10 20:26:32 -07:00
Heikki Krogerus
def7a8e7d7 UPSTREAM: software node: Allow node addition to already existing device
If the node is added to an already exiting device, the node
needs to be also linked to the device separately.

This will make sure the reference count is kept in balance
also when the node is injected to a device afterwards.

Fixes: e68d0119e328 ("software node: Introduce device_add_software_node()")
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210414075438.64547-1-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit b622b24519f5b008f6d4e20e5675eaffa8fbd87b)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I72ab0d95f5b936674e9cf1e567c287799fe6a718
2021-06-10 20:26:29 -07:00
Mike Leach
d0db984f3e UPSTREAM: coresight: etm-perf: Fix define build issue when built as module
CONFIG_CORESIGHT_SOURCE_ETM4X is undefined when built as module,
CONFIG_CORESIGHT_SOURCE_ETM4X_MODULE is defined instead.

Therefore code in format_attr_contextid_show() not correctly complied
when coresight built as module.

Use IS_ENABLED(CONFIG_CORESIGHT_SOURCE_ETM4X) to correct this.

Link: https://lore.kernel.org/r/20210414194808.22872-1-mike.leach@linaro.org
Fixes: 88f11864cf1d ("coresight: etm-perf: Support PID tracing for kernel at EL2")
Reviewed-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210415202404.945368-2-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9204ff94868496f2d9b8b173af52ec455160c364)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I9bd70169cfa9e5181ca53455ccd9ecf5fa461a79
2021-06-10 20:26:27 -07:00
Sean Christopherson
3ddee7b2ee UPSTREAM: kbuild: lto: Merge module sections if and only if CONFIG_LTO_CLANG is enabled
Merge module sections only when using Clang LTO. With ld.bfd, merging
sections does not appear to update the symbol tables for the module,
e.g. 'readelf -s' shows the value that a symbol would have had, if
sections were not merged. ld.lld does not show this problem.

The stale symbol table breaks gdb's function disassembler, and presumably
other things, e.g.

  gdb -batch -ex "file arch/x86/kvm/kvm.ko" -ex "disassemble kvm_init"

reads the wrong bytes and dumps garbage.

Fixes: dd2776222abb ("kbuild: lto: merge module sections")
Cc: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Tested-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210322234438.502582-1-seanjc@google.com
(cherry picked from commit 6a3193cdd5e5b96ac65f04ee42555c216da332af)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I295d9a6b71a41fd1585059d0f48a2a2c13eb2361
2021-06-10 20:26:25 -07:00
David Gow
94cf2b2d1d UPSTREAM: kunit: tool: Disable PAGE_POISONING under --alltests
kunit_tool maintains a list of config options which are broken under
UML, which we exclude from an otherwise 'make ARCH=um allyesconfig'
build used to run all tests with the --alltests option.

Something in UML allyesconfig is causing segfaults when page poisining
is enabled (and is poisoning with a non-zero value). Previously, this
didn't occur, as allyesconfig enabled the CONFIG_PAGE_POISONING_ZERO
option, which worked around the problem by zeroing memory. This option
has since been removed, and memory is now poisoned with 0xAA, which
triggers segfaults in many different codepaths, preventing UML from
booting.

Note that we have to disable both CONFIG_PAGE_POISONING and
CONFIG_DEBUG_PAGEALLOC, as the latter will 'select' the former on
architectures (such as UML) which don't implement __kernel_map_pages().

Ideally, we'd fix this properly by tracking down the real root cause,
but since this is breaking KUnit's --alltests feature, it's worth
disabling there in the meantime so the kernel can boot to the point
where tests can actually run.

Fixes: f289041ed4cf ("mm, page_poison: remove CONFIG_PAGE_POISONING_ZERO")
Signed-off-by: David Gow <davidgow@google.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
(cherry picked from commit 7fd53f41f771d250eb08db08650940f017e37c26)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Ia4a6bc590a7a5d3aa915a738fd83c50a748f1cbe
2021-06-10 20:26:23 -07:00
Wei Yongjun
a1cc08d515 UPSTREAM: gpiolib: Fix error return code in gpiolib_dev_init()
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 4731210c09f5 ("gpiolib: Bind gpio_device to a driver to enable fw_devlink=on by default")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
(cherry picked from commit 3875721e825cf3ab05fc1a52b6cbd76c8d16da51)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Ib4baa8a2e1952468f971dfb6fbdfefd827275519
2021-06-10 20:26:20 -07:00
Arnd Bergmann
5f7ec0f4c3 UPSTREAM: memblock: fix section mismatch warning
The inlining logic in clang-13 is rewritten to often not inline some
functions that were inlined by all earlier compilers.

In case of the memblock interfaces, this exposed a harmless bug of a
missing __init annotation:

WARNING: modpost: vmlinux.o(.text+0x507c0a): Section mismatch in reference from the function memblock_bottom_up() to the variable .meminit.data:memblock
The function memblock_bottom_up() references
the variable __meminitdata memblock.
This is often because memblock_bottom_up lacks a __meminitdata
annotation or the annotation of memblock is wrong.

Interestingly, these annotations were present originally, but got removed
with the explanation that the __init annotation prevents the function from
getting inlined.  I checked this again and found that while this is the
case with clang, gcc (version 7 through 10, did not test others) does
inline the functions regardless.

As the previous change was apparently intended to help the clang builds,
reverting it to help the newer clang versions seems appropriate as well.
gcc builds don't seem to care either way.

Link: https://lkml.kernel.org/r/20210225133808.2188581-1-arnd@kernel.org
Fixes: 5bdba520c1b3 ("mm: memblock: drop __init from memblock functions to make it inline")
Reference: 2cfb3665e8 ("include/linux/memblock.h: add __init to memblock_set_bottom_up()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Faiyaz Mohammed <faiyazm@codeaurora.org>
Cc: Baoquan He <bhe@redhat.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Aslan Bakirov <aslan@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 34dc2efb39a231280fd6696a59bbe712bf3c5c4a)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I0940378d103fe706d408b7524acddf47f0ecc79d
2021-06-10 20:26:18 -07:00
Heikki Krogerus
96fd9e07c0 UPSTREAM: software node: Fix device_add_software_node()
The function device_add_software_node() was meant to
register the node supplied to it, but only if that node
wasn't already registered. Right now the function attempts
to always register the node. That will cause a failure with
nodes that are already registered.

Fixing that by incrementing the reference count of the nodes
that have already been registered, and only registering the
new nodes. Also, clarifying the behaviour in the function
documentation.

Fixes: e68d0119e328 ("software node: Introduce device_add_software_node()")
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 2a92c90f2ecca4475d6050f2f938a1755a8954cc)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I77cb04fd58bfba05622ca8f4264ea45565529049
2021-06-10 20:26:16 -07:00
Johan Hovold
4378c305d9 UPSTREAM: gpio: fix NULL-deref-on-deregistration regression
Fix a NULL-pointer deference when deregistering the gpio character
device that was introduced by the recent stub-driver hack. When the new
"driver" is unbound as part of deregistration, driver core clears the
driver-data pointer which is used to retrieve the struct gpio_device in
its release callback.

Fix this by using container_of() in the release callback as should have
been done all along.

Fixes: 4731210c09f5 ("gpiolib: Bind gpio_device to a driver to enable fw_devlink=on by default")
Cc: Saravana Kannan <saravanak@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reported-by: syzbot+d27b4c8adbbff70fbfde@syzkaller.appspotmail.com
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
(cherry picked from commit a6112998ee45514def58200a7914706c0703f3d7)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: If877374ea82aad46ca9750cb9f42df7e46137561
2021-06-10 20:26:13 -07:00
Masahiro Yamada
2fc5237198 BACKPORT: kbuild: fix UNUSED_KSYMS_WHITELIST for Clang LTO
Commit fbe078d397b4 ("kbuild: lto: add a default list of used symbols")
does not work as expected if the .config file has already specified
CONFIG_UNUSED_KSYMS_WHITELIST="my/own/white/list" before enabling
CONFIG_LTO_CLANG.

So, the user-supplied whitelist and LTO-specific white list must be
independent of each other.

I refactored the shell script so CONFIG_MODVERSIONS and CONFIG_CLANG_LTO
handle whitelists in the same way.

Fixes: fbe078d397b4 ("kbuild: lto: add a default list of used symbols")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
(cherry picked from commit a6aaeb841198016083663ae56c568de4e065d090)
[fix conflicts due to renaming of lto-used-symbols.txt]
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I044ce75df5a3eb82adeb5bae665192eb836e8c63
2021-06-10 20:26:11 -07:00
Arnd Bergmann
f107d073ce UPSTREAM: kbuild: lto: add _mcount to list of used symbols
Some randconfig builds fail with undefined references to _mcount
when CONFIG_TRIM_UNUSED_KSYMS is set:

ERROR: modpost: "_mcount" [drivers/tee/optee/optee.ko] undefined!
ERROR: modpost: "_mcount" [drivers/fsi/fsi-occ.ko] undefined!
ERROR: modpost: "_mcount" [drivers/fpga/dfl-pci.ko] undefined!

Since there is already a list of symbols that get generated at link
time, add this one as well.

Fixes: fbe078d397b4 ("kbuild: lto: add a default list of used symbols")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
(cherry picked from commit da83616bcd3fa84233f6e37e2cf8cbfa979c6927)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I9e19b85b5ea81b1a0af3e835ed5f92c8a9c55765
2021-06-10 20:26:09 -07:00
Marc Zyngier
9bf26f0ace UPSTREAM: arm64: Add missing ISB after invalidating TLB in enter_vhe
Although there has been a bit of back and forth on the subject, it
appears that invalidating TLBs requires an ISB instruction after the
TLBI/DSB sequence when FEAT_ETS is not implemented by the CPU.

From the bible:

  | In an implementation that does not implement FEAT_ETS, a TLB
  | maintenance instruction executed by a PE, PEx, can complete at any
  | time after it is issued, but is only guaranteed to be finished for a
  | PE, PEx, after the execution of DSB by the PEx followed by a Context
  | synchronization event

Add the missing ISB in enter_vhe(), just in case.

Fixes: f359182291c7 ("arm64: Provide an 'upgrade to VHE' stub hypercall")
Suggested-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20210224093738.3629662-4-maz@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
(cherry picked from commit 430251cc864beb11ac5b6d2f5c6ef54ddd432612)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Id50f6f18605f0110afcee58a0cda34260235cccd
2021-06-10 20:26:07 -07:00
Masahiro Yamada
b1843022a9 UPSTREAM: kbuild: Move .thinlto-cache removal to 'make clean'
Instead of 'make distclean', 'make clean' should remove build artifacts
unneeded by external module builds. Obviously, you do not need to keep
this directory.

Fixes: dc5723b02e52 ("kbuild: add support for Clang LTO")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210225193912.3303604-1-masahiroy@kernel.org
(cherry picked from commit 4c7858b9001c85aacf86a74b3a68aa384bc33760)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I2126e71b9cf7d70e7192ac267f6b7d8fdf985bd3
2021-06-10 20:26:05 -07:00
Sami Tolvanen
4150d73816 UPSTREAM: parisc: select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
parisc uses -fpatchable-function-entry with dynamic ftrace, which means we
don't need recordmcount. Select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
to tell that to the build system.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Fixes: 3b15cdc15956 ("tracing: move function tracer options to Kconfig")
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210224225706.2726050-1-samitolvanen@google.com
(cherry picked from commit 3d1dc719bca9988e08a8d68363a5c2514ccaf5d4)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Id8d1f4ac0ed6b0e94566db229b4c45773d7891f1
2021-06-10 20:26:03 -07:00
Alexander Lobakin
e11b323bca UPSTREAM: kbuild: prevent CC_FLAGS_LTO self-bloating on recursive rebuilds
CC_FLAGS_LTO gets initialized only via +=, never with := or =.
When building with CONFIG_TRIM_UNUSED_KSYMS, Kbuild may perform
several kernel rebuilds to satisfy symbol dependencies. In this
case, value of CC_FLAGS_LTO is concatenated each time, which
triggers a full rebuild.
Initialize it with := to fix this.

Fixes: dc5723b02e52 ("kbuild: add support for Clang LTO")
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210121184544.659998-1-alobakin@pm.me
(cherry picked from commit 2b8689520520175075ca97bc4eaf51ff3f7253aa)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Id12534c0bfaec21e72b534a5a032161ff4606c73
2021-06-10 20:26:01 -07:00
Randy Dunlap
631b4dba04 UPSTREAM: regulator: qcom-rpmh: fix build after QCOM_COMMAND_DB is tristate
Restrict REGULATOR_QCOM_RPMH to QCOM_COMMAND_DB it the latter is enabled.

Fixes this build error:
  microblaze-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_probe':
  (.text+0x354): undefined reference to `cmd_db_read_addr'

Fixes: 778279f4f5e4 ("soc: qcom: cmd-db: allow loading as a module")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Lina Iyer <ilina@codeaurora.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Reviewed-by: Lina Iyer <ilina@codeaurora.org>
Link: https://lore.kernel.org/r/20201225185004.20747-1-rdunlap@infradead.org
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit ac6b559d818981406e587f4784777e9112d553f4)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Ic3d87283b9181134416c7c46d2bbc6ed33c7f68a
2021-06-10 20:26:00 -07:00
John Stultz
4e0d16b049 UPSTREAM: dma-buf: cma_heap: Include linux/vmalloc.h to fix build failures on MIPS
We need to include <linux/vmalloc.h> in order for MIPS to find
vmap(), as it doesn't otherwise get included there.

Without this patch, one can hit the following build error:
  drivers/dma-buf/heaps/cma_heap.c: In function 'cma_heap_do_vmap':
  drivers/dma-buf/heaps/cma_heap.c:195:10: error: implicit declaration of function 'vmap'

Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Liam Mark <lmark@codeaurora.org>
Cc: Laura Abbott <labbott@kernel.org>
Cc: Brian Starkey <Brian.Starkey@arm.com>
Cc: Hridya Valsaraju <hridya@google.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Sandeep Patil <sspatil@google.com>
Cc: Daniel Mentz <danielmentz@google.com>
Cc: Chris Goldsworthy <cgoldswo@codeaurora.org>
Cc: Ørjan Eide <orjan.eide@arm.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Ezequiel Garcia <ezequiel@collabora.com>
Cc: Simon Ser <contact@emersion.fr>
Cc: James Jones <jajones@nvidia.com>
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Fixes: a5d2d29e24be ("dma-buf: heaps: Move heap-helper logic into the cma_heap implementation")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20201216004931.113505-1-john.stultz@linaro.org
(cherry picked from commit 8075c3005e4b1efa12dbbf6e84bc412a713de92c)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Icc1f312d846620ce6900c8b4dbb2a26e1bc59e9a
2021-06-10 20:25:58 -07:00
Eric W. Biederman
4fef0d39b8 UPSTREAM: signal/parisc: Remove parisc specific definition of __ARCH_UAPI_SA_FLAGS
Randy Dunlap wrote:
> On 11/27/20 10:43 AM, Randy Dunlap wrote:
>
> > on parisc, _SA_SIGGFAULT is undefined and causing build errors.
> >
> > commit 23acdc76f1798b090bb9dcc90671cd29d929834e
> > Author: Peter Collingbourne <pcc@google.com>
> > Date:   Thu Nov 12 18:53:34 2020 -0800
> >
> >     signal: clear non-uapi flag bits when passing/returning sa_flags
> >
> >
> >
> > _SA_SIGGFAULT is not used or defined anywhere else in the
> > kernel source tree.
>
>
> Here is the build error (although it should be obvious):
>
> ../kernel/signal.c: In function 'do_sigaction':
> ../arch/parisc/include/asm/signal.h:24:30: error: '_SA_SIGGFAULT' undeclared (first use in this function)
>    24 | #define __ARCH_UAPI_SA_FLAGS _SA_SIGGFAULT
>       |                              ^~~~~~~~~~~~~

Stephen Rothwell pointed out:
> _SA_SIGGFAULT was removed by commit
>
>   41f5a81c07 ("parisc: Drop HP-UX specific fcntl and signal flags")
>
> which was added to Linus' tree in v5.10-rc1.

Solve this by removing the the parisc specific definition of
__ARCH_UAPI_SA_FLAGS that was just added.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Fixes: 23acdc76f179 ("signal: clear non-uapi flag bits when passing/returning sa_flags")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
(cherry picked from commit bc54a5cda97917155b8da0d99afe1dc0ed0b30db)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I0240e7d93d32f2e7d5bb997888ae168a87111776
2021-06-10 20:25:54 -07:00
Johannes Berg
259e0a28b9 UPSTREAM: nl80211: fix kernel-doc warning in the new SAE attribute
Format the items as a definition list, to avoid the warning
from the rst parsing.

Fixes: 9f0ffa418483 ("cfg80211: Add support to configure SAE PWE value to drivers")
Link: https://lore.kernel.org/r/20201110094911.bb020e863aa0.I960caf90e2a8cc23f6bf9245d77524df6a4d8f37@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit da1e9dd3a11cda85b58dafe64f091734934b2f6c)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Ia962bcdbc52f2019ff0ef957b512915bfc921fad
2021-06-10 20:25:50 -07:00
Maulik Shah
8cc6bf3aaf ANDROID: abi_gki_aarch64_qcom: Add cpuidle_psci and gic_resume symbols
This change adds cpuidle_psci_enter, cpuidle_psci_exit
and gic_resume tracepoint to whitelist.

Leaf changes summary: 7 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, 3 Added variables

4 Added functions:

  [A] 'function int __traceiter_android_vh_cpuidle_psci_enter(void*, cpuidle_device*, bool)'
  [A] 'function int __traceiter_android_vh_cpuidle_psci_exit(void*, cpuidle_device*, bool)'
  [A] 'function int __traceiter_android_vh_gic_resume(void*, irq_domain*, void*)'
  [A] 'function void gic_resume()'

3 Added variables:

  [A] 'tracepoint __tracepoint_android_vh_cpuidle_psci_enter'
  [A] 'tracepoint __tracepoint_android_vh_cpuidle_psci_exit'
  [A] 'tracepoint __tracepoint_android_vh_gic_resume'

Bug: 190353898
Change-Id: I2a373fcd0aaa28436fc4706e8dcbafb612bc340b
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
2021-06-10 22:07:32 +00:00
Maulik Shah
5fd82d3115 ANDROID: gic-v3: Export gic_resume() for vendor GIC enhancements
syscore ops in gic-v3 takes care of invoking gic_resume() when
exiting from "deep" suspend. However for "s2idle" suspend syscore
ops will not get invoked.

Vendor modules can register for s2idle notifications and
invoke gic_resume() when the first cpu is waking up from s2idle.

Bug: 190353898
Change-Id: I3d565ed3fd0fcada2231b10415dcf487fefc7c5f
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
2021-06-10 22:07:15 +00:00