Commit graph

877,194 commits

Author SHA1 Message Date
Alistair Delva
fc1e3e9554 ANDROID: clang: update to 10.0.4
Bug: 149785865
Change-Id: I35a240c483428ded6a584f105415f977e5f5e88f
Signed-off-by: Alistair Delva <adelva@google.com>
2020-02-19 19:33:24 +00:00
Liangcai Fan
34351d1081 ANDROID: ABI/Whitelist: initial unisoc whitelist
This adds a whitelist for the symbols used by the unisoc device.

Also, update the ABI representation accordingly.

44 Added functions:

  [A] 'function int __devm_iio_device_register(device*, iio_dev*, module*)'
  [A] 'function void __init_rwsem(rw_semaphore*, const char*, lock_class_key*)'
  [A] 'function int __spi_register_driver(module*, spi_driver*)'
  [A] 'function void _dev_emerg(const device*, const char*, ...)'
  [A] 'function int blocking_notifier_call_chain(blocking_notifier_head*, unsigned long int, void*)'
  [A] 'function int blocking_notifier_chain_register(blocking_notifier_head*, notifier_block*)'
  [A] 'function int blocking_notifier_chain_unregister(blocking_notifier_head*, notifier_block*)'
  [A] 'function fwnode_handle* device_get_named_child_node(device*, const char*)'
  [A] 'function int devm_extcon_register_notifier_all(device*, extcon_dev*, notifier_block*)'
  [A] 'function iio_dev* devm_iio_device_alloc(device*, int)'
  [A] 'function int devm_mfd_add_devices(device*, int, const mfd_cell*, int, resource*, int, irq_domain*)'
  [A] 'function pinctrl* devm_pinctrl_get(device*)'
  [A] 'function power_supply* devm_power_supply_register(device*, const power_supply_desc*, const power_supply_config*)'
  [A] 'function int devm_regmap_add_irq_chip(device*, regmap*, int, int, int, const regmap_irq_chip*, regmap_irq_chip_data**)'
  [A] 'function regulator* devm_regulator_get_optional(device*, const char*)'
  [A] 'function int fwnode_property_read_string(const fwnode_handle*, const char*, const char**)'
  [A] 'function int fwnode_property_read_u16_array(const fwnode_handle*, const char*, u16*, size_t)'
  [A] 'function int fwnode_property_read_u32_array(const fwnode_handle*, const char*, u32*, size_t)'
  [A] 'function int kobject_uevent(kobject*, kobject_action)'
  [A] 'function int match_string(const char* const*, size_t, const char*)'
  [A] 'function const char* of_prop_next_string(property*, const char*)'
  [A] 'function const char* pin_get_name(pinctrl_dev*, const unsigned int)'
  [A] 'function int pinconf_generic_parse_dt_config(device_node*, pinctrl_dev*, unsigned long int**, unsigned int*)'
  [A] 'function pinctrl_state* pinctrl_lookup_state(pinctrl*, const char*)'
  [A] 'function pinctrl_dev* pinctrl_register(pinctrl_desc*, device*, void*)'
  [A] 'function int pinctrl_select_state(pinctrl*, pinctrl_state*)'
  [A] 'function void pinctrl_unregister(pinctrl_dev*)'
  [A] 'function int pinctrl_utils_add_map_configs(pinctrl_dev*, pinctrl_map**, unsigned int*, unsigned int*, const char*, unsigned long int*, unsigned int, pinctrl_map_type)'
  [A] 'function int pinctrl_utils_add_map_mux(pinctrl_dev*, pinctrl_map**, unsigned int*, unsigned int*, const char*, const char*)'
  [A] 'function int pinctrl_utils_reserve_map(pinctrl_dev*, pinctrl_map**, unsigned int*, unsigned int*, unsigned int)'
  [A] 'function void power_supply_changed(power_supply*)'
  [A] 'function void* power_supply_get_drvdata(power_supply*)'
  [A] 'function irq_domain* regmap_irq_get_domain(regmap_irq_chip_data*)'
  [A] 'function void seq_putc(seq_file*, char)'
  [A] 'function int spi_sync(spi_device*, spi_message*)'
  [A] 'function regmap* syscon_regmap_lookup_by_phandle_args(device_node*, const char*, int, unsigned int*)'
  [A] 'function int sysfs_create_group(kobject*, const attribute_group*)'
  [A] 'function int sysfs_create_groups(kobject*, const attribute_group**)'
  [A] 'function int sysfs_create_link(kobject*, kobject*, const char*)'
  [A] 'function void sysfs_notify(kobject*, const char*, const char*)'
  [A] 'function void sysfs_remove_group(kobject*, const attribute_group*)'
  [A] 'function void sysfs_remove_groups(kobject*, const attribute_group**)'
  [A] 'function void sysfs_remove_link(kobject*, const char*)'
  [A] 'function bool sysfs_streq(const char*, const char*)'

Bug: 147075469
Change-Id: I54adc551bafc815ad62a815e3327f7ebf09aab9e
Signed-off-by: Liangcai Fan <liangcai.fan@unisoc.com>
Signed-off-by: Matthias Maennich <maennich@google.com>
2020-02-19 13:35:40 +00:00
Matthias Maennich
66096b4c5f ANDROID: Fix ABI representation after enabling CONFIG_NET_NS
Leaf changes summary: 7 artifacts changed (1 filtered out)
Changed leaf types summary: 7 (1 filtered out) leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

'struct net at net_namespace.h:54:1' changed:
  type size hasn't changed
  1 data member insertion:
    'netns_xdp net::xdp', at offset 31744 (in bits) at net_namespace.h:178:1
  there are data member changes:
   'sock* net::diag_nlsk' offset changed from 31744 to 32064 (in bits) (by +320 bits)

  1018 impacted interfaces

'struct net_device at netdevice.h:1781:1' changed:
  type size hasn't changed
  there are data member changes:
   'possible_net_t net_device::nd_net' size changed from 0 to 64 (in bits) (by +64 bits)
   offset changed from 9472 to 9536 (in bits) (by +64 bits)
   'device net_device::dev' offset changed from 9536 to 9600 (in bits) (by +64 bits)
   'const attribute_group* net_device::sysfs_groups[4]' offset changed from 15680 to 15744 (in bits) (by +64 bits)
   'const attribute_group* net_device::sysfs_rx_queue_group' offset changed from 15936 to 16000 (in bits) (by +64 bits)
   'const rtnl_link_ops* net_device::rtnl_link_ops' offset changed from 16000 to 16064 (in bits) (by +64 bits)
   'unsigned int net_device::gso_max_size' offset changed from 16064 to 16128 (in bits) (by +64 bits)
   'u16 net_device::gso_max_segs' offset changed from 16096 to 16160 (in bits) (by +64 bits)
   's16 net_device::num_tc' offset changed from 16112 to 16176 (in bits) (by +64 bits)
   'netdev_tc_txq net_device::tc_to_txq[16]' offset changed from 16128 to 16192 (in bits) (by +64 bits)
   'u8 net_device::prio_tc_map[16]' offset changed from 16640 to 16704 (in bits) (by +64 bits)
   'phy_device* net_device::phydev' offset changed from 16768 to 16832 (in bits) (by +64 bits)
   'sfp_bus* net_device::sfp_bus' offset changed from 16832 to 16896 (in bits) (by +64 bits)
   'lock_class_key net_device::addr_list_lock_key' offset changed from 16896 to 16960 (in bits) (by +64 bits)
   'bool net_device::proto_down' offset changed from 16896 to 16960 (in bits) (by +64 bits)
   'lock_class_key net_device::qdisc_running_key' offset changed from 16896 to 16960 (in bits) (by +64 bits)
   'lock_class_key net_device::qdisc_tx_busylock_key' offset changed from 16896 to 16960 (in bits) (by +64 bits)
   'lock_class_key net_device::qdisc_xmit_lock_key' offset changed from 16896 to 16960 (in bits) (by +64 bits)

  1018 impacted interfaces

'struct netdev_queue at netdevice.h:589:1' changed:
  type size hasn't changed
  1 data member insertion:
    'xdp_umem* netdev_queue::umem', at offset 896 (in bits) at netdevice.h:612:1

  1018 impacted interfaces

