Commit Graph

1148678 Commits

Author SHA1 Message Date
Elliot Berman
de3283f904 FROMLIST: docs: gunyah: Introduce Gunyah Hypervisor
Gunyah is an open-source Type-1 hypervisor developed by Qualcomm. It
does not depend on any lower-privileged OS/kernel code for its core
functionality. This increases its security and can support a smaller
trusted computing based when compared to Type-2 hypervisors.

Add documentation describing the Gunyah hypervisor and the main
components of the Gunyah hypervisor which are of interest to Linux
virtualization development.

Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>
Change-Id: I471b5ad02732f25e35efe033cd281025c84d0f09
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-2-quic_eberman@quicinc.com/
2023-03-30 19:20:27 +00:00
Elliot Berman
f72d338c3d FROMLIST: mailbox: Allow direct registration to a channel
Support virtual mailbox controllers and clients which are not platform
devices or come from the devicetree by allowing them to match client to
channel via some other mechanism.

Bug: 268234781
Link: https://lore.kernel.org/all/20230216163804.456714-1-quic_eberman@quicinc.com/
Change-Id: I33bb150bfcd0c40b15d1da634a907b0ffbca16ef
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2023-03-30 19:20:27 +00:00
Will McVicker
f2844fae7f ANDROID: Fix the KMI
The CRC for shmem_file_setup changed after
https://r.android.com/c/2512924/5 rebased on commit due to the bi-weekly
KMI update happening in tandem.

The KMI changes include:

function symbol 'struct file* shmem_file_setup(const char*,
loff_t, unsigned long)' changed
  CRC changed from 0x5979e157 to 0xe9ef458b

Also, abi_gki_protected_exports_aarch64 needed an update due to
the hashtag 'kmi-changes-for-2023-03-29'.

Bug: 273448633
Change-Id: Ie174f036ddfbac12e454bbaf927c4a15cf9020f0
Signed-off-by: Will McVicker <willmcvicker@google.com>
2023-03-30 17:03:14 +00:00
Charan Teja Kalla
6976fcd167 ANDROID: mm: shmem: whitelist the symbols in the shmem
Whitelist the below symbols in shmem:
shmem_file_setup
android_rvh_shmem_get_folio .

Bug: 273448633
Change-Id: I701bd49d38011a191908a3247ec79c1a9481e660
Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>
2023-03-30 15:35:48 +00:00
Charan Teja Kalla
d13275473e ANDROID: mm/shmem: Add a trace hook to get the shmem folio
Add a trace hook whose callback be used to fill the folio that can be
used for shmem fs. This VH also takes the 'shmem_inode_info' which
can contain the vendor specific data.

Bug: 273448633
Change-Id: Ia48480bba6dba1ee37a3297b69fd61877dae8dc9
Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>
2023-03-30 15:35:48 +00:00
Charan Teja Kalla
a033dd393f ANDROID: mm: shmem: add vendor data in 'shmem_inode_info'
Add vendor specific data in the 'struct shmem_inode_info'.

Bug: 273448633
Change-Id: I83a3ac822275d2464af7eb25b869b816fdb7276e
Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>
2023-03-30 15:35:48 +00:00
Carlos Llamas
9e35a21ec0 ANDROID: 3/29/2023 KMI update
Set KMI_GENERATION=3 for 3/29 KMI update

5 function symbol(s) added
  'struct page* dmabuf_page_pool_alloc(struct dmabuf_page_pool*)'
  'struct dmabuf_page_pool* dmabuf_page_pool_create(gfp_t, unsigned int)'
  'void dmabuf_page_pool_destroy(struct dmabuf_page_pool*)'
  'void dmabuf_page_pool_free(struct dmabuf_page_pool*, struct page*)'
  'unsigned long dmabuf_page_pool_get_size(struct dmabuf_page_pool*)'

function symbol changed from 'void __wake_up(struct wait_queue_head*, unsigned int, int, void*)' to 'int __wake_up(struct wait_queue_head*, unsigned int, int, void*)'
  CRC changed from 0x3eeb2322 to 0xe2964344
  type changed from 'void(struct wait_queue_head*, unsigned int, int, void*)' to 'int(struct wait_queue_head*, unsigned int, int, void*)'
    return type changed from 'void' to 'int'

function symbol changed from 'void cfg80211_ch_switch_notify(struct net_device*, struct cfg80211_chan_def*, unsigned int)' to 'void cfg80211_ch_switch_notify(struct net_device*, struct cfg80211_chan_def*, unsigned int, u16)'
  CRC changed from 0xe8432c8b to 0xdcde54a6
  type changed from 'void(struct net_device*, struct cfg80211_chan_def*, unsigned int)' to 'void(struct net_device*, struct cfg80211_chan_def*, unsigned int, u16)'
    parameter 4 of type 'u16' was added

function symbol changed from 'void cfg80211_ch_switch_started_notify(struct net_device*, struct cfg80211_chan_def*, unsigned int, u8, bool)' to 'void cfg80211_ch_switch_started_notify(struct net_device*, struct cfg80211_chan_def*, unsigned int, u8, bool, u16)'
  CRC changed from 0xe086a1f0 to 0x86eba6c4
  type changed from 'void(struct net_device*, struct cfg80211_chan_def*, unsigned int, u8, bool)' to 'void(struct net_device*, struct cfg80211_chan_def*, unsigned int, u8, bool, u16)'
    parameter 6 of type 'u16' was added

function symbol changed from 'void cfg80211_port_authorized(struct net_device*, const u8*, gfp_t)' to 'void cfg80211_port_authorized(struct net_device*, const u8*, const u8*, u8, gfp_t)'
  CRC changed from 0x2ce6ed68 to 0x8ba3e8b9
  type changed from 'void(struct net_device*, const u8*, gfp_t)' to 'void(struct net_device*, const u8*, const u8*, u8, gfp_t)'
    parameter 3 type changed from 'gfp_t' = 'unsigned int' to 'const u8*'
      resolved type changed from 'unsigned int' to 'const u8*'
    parameter 4 of type 'u8' was added
    parameter 5 of type 'gfp_t' was added

function symbol changed from 'unsigned long drm_gem_lru_scan(struct drm_gem_lru*, unsigned int, bool(*)(struct drm_gem_object*))' to 'unsigned long drm_gem_lru_scan(struct drm_gem_lru*, unsigned int, unsigned long*, bool(*)(struct drm_gem_object*))'
  CRC changed from 0x98fde9d to 0x9acfaf20
  type changed from 'unsigned long(struct drm_gem_lru*, unsigned int, bool(*)(struct drm_gem_object*))' to 'unsigned long(struct drm_gem_lru*, unsigned int, unsigned long*, bool(*)(struct drm_gem_object*))'
    parameter 3 type changed from 'bool(*)(struct drm_gem_object*)' to 'unsigned long*'
      pointed-to type changed from 'bool(struct drm_gem_object*)' to 'unsigned long'
    parameter 4 of type 'bool(*)(struct drm_gem_object*)' was added