'struct netdev_rx_queue at netdevice.h:736:1' changed:
  type size changed from 1536 to 2048 (in bits)
  1 data member insertion:
    'xdp_umem* netdev_rx_queue::umem', at offset 1536 (in bits) at netdevice.h:745:1

  1018 impacted interfaces

'struct request_sock at request_sock.h:46:1' changed:
  type size changed from 1728 to 1792 (in bits)
  there are data member changes:
   type 'struct sock_common' of 'request_sock::__req_common' changed:
, size changed from 1024 to 1088 (in bits) (by +64 bits)
   'request_sock* request_sock::dl_next' offset changed from 1024 to 1088 (in bits) (by +64 bits)
   'u16 request_sock::mss' offset changed from 1088 to 1152 (in bits) (by +64 bits)
   'u8 request_sock::num_retrans' offset changed from 1104 to 1168 (in bits) (by +64 bits)
   'u8 request_sock::num_timeout' offset changed from 1112 to 1176 (in bits) (by +64 bits)
   'u32 request_sock::ts_recent' offset changed from 1120 to 1184 (in bits) (by +64 bits)
   'timer_list request_sock::rsk_timer' offset changed from 1152 to 1216 (in bits) (by +64 bits)
   'const request_sock_ops* request_sock::rsk_ops' offset changed from 1472 to 1536 (in bits) (by +64 bits)
   'sock* request_sock::sk' offset changed from 1536 to 1600 (in bits) (by +64 bits)
   'u32* request_sock::saved_syn' offset changed from 1600 to 1664 (in bits) (by +64 bits)
   'u32 request_sock::secid' offset changed from 1664 to 1728 (in bits) (by +64 bits)
   'u32 request_sock::peer_secid' offset changed from 1696 to 1760 (in bits) (by +64 bits)

  36 impacted interfaces

'struct sock at sock.h:324:1' changed:
  type size changed from 5952 to 6016 (in bits)
  there are data member changes:
   type 'struct sock_common' of 'sock::__sk_common' changed:
     type size changed from 1024 to 1088 (in bits)
     there are data member changes:
      'possible_net_t sock_common::skc_net' size changed from 0 to 64 (in bits) (by +64 bits)
      'in6_addr sock_common::skc_v6_daddr' offset changed from 384 to 448 (in bits) (by +64 bits)
      'in6_addr sock_common::skc_v6_rcv_saddr' offset changed from 512 to 576 (in bits) (by +64 bits)
      'atomic64_t sock_common::skc_cookie' offset changed from 640 to 704 (in bits) (by +64 bits)
      'int sock_common::skc_dontcopy_begin[]' offset changed from 768 to 832 (in bits) (by +64 bits)
      'unsigned short int sock_common::skc_tx_queue_mapping' offset changed from 896 to 960 (in bits) (by +64 bits)
      'unsigned short int sock_common::skc_rx_queue_mapping' offset changed from 912 to 976 (in bits) (by +64 bits)
      'refcount_t sock_common::skc_refcnt' offset changed from 960 to 1024 (in bits) (by +64 bits)
      'int sock_common::skc_dontcopy_end[]' offset changed from 992 to 1056 (in bits) (by +64 bits)

     36 impacted interfaces
, offset changed from 1792 to 1856 (in bits) (by +64 bits)
   'int sock::sk_forward_alloc' offset changed from 1984 to 2048 (in bits) (by +64 bits)
   'unsigned int sock::sk_ll_usec' offset changed from 2016 to 2080 (in bits) (by +64 bits)
   'unsigned int sock::sk_napi_id' offset changed from 2048 to 2112 (in bits) (by +64 bits)
   'int sock::sk_rcvbuf' offset changed from 2080 to 2144 (in bits) (by +64 bits)
   'sk_filter* sock::sk_filter' offset changed from 2112 to 2176 (in bits) (by +64 bits)
   offset changed from 2176 to 2240 (in bits) (by +64 bits)
   'xfrm_policy* sock::sk_policy[2]' offset changed from 2240 to 2304 (in bits) (by +64 bits)
   'dst_entry* sock::sk_rx_dst' offset changed from 2368 to 2432 (in bits) (by +64 bits)
   'dst_entry* sock::sk_dst_cache' offset changed from 2432 to 2496 (in bits) (by +64 bits)
   'atomic_t sock::sk_omem_alloc' offset changed from 2496 to 2560 (in bits) (by +64 bits)
   'int sock::sk_sndbuf' offset changed from 2528 to 2592 (in bits) (by +64 bits)
   'int sock::sk_wmem_queued' offset changed from 2560 to 2624 (in bits) (by +64 bits)
   'refcount_t sock::sk_wmem_alloc' offset changed from 2592 to 2656 (in bits) (by +64 bits)
   'unsigned long int sock::sk_tsq_flags' offset changed from 2624 to 2688 (in bits) (by +64 bits)
   'sk_buff* sock::sk_tx_skb_cache' offset changed from 2752 to 2816 (in bits) (by +64 bits)
   'sk_buff_head sock::sk_write_queue' offset changed from 2816 to 2880 (in bits) (by +64 bits)
   '__s32 sock::sk_peek_off' offset changed from 3008 to 3072 (in bits) (by +64 bits)
   'int sock::sk_write_pending' offset changed from 3040 to 3104 (in bits) (by +64 bits)
   '__u32 sock::sk_dst_pending_confirm' offset changed from 3072 to 3136 (in bits) (by +64 bits)
   'u32 sock::sk_pacing_status' offset changed from 3104 to 3168 (in bits) (by +64 bits)
   'long int sock::sk_sndtimeo' offset changed from 3136 to 3200 (in bits) (by +64 bits)
   'timer_list sock::sk_timer' offset changed from 3200 to 3264 (in bits) (by +64 bits)
   '__u32 sock::sk_priority' offset changed from 3520 to 3584 (in bits) (by +64 bits)
   '__u32 sock::sk_mark' offset changed from 3552 to 3616 (in bits) (by +64 bits)
   'unsigned long int sock::sk_pacing_rate' offset changed from 3584 to 3648 (in bits) (by +64 bits)
   'unsigned long int sock::sk_max_pacing_rate' offset changed from 3648 to 3712 (in bits) (by +64 bits)
   'page_frag sock::sk_frag' offset changed from 3712 to 3776 (in bits) (by +64 bits)
   'netdev_features_t sock::sk_route_caps' offset changed from 3840 to 3904 (in bits) (by +64 bits)
   'netdev_features_t sock::sk_route_nocaps' offset changed from 3904 to 3968 (in bits) (by +64 bits)
   'netdev_features_t sock::sk_route_forced_caps' offset changed from 3968 to 4032 (in bits) (by +64 bits)
   'int sock::sk_gso_type' offset changed from 4032 to 4096 (in bits) (by +64 bits)
   'unsigned int sock::sk_gso_max_size' offset changed from 4064 to 4128 (in bits) (by +64 bits)
   'gfp_t sock::sk_allocation' offset changed from 4096 to 4160 (in bits) (by +64 bits)
   '__u32 sock::sk_txhash' offset changed from 4128 to 4192 (in bits) (by +64 bits)
   'unsigned int sock::__sk_flags_offset[]' offset changed from 4160 to 4224 (in bits) (by +64 bits)
   'unsigned int sock::sk_type' offset changed from 4160 to 4224 (in bits) (by +64 bits)
   'u16 sock::sk_gso_max_segs' offset changed from 4192 to 4256 (in bits) (by +64 bits)
   'u8 sock::sk_pacing_shift' offset changed from 4208 to 4272 (in bits) (by +64 bits)
   'unsigned long int sock::sk_lingertime' offset changed from 4224 to 4288 (in bits) (by +64 bits)
   'proto* sock::sk_prot_creator' offset changed from 4288 to 4352 (in bits) (by +64 bits)
   'rwlock_t sock::sk_callback_lock' offset changed from 4352 to 4416 (in bits) (by +64 bits)
   'int sock::sk_err' offset changed from 4416 to 4480 (in bits) (by +64 bits)
   'int sock::sk_err_soft' offset changed from 4448 to 4512 (in bits) (by +64 bits)
   'u32 sock::sk_ack_backlog' offset changed from 4480 to 4544 (in bits) (by +64 bits)
   'u32 sock::sk_max_ack_backlog' offset changed from 4512 to 4576 (in bits) (by +64 bits)
   'kuid_t sock::sk_uid' offset changed from 4544 to 4608 (in bits) (by +64 bits)
   'pid* sock::sk_peer_pid' offset changed from 4608 to 4672 (in bits) (by +64 bits)
   'const cred* sock::sk_peer_cred' offset changed from 4672 to 4736 (in bits) (by +64 bits)
   'long int sock::sk_rcvtimeo' offset changed from 4736 to 4800 (in bits) (by +64 bits)
   'ktime_t sock::sk_stamp' offset changed from 4800 to 4864 (in bits) (by +64 bits)
   'u16 sock::sk_tsflags' offset changed from 4864 to 4928 (in bits) (by +64 bits)
   'u8 sock::sk_shutdown' offset changed from 4880 to 4944 (in bits) (by +64 bits)
   'u32 sock::sk_tskey' offset changed from 4896 to 4960 (in bits) (by +64 bits)
   'atomic_t sock::sk_zckey' offset changed from 4928 to 4992 (in bits) (by +64 bits)
   'u8 sock::sk_clockid' offset changed from 4960 to 5024 (in bits) (by +64 bits)
   'u8 sock::sk_txtime_unused' offset changed from 4968 to 5032 (in bits) (by +64 bits)
   'socket* sock::sk_socket' offset changed from 4992 to 5056 (in bits) (by +64 bits)
   'void* sock::sk_user_data' offset changed from 5056 to 5120 (in bits) (by +64 bits)
   'void* sock::sk_security' offset changed from 5120 to 5184 (in bits) (by +64 bits)
   'sock_cgroup_data sock::sk_cgrp_data' offset changed from 5184 to 5248 (in bits) (by +64 bits)
   'mem_cgroup* sock::sk_memcg' offset changed from 5248 to 5312 (in bits) (by +64 bits)
   'void ()* sock::sk_state_change' offset changed from 5312 to 5376 (in bits) (by +64 bits)
   'void ()* sock::sk_data_ready' offset changed from 5376 to 5440 (in bits) (by +64 bits)
   'void ()* sock::sk_write_space' offset changed from 5440 to 5504 (in bits) (by +64 bits)
   'void ()* sock::sk_error_report' offset changed from 5504 to 5568 (in bits) (by +64 bits)
   'void ()* sock::sk_backlog_rcv' offset changed from 5568 to 5632 (in bits) (by +64 bits)
   'void ()* sock::sk_destruct' offset changed from 5632 to 5696 (in bits) (by +64 bits)
   'sock_reuseport* sock::sk_reuseport_cb' offset changed from 5696 to 5760 (in bits) (by +64 bits)
   'bpf_sk_storage* sock::sk_bpf_storage' offset changed from 5760 to 5824 (in bits) (by +64 bits)
   'callback_head sock::sk_rcu' offset changed from 5824 to 5888 (in bits) (by +64 bits)

  36 impacted interfaces