function symbol changed from 'char* kobject_get_path(struct kobject*, gfp_t)' to 'char* kobject_get_path(const struct kobject*, gfp_t)'
  CRC changed from 0x6d2bc3a7 to 0x62b056f6
  type changed from 'char*(struct kobject*, gfp_t)' to 'char*(const struct kobject*, gfp_t)'
    parameter 1 type changed from 'struct kobject*' to 'const struct kobject*'
      pointed-to type changed from 'struct kobject' to 'const struct kobject'
        qualifier const added

function symbol 'struct block_device* I_BDEV(struct inode*)' changed
  CRC changed from 0x66b14c8d to 0xc79e45c3

function symbol 'void __ClearPageMovable(struct page*)' changed
  CRC changed from 0xbf6e946f to 0x4cf602fa

function symbol 'void __SetPageMovable(struct page*, const struct movable_operations*)' changed
  CRC changed from 0x8c770d3 to 0x60f5778b

... 1724 omitted; 1727 symbols have only CRC changes

type 'enum nl80211_attrs' changed
  enumerator 'NL80211_ATTR_TD_BITMAP' (321) was added
  enumerator 'NL80211_ATTR_PUNCT_BITMAP' (322) was added
  enumerator '__NL80211_ATTR_AFTER_LAST' value changed from 321 to 323
  enumerator 'NUM_NL80211_ATTR' value changed from 321 to 323
  enumerator 'NL80211_ATTR_MAX' value changed from 320 to 322

type 'struct scsi_device' changed
  member 'unsigned int no_vpd_size : 1' was added

type 'struct dma_buf' changed
  byte size changed from 264 to 272
  member 'struct dma_buf_sysfs_entry* sysfs_entry' was added

type 'struct ufs_hba' changed
  member 'unsigned int android_quirks' was added
  member 'unsigned int dev_quirks' changed
    offset changed by 32

type 'struct cfg80211_connect_resp_params' changed
  byte size changed from 472 to 592
  member changed from 'struct { const u8* addr; const u8* bssid; struct cfg80211_bss* bss; } links[15]' to 'struct { const u8* addr; const u8* bssid; struct cfg80211_bss* bss; u16 status; } links[15]'
    type changed from 'struct { const u8* addr; const u8* bssid; struct cfg80211_bss* bss; }[15]' to 'struct { const u8* addr; const u8* bssid; struct cfg80211_bss* bss; u16 status; }[15]'
      element type changed from 'struct { const u8* addr; const u8* bssid; struct cfg80211_bss* bss; }' to 'struct { const u8* addr; const u8* bssid; struct cfg80211_bss* bss; u16 status; }'
        byte size changed from 24 to 32
        member 'u16 status' was added

type 'struct station_info' changed
  byte size changed from 232 to 256
  member 'bool mlo_params_valid' was added
  member 'u8 assoc_link_id' was added
  member 'u8 mld_addr[6]' was added
  member 'const u8* assoc_resp_ies' was added
  member 'size_t assoc_resp_ies_len' was added

type 'struct cfg80211_external_auth_params' changed
  byte size changed from 64 to 72
  member 'u8 mld_addr[6]' was added

type 'struct cfg80211_rx_assoc_resp' changed
  byte size changed from 288 to 408
  member changed from 'struct { const u8* addr; struct cfg80211_bss* bss; } links[15]' to 'struct { const u8* addr; struct cfg80211_bss* bss; u16 status; } links[15]'
    type changed from 'struct { const u8* addr; struct cfg80211_bss* bss; }[15]' to 'struct { const u8* addr; struct cfg80211_bss* bss; u16 status; }[15]'
      element type changed from 'struct { const u8* addr; struct cfg80211_bss* bss; }' to 'struct { const u8* addr; struct cfg80211_bss* bss; u16 status; }'
        byte size changed from 16 to 24
        member 'u16 status' was added

type 'struct cfg80211_update_owe_info' changed
  byte size changed from 24 to 40
  member 'int assoc_link_id' was added
  member 'u8 peer_mld_addr[6]' was added

type 'struct pglist_data' changed
  byte size changed from 6976 to 7168
  2 members ('unsigned long flags' .. 'struct lru_gen_mm_walk mm_walk') changed
    offset changed by 128
  member 'struct lru_gen_memcg memcg_lru' was added
  3 members ('struct cacheline_padding _pad2_' .. 'atomic_long_t vm_stat[42]') changed
    offset changed by 1536

type 'struct pci_host_bridge' changed
  member 'unsigned int no_inc_mrrs : 1' was added
  9 members ('unsigned int native_aer : 1' .. 'unsigned int msi_domain : 1') changed
    offset changed by 1

type 'struct hid_device' changed
  member 'unsigned int initial_quirks' was added
  member 'bool io_started' changed
    offset changed by 32

type 'struct tcpm_port' changed
  member 'bool potential_contaminant' was added

type 'struct tcpci' changed
  byte size changed from 224 to 232
  member 'struct tcpci_data* data' changed
    offset changed by 64

type 'struct tcpci_data' changed
  byte size changed from 64 to 72
  member 'void(* check_contaminant)(struct tcpci*, struct tcpci_data*)' was added

type 'struct blk_mq_tags' changed
  byte size changed from 168 to 184
  member 'struct sbitmap_queue breserved_tags' changed
    offset changed by 64
  4 members ('struct request** rqs' .. 'spinlock_t lock') changed
    offset changed by 128

type 'struct netns_ct' changed
  member 'u8 ctnetlink_has_listener' was removed
  6 members ('bool ecache_dwork_pending' .. 'u8 sysctl_checksum') changed
    offset changed by -8

type 'struct lruvec' changed
  byte size changed from 1208 to 1224
  member changed from 'struct lru_gen_struct lrugen' to 'struct lru_gen_folio lrugen'
    type changed from 'struct lru_gen_struct' to 'struct lru_gen_folio'
  2 members ('struct lru_gen_mm_state mm_state' .. 'struct pglist_data* pgdat') changed
    offset changed by 128

type 'struct tcpc_dev' changed
  byte size changed from 184 to 192
  member 'void(* check_contaminant)(struct tcpc_dev*)' was added