'struct sock_common at sock.h:147:1' changed:
  details were reported earlier

Fixes: 9b0d1af931 ("ANDROID: gki_defconfig: Enable CONFIG_NET_NS")
Change-Id: Ied4883cd3d8b15c29df2b04258b30aa4c8c739ec
Signed-off-by: Matthias Maennich <maennich@google.com>
2020-02-19 12:24:09 +00:00
Alistair Delva
9b0d1af931 ANDROID: gki_defconfig: Enable CONFIG_NET_NS
Bug: 144061615
Bug: 147493341
Change-Id: I6392a7ee9c8ab26ca3e033889d8311661e6ec4aa
Signed-off-by: Alistair Delva <adelva@google.com>
2020-02-19 08:14:59 +00:00
Alistair Delva
246b8542c8 ANDROID: gki_defconfig: Enable XDP_SOCKETS
Bug: 145685190
Bug: 144061615
Change-Id: I8f2fdf61473916e5e8dbb15e12d49cb0777cb42e
Signed-off-by: Alistair Delva <adelva@google.com>
2020-02-19 08:14:55 +00:00
Greg Kroah-Hartman
e736cc6873 This is the 5.4.20 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl5HElwACgkQONu9yGCS
 aT6GQBAAxBLl+L518k3/Jm7Fv5VGFtfk7QIJmLKSdI58Gj7aLib2CulB5dJpHu0Z
 uOJXEUKQoUC739MjS6IgrAUoee/GTgyeOS1gyI49IBVvrBgjQop/3FJ4Oe4EF6Wj
 aEy7xA1k1MRUM4XWy3PiMvIuaxWNWoEn22DS703adOKPEx2yS0sPtAf6RRRpzxW+
 oWR9aJv5y+wKRi7frRvTJ8juQoeo67XHNQWBybv7v+th7KqF33EYk/faLJqTbqNd
 caJAG+DuGsu/oLcwlWEE5CZ8rP5OAOh12505J9XG5uXoqA2BrQFCTLW6okG1PUNI
 I+GugtMKWwOSP8dHkfq/jPKInG3H+mCwVW3wWzKfWBJwIi4NWokYK31SQty1BNBe
 if9ytUT97ykgkovVjVbu+X+wMnEes2JMrVyBAzY2cOK01KD2PUR/cLdZZXTil4A0
 rEKXd+tJRN7+ko+z4EJRdstzNtB030tDeEUmwJSIlJoWPRROk69it8d4/OFXe+/u
 Le4T4V6w22tcP0H/2CtDSwTntDbjNoXWpTGzqp2HO0urObqZyX99leyCI8Ee9sRz
 00B6ykAOnOMPdLmAGmpBXnhKRK89VlnfG5A/d609km4EPJuKZyX9KS6tZSwpJIAd
 3W9FWaNyr8Z79BDJyeK0ftS5BD/WNGDLux7lylLzMsPAmF7YNsI=
 =Zp/p
 -----END PGP SIGNATURE-----

Merge 5.4.20 into android-5.4