type 'enum tcpm_state' changed
  enumerator 'CHECK_CONTAMINANT' (2) was added
  enumerator 'SRC_UNATTACHED' value changed from 2 to 3
  enumerator 'SRC_ATTACH_WAIT' value changed from 3 to 4
  enumerator 'SRC_ATTACHED' value changed from 4 to 5
  enumerator 'SRC_STARTUP' value changed from 5 to 6
  enumerator 'SRC_SEND_CAPABILITIES' value changed from 6 to 7
  enumerator 'SRC_SEND_CAPABILITIES_TIMEOUT' value changed from 7 to 8
  enumerator 'SRC_NEGOTIATE_CAPABILITIES' value changed from 8 to 9
  enumerator 'SRC_TRANSITION_SUPPLY' value changed from 9 to 10
  enumerator 'SRC_READY' value changed from 10 to 11
  enumerator 'SRC_WAIT_NEW_CAPABILITIES' value changed from 11 to 12
  enumerator 'SNK_UNATTACHED' value changed from 12 to 13
  enumerator 'SNK_ATTACH_WAIT' value changed from 13 to 14
  enumerator 'SNK_DEBOUNCED' value changed from 14 to 15
  enumerator 'SNK_ATTACHED' value changed from 15 to 16
  enumerator 'SNK_STARTUP' value changed from 16 to 17
  enumerator 'SNK_DISCOVERY' value changed from 17 to 18
  enumerator 'SNK_DISCOVERY_DEBOUNCE' value changed from 18 to 19
  enumerator 'SNK_DISCOVERY_DEBOUNCE_DONE' value changed from 19 to 20
  enumerator 'SNK_WAIT_CAPABILITIES' value changed from 20 to 21
  enumerator 'SNK_NEGOTIATE_CAPABILITIES' value changed from 21 to 22
  enumerator 'SNK_NEGOTIATE_PPS_CAPABILITIES' value changed from 22 to 23
  enumerator 'SNK_TRANSITION_SINK' value changed from 23 to 24
  enumerator 'SNK_TRANSITION_SINK_VBUS' value changed from 24 to 25
  enumerator 'SNK_READY' value changed from 25 to 26
  enumerator 'ACC_UNATTACHED' value changed from 26 to 27
  enumerator 'DEBUG_ACC_ATTACHED' value changed from 27 to 28
  enumerator 'AUDIO_ACC_ATTACHED' value changed from 28 to 29
  enumerator 'AUDIO_ACC_DEBOUNCE' value changed from 29 to 30
  enumerator 'HARD_RESET_SEND' value changed from 30 to 31
  enumerator 'HARD_RESET_START' value changed from 31 to 32
  enumerator 'SRC_HARD_RESET_VBUS_OFF' value changed from 32 to 33
  enumerator 'SRC_HARD_RESET_VBUS_ON' value changed from 33 to 34
  enumerator 'SNK_HARD_RESET_SINK_OFF' value changed from 34 to 35
  enumerator 'SNK_HARD_RESET_WAIT_VBUS' value changed from 35 to 36
  enumerator 'SNK_HARD_RESET_SINK_ON' value changed from 36 to 37
  enumerator 'SOFT_RESET' value changed from 37 to 38
  enumerator 'SRC_SOFT_RESET_WAIT_SNK_TX' value changed from 38 to 39
  enumerator 'SNK_SOFT_RESET' value changed from 39 to 40
  enumerator 'SOFT_RESET_SEND' value changed from 40 to 41
  enumerator 'DR_SWAP_ACCEPT' value changed from 41 to 42
  enumerator 'DR_SWAP_SEND' value changed from 42 to 43
  enumerator 'DR_SWAP_SEND_TIMEOUT' value changed from 43 to 44
  enumerator 'DR_SWAP_CANCEL' value changed from 44 to 45
  enumerator 'DR_SWAP_CHANGE_DR' value changed from 45 to 46
  enumerator 'PR_SWAP_ACCEPT' value changed from 46 to 47
  enumerator 'PR_SWAP_SEND' value changed from 47 to 48
  enumerator 'PR_SWAP_SEND_TIMEOUT' value changed from 48 to 49
  enumerator 'PR_SWAP_CANCEL' value changed from 49 to 50
  enumerator 'PR_SWAP_START' value changed from 50 to 51
  enumerator 'PR_SWAP_SRC_SNK_TRANSITION_OFF' value changed from 51 to 52
  enumerator 'PR_SWAP_SRC_SNK_SOURCE_OFF' value changed from 52 to 53
  enumerator 'PR_SWAP_SRC_SNK_SOURCE_OFF_CC_DEBOUNCED' value changed from 53 to 54
  enumerator 'PR_SWAP_SRC_SNK_SINK_ON' value changed from 54 to 55
  enumerator 'PR_SWAP_SNK_SRC_SINK_OFF' value changed from 55 to 56
  enumerator 'PR_SWAP_SNK_SRC_SOURCE_ON' value changed from 56 to 57
  enumerator 'PR_SWAP_SNK_SRC_SOURCE_ON_VBUS_RAMPED_UP' value changed from 57 to 58
  enumerator 'VCONN_SWAP_ACCEPT' value changed from 58 to 59
  enumerator 'VCONN_SWAP_SEND' value changed from 59 to 60
  enumerator 'VCONN_SWAP_SEND_TIMEOUT' value changed from 60 to 61
  enumerator 'VCONN_SWAP_CANCEL' value changed from 61 to 62
  enumerator 'VCONN_SWAP_START' value changed from 62 to 63
  enumerator 'VCONN_SWAP_WAIT_FOR_VCONN' value changed from 63 to 64
  enumerator 'VCONN_SWAP_TURN_ON_VCONN' value changed from 64 to 65
  enumerator 'VCONN_SWAP_TURN_OFF_VCONN' value changed from 65 to 66
  enumerator 'FR_SWAP_SEND' value changed from 66 to 67
  enumerator 'FR_SWAP_SEND_TIMEOUT' value changed from 67 to 68
  enumerator 'FR_SWAP_SNK_SRC_TRANSITION_TO_OFF' value changed from 68 to 69
  enumerator 'FR_SWAP_SNK_SRC_NEW_SINK_READY' value changed from 69 to 70
  enumerator 'FR_SWAP_SNK_SRC_SOURCE_VBUS_APPLIED' value changed from 70 to 71
  enumerator 'FR_SWAP_CANCEL' value changed from 71 to 72
  enumerator 'SNK_TRY' value changed from 72 to 73
  enumerator 'SNK_TRY_WAIT' value changed from 73 to 74
  enumerator 'SNK_TRY_WAIT_DEBOUNCE' value changed from 74 to 75
  enumerator 'SNK_TRY_WAIT_DEBOUNCE_CHECK_VBUS' value changed from 75 to 76
  enumerator 'SRC_TRYWAIT' value changed from 76 to 77
  enumerator 'SRC_TRYWAIT_DEBOUNCE' value changed from 77 to 78
  enumerator 'SRC_TRYWAIT_UNATTACHED' value changed from 78 to 79
  enumerator 'SRC_TRY' value changed from 79 to 80
  enumerator 'SRC_TRY_WAIT' value changed from 80 to 81
  enumerator 'SRC_TRY_DEBOUNCE' value changed from 81 to 82
  enumerator 'SNK_TRYWAIT' value changed from 82 to 83
  enumerator 'SNK_TRYWAIT_DEBOUNCE' value changed from 83 to 84
  enumerator 'SNK_TRYWAIT_VBUS' value changed from 84 to 85
  enumerator 'BIST_RX' value changed from 85 to 86
  enumerator 'GET_STATUS_SEND' value changed from 86 to 87
  enumerator 'GET_STATUS_SEND_TIMEOUT' value changed from 87 to 88
  enumerator 'GET_PPS_STATUS_SEND' value changed from 88 to 89
  enumerator 'GET_PPS_STATUS_SEND_TIMEOUT' value changed from 89 to 90
  enumerator 'GET_SINK_CAP' value changed from 90 to 91
  enumerator 'GET_SINK_CAP_TIMEOUT' value changed from 91 to 92
  enumerator 'ERROR_RECOVERY' value changed from 92 to 93
  enumerator 'PORT_RESET' value changed from 93 to 94
  enumerator 'PORT_RESET_WAIT_OFF' value changed from 94 to 95
  enumerator 'AMS_START' value changed from 95 to 96
  enumerator 'CHUNK_NOT_SUPP' value changed from 96 to 97

type 'struct cfg80211_ap_settings' changed
  byte size changed from 904 to 912
  member 'u16 punct_bitmap' was added

type 'struct bss_parameters' changed
  member 'int link_id' was added
  3 members ('int use_cts_prot' .. 'int use_short_slot_time') changed
    offset changed by 32

type 'struct cfg80211_csa_settings' changed
  member 'u16 punct_bitmap' was added

type 'struct sbitmap_queue' changed
  byte size changed from 56 to 64
  member 'atomic_t completion_cnt' was added
  member 'atomic_t wakeup_cnt' was added

type 'struct mem_cgroup_per_node' changed
  byte size changed from 2080 to 2096
  9 members ('struct lruvec_stats_percpu* lruvec_stats_percpu' .. 'struct mem_cgroup* memcg') changed
    offset changed by 128

type 'struct sbq_wait_state' changed
  member 'atomic_t wait_cnt' was removed
  member 'wait_queue_head_t wait' changed
    offset changed by -64

type 'struct pkvm_module_ops' changed
  byte size changed from 208 to 496
  member 'int(* host_share_hyp)(u64)' was added
  member 'int(* host_unshare_hyp)(u64)' was added
  member 'int(* pin_shared_mem)(void*, void*)' was added
  member 'void(* unpin_shared_mem)(void*, void*)' was added
  5 members ('void*(* memcpy)(void*, const void*, size_t)' .. 'unsigned long(* kern_hyp_va)(unsigned long)') changed
    offset changed by 256
  member 'u64 android_kabi_reserved1' was added
  member 'u64 android_kabi_reserved2' was added
  member 'u64 android_kabi_reserved3' was added
  member 'u64 android_kabi_reserved4' was added
  member 'u64 android_kabi_reserved5' was added
  member 'u64 android_kabi_reserved6' was added
  member 'u64 android_kabi_reserved7' was added
  member 'u64 android_kabi_reserved8' was added
  member 'u64 android_kabi_reserved9' was added
  member 'u64 android_kabi_reserved10' was added
  member 'u64 android_kabi_reserved11' was added
  member 'u64 android_kabi_reserved12' was added
  member 'u64 android_kabi_reserved13' was added
  member 'u64 android_kabi_reserved14' was added
  member 'u64 android_kabi_reserved15' was added
  member 'u64 android_kabi_reserved16' was added
  member 'u64 android_kabi_reserved17' was added
  member 'u64 android_kabi_reserved18' was added
  member 'u64 android_kabi_reserved19' was added
  member 'u64 android_kabi_reserved20' was added
  member 'u64 android_kabi_reserved21' was added
  member 'u64 android_kabi_reserved22' was added
  member 'u64 android_kabi_reserved23' was added
  member 'u64 android_kabi_reserved24' was added
  member 'u64 android_kabi_reserved25' was added
  member 'u64 android_kabi_reserved26' was added
  member 'u64 android_kabi_reserved27' was added
  member 'u64 android_kabi_reserved28' was added
  member 'u64 android_kabi_reserved29' was added
  member 'u64 android_kabi_reserved30' was added
  member 'u64 android_kabi_reserved31' was added
  member 'u64 android_kabi_reserved32' was added

type 'struct kvm_vcpu' changed
  byte size changed from 9696 to 9680
  5 members ('struct kvm_vcpu_stat stat' .. 'u64 last_used_slot_gen') changed
    offset changed by -128

type 'struct kvm_vcpu_arch' changed
  byte size changed from 8464 to 8448
  member 'struct task_struct* parent_task' was removed
  12 members ('struct { struct kvm_guest_debug_arch regs; u64 pmscr_el1; u64 trfcr_el1; } host_debug_state' .. 'struct { u64 last_steal; gpa_t base; } steal') changed
    offset changed by -64

Bug: 273751441
Change-Id: I7a5d2599515e67b55871f17eafd239c6cbf136bd
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2023-03-30 12:23:05 +01:00
Eric Biggers
0844ef7770 ANDROID: ufs: core: move Android quirks into separate field
Prevent the imminent collision between the upstream quirk bits (now up
to '1 << 19') and the Android quirk bits (starting at '1 << 20') by
moving the Android quirk bits into their own field in struct ufs_hba.

Bug: 162257402
Change-Id: I5373c092734d16f693300d9bd73c7c9063ac921e
Signed-off-by: Eric Biggers <ebiggers@google.com>
2023-03-30 12:23:04 +01:00
Fuad Tabba
743439fcc6 ANDROID: KVM: arm64: Save and restore host sve state in pKVM
Non-protected mode relies on the host to restore its SVE state if
necessary. However, protected VMs shouldn't reveal any
information to the host, including whether they have potentially
dirtied the host's sve state. Therefore, save and restore the
host's sve state at hyp in protected mode.