Changes in 5.4.20
	ASoC: pcm: update FE/BE trigger order based on the command
	hv_sock: Remove the accept port restriction
	IB/mlx4: Fix memory leak in add_gid error flow
	IB/srp: Never use immediate data if it is disabled by a user
	IB/mlx4: Fix leak in id_map_find_del
	RDMA/netlink: Do not always generate an ACK for some netlink operations
	RDMA/i40iw: fix a potential NULL pointer dereference
	RDMA/core: Fix locking in ib_uverbs_event_read
	RDMA/uverbs: Verify MR access flags
	RDMA/cma: Fix unbalanced cm_id reference count during address resolve
	RDMA/umem: Fix ib_umem_find_best_pgsz()
	scsi: ufs: Fix ufshcd_probe_hba() reture value in case ufshcd_scsi_add_wlus() fails
	PCI/IOV: Fix memory leak in pci_iov_add_virtfn()
	ath10k: pci: Only dump ATH10K_MEM_REGION_TYPE_IOREG when safe
	PCI/switchtec: Use dma_set_mask_and_coherent()
	PCI/switchtec: Fix vep_vector_number ioread width
	PCI: tegra: Fix afi_pex2_ctrl reg offset for Tegra30
	PCI: Don't disable bridge BARs when assigning bus resources
	PCI/AER: Initialize aer_fifo
	iwlwifi: mvm: avoid use after free for pmsr request
	bpftool: Don't crash on missing xlated program instructions
	bpf, sockmap: Don't sleep while holding RCU lock on tear-down
	bpf, sockhash: Synchronize_rcu before free'ing map
	selftests/bpf: Test freeing sockmap/sockhash with a socket in it
	bpf: Improve bucket_log calculation logic
	bpf, sockmap: Check update requirements after locking
	nfs: NFS_SWAP should depend on SWAP
	NFS: Revalidate the file size on a fatal write error
	NFS/pnfs: Fix pnfs_generic_prepare_to_resend_writes()
	NFS: Fix fix of show_nfs_errors
	NFSv4: pnfs_roc() must use cred_fscmp() to compare creds
	NFSv4: try lease recovery on NFS4ERR_EXPIRED
	NFSv4.0: nfs4_do_fsinfo() should not do implicit lease renewals
	x86/boot: Handle malformed SRAT tables during early ACPI parsing
	rtc: hym8563: Return -EINVAL if the time is known to be invalid
	rtc: cmos: Stop using shared IRQ
	watchdog: qcom: Use platform_get_irq_optional() for bark irq
	ARC: [plat-axs10x]: Add missing multicast filter number to GMAC node
	platform/x86: intel_mid_powerbtn: Take a copy of ddata
	arm64: dts: qcom: msm8998: Fix tcsr syscon size
	arm64: dts: uDPU: fix broken ethernet
	ARM: dts: at91: Reenable UART TX pull-ups
	ARM: dts: am43xx: add support for clkout1 clock
	arm64: dts: renesas: r8a77990: ebisu: Remove clkout-lr-synchronous from sound
	arm64: dts: marvell: clearfog-gt-8k: fix switch cpu port node
	ARM: dts: meson8: use the actual frequency for the GPU's 182.1MHz OPP
	ARM: dts: meson8b: use the actual frequency for the GPU's 364MHz OPP
	ARM: dts: at91: sama5d3: fix maximum peripheral clock rates
	ARM: dts: at91: sama5d3: define clock rate range for tcb1
	tools/power/acpi: fix compilation error
	soc: qcom: rpmhpd: Set 'active_only' for active only power domains
	Revert "powerpc/pseries/iommu: Don't use dma_iommu_ops on secure guests"
	powerpc/ptdump: Fix W+X verification call in mark_rodata_ro()
	powerpc/ptdump: Only enable PPC_CHECK_WX with STRICT_KERNEL_RWX
	powerpc/papr_scm: Fix leaking 'bus_desc.provider_name' in some paths
	powerpc/pseries/vio: Fix iommu_table use-after-free refcount warning
	powerpc/pseries: Allow not having ibm, hypertas-functions::hcall-multi-tce for DDW
	iommu/arm-smmu-v3: Populate VMID field for CMDQ_OP_TLBI_NH_VA
	ARM: at91: pm: use SAM9X60 PMC's compatible
	ARM: at91: pm: use of_device_id array to find the proper shdwc node
	KVM: arm/arm64: vgic-its: Fix restoration of unmapped collections
	ARM: 8949/1: mm: mark free_memmap as __init
	sched/uclamp: Fix a bug in propagating uclamp value in new cgroups
	arm64: cpufeature: Fix the type of no FP/SIMD capability
	arm64: cpufeature: Set the FP/SIMD compat HWCAP bits properly
	arm64: ptrace: nofpsimd: Fail FP/SIMD regset operations
	KVM: arm/arm64: Fix young bit from mmu notifier
	KVM: arm: Fix DFSR setting for non-LPAE aarch32 guests
	KVM: arm: Make inject_abt32() inject an external abort instead
	KVM: arm64: pmu: Don't increment SW_INCR if PMCR.E is unset
	KVM: arm64: pmu: Fix chained SW_INCR counters
	KVM: arm64: Treat emulated TVAL TimerValue as a signed 32-bit integer
	arm64: nofpsmid: Handle TIF_FOREIGN_FPSTATE flag cleanly
	mtd: onenand_base: Adjust indentation in onenand_read_ops_nolock
	mtd: sharpslpart: Fix unsigned comparison to zero
	crypto: testmgr - don't try to decrypt uninitialized buffers
	crypto: artpec6 - return correct error code for failed setkey()
	crypto: atmel-sha - fix error handling when setting hmac key
	crypto: caam/qi2 - fix typo in algorithm's driver name
	drivers: watchdog: stm32_iwdg: set WDOG_HW_RUNNING at probe
	media: i2c: adv748x: Fix unsafe macros
	dt-bindings: iio: adc: ad7606: Fix wrong maxItems value
	bcache: avoid unnecessary btree nodes flushing in btree_flush_write()
	selinux: revert "stop passing MAY_NOT_BLOCK to the AVC upon follow_link"
	selinux: fix regression introduced by move_mount(2) syscall
	pinctrl: sh-pfc: r8a77965: Fix DU_DOTCLKIN3 drive/bias control
	pinctrl: sh-pfc: r8a7778: Fix duplicate SDSELF_B and SD1_CLK_B
	regmap: fix writes to non incrementing registers
	mfd: max77650: Select REGMAP_IRQ in Kconfig
	clk: meson: g12a: fix missing uart2 in regmap table
	dmaengine: axi-dmac: add a check for devm_regmap_init_mmio
	mwifiex: Fix possible buffer overflows in mwifiex_ret_wmm_get_status()
	mwifiex: Fix possible buffer overflows in mwifiex_cmd_append_vsie_tlv()
	libertas: don't exit from lbs_ibss_join_existing() with RCU read lock held
	libertas: make lbs_ibss_join_existing() return error code on rates overflow
	selinux: fall back to ref-walk if audit is required
	Linux 5.4.20

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I68c0ac72422e279b38324afc91dc52df3eadc0f7
2020-02-19 08:28:27 +01:00
Alistair Delva
8eb5e16db0 ANDROID: gki_defconfig: Enable MAC80211_RC_MINSTREL
This feature was noticed missing on the android emulator, but it's
normally default 'on', we just were able to disable it because we
turn CONFIG_EXPERT on too.

Bug: 147493341
Change-Id: Ia81b4f841a5b5d4a37ad8a1f3450dff70abc341d
Signed-off-by: Alistair Delva <adelva@google.com>
2020-02-19 04:23:51 +00:00
Roman Kiryanov
0ec6aa3337 ANDROID: virtio: virtio_input: pass _DIRECT only if the device
advertises _DIRECT

INPUT_MT_DIRECT should be used only if the device advertises
INPUT_PROP_DIRECT.

Bug: 147493341
Bug: 149250379
Test: boot emulator with 5.4 kernel, check if touchscreen works
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: Ic06ae2b9d0ab7c77cb8829e5392fd048139500a2
2020-02-19 04:05:13 +00:00
Hridya Valsaraju
9f3f1787d8 ANDROID: staging: ion: delete unused heap types and IDs
Delete system_contig, chunk and carevout heap types and IDs.

Test: build, boot, ion-unit-tests
Bug: 138149732
Change-Id: I45d97138ab2a6986955c8934ab13b70372d9e62d
Signed-off-by: Hridya Valsaraju <hridya@google.com>
2020-02-18 23:09:23 +00:00
Hridya Valsaraju
c877e4cfa8 ANDROID: gki_defconfig: disable system_contig ion heap.
Test: build, boot, ion-unit-test
Bug: 138149732
Change-Id: Ic7bc1e59c5bdbdda656fbc06e6dcffea6b7740cf
Signed-off-by: Hridya Valsaraju <hridya@google.com>
2020-02-18 23:09:13 +00:00
Ram Muthiah
f910a6a4f2 ANDROID: cf build: Use merge_configs
Previously the cuttlefish build was cat'ng the cuttlefish.fragment
with the gki_defconfig. The correct way to merge fragments is to use
the merge_configs script.

Bug: 139431025
Bug: 148247383
Test: Treehugger
Signed-off-by: Ram Muthiah <rammuthiah@google.com>
Change-Id: I0a62e6c5395b6933955894c8d5ad0484f5c7102d
2020-02-18 21:18:26 +00:00
Lorenzo Colitti
d730995e7b ANDROID: net: bpf: Allow TC programs to call BPF_FUNC_skb_change_head
This enables ebpf tethering offload from a cellular interface with
no L2 mac header to a wifi/ethernet/usb interface with one.

Will pursue upstreaming this along with further mtu related fixups.

Test: builds, real testing with identical patch on a 4.14 flame device
Bug: 149724482
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ic182320bf1abb248d0f86fa2973c60208710f664
2020-02-18 09:25:51 +00:00
Alistair Delva
f0212822fa ANDROID: gki_defconfig: Disable SDCARD_FS
Move SDCARD_FS into the fragments for cuttlefish and db845c as this
feature is still being used by AOSP master. These will be removed later.