Currently this behavior applies to protected and non-protected
VMs in protected mode. It could be optimised for non-protected
VMs by applying the same behavior as non-protected mode, which is
to inform the host that it should restore its sve state. But for
now it's kept this way to maintain the same behavior for all VMs
in protected mode.

Signed-off-by: Fuad Tabba <tabba@google.com>

Bug: 267291591
Change-Id: Ifbcc64b387c3f821a6c1047e8c843f6250a3f690
2023-03-30 12:23:04 +01:00
Fuad Tabba
1ed56a9485 ANDROID: KVM: arm64: Specialize deactivate fpsimd traps on guest fpsimd trap
The code for deactivating traps, to be able to update the fpsimd
registers, is the only code in this file that is n/vhe specific.
Move it to specialized functions.

This is also needed for the subsequent patch, since the logic for
deciding which traps to enable/disable will get more complex.

No functional change intended.

Signed-off-by: Fuad Tabba <tabba@google.com>

Bug: 267291591
Change-Id: Ia0477450aa9319a46a91b3c31c1910ad02fbe246
2023-03-30 12:23:04 +01:00
Fuad Tabba
55c963e08b ANDROID: KVM: arm64: Specialize handling of host fpsimd state on EL2 trap n/vhe
In subsequent patches, vhe/pKVM(nvhe) will diverge significantly
on saving the host fpsimd/sve state when taking a guest fpsimd
trap. Add a specialized helper to handle that.

No functional change intended.

Signed-off-by: Fuad Tabba <tabba@google.com>

Bug: 267291591
Change-Id: Ib6b13cafad8bf568694804e3b55e0a5a4fcd70a4
2023-03-30 12:23:04 +01:00
Fuad Tabba
6a8b1d4934 ANDROID: KVM: arm64: Allocate memory at hyp for host sve state
Allocate memory and donate it to hyp at setup time for tracking
the host sve state at hyp in protected mode. This memory is used
in the subsequent patch.

Signed-off-by: Fuad Tabba <tabba@google.com>

Bug: 267291591
Change-Id: If07eec9ea9c7b216d02e2d1ea69bd62d99f08081
2023-03-30 12:23:04 +01:00
Fuad Tabba
a752b269cb ANDROID: KVM: arm64: Store the maximum sve vector length at hyp
The code to determine the maximum sve vector length by the system
isn't trivial. In subsequent patches hyp needs to know it for
allocating memory for the host sve state.

Signed-off-by: Fuad Tabba <tabba@google.com>

Bug: 267291591
Change-Id: I2561af67722a99d8a989b26cb47d073eba3869ff
2023-03-30 12:23:04 +01:00
Fuad Tabba
6dc9af85f7 ANDROID: KVM: arm64: Allocate host fp state at pkvm init rather than per cpu
Subsequent patches will augment this state to allocate space for
tracking the host sve state. SVE state size is not static, and
there isn't support for dynamic per_cpu allocation in hyp.

This is done as a first step in allowing us to allocate SVE state
under the same umbrella.

Signed-off-by: Fuad Tabba <tabba@google.com>

Bug: 267291591
Change-Id: I0902623a5ab81a80105f5b00a26765d257bc1ceb
2023-03-30 12:23:04 +01:00
Fuad Tabba
dbe1e94b31 ANDROID: KVM: arm64: Move loaded host fp state to pkvm
The state will be augmented in future patches and accessed in
more than one location. It makes it easier to reason about the
code.

No functional change intended.

Signed-off-by: Fuad Tabba <tabba@google.com>

Bug: 267291591
Change-Id: If3a3a9266c201f63c126860b61da9698be9b9faa
2023-03-30 12:23:04 +01:00
Fuad Tabba
72919eb248 ANDROID: KVM: arm64: Use helper to get the host fpsimd state in pKVM
Subsequent patches will change how the fpsimd state is allocated,
and add tracking of sve state. Moving this to a helper makes
future code cleaner and patches easier to reason about.

No functional change intended.

Signed-off-by: Fuad Tabba <tabba@google.com>

Bug: 267291591
Change-Id: Ic46b8889c1fe11f0cfdd7b5f3d2b98bf412183f0
2023-03-30 12:23:03 +01:00
Fuad Tabba
26d24625b3 ANDROID: KVM: arm64: Use enum instead of helper for fp state
Before the conversion of the various booleans into an enum
representing the state,  this helper clarified things. Since the
introduction of the enum, the helper obfuscates rather than
helps.

No functional change intended.

Signed-off-by: Fuad Tabba <tabba@google.com>

Bug: 267291591
Change-Id: I83c870146ed2d910bf10d625d1048b95c8b23736
2023-03-30 12:23:03 +01:00
Fuad Tabba
4fa6c1122e ANDROID: KVM: arm64: Do not map the host fpsimd state to hyp in pKVM
pKVM maintains its own state for tracking the host fpsimd state.
Therefore, no need to map and share the host's view with it.

Signed-off-by: Fuad Tabba <tabba@google.com>

Bug: 267291591
Change-Id: I5e5164a7694881ffa641b5b6a8691a542fd55a14
2023-03-30 12:23:03 +01:00
Fuad Tabba
ba446078c9 ANDROID: KVM: arm64: Clarify rationale for ZCR_EL1 value restored on guest exit
Expand comment clarifying why the host value representing sve
vector length being restored for ZCR_EL1 on guest exit isn't the
same as it was on guest entry.

Signed-off-by: Fuad Tabba <tabba@google.com>

Bug: 267291591
Change-Id: I5889407b4391a80dfcf77b31375c3a17705b68da
2023-03-30 12:23:03 +01:00
Greg Kroah-Hartman
d9e00246e0 Revert "Revert "scsi: core: Add BLIST_NO_VPD_SIZE for some VDASD""
This reverts commit ad8dbd4420.

It was perserving the ABI, but that is not needed anymore at this point
in time.

Change-Id: If9e034122448b199c0c98b689c6e6d0e52d388fd
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-30 12:23:03 +01:00
Greg Kroah-Hartman
b21e700aa4 Revert "Revert "drm/msm/gem: Prevent blocking within shrinker loop""
This reverts commit eb1f5e4656.

It was perserving the ABI, but that is not needed anymore at this point
in time.

Change-Id: I2f1ddf6bb64c0b7bc4a6b653d60cdd256820080d
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-30 12:23:03 +01:00
Greg Kroah-Hartman
0e07b5c674 Revert "Revert "PCI: loongson: Add more devices that need MRRS quirk""
This reverts commit 8c8619f60e.

It was perserving the ABI, but that is not needed anymore at this point
in time.