Bug: 149410031
Change-Id: I9142338cd0709aa8ec067b9e7d8c22390630de02
Signed-off-by: Alistair Delva <adelva@google.com>
2020-02-14 21:39:47 +00:00
Greg Kroah-Hartman
27dfbcc2f5 Linux 5.4.20 2020-02-14 16:34:20 -05:00
Stephen Smalley
2d8fdc5744 selinux: fall back to ref-walk if audit is required
commit 0188d5c025ca8fe756ba3193bd7d150139af5a88 upstream.

commit bda0be7ad9 ("security: make inode_follow_link RCU-walk aware")
passed down the rcu flag to the SELinux AVC, but failed to adjust the
test in slow_avc_audit() to also return -ECHILD on LSM_AUDIT_DATA_DENTRY.
Previously, we only returned -ECHILD if generating an audit record with
LSM_AUDIT_DATA_INODE since this was only relevant from inode_permission.
Move the handling of MAY_NOT_BLOCK to avc_audit() and its inlined
equivalent in selinux_inode_permission() immediately after we determine
that audit is required, and always fall back to ref-walk in this case.

Fixes: bda0be7ad9 ("security: make inode_follow_link RCU-walk aware")
Reported-by: Will Deacon <will@kernel.org>
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:20 -05:00
Nicolai Stange
ae7f404d92 libertas: make lbs_ibss_join_existing() return error code on rates overflow
[ Upstream commit 1754c4f60aaf1e17d886afefee97e94d7f27b4cb ]

Commit e5e884b42639 ("libertas: Fix two buffer overflows at parsing bss
descriptor") introduced a bounds check on the number of supplied rates to
lbs_ibss_join_existing() and made it to return on overflow.

However, the aforementioned commit doesn't set the return value accordingly
and thus, lbs_ibss_join_existing() would return with zero even though it
failed.

Make lbs_ibss_join_existing return -EINVAL in case the bounds check on the
number of supplied rates fails.

Fixes: e5e884b42639 ("libertas: Fix two buffer overflows at parsing bss descriptor")
Signed-off-by: Nicolai Stange <nstange@suse.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-14 16:34:20 -05:00
Nicolai Stange
61087dce64 libertas: don't exit from lbs_ibss_join_existing() with RCU read lock held
[ Upstream commit c7bf1fb7ddca331780b9a733ae308737b39f1ad4 ]

Commit e5e884b42639 ("libertas: Fix two buffer overflows at parsing bss
descriptor") introduced a bounds check on the number of supplied rates to
lbs_ibss_join_existing().

Unfortunately, it introduced a return path from within a RCU read side
critical section without a corresponding rcu_read_unlock(). Fix this.

Fixes: e5e884b42639 ("libertas: Fix two buffer overflows at parsing bss descriptor")
Signed-off-by: Nicolai Stange <nstange@suse.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-14 16:34:20 -05:00
Qing Xu
3c822e1f31 mwifiex: Fix possible buffer overflows in mwifiex_cmd_append_vsie_tlv()
[ Upstream commit b70261a288ea4d2f4ac7cd04be08a9f0f2de4f4d ]

mwifiex_cmd_append_vsie_tlv() calls memcpy() without checking
the destination size may trigger a buffer overflower,
which a local user could use to cause denial of service
or the execution of arbitrary code.
Fix it by putting the length check before calling memcpy().

Signed-off-by: Qing Xu <m1s5p6688@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-14 16:34:20 -05:00
Qing Xu
c5b071e3f4 mwifiex: Fix possible buffer overflows in mwifiex_ret_wmm_get_status()
[ Upstream commit 3a9b153c5591548612c3955c9600a98150c81875 ]

mwifiex_ret_wmm_get_status() calls memcpy() without checking the
destination size.Since the source is given from remote AP which
contains illegal wmm elements , this may trigger a heap buffer
overflow.
Fix it by putting the length check before calling memcpy().

Signed-off-by: Qing Xu <m1s5p6688@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-14 16:34:20 -05:00
Chuhong Yuan
2cf2b620af dmaengine: axi-dmac: add a check for devm_regmap_init_mmio
commit a5b982af953bcc838cd198b0434834cc1dff14ec upstream.

The driver misses checking the result of devm_regmap_init_mmio().
Add a check to fix it.

Fixes: fc15be39a8 ("dmaengine: axi-dmac: add regmap support")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20191209085711.16001-1-hslester96@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:19 -05:00
Jerome Brunet
eada328f7f clk: meson: g12a: fix missing uart2 in regmap table
commit b1b3f0622a9d52ac19a63619911823c89a4d85a4 upstream.

UART2 peripheral is missing from the regmap fixup table of the g12a family
clock controller. As it is, any access to this clock would Oops, which is
not great.

Add the clock to the table to fix the problem.

Fixes: 085a4ea93d ("clk: meson: g12a: add peripheral clock controller")
Reported-by: Dmitry Shmidt <dimitrysh@google.com>
Tested-by: Dmitry Shmidt <dimitrysh@google.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Tested-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:19 -05:00
Bartosz Golaszewski
3cfb0b360b mfd: max77650: Select REGMAP_IRQ in Kconfig
commit cb7a374a5e7a5af3f8c839f74439193add6d0589 upstream.

MAX77650 MFD driver uses regmap_irq API but doesn't select the required
REGMAP_IRQ option in Kconfig. This can cause the following build error
if regmap irq is not enabled implicitly by someone else:

    ld: drivers/mfd/max77650.o: in function `max77650_i2c_probe':
    max77650.c:(.text+0xcb): undefined reference to `devm_regmap_add_irq_chip'
    ld: max77650.c:(.text+0xdb): undefined reference to `regmap_irq_get_domain'
    make: *** [Makefile:1079: vmlinux] Error 1

Fix it by adding the missing option.

Fixes: d0f6033450 ("mfd: Add new driver for MAX77650 PMIC")
Reported-by: Paul Gazzillo <paul@pgazz.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:19 -05:00
Ben Whitten
3b9586e82c regmap: fix writes to non incrementing registers
commit 2e31aab08bad0d4ee3d3d890a7b74cb6293e0a41 upstream.

When checking if a register block is writable we must ensure that the
block does not start with or contain a non incrementing register.

Fixes: 8b9f9d4dc5 ("regmap: verify if register is writeable before writing operations")
Signed-off-by: Ben Whitten <ben.whitten@gmail.com>
Link: https://lore.kernel.org/r/20200118205625.14532-1-ben.whitten@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:19 -05:00
Geert Uytterhoeven
4eb12ef749 pinctrl: sh-pfc: r8a7778: Fix duplicate SDSELF_B and SD1_CLK_B
commit 805f635703b2562b5ddd822c62fc9124087e5dd5 upstream.

The FN_SDSELF_B and FN_SD1_CLK_B enum IDs are used twice, which means
one set of users must be wrong.  Replace them by the correct enum IDs.

Fixes: 87f8c98863 ("sh-pfc: Add r8a7778 pinmux support")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20191218194812.12741-2-geert+renesas@glider.be
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:19 -05:00
Geert Uytterhoeven
7b07d15aa5 pinctrl: sh-pfc: r8a77965: Fix DU_DOTCLKIN3 drive/bias control
commit a34cd9dfd03fa9ec380405969f1d638bc63b8d63 upstream.

R-Car Gen3 Hardware Manual Errata for Rev. 2.00 of October 24, 2019
changed the configuration bits for drive and bias control for the
DU_DOTCLKIN3 pin on R-Car M3-N, to match the same pin on R-Car H3.
Update the driver to reflect this.

After this, the handling of drive and bias control for the various
DU_DOTCLKINx pins is consistent across all of the R-Car H3, M3-W,
M3-W+, and M3-N SoCs.

Fixes: 86c045c2e4 ("pinctrl: sh-pfc: r8a77965: Replace DU_DOTCLKIN2 by DU_DOTCLKIN3")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20191113101653.28428-1-geert+renesas@glider.be
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:19 -05:00
Stephen Smalley
875e01dd8a selinux: fix regression introduced by move_mount(2) syscall
commit 98aa00345de54b8340dc2ddcd87f446d33387b5e upstream.

commit 2db154b3ea ("vfs: syscall: Add move_mount(2) to move mounts around")
introduced a new move_mount(2) system call and a corresponding new LSM
security_move_mount hook but did not implement this hook for any existing
LSM.  This creates a regression for SELinux with respect to consistent
checking of mounts; the existing selinux_mount hook checks mounton
permission to the mount point path.  Provide a SELinux hook
implementation for move_mount that applies this same check for
consistency.  In the future we may wish to add a new move_mount
filesystem permission and check as well, but this addresses
the immediate regression.

Fixes: 2db154b3ea ("vfs: syscall: Add move_mount(2) to move mounts around")
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Reviewed-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:19 -05:00
Stephen Smalley
3b2e595dfe selinux: revert "stop passing MAY_NOT_BLOCK to the AVC upon follow_link"
commit 1a37079c236d55fb31ebbf4b59945dab8ec8764c upstream.

This reverts commit e46e01eebb ("selinux: stop passing MAY_NOT_BLOCK
to the AVC upon follow_link"). The correct fix is to instead fall
back to ref-walk if audit is required irrespective of the specific
audit data type.  This is done in the next commit.

Fixes: e46e01eebb ("selinux: stop passing MAY_NOT_BLOCK to the AVC upon follow_link")
Reported-by: Will Deacon <will@kernel.org>
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:19 -05:00
Coly Li
837c36e045 bcache: avoid unnecessary btree nodes flushing in btree_flush_write()
commit 2aa8c529387c25606fdc1484154b92f8bfbc5746 upstream.

the commit 91be66e131 ("bcache: performance improvement for
btree_flush_write()") was an effort to flushing btree node with oldest
btree node faster in following methods,
- Only iterate dirty btree nodes in c->btree_cache, avoid scanning a lot
  of clean btree nodes.
- Take c->btree_cache as a LRU-like list, aggressively flushing all
  dirty nodes from tail of c->btree_cache util the btree node with
  oldest journal entry is flushed. This is to reduce the time of holding
  c->bucket_lock.

Guoju Fang and Shuang Li reported that they observe unexptected extra
write I/Os on cache device after applying the above patch. Guoju Fang
provideed more detailed diagnose information that the aggressive
btree nodes flushing may cause 10x more btree nodes to flush in his
workload. He points out when system memory is large enough to hold all
btree nodes in memory, c->btree_cache is not a LRU-like list any more.
Then the btree node with oldest journal entry is very probably not-
close to the tail of c->btree_cache list. In such situation much more
dirty btree nodes will be aggressively flushed before the target node
is flushed. When slow SATA SSD is used as cache device, such over-
aggressive flushing behavior will cause performance regression.

After spending a lot of time on debug and diagnose, I find the real
condition is more complicated, aggressive flushing dirty btree nodes
from tail of c->btree_cache list is not a good solution.
- When all btree nodes are cached in memory, c->btree_cache is not
  a LRU-like list, the btree nodes with oldest journal entry won't
  be close to the tail of the list.
- There can be hundreds dirty btree nodes reference the oldest journal
  entry, before flushing all the nodes the oldest journal entry cannot
  be reclaimed.
When the above two conditions mixed together, a simply flushing from
tail of c->btree_cache list is really NOT a good idea.

Fortunately there is still chance to make btree_flush_write() work
better. Here is how this patch avoids unnecessary btree nodes flushing,
- Only acquire c->journal.lock when getting oldest journal entry of
  fifo c->journal.pin. In rested locations check the journal entries
  locklessly, so their values can be changed on other cores
  in parallel.
- In loop list_for_each_entry_safe_reverse(), checking latest front
  point of fifo c->journal.pin. If it is different from the original
  point which we get with locking c->journal.lock, it means the oldest
  journal entry is reclaim on other cores. At this moment, all selected
  dirty nodes recorded in array btree_nodes[] are all flushed and clean
  on other CPU cores, it is unncessary to iterate c->btree_cache any
  longer. Just quit the list_for_each_entry_safe_reverse() loop and
  the following for-loop will skip all the selected clean nodes.
- Find a proper time to quit the list_for_each_entry_safe_reverse()
  loop. Check the refcount value of orignial fifo front point, if the
  value is larger than selected node number of btree_nodes[], it means
  more matching btree nodes should be scanned. Otherwise it means no
  more matching btee nodes in rest of c->btree_cache list, the loop
  can be quit. If the original oldest journal entry is reclaimed and
  fifo front point is updated, the refcount of original fifo front point
  will be 0, then the loop will be quit too.
- Not hold c->bucket_lock too long time. c->bucket_lock is also required
  for space allocation for cached data, hold it for too long time will
  block regular I/O requests. When iterating list c->btree_cache, even
  there are a lot of maching btree nodes, in order to not holding
  c->bucket_lock for too long time, only BTREE_FLUSH_NR nodes are
  selected and to flush in following for-loop.
With this patch, only btree nodes referencing oldest journal entry
are flushed to cache device, no aggressive flushing for  unnecessary
btree node any more. And in order to avoid blocking regluar I/O
requests, each time when btree_flush_write() called, at most only
BTREE_FLUSH_NR btree nodes are selected to flush, even there are more
maching btree nodes in list c->btree_cache.

At last, one more thing to explain: Why it is safe to read front point
of c->journal.pin without holding c->journal.lock inside the
list_for_each_entry_safe_reverse() loop ?

Here is my answer: When reading the front point of fifo c->journal.pin,
we don't need to know the exact value of front point, we just want to
check whether the value is different from the original front point
(which is accurate value because we get it while c->jouranl.lock is
held). For such purpose, it works as expected without holding
c->journal.lock. Even the front point is changed on other CPU core and
not updated to local core, and current iterating btree node has
identical journal entry local as original fetched fifo front point, it
is still safe. Because after holding mutex b->write_lock (with memory
barrier) this btree node can be found as clean and skipped, the loop
will quite latter when iterate on next node of list c->btree_cache.

Fixes: 91be66e131 ("bcache: performance improvement for btree_flush_write()")
Reported-by: Guoju Fang <fangguoju@gmail.com>
Reported-by: Shuang Li <psymon@bonuscloud.io>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:19 -05:00
Beniamin Bia
7c71d438e7 dt-bindings: iio: adc: ad7606: Fix wrong maxItems value
commit a6c4f77cb3b11f81077b53c4a38f21b92d41f21e upstream.

This patch set the correct value for oversampling maxItems. In the
original example, appears 3 items for oversampling while the maxItems
is set to 1, this patch fixes those issues.

Fixes: 416f882c3b ("dt-bindings: iio: adc: Migrate AD7606 documentation to yaml")
Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:19 -05:00
Gustavo A. R. Silva
d15a2930f6 media: i2c: adv748x: Fix unsafe macros
commit 0d962e061abcf1b9105f88fb850158b5887fbca3 upstream.

Enclose multiple macro parameters in parentheses in order to
make such macros safer and fix the Clang warning below:

drivers/media/i2c/adv748x/adv748x-afe.c:452:12: warning: operator '?:'
has lower precedence than '|'; '|' will be evaluated first
[-Wbitwise-conditional-parentheses]

ret = sdp_clrset(state, ADV748X_SDP_FRP, ADV748X_SDP_FRP_MASK, enable
? ctrl->val - 1 : 0);

Fixes: 3e89586a64 ("media: i2c: adv748x: add adv748x driver")
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:18 -05:00
Christophe Roullier
30dd20c6d0 drivers: watchdog: stm32_iwdg: set WDOG_HW_RUNNING at probe
commit 85fdc63fe256b595f923a69848cd99972ff446d8 upstream.

If the watchdog hardware is already enabled during the boot process,
when the Linux watchdog driver loads, it should start/reset the watchdog
and tell the watchdog framework. As a result, ping can be generated from
the watchdog framework (if CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED is set),
until the userspace watchdog daemon takes over control

Fixes:4332d113c66a ("watchdog: Add STM32 IWDG driver")

Signed-off-by: Christophe Roullier <christophe.roullier@st.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20191122132246.8473-1-christophe.roullier@st.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:18 -05:00
Horia Geantă
8dfa118376 crypto: caam/qi2 - fix typo in algorithm's driver name
commit 53146d152510584c2034c62778a7cbca25743ce9 upstream.

Fixes: 8d818c1055 ("crypto: caam/qi2 - add DPAA2-CAAM driver")
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:18 -05:00
Eric Biggers
1f42c6de7b crypto: atmel-sha - fix error handling when setting hmac key
commit b529f1983b2dcc46354f311feda92e07b6e9e2da upstream.

HMAC keys can be of any length, and atmel_sha_hmac_key_set() can only
fail due to -ENOMEM.  But atmel_sha_hmac_setkey() incorrectly treated
any error as a "bad key length" error.  Fix it to correctly propagate
the -ENOMEM error code and not set any tfm result flags.

Fixes: 81d8750b2b ("crypto: atmel-sha - add support to hmac(shaX)")
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:18 -05:00
Eric Biggers
fb42d3f4ec crypto: artpec6 - return correct error code for failed setkey()
commit b828f905904cd76424230c69741a4cabb0174168 upstream.

->setkey() is supposed to retun -EINVAL for invalid key lengths, not -1.

Fixes: a21eb94fc4 ("crypto: axis - add ARTPEC-6/7 crypto accelerator driver")
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Lars Persson <lars.persson@axis.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Lars Persson <lars.persson@axis.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:18 -05:00
Eric Biggers
ee1c6b1aa9 crypto: testmgr - don't try to decrypt uninitialized buffers
commit eb455dbd02cb1074b37872ffca30a81cb2a18eaa upstream.

Currently if the comparison fuzz tests encounter an encryption error
when generating an skcipher or AEAD test vector, they will still test
the decryption side (passing it the uninitialized ciphertext buffer)
and expect it to fail with the same error.

This is sort of broken because it's not well-defined usage of the API to
pass an uninitialized buffer, and furthermore in the AEAD case it's
acceptable for the decryption error to be EBADMSG (meaning "inauthentic
input") even if the encryption error was something else like EINVAL.

Fix this for skcipher by explicitly initializing the ciphertext buffer
on error, and for AEAD by skipping the decryption test on error.

Reported-by: Pascal Van Leeuwen <pvanleeuwen@verimatrix.com>
Fixes: d435e10e67 ("crypto: testmgr - fuzz skciphers against their generic implementation")
Fixes: 40153b10d9 ("crypto: testmgr - fuzz AEADs against their generic implementation")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:18 -05:00
YueHaibing
771fd0b2e8 mtd: sharpslpart: Fix unsigned comparison to zero
commit f33113b542219448fa02d77ca1c6f4265bd7f130 upstream.

The unsigned variable log_num is being assigned a return value
from the call to sharpsl_nand_get_logical_num that can return
-EINVAL.

Detected using Coccinelle:
./drivers/mtd/parsers/sharpslpart.c:207:6-13: WARNING: Unsigned expression compared with zero: log_num > 0

Fixes: 8a4580e4d2 ("mtd: sharpslpart: Add sharpslpart partition parser")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:18 -05:00
Nathan Chancellor
1765aaef17 mtd: onenand_base: Adjust indentation in onenand_read_ops_nolock
commit 0e7ca83e82d021c928dadf4c13c137d57337540d upstream.

Clang warns:

../drivers/mtd/nand/onenand/onenand_base.c:1269:3: warning: misleading
indentation; statement is not part of the previous 'if'
[-Wmisleading-indentation]
        while (!ret) {
        ^
../drivers/mtd/nand/onenand/onenand_base.c:1266:2: note: previous
statement is here
        if (column + thislen > writesize)
        ^
1 warning generated.

This warning occurs because there is a space before the tab of the while
loop. There are spaces at the beginning of a lot of the lines in this
block, remove them so that the indentation is consistent with the Linux
kernel coding style and clang no longer warns.

Fixes: a8de85d557 ("[MTD] OneNAND: Implement read-while-load")
Link: https://github.com/ClangBuiltLinux/linux/issues/794
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:18 -05:00
Suzuki K Poulose
7df80a021f arm64: nofpsmid: Handle TIF_FOREIGN_FPSTATE flag cleanly
commit 52f73c383b2418f2d31b798e765ae7d596c35021 upstream.

We detect the absence of FP/SIMD after an incapable CPU is brought up,
and by then we have kernel threads running already with TIF_FOREIGN_FPSTATE set
which could be set for early userspace applications (e.g, modprobe triggered
from initramfs) and init. This could cause the applications to loop forever in
do_nofity_resume() as we never clear the TIF flag, once we now know that
we don't support FP.

Fix this by making sure that we clear the TIF_FOREIGN_FPSTATE flag
for tasks which may have them set, as we would have done in the normal
case, but avoiding touching the hardware state (since we don't support any).

Also to make sure we handle the cases seemlessly we categorise the
helper functions to two :
 1) Helpers for common core code, which calls into take appropriate
    actions without knowing the current FPSIMD state of the CPU/task.

    e.g fpsimd_restore_current_state(), fpsimd_flush_task_state(),
        fpsimd_save_and_flush_cpu_state().

    We bail out early for these functions, taking any appropriate actions
    (e.g, clearing the TIF flag) where necessary to hide the handling
    from core code.

 2) Helpers used when the presence of FP/SIMD is apparent.
    i.e, save/restore the FP/SIMD register state, modify the CPU/task
    FP/SIMD state.
    e.g,

    fpsimd_save(), task_fpsimd_load() - save/restore task FP/SIMD registers

    fpsimd_bind_task_to_cpu()  \
                                - Update the "state" metadata for CPU/task.
    fpsimd_bind_state_to_cpu() /

    fpsimd_update_current_state() - Update the fp/simd state for the current
                                    task from memory.

    These must not be called in the absence of FP/SIMD. Put in a WARNING
    to make sure they are not invoked in the absence of FP/SIMD.

KVM also uses the TIF_FOREIGN_FPSTATE flag to manage the FP/SIMD state
on the CPU. However, without FP/SIMD support we trap all accesses and
inject undefined instruction. Thus we should never "load" guest state.
Add a sanity check to make sure this is valid.

Fixes: 82e0191a1a ("arm64: Support systems without FP/ASIMD")
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:18 -05:00
Alexandru Elisei
0ec337059d KVM: arm64: Treat emulated TVAL TimerValue as a signed 32-bit integer
commit 4a267aa707953a9a73d1f5dc7f894dd9024a92be upstream.

According to the ARM ARM, registers CNT{P,V}_TVAL_EL0 have bits [63:32]
RES0 [1]. When reading the register, the value is truncated to the least
significant 32 bits [2], and on writes, TimerValue is treated as a signed
32-bit integer [1, 2].

When the guest behaves correctly and writes 32-bit values, treating TVAL
as an unsigned 64 bit register works as expected. However, things start
to break down when the guest writes larger values, because
(u64)0x1_ffff_ffff = 8589934591. but (s32)0x1_ffff_ffff = -1, and the
former will cause the timer interrupt to be asserted in the future, but
the latter will cause it to be asserted now.  Let's treat TVAL as a
signed 32-bit register on writes, to match the behaviour described in
the architecture, and the behaviour experimentally exhibited by the
virtual timer on a non-vhe host.

[1] Arm DDI 0487E.a, section D13.8.18
[2] Arm DDI 0487E.a, section D11.2.4

Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
[maz: replaced the read-side mask with lower_32_bits]
Signed-off-by: Marc Zyngier <maz@kernel.org>
Fixes: 8fa7616248 ("KVM: arm/arm64: arch_timer: Fix CNTP_TVAL calculation")
Link: https://lore.kernel.org/r/20200127103652.2326-1-alexandru.elisei@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:18 -05:00
Eric Auger
a17d216404 KVM: arm64: pmu: Fix chained SW_INCR counters
commit aa76829171e98bd75a0cc00b6248eca269ac7f4f upstream.

At the moment a SW_INCR counter always overflows on 32-bit
boundary, independently on whether the n+1th counter is
programmed as CHAIN.

Check whether the SW_INCR counter is a 64b counter and if so,
implement the 64b logic.

Fixes: 80f393a23b ("KVM: arm/arm64: Support chained PMU counters")
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200124142535.29386-4-eric.auger@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:17 -05:00
Eric Auger
a6229d1b5c KVM: arm64: pmu: Don't increment SW_INCR if PMCR.E is unset
commit 3837407c1aa1101ed5e214c7d6041e7a23335c6e upstream.

The specification says PMSWINC increments PMEVCNTR<n>_EL1 by 1
if PMEVCNTR<n>_EL0 is enabled and configured to count SW_INCR.

For PMEVCNTR<n>_EL0 to be enabled, we need both PMCNTENSET to
be set for the corresponding event counter but we also need
the PMCR.E bit to be set.

Fixes: 7a0adc7064 ("arm64: KVM: Add access handler for PMSWINC register")
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Andrew Murray <andrew.murray@arm.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200124142535.29386-2-eric.auger@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:17 -05:00
James Morse
93a509cf11 KVM: arm: Make inject_abt32() inject an external abort instead
commit 21aecdbd7f3ab02c9b82597dc733ee759fb8b274 upstream.

KVM's inject_abt64() injects an external-abort into an aarch64 guest.
The KVM_CAP_ARM_INJECT_EXT_DABT is intended to do exactly this, but
for an aarch32 guest inject_abt32() injects an implementation-defined
exception, 'Lockdown fault'.

Change this to external abort. For non-LPAE we now get the documented:
| Unhandled fault: external abort on non-linefetch (0x008) at 0x9c800f00
and for LPAE:
| Unhandled fault: synchronous external abort (0x210) at 0x9c800f00

Fixes: 74a64a9816 ("KVM: arm/arm64: Unify 32bit fault injection")
Reported-by: Beata Michalska <beata.michalska@linaro.org>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200121123356.203000-3-james.morse@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:17 -05:00
James Morse
9cce31930a KVM: arm: Fix DFSR setting for non-LPAE aarch32 guests
commit 018f22f95e8a6c3e27188b7317ef2c70a34cb2cd upstream.

Beata reports that KVM_SET_VCPU_EVENTS doesn't inject the expected
exception to a non-LPAE aarch32 guest.

The host intends to inject DFSR.FS=0x14 "IMPLEMENTATION DEFINED fault
(Lockdown fault)", but the guest receives DFSR.FS=0x04 "Fault on
instruction cache maintenance". This fault is hooked by
do_translation_fault() since ARMv6, which goes on to silently 'handle'
the exception, and restart the faulting instruction.

It turns out, when TTBCR.EAE is clear DFSR is split, and FS[4] has
to shuffle up to DFSR[10].

As KVM only does this in one place, fix up the static values. We
now get the expected:
| Unhandled fault: lock abort (0x404) at 0x9c800f00

Fixes: 74a64a9816 ("KVM: arm/arm64: Unify 32bit fault injection")
Reported-by: Beata Michalska <beata.michalska@linaro.org>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200121123356.203000-2-james.morse@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:17 -05:00
Gavin Shan
48f9ec2020 KVM: arm/arm64: Fix young bit from mmu notifier
commit cf2d23e0bac9f6b5cd1cba8898f5f05ead40e530 upstream.

kvm_test_age_hva() is called upon mmu_notifier_test_young(), but wrong
address range has been passed to handle_hva_to_gpa(). With the wrong
address range, no young bits will be checked in handle_hva_to_gpa().
It means zero is always returned from mmu_notifier_test_young().

This fixes the issue by passing correct address range to the underly
function handle_hva_to_gpa(), so that the hardware young (access) bit
will be visited.

Fixes: 35307b9a5f ("arm/arm64: KVM: Implement Stage-2 page aging")
Signed-off-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200121055659.19560-1-gshan@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:17 -05:00
Suzuki K Poulose
537493f146 arm64: ptrace: nofpsimd: Fail FP/SIMD regset operations
commit c9d66999f064947e6b577ceacc1eb2fbca6a8d3c upstream.

When fp/simd is not supported on the system, fail the operations
of FP/SIMD regsets.

Fixes: 82e0191a1a ("arm64: Support systems without FP/ASIMD")
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:17 -05:00
Suzuki K Poulose
37014cee45 arm64: cpufeature: Set the FP/SIMD compat HWCAP bits properly
commit 7559950aef1ab8792c50797c6c5c7c5150a02460 upstream.

We set the compat_elf_hwcap bits unconditionally on arm64 to
include the VFP and NEON support. However, the FP/SIMD unit
is optional on Arm v8 and thus could be missing. We already
handle this properly in the kernel, but still advertise to
the COMPAT applications that the VFP is available. Fix this
to make sure we only advertise when we really have them.

Fixes: 82e0191a1a ("arm64: Support systems without FP/ASIMD")
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:17 -05:00
Suzuki K Poulose
1a2b07a2c3 arm64: cpufeature: Fix the type of no FP/SIMD capability
commit 449443c03d8cfdacf7313e17779a2594ebf87e6d upstream.

The NO_FPSIMD capability is defined with scope SYSTEM, which implies
that the "absence" of FP/SIMD on at least one CPU is detected only
after all the SMP CPUs are brought up. However, we use the status
of this capability for every context switch. So, let us change
the scope to LOCAL_CPU to allow the detection of this capability
as and when the first CPU without FP is brought up.

Also, the current type allows hotplugged CPU to be brought up without
FP/SIMD when all the current CPUs have FP/SIMD and we have the userspace
up. Fix both of these issues by changing the capability to
BOOT_RESTRICTED_LOCAL_CPU_FEATURE.

Fixes: 82e0191a1a ("arm64: Support systems without FP/ASIMD")
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:17 -05:00
Qais Yousef
ba95651cef sched/uclamp: Fix a bug in propagating uclamp value in new cgroups
commit 7226017ad37a888915628e59a84a2d1e57b40707 upstream.

When a new cgroup is created, the effective uclamp value wasn't updated
with a call to cpu_util_update_eff() that looks at the hierarchy and
update to the most restrictive values.

Fix it by ensuring to call cpu_util_update_eff() when a new cgroup
becomes online.

Without this change, the newly created cgroup uses the default
root_task_group uclamp values, which is 1024 for both uclamp_{min, max},
which will cause the rq to to be clamped to max, hence cause the
system to run at max frequency.

The problem was observed on Ubuntu server and was reproduced on Debian
and Buildroot rootfs.

By default, Ubuntu and Debian create a cpu controller cgroup hierarchy
and add all tasks to it - which creates enough noise to keep the rq
uclamp value at max most of the time. Imitating this behavior makes the
problem visible in Buildroot too which otherwise looks fine since it's a
minimal userspace.

Fixes: 0b60ba2dd3 ("sched/uclamp: Propagate parent clamps")
Reported-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Doug Smythies <dsmythies@telus.net>
Link: https://lore.kernel.org/lkml/000701d5b965$361b6c60$a2524520$@net/
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:17 -05:00
Olof Johansson
5d42957c90 ARM: 8949/1: mm: mark free_memmap as __init
commit 31f3010e60522ede237fb145a63b4af5a41718c2 upstream.

As of commit ac7c3e4ff4 ("compiler: enable CONFIG_OPTIMIZE_INLINING
forcibly"), free_memmap() might not always be inlined, and thus is
triggering a section warning:

WARNING: vmlinux.o(.text.unlikely+0x904): Section mismatch in reference from the function free_memmap() to the function .meminit.text:memblock_free()

Mark it as __init, since the faller (free_unused_memmap) already is.

Fixes: ac7c3e4ff4 ("compiler: enable CONFIG_OPTIMIZE_INLINING forcibly")
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:17 -05:00
Eric Auger
199808393e KVM: arm/arm64: vgic-its: Fix restoration of unmapped collections
commit 8c58be34494b7f1b2adb446e2d8beeb90e5de65b upstream.

Saving/restoring an unmapped collection is a valid scenario. For
example this happens if a MAPTI command was sent, featuring an
unmapped collection. At the moment the CTE fails to be restored.
Only compare against the number of online vcpus if the rdist
base is set.

Fixes: ea1ad53e1e ("KVM: arm64: vgic-its: Collection table save/restore")
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Link: https://lore.kernel.org/r/20191213094237.19627-1-eric.auger@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:34:17 -05:00