Change-Id: Ic7a4708cc761cc7343ceee47ffb63a7cde23516a
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-30 12:23:03 +01:00
Greg Kroah-Hartman
68acfb3592 Revert "Revert "PCI: loongson: Prevent LS7A MRRS increases""
This reverts commit 1a291b98a3.

It was perserving the ABI, but that is not needed anymore at this point
in time.

Change-Id: I53ec3c627f1a697a1d2054f85e9d794e6e18df37
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-30 12:23:02 +01:00
Greg Kroah-Hartman
bd4a7c70f3 Revert "Revert "netfilter: ctnetlink: make event listener tracking global""
This reverts commit b5a444808a.

It was perserving the ABI, but that is not needed anymore at this point
in time.

Change-Id: I595ea6488d44620f3576e4c9ecf5dc7e4d269909
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-30 12:23:02 +01:00
Greg Kroah-Hartman
a9a5726a7a Revert "Revert "HID: retain initial quirks set up when creating HID devices""
This reverts commit e0f8567110.

It was perserving the ABI, but that is not needed anymore at this point
in time.

Change-Id: I4f91f78a34c8ab5761d85ebb4061f9620eec592a
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-30 12:23:02 +01:00
Greg Kroah-Hartman
f61c12dabf Revert "Revert "sbitmap: Try each queue to wake up at least one waiter""
This reverts commit 77bcc673f6.

It was perserving the ABI, but that is not needed anymore at this point
in time.

Change-Id: I0737d8ce7f08323128fa61389169e5e692b56351
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-30 12:23:02 +01:00
Greg Kroah-Hartman
7b05fba131 Revert "Revert "sbitmap: Advance the queue index before waking up a queue""
This reverts commit 1e993e7647.

It was perserving the ABI, but that is not needed anymore at this point
in time.

Change-Id: I7b6c62480765cfa9751874641092b2a52229ea84
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-30 12:23:02 +01:00
Greg Kroah-Hartman
d774f1e1f0 Revert "Revert "sbitmap: correct wake_batch recalculation to avoid potential IO hung""
This reverts commit f12f3bc9c7.

It was perserving the ABI, but that is not needed anymore at this point
in time.

Change-Id: Idfe61bf8ce3a83c66c31769b845572454f0f196b
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-30 11:16:06 +00:00
Greg Kroah-Hartman
02fb5b0cc5 Revert "Revert "sbitmap: Use single per-bitmap counting to wake up queued tags""
This reverts commit 8ec4245b45.

It was perserving the ABI, but that is not needed anymore at this point
in time.

Change-Id: I82776674a83f38800e3144d025631e4256cc53f4
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-30 11:11:05 +00:00
Greg Kroah-Hartman
3b29299e5f Linux 6.1.22
Link: https://lore.kernel.org/r/20230328142617.205414124@linuxfoundation.org
Tested-by: Markus Reichelt <lkt+2023@mareichelt.com>
Tested-by: Shuah Khan <skhan@linuxfoundation.org>
Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com>
Tested-by: Bagas Sanjaya <bagasdotme@gmail.com>
Tested-by: Chris Paterson (CIP) <chris.paterson2@renesas.com>
Tested-by: Rudi Heitbaum <rudi@heitbaum.com>
Tested-by: Conor Dooley <conor.dooley@microchip.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Salvatore Bonaccorso <carnil@debian.org>
Tested-by: Ron Economos <re@w6rz.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:31 +02:00
Ma Jun
8c31b663ed drm/amdkfd: Fix the memory overrun
commit 4cc16d64b6 upstream.

Fix the memory overrun issue caused by wrong array size.

Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1527133 ("Memory - corruptions")
Fixes: c0cc999f3c ("drm/amdkfd: Fix the warning of array-index-out-of-bounds")
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:31 +02:00
Yifan Zhang
132f1d3943 drm/amdkfd: add GC 11.0.4 KFD support
commit 88c21c2b56 upstream.

Add initial support for GC 11.0.4 in KFD compute driver.

Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Aaron Liu <aaron.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: "Limonciello, Mario" <Mario.Limonciello@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:31 +02:00
Ma Jun
0ac954ec7f drm/amdkfd: Fix the warning of array-index-out-of-bounds
commit c0cc999f3c upstream.

For some GPUs with more CUs, the original sibling_map[32]
in struct crat_subtype_cache is not enough
to save the cache information when create the VCRAT table,
so skip filling the struct crat_subtype_cache info instead
fill struct kfd_cache_properties directly to fix this problem.

Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: "Limonciello, Mario" <Mario.Limonciello@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:31 +02:00
Prike Liang
a5528973c6 drm/amdkfd: introduce dummy cache info for property asic
commit fd72e2cb2f upstream.

This dummy cache info will enable kfd base function support.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: "Limonciello, Mario" <Mario.Limonciello@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:30 +02:00
Vincent Guittot
388c4c1d12 sched/fair: Sanitize vruntime of entity being migrated
commit a53ce18cac upstream.

Commit 829c1651e9 ("sched/fair: sanitize vruntime of entity being placed")
fixes an overflowing bug, but ignore a case that se->exec_start is reset
after a migration.

For fixing this case, we delay the reset of se->exec_start after
placing the entity which se->exec_start to detect long sleeping task.

In order to take into account a possible divergence between the clock_task
of 2 rqs, we increase the threshold to around 104 days.

Fixes: 829c1651e9 ("sched/fair: sanitize vruntime of entity being placed")
Originally-by: Zhang Qiao <zhangqiao22@huawei.com>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Zhang Qiao <zhangqiao22@huawei.com>
Link: https://lore.kernel.org/r/20230317160810.107988-1-vincent.guittot@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:30 +02:00
Zhang Qiao
e427be6889 sched/fair: sanitize vruntime of entity being placed
commit 829c1651e9 upstream.

When a scheduling entity is placed onto cfs_rq, its vruntime is pulled
to the base level (around cfs_rq->min_vruntime), so that the entity
doesn't gain extra boost when placed backwards.

However, if the entity being placed wasn't executed for a long time, its
vruntime may get too far behind (e.g. while cfs_rq was executing a
low-weight hog), which can inverse the vruntime comparison due to s64
overflow.  This results in the entity being placed with its original
vruntime way forwards, so that it will effectively never get to the cpu.

To prevent that, ignore the vruntime of the entity being placed if it
didn't execute for much longer than the characteristic sheduler time
scale.

[rkagan: formatted, adjusted commit log, comments, cutoff value]
Signed-off-by: Zhang Qiao <zhangqiao22@huawei.com>
Co-developed-by: Roman Kagan <rkagan@amazon.de>
Signed-off-by: Roman Kagan <rkagan@amazon.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20230130122216.3555094-1-rkagan@amazon.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:30 +02:00
Mike Snitzer
b9d6816713 dm crypt: avoid accessing uninitialized tasklet
commit d9a02e016a upstream.

When neither "no_read_workqueue" nor "no_write_workqueue" are enabled,
tasklet_trylock() in crypt_dec_pending() may still return false due to
an uninitialized state, and dm-crypt will unnecessarily do io completion
in io_queue workqueue instead of current context.

Fix this by adding an 'in_tasklet' flag to dm_crypt_io struct and
initialize it to false in crypt_io_init(). Set this flag to true in
kcryptd_queue_crypt() before calling tasklet_schedule(). If set
crypt_dec_pending() will punt io completion to a workqueue.

This also nicely avoids the tasklet_trylock/unlock hack when tasklets
aren't in use.

Fixes: 8e14f61015 ("dm crypt: do not call bio_endio() from the dm-crypt tasklet")
Cc: stable@vger.kernel.org
Reported-by: Hou Tao <houtao1@huawei.com>
Suggested-by: Ignat Korchagin <ignat@cloudflare.com>
Reviewed-by: Ignat Korchagin <ignat@cloudflare.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:30 +02:00
Mikulas Patocka
f0eb61b493 dm crypt: add cond_resched() to dmcrypt_write()
commit fb294b1c0b upstream.

The loop in dmcrypt_write may be running for unbounded amount of time,
thus we need cond_resched() in it.

This commit fixes the following warning:

[ 3391.153255][   C12] watchdog: BUG: soft lockup - CPU#12 stuck for 23s! [dmcrypt_write/2:2897]
...
[ 3391.387210][   C12] Call trace:
[ 3391.390338][   C12]  blk_attempt_bio_merge.part.6+0x38/0x158
[ 3391.395970][   C12]  blk_attempt_plug_merge+0xc0/0x1b0
[ 3391.401085][   C12]  blk_mq_submit_bio+0x398/0x550
[ 3391.405856][   C12]  submit_bio_noacct+0x308/0x380
[ 3391.410630][   C12]  dmcrypt_write+0x1e4/0x208 [dm_crypt]
[ 3391.416005][   C12]  kthread+0x130/0x138
[ 3391.419911][   C12]  ret_from_fork+0x10/0x18

Reported-by: yangerkun <yangerkun@huawei.com>
Fixes: dc2676210c ("dm crypt: offload writes to thread")
Cc: stable@vger.kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:30 +02:00
Jiasheng Jiang
a42180dd36 dm stats: check for and propagate alloc_percpu failure
commit d3aa3e060c upstream.

Check alloc_precpu()'s return value and return an error from
dm_stats_init() if it fails. Update alloc_dev() to fail if
dm_stats_init() does.

Otherwise, a NULL pointer dereference will occur in dm_stats_cleanup()
even if dm-stats isn't being actively used.

Fixes: fd2ed4d252 ("dm: add statistics support")
Cc: stable@vger.kernel.org
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:30 +02:00
Wei Chen
7c64e83958 i2c: xgene-slimpro: Fix out-of-bounds bug in xgene_slimpro_i2c_xfer()
commit 92fbb6d129 upstream.

The data->block[0] variable comes from user and is a number between
0-255. Without proper check, the variable may be very large to cause
an out-of-bounds when performing memcpy in slimpro_i2c_blkwr.

Fix this bug by checking the value of writelen.

Fixes: f6505fbabc ("i2c: add SLIMpro I2C device driver on APM X-Gene platform")
Signed-off-by: Wei Chen <harperchen1110@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:30 +02:00
Ivan Bornyakov
d22bc65a98 bus: imx-weim: fix branch condition evaluates to a garbage value
commit 1adab2922c upstream.

If bus type is other than imx50_weim_devtype and have no child devices,
variable 'ret' in function weim_parse_dt() will not be initialized, but
will be used as branch condition and return value. Fix this by
initializing 'ret' with 0.

This was discovered with help of clang-analyzer, but the situation is
quite possible in real life.

Fixes: 52c47b6341 ("bus: imx-weim: improve error handling upon child probe-failure")
Signed-off-by: Ivan Bornyakov <i.bornyakov@metrotek.ru>
Cc: stable@vger.kernel.org
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:29 +02:00
Liam R. Howlett
286b0cab31 mm/ksm: fix race with VMA iteration and mm_struct teardown
commit 6db504ce55 upstream.

exit_mmap() will tear down the VMAs and maple tree with the mmap_lock held
in write mode.  Ensure that the maple tree is still valid by checking
ksm_test_exit() after taking the mmap_lock in read mode, but before the
for_each_vma() iterator dereferences a destroyed maple tree.

Since the maple tree is destroyed, the flags telling lockdep to check an
external lock has been cleared.  Skip the for_each_vma() iterator to avoid
dereferencing a maple tree without the external lock flag, which would
create a lockdep warning.

Link: https://lkml.kernel.org/r/20230308220310.3119196-1-Liam.Howlett@oracle.com
Fixes: a5f18ba072 ("mm/ksm: use vma iterators instead of vma linked list")
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reported-by: Pengfei Xu <pengfei.xu@intel.com>
  Link: https://lore.kernel.org/lkml/ZAdUUhSbaa6fHS36@xpf.sh.intel.com/
Reported-by: syzbot+2ee18845e89ae76342c5@syzkaller.appspotmail.com
  Link: https://syzkaller.appspot.com/bug?id=64a3e95957cd3deab99df7cd7b5a9475af92c93e
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: <heng.su@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:29 +02:00
Abel Vesa
318b653867 soc: qcom: llcc: Fix slice configuration values for SC8280XP
commit 77bf4b3ed4 upstream.

The slice IDs for CVPFW, CPUSS1 and CPUWHT currently overflow the 32bit
LLCC config registers, which means it is writing beyond the upper limit
of the ATTR0_CFGn and ATTR1_CFGn range of registers. But the most obvious
impact is the fact that the mentioned slices do not get configured at all,
which will result in reduced performance. Fix that by using the slice ID
values taken from the latest LLCC SC table.

Fixes: ec69dfbdc4 ("soc: qcom: llcc: Add sc8180x and sc8280xp configurations")
Cc: stable@vger.kernel.org	# 5.19+
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Tested-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Reviewed-by: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230306135527.509796-1-abel.vesa@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:29 +02:00
Manivannan Sadhasivam
83f40feee6 arm64: dts: qcom: sm8150: Fix the iommu mask used for PCIe controllers
commit 672a58fc7c upstream.

The iommu mask should be 0x3f as per Qualcomm internal documentation.
Without the correct mask, the PCIe transactions from the endpoint will
result in SMMU faults. Hence, fix it!

Cc: stable@vger.kernel.org # 5.19
Fixes: a1c86c6805 ("arm64: dts: qcom: sm8150: Add PCIe nodes")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230224080045.6577-1-manivannan.sadhasivam@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:29 +02:00
Krishna chaitanya chundru
267b899375 arm64: dts: qcom: sc7280: Mark PCIe controller as cache coherent
commit 8a63441e83 upstream.

If the controller is not marked as cache coherent, then kernel will
try to ensure coherency during dma-ops and that may cause data corruption.
So, mark the PCIe node as dma-coherent as the devices on PCIe bus are
cache coherent.

Cc: stable@vger.kernel.org
Fixes: 92e0ee9f83 ("arm64: dts: qcom: sc7280: Add PCIe and PHY related node")
Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/1677584952-17496-1-git-send-email-quic_krichai@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:29 +02:00
Cristian Marussi
0156ad2a60 firmware: arm_scmi: Fix device node validation for mailbox transport
commit 2ab4f4018c upstream.

When mailboxes are used as a transport it is possible to setup the SCMI
transport layer, depending on the underlying channels configuration, to use
one or two mailboxes, associated, respectively, to one or two, distinct,
shared memory areas: any other combination should be treated as invalid.

Add more strict checking of SCMI mailbox transport device node descriptors.

Fixes: 5c8a47a5a9 ("firmware: arm_scmi: Make scmi core independent of the transport type")
Cc: <stable@vger.kernel.org> # 4.19
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20230307162324.891866-1-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:29 +02:00
Rijo Thomas
a63cce9393 tee: amdtee: fix race condition in amdtee_open_session
commit f8502fba45 upstream.

There is a potential race condition in amdtee_open_session that may
lead to use-after-free. For instance, in amdtee_open_session() after
sess->sess_mask is set, and before setting:

    sess->session_info[i] = session_info;

if amdtee_close_session() closes this same session, then 'sess' data
structure will be released, causing kernel panic when 'sess' is
accessed within amdtee_open_session().

The solution is to set the bit sess->sess_mask as the last step in
amdtee_open_session().

Fixes: 757cc3e9ff ("tee: add AMD-TEE driver")
Cc: stable@vger.kernel.org
Signed-off-by: Rijo Thomas <Rijo-john.Thomas@amd.com>
Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:29 +02:00
Nathan Chancellor
8a09fa7be6 riscv: Handle zicsr/zifencei issues between clang and binutils
commit e89c2e815e upstream.

There are two related issues that appear in certain combinations with
clang and GNU binutils.

The first occurs when a version of clang that supports zicsr or zifencei
via '-march=' [1] (i.e, >= 17.x) is used in combination with a version
of GNU binutils that do not recognize zicsr and zifencei in the
'-march=' value (i.e., < 2.36):

  riscv64-linux-gnu-ld: -march=rv64i2p0_m2p0_a2p0_c2p0_zicsr2p0_zifencei2p0: Invalid or unknown z ISA extension: 'zifencei'
  riscv64-linux-gnu-ld: failed to merge target specific data of file fs/efivarfs/file.o
  riscv64-linux-gnu-ld: -march=rv64i2p0_m2p0_a2p0_c2p0_zicsr2p0_zifencei2p0: Invalid or unknown z ISA extension: 'zifencei'
  riscv64-linux-gnu-ld: failed to merge target specific data of file fs/efivarfs/super.o

The second occurs when a version of clang that does not support zicsr or
zifencei via '-march=' (i.e., <= 16.x) is used in combination with a
version of GNU as that defaults to a newer ISA base spec, which requires
specifying zicsr and zifencei in the '-march=' value explicitly (i.e, >=
2.38):

  ../arch/riscv/kernel/kexec_relocate.S: Assembler messages:
  ../arch/riscv/kernel/kexec_relocate.S:147: Error: unrecognized opcode `fence.i', extension `zifencei' required
  clang-12: error: assembler command failed with exit code 1 (use -v to see invocation)

This is the same issue addressed by commit 6df2a016c0 ("riscv: fix
build with binutils 2.38") (see [2] for additional information) but
older versions of clang miss out on it because the cc-option check
fails:

  clang-12: error: invalid arch name 'rv64imac_zicsr_zifencei', unsupported standard user-level extension 'zicsr'
  clang-12: error: invalid arch name 'rv64imac_zicsr_zifencei', unsupported standard user-level extension 'zicsr'

To resolve the first issue, only attempt to add zicsr and zifencei to
the march string when using the GNU assembler 2.38 or newer, which is
when the default ISA spec was updated, requiring these extensions to be
specified explicitly. LLVM implements an older version of the base
specification for all currently released versions, so these instructions
are available as part of the 'i' extension. If LLVM's implementation is
updated in the future, a CONFIG_AS_IS_LLVM condition can be added to
CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI.

To resolve the second issue, use version 2.2 of the base ISA spec when
using an older version of clang that does not support zicsr or zifencei
via '-march=', as that is the spec version most compatible with the one
clang/LLVM implements and avoids the need to specify zicsr and zifencei
explicitly due to still being a part of 'i'.

[1]: 22e199e6af
[2]: https://lore.kernel.org/ZAxT7T9Xy1Fo3d5W@aurel32.net/

Cc: stable@vger.kernel.org
Link: https://github.com/ClangBuiltLinux/linux/issues/1808
Co-developed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20230313-riscv-zicsr-zifencei-fiasco-v1-1-dd1b7840a551@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:28 +02:00
Dylan Jhong
aa8a49b610 riscv: mm: Fix incorrect ASID argument when flushing TLB
commit 9a801afd3e upstream.

Currently, we pass the CONTEXTID instead of the ASID to the TLB flush
function. We should only take the ASID field to prevent from touching
the reserved bit field.

Fixes: 3f1e782998 ("riscv: add ASID-based tlbflushing methods")
Signed-off-by: Dylan Jhong <dylan@andestech.com>
Reviewed-by: Sergey Matyukevich <sergey.matyukevich@syntacore.com>
Link: https://lore.kernel.org/r/20230313034906.2401730-1-dylan@andestech.com
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:28 +02:00
Tim Huang
75e10d7fb9 drm/amdgpu: reposition the gpu reset checking for reuse
commit aaee0ce460 upstream.

Move the amdgpu_acpi_should_gpu_reset out of
CONFIG_SUSPEND to share it with hibernate case.

Signed-off-by: Tim Huang <tim.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 6.1.x
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-30 12:49:28 +02:00