Commit Graph

1052594 Commits

Author SHA1 Message Date
Lina Iyer f154a239c3 ANDROID: cpuidle: export cpuidle_driver_state_disabled
Export cpuidle_driver_state_disabled() so that CPU idle states may be
disabled at runtime for debugging CPU and cluster idle states.

Bug: 175718935
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Change-Id: Id9038074d64fb6c0444d9aca68420414c3223e93
(cherry picked from commit de93734e224be27681d2367bc6275a4dc58e6dc6)
2022-03-15 01:37:19 +00:00
Ben Dai 307ad9fb59 ANDROID: printk: add vendor hook to record more information about caller
With these hooks, printk can provide more information, such as the
processor ID.

Bug: 223302138
Signed-off-by: Ben Dai <ben.dai@unisoc.com>
Change-Id: Iac60ffd49640d8badf5c5dd446c211d37bbbc6a6
2022-03-14 14:30:51 +00:00
Kai Lueke a733d4b8db FROMGIT: Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0"
This reverts commit 68ac0f3810e76a853b5f7b90601a05c3048b8b54 because ID
0 was meant to be used for configuring the policy/state without
matching for a specific interface (e.g., Cilium is affected, see
https://github.com/cilium/cilium/pull/18789 and
https://github.com/cilium/cilium/pull/19019).

Signed-off-by: Kai Lueke <kailueke@linux.microsoft.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Link: https://lore.kernel.org/netdev/20220309130839.3263912-3-steffen.klassert@secunet.com/
(cherry picked from commit a3d9001b4e287fc043e5539d03d71a32ab114bcb
 https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=a3d9001b4e287fc043e5539d03d71a32ab114bcb)
Bug: 221187056
Test: run_net_test.sh
Change-Id: Iccaf42f776cad9166f808c490bfce586f850554c
2022-03-10 19:59:17 +00:00
Will Deacon b12a57fccd FROMGIT: KVM: arm64: Really propagate PSCI SYSTEM_RESET2 arguments to userspace
Commit d43583b890e7 ("KVM: arm64: Expose PSCI SYSTEM_RESET2 call to the
guest") hooked up the SYSTEM_RESET2 PSCI call for guests but failed to
preserve its arguments for userspace, instead overwriting them with
zeroes via smccc_set_retval(). As Linux only passes zeroes for these
arguments, this appeared to be working for Linux guests. Oh well.

Don't call smccc_set_retval() for a SYSTEM_RESET2 heading to userspace
and instead set X0 (and only X0) explicitly to PSCI_RET_INTERNAL_FAILURE
just in case the vCPU re-enters the guest.

Fixes: d43583b890e7 ("KVM: arm64: Expose PSCI SYSTEM_RESET2 call to the guest")
Reported-by: Andrew Walbran <qwandor@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220309181308.982-1-will@kernel.org
(cherry picked from commit 9d3e7b7c82fd9d40240867ef4c45388cd05031f3
 git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git next)
Bug: 216801012
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Ieead1a813e6b4dfee1aa89e42ee1926efcd5f590
2022-03-10 08:37:25 +00:00
Howard Chen a5e266c7e8 Revert "xfrm: Use actual socket sk instead of skb socket for xfrm_output_resume"
The reverted CL makes CtsnetTestCases fails on
  CtsNetTestCases:android.net.cts.IpSecManagerTest#testAesGcm128Tcp6

Bug: 186608065
Bug: 197517655
Test: CtsNetTestCases
Change-Id: I65eb4e45623af5d6ff8ec634ac11aa039f5cceef
Signed-off-by: Howard Chen <howardsoc@google.com>
Signed-off-by: Alistair Delva <adelva@google.com>
2022-03-09 23:37:07 +00:00
Todd Kjos fc6ab4da31 ANDROID: GKI: 3/9/2022 KMI update
Set KMI_GENERATION=1 for 3/9 KMI update

Leaf changes summary: 2579 artifacts changed (1 filtered out)
Changed leaf types summary: 9 (1 filtered out) leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 2521 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 49 Changed, 0 Added variable

2521 functions with some sub-type change:

  [C] 'function void* PDE_DATA(const inode*)' at generic.c:794:1 has some sub-type changes:
    CRC (modversions) changed from 0x17465176 to 0x1c3e2a86

  [C] 'function void __ClearPageMovable(page*)' at compaction.c:138:1 has some sub-type changes:
    CRC (modversions) changed from 0x8331b3e3 to 0x734edab3

  [C] 'function void __SetPageMovable(page*, address_space*)' at compaction.c:130:1 has some sub-type changes:
    CRC (modversions) changed from 0xe56f361 to 0x891f9c1d

  ... 2518 omitted; 2521 symbols have only CRC changes

49 Changed variables:

  [C] 'bus_type amba_bustype' was changed at bus.c:313:1:
    CRC (modversions) changed from 0xe555ebeb to 0x517f2d17

  [C] 'const address_space_operations balloon_aops' was changed at balloon_compaction.c:253:1:
    CRC (modversions) changed from 0xa9866f1a to 0x89a77b8c

  [C] 'const clk_ops clk_divider_ops' was changed at clk-divider.c:522:1:
    CRC (modversions) changed from 0xca4154fa to 0x5a75cc1

  ... 46 omitted; 49 symbols have only CRC changes

'enum nl80211_attrs at nl80211.h:2666:1' changed:
  type size hasn't changed
  1 enumerator insertion:
    'nl80211_attrs::NL80211_ATTR_EHT_CAPABILITY' value '310'
  3 enumerator changes:
    'nl80211_attrs::NL80211_ATTR_MAX' from value '309' to '310' at nl80211.h:2670:1
    'nl80211_attrs::NUM_NL80211_ATTR' from value '310' to '311' at nl80211.h:2670:1
    'nl80211_attrs::__NL80211_ATTR_AFTER_LAST' from value '310' to '311' at nl80211.h:2670:1
  2 impacted interfaces
'struct ieee80211_sband_iftype_data at cfg80211.h:378:1' changed:
  type size changed from 640 to 1024 (in bits)
  1 data member insertion:
    'ieee80211_sta_eht_cap eht_cap', at offset 472 (in bits) at cfg80211.h:431:1
  there are data member changes:
    'struct {const u8* data; unsigned int len;} vendor_elems' offset changed (by +384 bits)
  3084 impacted interfaces

'struct iommu_dma_cookie at dma-iommu.c:41:1' changed (indirectly):
  type size changed from 15360 to 15424 (in bits)
  there are data member changes:
    type 'union {iova_domain iovad; dma_addr_t msi_iova;}' of 'anonymous data member' changed:
      type size changed from 15104 to 15168 (in bits)
      there are data member changes:
        type 'struct iova_domain' of '__anonymous_union__::iovad' changed:
          type size changed from 15104 to 15168 (in bits)
          1 data member insertion:
            'bool best_fit', at offset 15104 (in bits) at iova.h:99:1
          3086 impacted interfaces
    2 ('list_head msi_page_list' .. 'iommu_domain* fq_domain') offsets changed (by +64 bits)
  3084 impacted interfaces

'struct iova_domain at iova.h:68:1' changed:
  details were reported earlier

'struct module at module.h:364:1' changed:
  type size hasn't changed
  2 data member insertions:
    'unsigned int btf_data_size', at offset 6016 (in bits) at module.h:477:1
    'void* btf_data', at offset 6080 (in bits) at module.h:478:1
  there are data member changes:
    18 ('jump_entry* jump_entries' .. 'unsigned int num_ei_funcs') offsets changed (by +128 bits)
  3084 impacted interfaces

'struct rate_info at cfg80211.h:1580:1' changed:
  type size changed from 80 to 96 (in bits)
  2 data member insertions:
    'u8 eht_gi', at offset 80 (in bits) at cfg80211.h:1673:1
    'u8 eht_ru_alloc', at offset 88 (in bits) at cfg80211.h:1674:1
  5 impacted interfaces

'struct station_info at cfg80211.h:1743:1' changed (indirectly):
  type size changed from 1792 to 1856 (in bits)
  there are data member changes:
    type 'struct rate_info' of 'station_info::txrate' changed, as reported earlier
    type 'struct rate_info' of 'station_info::rxrate' changed, as reported earlier
    and offset changed from 528 to 544 (in bits) (by +16 bits)
    8 ('u32 rx_packets' .. 'int generation') offsets changed (by +32 bits)
    21 ('const u8* assoc_req_ies' .. 'u8 connected_to_as') offsets changed (by +64 bits)
  4 impacted interfaces

'struct station_parameters at cfg80211.h:1421:1' changed:
  type size changed from 1280 to 1408 (in bits)
  2 data member insertions:
    'const ieee80211_eht_cap_elem* eht_capa', at offset 1280 (in bits) at cfg80211.h:1525:1
    'u8 eht_capa_len', at offset 1344 (in bits) at cfg80211.h:1526:1
  one impacted interface

'struct virtio_config_ops at virtio_config.h:77:1' changed:
  type size changed from 896 to 960 (in bits)
  1 data member insertion:
    'void (virtio_device*)* enable_cbs', at offset 0 (in bits) at virtio_config.h:80:1
  there are data member changes:
    14 ('void (virtio_device*, unsigned int, void*, unsigned int)* get' .. 'typedef bool (virtio_device*, virtio_shm_region*, typedef u8)* get_shm_region') offsets changed (by +64 bits)
  35 impacted interfaces

Bug: 222115076
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: I1aac74111756444ff6bff92b843a5133f3c7541c
2022-03-09 09:05:45 -08:00
Jason Wang a0c2ddcd79 UPSTREAM: virtio-pci: harden INTX interrupts
This patch tries to make sure the virtio interrupt handler for INTX
won't be called after a reset and before virtio_device_ready(). We
can't use IRQF_NO_AUTOEN since we're using shared interrupt
(IRQF_SHARED). So this patch tracks the INTX enabling status in a new
intx_soft_enabled variable and toggle it during in
vp_disable/enable_vectors(). The INTX interrupt handler will check
intx_soft_enabled before processing the actual interrupt.

Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20211019070152.8236-6-jasowang@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 080cd7c3ac8701081d143a15ba17dd9475313188)
Bug: 196772804
Signed-off-by: Keir Fraser <keirf@google.com>
Change-Id: If90814df2859e742df050d406f2d67547bd6dbb3
2022-03-09 08:52:39 -08:00
Jason Wang 3e0edf7cb5 UPSTREAM: virtio_pci: harden MSI-X interrupts
We used to synchronize pending MSI-X irq handlers via
synchronize_irq(), this may not work for the untrusted device which
may keep sending interrupts after reset which may lead unexpected
results. Similarly, we should not enable MSI-X interrupt until the
device is ready. So this patch fixes those two issues by:

1) switching to use disable_irq() to prevent the virtio interrupt
   handlers to be called after the device is reset.
2) using IRQF_NO_AUTOEN and enable the MSI-X irq during .ready()

This can make sure the virtio interrupt handler won't be called before
virtio_device_ready() and after reset.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20211019070152.8236-5-jasowang@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 9e35276a5344f74d4a3600fc4100b3dd251d5c56)
Bug: 196772804
Signed-off-by: Keir Fraser <keirf@google.com>
Change-Id: I63832b87a567c4447064143fa62386c59481d43b
2022-03-09 08:52:39 -08:00
Jason Wang c9d5a7ce80 UPSTREAM: virtio_config: introduce a new .enable_cbs method
This patch introduces a new method to enable the callbacks for config
and virtqueues. This will be used for making sure the virtqueue
callbacks are only enabled after virtio_device_ready() if transport
implements this method.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20211019070152.8236-4-jasowang@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit d50497eb4e554e1f0351e1836ee7241c059592e6)
Bug: 196772804
Signed-off-by: Keir Fraser <keirf@google.com>
Change-Id: I17ea164aa100d690ebde3b2f6c2e5514a9b5cfd9
2022-03-09 08:52:39 -08:00
Connor O'Brien 6434bd9e96 ANDROID: GKI: defconfig: enable BTF debug info
Build BTF type info into the kernel to enable use of BPF-based tools
such as BCC's libbpf-tools.
By default, modules whose split BTF is inconsistent with vmlinux BTF
will fail to load, which can prevent loading compatible but separately
built modules. Instead, enable MODULE_ALLOW_BTF_MISMATCH to ignore
such modules' BTF rather than refusing to load the module.

Bug: 203823368
Bug: 218515241
Test: build
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I8efaab5f1a5c6ad6e9e6ccf1e78088d81a880480
2022-03-09 08:52:39 -08:00
Ilan Peer f3ff03c9a1 UPSTREAM: cfg80211: Support configuration of station EHT capabilities
Add attributes and some code bits to support userspace passing
in EHT capabilities of stations.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Link: https://lore.kernel.org/r/20220214173004.ecf0b3ff9627.Icb4a5f2ec7b41d9008ac4cfc16c59baeb84793d3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: I63ac58dc56e22620cd1ed1082ca851a7a9206409
(cherry picked from commit ea05fd3581d32a0f1098657005c7a9b763798fe8)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:39 -08:00
Ilan Peer 160e88de72 UPSTREAM: cfg80211: add NO-EHT flag to regulatory
This may be necessary in some cases, add a flag and propagate
it, just like the NO-HE that already exists.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
[split off from a combined 320/no-EHT patch]
Link: https://lore.kernel.org/r/20220214173004.dbb85a7b86bb.Ifc1e2daac51c1cc5f895ccfb79faf5eaec3950ec@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: I1622fd73d18616ef05d4975e8a981bc58e98b8b0
(cherry picked from commit 31846b657857e6a73d982604f36a34710d98902c)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:38 -08:00
Sriram R 93637453d1 UPSTREAM: nl80211: add support for 320MHz channel limitation
Add support to advertise drivers or regulatory limitations on 320 MHz
channels to userspace.

Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Co-authored-by: Karthikeyan Periyasamy <quic_periyasia@quicinc.com>
Signed-off-by: Karthikeyan Periyasamy <quic_periyasia@quicinc.com>
Co-authored-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Link: https://lore.kernel.org/r/1640163883-12696-6-git-send-email-quic_vjakkam@quicinc.com
Link: https://lore.kernel.org/r/20220214163009.175289-3-johannes@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: I2bc918f9ce4f64b675464d6b5ad3eedd2e0fb38a
(cherry picked from commit c2b3d7699fb0ce66538b829af43970acc2f89060)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:38 -08:00
Veerendranath Jakkam 44f32f3f7f UPSTREAM: nl80211: add EHT MCS support
Add support for reporting and calculating EHT bitrates.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Link: https://lore.kernel.org/r/1640163883-12696-7-git-send-email-quic_vjakkam@quicinc.com
Link: https://lore.kernel.org/r/20220214163009.175289-2-johannes@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: Idc8fd87e32e7bd84936f29df3e49e57e1efc3b64
(cherry picked from commit cfb14110acf87b4db62e07ba08a80429f1749f40)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:38 -08:00
Jia Ding 263ab78988 UPSTREAM: cfg80211: Add support for EHT 320 MHz channel width
Add 320 MHz support in the channel def and center frequency validation
with compatible check.

Signed-off-by: Jia Ding <quic_jiad@quicinc.com>
Co-authored-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Co-authored-by: Muna Sinada <quic_msinada@quicinc.com>
Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
Co-authored-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Link: https://lore.kernel.org/r/1640163883-12696-5-git-send-email-quic_vjakkam@quicinc.com
Link: https://lore.kernel.org/r/20220214163009.175289-1-johannes@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: I62a1f7cd17faceea96df4eeb5edf3aa5ef903d2b
(cherry picked from commit 3743bec6120ae0748cb3fda6ff80a690117ef1f3)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:38 -08:00
Ilan Peer 2626768c2a UPSTREAM: cfg80211: Add data structures to capture EHT capabilities
And advertise EHT capabilities to user space when supported.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Link: https://lore.kernel.org/r/20220214173004.6fb70658529f.I2413a37c8f7d2d6d638038a3d95360a3fce0114d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: If6ca3026ba618317a1719c62243c6710c16b8344
(cherry picked from commit 5cd5a8a3e2fb11b1c8a09f062c44c1e228ef987a)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:38 -08:00
Mordechay Goodstein 1b0f13df70 UPSTREAM: ieee80211: add EHT 1K aggregation definitions
We add the fields for parsing extended ADDBA request/respond,
and new max 1K aggregation for limit ADDBA request/respond.

Adjust drivers to use the proper macro, IEEE80211_MAX_AMPDU_BUF ->
IEEE80211_MAX_AMPDU_BUF_HE.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Link: https://lore.kernel.org/r/20220214173004.b8b447ce95b7.I0ee2554c94e89abc7a752b0f7cc7fd79c273efea@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: I9fdb0e3900de9b605bacf96c78b3985661679fca
(cherry picked from commit 2a2c86f15e17c5013b9897b67d895e64a25ae3cb)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:38 -08:00
Ilan Peer 902345aabc UPSTREAM: ieee80211: Add EHT (802.11be) definitions
Based on Draft P802.11be_D1.4.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Link: https://lore.kernel.org/r/20220214173004.928e23cacb2b.Id30a3ef2844b296efbd5486fe1da9ca36a95c5cf@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: I83860d9e8f46e785e3c0612f4876b519440bc2a9
(cherry picked from commit cbc1ca0a9d0a54cb8aa7c54c16e71599551e3f74)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:38 -08:00
Johannes Berg 3dcf9eb37a UPSTREAM: mac80211_hwsim: check TX and STA bandwidth
Add checks to hwsim to validate that neither TX nor any
station's configured bandwidth can exceed the channel
(context) configuration previously requested.

Link: https://lore.kernel.org/r/20220214173004.9fd154d2c3c2.Ia0cd152357a373149bab017d479ab7d5ded289c0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: I6ea0a0974736aa9e367cd6f90d2b05f53cb8298c
(cherry picked from commit 585625c955b1dcdda55036bee6fbda5bc5d97bd2)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:37 -08:00
Johannes Berg d0026ae78f UPSTREAM: nl80211: accept only HE capability elements with valid size
The kernel (driver code) should be able to assume that a station's
HE capabilities are not badly sized, so reject them if they are.

Link: https://lore.kernel.org/r/20220214172921.80b710d45cb7.Id57ce32f9538a40e36c620fabedbd2c73346ef56@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: I7043f88e1404c0ffc8f1989c13d240b5dcb540c8
(cherry picked from commit a3a20feb32a1c281ccac80dcf615480d3a79a6bf)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:37 -08:00
Johannes Berg 1afe8a5aa0 UPSTREAM: ieee80211: add helper to check HE capability element size
This element has a very dynamic structure, create a small helper
function to validate its size. We're currently checking it in
mac80211 in a conversion function, but that's actually slightly
buggy.

Link: https://lore.kernel.org/r/20220214172920.750bee9eaf37.Ie18359bd38143b7dc949078f10752413e6d36854@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: I68ca6afb834d20ab994f0056f4d6973f01767f69
(cherry picked from commit d61f4274daa41565b5f9ce589b4ba1239781c139)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:37 -08:00
Avraham Stern 4c4e96fcb0 UPSTREAM: cfg80211: don't add non transmitted BSS to 6GHz scanned channels
When adding 6GHz channels to scan request based on reported
co-located APs, don't add channels that have only APs with
"non-transmitted" BSSes if they only match the wildcard SSID since
they will be found by probing the "transmitted" BSS.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20220202104617.f6ddf099f934.I231e55885d3644f292d00dfe0f42653269f2559e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: Id198660ab8c3f01f9b66ad183a3ffd372709d60c
(cherry picked from commit 5666ee154f4696c011dfa8544aaf5591b6b87515)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:37 -08:00
Liam Mark 150c882a3d FROMLIST: iommu/iova: Add a best-fit algorithm
Using the best-fit algorithm, instead of the first-fit
algorithm, may reduce fragmentation when allocating
IOVAs.

Bug: 190519428
Change-Id: I2703bde59256b104015aed774b294c421889a40c
Link: https://lore.kernel.org/r/1581721602-17010-1-git-send-email-isaacm@codeaurora.org
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Signed-off-by: Georgi Djakov <quic_c_gdjako@quicinc.com>
2022-03-09 08:52:37 -08:00
Georgi Djakov 989b762eb1 FROMLIST: iommu/iova: Add support for IOVA max alignment tuning
IOVAs are aligned to the smallest PAGE_SIZE order, where the requested
IOVA can fit. But this might not work for all use-cases. It can cause
IOVA fragmentation in some multimedia and 8K video use-cases that may
require larger buffers to be allocated and mapped.

When the above allocation pattern is used with the current alignment
scheme, the IOVA space could be quickly exhausted for 32bit devices.

In order to get better IOVA space utilization and reduce fragmentation,
a new kernel command line parameter is introduced to make the alignment
limit configurable by the user during boot.

Bug: 190519428
Change-Id: I0c8e72370fc3266a5a242837d82aae4f9831aef3
Link: https://lore.kernel.org/r/1634148667-409263-1-git-send-email-quic_c_gdjako@quicinc.com/
Signed-off-by: Georgi Djakov <quic_c_gdjako@quicinc.com>
2022-03-09 08:52:37 -08:00
Ali Pouladi 6215ed4f5f FROMGIT: rtc: pl031: fix rtc features null pointer dereference
When there is no interrupt line, rtc alarm feature is disabled.

The clearing of the alarm feature bit was being done prior to allocations
of ldata->rtc device, resulting in a null pointer dereference.

Clear RTC_FEATURE_ALARM after the rtc device is allocated.

Fixes: d9b0dd54a1 ("rtc: pl031: use RTC_FEATURE_ALARM")
Cc: stable@vger.kernel.org
Signed-off-by: Ali Pouladi <quic_apouladi@quicinc.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220225161924.274141-1-quic_eberman@quicinc.com
(cherry picked from commit 77b0eea1508d116b67753bdaf9378a2e30b815a9
 https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git
 rtc-next)

Bug: 223381022
Change-Id: Ie48a3ad9708466462331e07334de94f1cf6d4074
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2022-03-09 16:22:30 +00:00
Tadeusz Struk 097c689d48 Revert "ANDROID: incremental-fs: fix mount_fs issue"
This reverts three increment-fs commits:
d5faa13b59
10412e10c6
7ad88c9349

This is to fix the incrementalinstall test.
Can now install the same apk twice, and repeated installs are stable.

Bug: 217661925
Bug: 219731048
Signed-off-by: Tadeusz Struk <tadeusz.struk@linaro.org>
Change-Id: Ia8488d728218881ed17e4d68cab21b0b152e3ca4
2022-03-08 17:30:03 -08:00
Quentin Perret a0662e559d ANDROID: KVM: arm64: Flag pages needing poisoning in hyp_vmemmap
During teardown, we currently walk the guest stage-2 page-table and
annotate all of its pages as 'pending poisoning' in the host stage-2.
Sadly, this requires a host stage-2 walk for every guest page, which is
rather inefficient and can lead to a long non-preemptible amount of time
spent at EL2. This gets particularly bad with IOMMUs as, in its current
form, the host stage-2 annotation triggers IOMMU updates.

To avoid the host stage-2 walks, let's annotate the pages pending
poisoning using a flag in the hyp_vmemmap instead.

Bug: 219180169
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I8894bd8e0b10ea8817763479412b540c0291e8f5
2022-03-07 11:22:03 +00:00
Quentin Perret ba565fd777 ANDROID: KVM: arm64: Add flags to struct hyp_page
Add a 'flags' field to struct hyp_page, and reduce the size of the order
field to u8 to avoid growing the struct size.

Bug: 219180169
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: If629935bb6fa7d832c595685083f7985cfcfa221
2022-03-07 11:21:58 +00:00
Jason Wang eabae32b80 UPSTREAM: virtio_console: validate max_nr_ports before trying to use it
We calculate nr_ports based on the max_nr_ports:

nr_queues = use_multiport(portdev) ? (nr_ports + 1) * 2 : 2;

If the device advertises a large max_nr_ports, we will end up with a
integer overflow. Fixing this by validating the max_nr_ports and fail
the probe for invalid max_nr_ports in this case.

Cc: Amit Shah <amit@kernel.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20211019070152.8236-3-jasowang@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 28962ec595d701ec9d39369f9774895dfa408273)
Bug: 196772804
Signed-off-by: Keir Fraser <keirf@google.com>
Change-Id: Idb5462a1268d2bde5f867f5455da0957ca68035a
2022-03-07 11:14:04 +00:00
Jason Wang 03094c3abe UPSTREAM: virtio-blk: validate num_queues during probe
If an untrusted device neogitates BLK_F_MQ but advertises a zero
num_queues, the driver may end up trying to allocating zero size
buffers where ZERO_SIZE_PTR is returned which may pass the checking
against the NULL. This will lead unexpected results.

Fixing this by failing the probe in this case.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20211019070152.8236-2-jasowang@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 6ae6ff6f6e7d2f304a12a53af8298e4f16ad633e)
Bug: 196772804
Signed-off-by: Keir Fraser <keirf@google.com>
Change-Id: I8a4dbd80bdf8e7d41013e43d069b04af9c35e200
2022-03-07 11:14:04 +00:00
Will Deacon e085ccb3db ANDROID: KVM: arm64: Relax SMCCC version check during FF-A proxy init
Although FF-A claims to require version v1.2 of SMCCC, in reality the
current set of calls work just fine with v1.1 and some devices ship with
EL3 firmware that advertises this configuration.

Allow pKVM to proxy FF-A calls for these devices by relaxing our SMCCC
version check to permit SMCCC v1.1+

Reported-by: Alan Stokes <alanstokes@google.com>
Bug: 222663556
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I41e9ff35f169df3609acee7bbc67999c1d11c9d1
2022-03-04 17:27:05 +00:00
Stephen Dickey 4345c3db84 ANDROID: sched: update is_cpu_allowed tracehook
Currently, the trace hook for is_cpu_allowed only executes if the
cpu is not a kthread. Modules need to be able to reject cpus
regardless of whether the task is a kthread or not. Modules also
need to have the flexibility to execute, or not, the remainder of
is_cpu_allowed.

Move the tracepoint for is_cpu_allowed so that it is invoked
regardless of task's kthread status, but do not interfere with
per-cpu-kthread cpu assignment.

Bug: 222550772
Change-Id: Ide48a82a33129448bb22be28814267b0b76535a2
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-03-04 03:49:45 +00:00
Prasad Sodagudi 16327a1367 ANDROID: tracing: fix register tracing spam on memcpy
Disable register read/write tracing for memcpy and memset
APIs to avoid flood of read/write trace events.

Bug: 202309221
Fixes: 4373261be0bc ("ANDROID: tracing: Add generic flag for register tracing disable")
Change-Id: Ic860ee3a86b4664f3c5edd79a9c432dede87733e
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Vamsi Krishna Lanka <quic_vamslank@quicinc.com>
2022-03-03 23:52:34 +00:00
Chris Goldsworthy 97c18633aa ANDROID: dma-direct: Document disable_dma32
Document the functionality of disable_dma32 as introduced in commit
c3c2bb34ac8f ("ANDROID: arm64/mm: Add command line option to make
ZONE_DMA32 empty").

Bug: 199917449
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
Change-Id: I32ab2969f59fcc49e9ac49e7e6b545f816d120f9
2022-03-03 01:02:20 +00:00
Chris Goldsworthy 4632fda82b ANDROID: dma-direct: Make DMA32 disablement work for CONFIG_NUMA
zone_dma32_is_empty() currently lacks the proper validation to ensure
that the NUMA node ID it receives as an argument is valid. This has no
effect on kernels with CONFIG_NUMA=n as NODE_DATA() will return the
same pglist_data on these devices, but on kernels with CONFIG_NUMA=y,
this is not the case, and the node passed to NODE_DATA must be
validated.

Rather than trying to find the node containing ZONE_DMA32, replace
calls of zone_dma32_is_empty() with zone_dma32_are_empty() (which
iterates over all nodes and returns false if one of the nodes holds
DMA32 and it is non-empty).

Bug: 199917449
Fixes: c3c2bb34ac8f ("ANDROID: arm64/mm: Add command line option to make ZONE_DMA32 empty")
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
Change-Id: I850fb9213b71a1ef29106728bfda0cc6de46fdbb
2022-03-03 01:02:07 +00:00
John Stultz 84915dbcbe UPSTREAM: dma-buf: system_heap: Avoid warning on mid-order allocations
When trying to do mid-order allocations, set __GFP_NOWARN to
avoid warning messages if the allocation fails, as we will
still fall back to single page allocatitions in that case.
This is the similar to what we already do for large order
allocations.

Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Christian Koenig <christian.koenig@amd.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Liam Mark <lmark@codeaurora.org>
Cc: Chris Goldsworthy <cgoldswo@codeaurora.org>
Cc: Laura Abbott <labbott@kernel.org>
Cc: Brian Starkey <Brian.Starkey@arm.com>
Cc: Hridya Valsaraju <hridya@google.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Sandeep Patil <sspatil@google.com>
Cc: Daniel Mentz <danielmentz@google.com>
Cc: Ørjan Eide <orjan.eide@arm.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Simon Ser <contact@emersion.fr>
Cc: James Jones <jajones@nvidia.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: John Stultz <john.stultz@linaro.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210909023741.2592429-1-john.stultz@linaro.org

Bug: 221895941
(cherry picked from commit 5ad2d11feafbb9a51291754c66b35e450ac6ee59)
Change-Id: Id3078c3ad22f909dfeb6385aacc9df835240c055
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
2022-03-02 23:36:49 +00:00
Connor O'Brien b25a6a78d4 FROMGIT: bpf: Add config to allow loading modules with BTF mismatches
BTF mismatch can occur for a separately-built module even when the ABI is
otherwise compatible and nothing else would prevent successfully loading.

Add a new Kconfig to control how mismatches are handled. By default, preserve
the current behavior of refusing to load the module. If MODULE_ALLOW_BTF_MISMATCH
is enabled, load the module but ignore its BTF information.

Suggested-by: Yonghong Song <yhs@fb.com>
Suggested-by: Michal Suchánek <msuchanek@suse.de>
Signed-off-by: Connor O'Brien <connoro@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/CAADnVQJ+OVPnBz8z3vNu8gKXX42jCUqfuvhWAyCQDu8N_yqqwQ@mail.gmail.com
Link: https: //lore.kernel.org/bpf/20220223012814.1898677-1-connoro@google.com
(cherry picked from commit 5e214f2e43e453d862ebbbd2a4f7ee3fe650f209
 git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master)
Bug: 218515241
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Idabf7f5e38cb58da55faeaafae56dee7262a6886
2022-03-01 21:39:55 +00:00
Peter Zijlstra 42da9cb956 UPSTREAM: sched: Fix yet more sched_fork() races
Where commit 4ef0c5c6b5ba ("kernel/sched: Fix sched_fork() access an
invalid sched_task_group") fixed a fork race vs cgroup, it opened up a
race vs syscalls by not placing the task on the runqueue before it
gets exposed through the pidhash.

Commit 13765de8148f ("sched/fair: Fix fault in reweight_entity") is
trying to fix a single instance of this, instead fix the whole class
of issues, effectively reverting this commit.

Change-Id: I4d34311eac28b23ee32e9308a21c66afe8fa8a3b
Fixes: 4ef0c5c6b5ba ("kernel/sched: Fix sched_fork() access an invalid sched_task_group")
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Tadeusz Struk <tadeusz.struk@linaro.org>
Tested-by: Zhang Qiao <zhangqiao22@huawei.com>
Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Link: https://lkml.kernel.org/r/YgoeCbwj5mbCR0qA@hirez.programming.kicks-ass.net
BUG: 221850698
(cherry picked from commit b1e8206582f9d680cff7d04828708c8b6ab32957)
Signed-off-by: Ashay Jaiswal <quic_ashayj@quicinc.com>
2022-03-01 21:35:25 +00:00
Tadeusz Struk 8ab19855fc UPSTREAM: sched/fair: Fix fault in reweight_entity
Syzbot found a GPF in reweight_entity. This has been bisected to
commit 4ef0c5c6b5ba ("kernel/sched: Fix sched_fork() access an invalid
sched_task_group")

There is a race between sched_post_fork() and setpriority(PRIO_PGRP)
within a thread group that causes a null-ptr-deref in
reweight_entity() in CFS. The scenario is that the main process spawns
number of new threads, which then call setpriority(PRIO_PGRP, 0, -20),
wait, and exit.  For each of the new threads the copy_process() gets
invoked, which adds the new task_struct and calls sched_post_fork()
for it.

In the above scenario there is a possibility that
setpriority(PRIO_PGRP) and set_one_prio() will be called for a thread
in the group that is just being created by copy_process(), and for
which the sched_post_fork() has not been executed yet. This will
trigger a null pointer dereference in reweight_entity(), as it will
try to access the run queue pointer, which hasn't been set.

Before the mentioned change the cfs_rq pointer for the task  has been
set in sched_fork(), which is called much earlier in copy_process(),
before the new task is added to the thread_group.  Now it is done in
the sched_post_fork(), which is called after that.  To fix the issue
the remove the update_load param from the update_load param() function
and call reweight_task() only if the task flag doesn't have the
TASK_NEW flag set.

Change-Id: I22d5b9d0b06cd85f0f02446b1e8a2389935cffa8
Fixes: 4ef0c5c6b5ba ("kernel/sched: Fix sched_fork() access an invalid sched_task_group")
Reported-by: syzbot+af7a719bc92395ee41b3@syzkaller.appspotmail.com
Signed-off-by: Tadeusz Struk <tadeusz.struk@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20220203161846.1160750-1-tadeusz.struk@linaro.org
BUG: 221850698
(cherry picked from commit 13765de8148f71fa795e0a6607de37c49ea5915a)
Signed-off-by: Ashay Jaiswal <quic_ashayj@quicinc.com>
2022-03-01 21:35:17 +00:00
Jeevan Shriram f3eb1ea20f ANDROID: Update QCOM symbol list
Update QCOM symbol list in android/abi_gki_aarch64_qcom with following
symbols.

powercap_register_control_type
powercap_register_zone
powercap_unregister_control_type
powercap_unregister_zone

Bug: 220884335
Change-Id: I986905c8d6263589294e4eb12796c219305c7641
Signed-off-by: Jeevan Shriram <quic_jshriram@quicinc.com>
Signed-off-by: Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com>
2022-03-01 08:22:07 -08:00
Manaf Meethalavalappu Pallikunhi 7300e71355 ANDROID: gki_defconfig: Enable powercap framework
It enables the power capping sysfs interface for
different power zone devices.

Bug: 220884335
Change-Id: I11bc3efe06d2a02dcc602d223d3e6757088ca771
Signed-off-by: Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com>
2022-03-01 08:21:57 -08:00
Will Deacon 3b0c9ad7c7 ANDROID: KVM: arm64: Ignore length of 0 in kvm_flush_dcache_to_poc()
kvm_flush_dcache_to_poc() converts its (start,len) parameters into
(start,end) parameters for dcache_clean_inval_poc(). This mostly works
out except for the case when 'len == 0', where dcache_clean_inval_poc()
will still issue cache maintenance for the cache line containing 'start'.
If 'start' is not mapped, then this can generate an unexpected fault.

Don't call into dcache_clean_inval_poc() from kvm_flush_dcache_to_poc()
if the supplied length is 0.

Reported-by: John Stultz <john.stultz@linaro.org>
Bug: 196204410
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Idae2b22289398e941938821d1d3b3a5a1da3fd8f
2022-03-01 10:33:51 +00:00
Suren Baghdasaryan f03e0cb77b FROMGIT: mm: count time in drain_all_pages during direct reclaim as memory pressure
When page allocation in direct reclaim path fails, the system will make
one attempt to shrink per-cpu page lists and free pages from high alloc
reserves.  Draining per-cpu pages into buddy allocator can be a very slow
operation because it's done using workqueues and the task in direct
reclaim waits for all of them to finish before proceeding.  Currently this
time is not accounted as psi memory stall.

While testing mobile devices under extreme memory pressure, when
allocations are failing during direct reclaim, we notices that psi events
which would be expected in such conditions were not triggered.  After
profiling these cases it was determined that the reason for missing psi
events was that a big chunk of time spent in direct reclaim is not
accounted as memory stall, therefore psi would not reach the levels at
which an event is generated.  Further investigation revealed that the bulk
of that unaccounted time was spent inside drain_all_pages call.

A typical captured case when drain_all_pages path gets activated:

__alloc_pages_slowpath  took 44.644.613ns
    __perform_reclaim   took    751.668ns (1.7%)
    drain_all_pages     took 43.887.167ns (98.3%)

PSI in this case records the time spent in __perform_reclaim but ignores
drain_all_pages, IOW it misses 98.3% of the time spent in
__alloc_pages_slowpath.

Annotate __alloc_pages_direct_reclaim in its entirety so that delays from
handling page allocation failure in the direct reclaim path are accounted
as memory stall.

Link: https://lkml.kernel.org/r/20220223194812.1299646-1-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Reported-by: Tim Murray <timmurray@google.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Roman Gushchin <guro@fb.com>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit d4f448732857375eb3dc422225a61e64f8257cb1
https://github.com/hnaz/linux-mm.git master)

Bug: 205182133
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ia3a4138f8d5e8ce612bd5c371cfcc0f21e1ebc42
2022-02-28 18:49:10 +00:00
Will Deacon 48870890a3 ANDROID: gki_defconfig: Ensure KVM is configured in "protected" mode
In order to support the Protected KVM (pKVM) development effort, ensure
that the GKI kernel initialises KVM in "protected" mode when booted at
EL2, even if the underlying CPU hardware supports VHE.

This has no impact on platforms entering the kernel at EL1.

Cc: David Brazdil <dbrazdil@google.com>
Cc: Marc Zyngier <mzyngier@google.com>
Cc: Alistair Delva <adelva@google.com>
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 178098380
Test: atest VirtualizationHostTestCases on an EL2-enabled device
Change-Id: Id84d0b0d08706658d1fc080c09ad8ee5b51ed517
2022-02-28 10:27:51 +00:00
Giuliano Procida 87dcc48027 ANDROID: GKI: remove TIDY_ABI=1 from build configuration
ABI XML is tidied unconditionality from Android 13.

Bug: 221390852
Change-Id: If2d6ad724450d8affbf302f449e408ae2b0d3b2a
Signed-off-by: Giuliano Procida <gprocida@google.com>
2022-02-25 21:11:22 +00:00
Lecopzer Chen 5a379c470b ANDROID: Update mtktv symbol list
Update mtktv symbol list from Feb. main trunk

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

43 Added functions:

  [A] 'function void __cfg80211_radar_event(wiphy*, cfg80211_chan_def*, bool, gfp_t)'
  [A] 'function int __hwspin_trylock(hwspinlock*, int, unsigned long int*)'
  [A] 'function int __kfifo_to_user(__kfifo*, void*, unsigned long int, unsigned int*)'
  [A] 'function void __napi_schedule_irqoff(napi_struct*)'
  [A] 'function int alg_test(const char*, const char*, u32, u32)'
  [A] 'function void cfg80211_assoc_timeout(net_device*, cfg80211_bss*)'
  [A] 'function void cfg80211_cac_event(net_device*, const cfg80211_chan_def*, nl80211_radar_event, gfp_t)'
  [A] 'function unsigned int cfg80211_classify8021d(sk_buff*, cfg80211_qos_map*)'
  [A] 'function void cfg80211_cqm_rssi_notify(net_device*, nl80211_cqm_rssi_threshold_event, s32, gfp_t)'
  [A] 'function void cfg80211_cqm_txe_notify(net_device*, const u8*, u32, u32, u32, gfp_t)'
  [A] 'function void cfg80211_ft_event(net_device*, cfg80211_ft_event_params*)'
  [A] 'function void cfg80211_pmksa_candidate_notify(net_device*, int, const u8*, bool, gfp_t)'
  [A] 'function void cfg80211_rx_assoc_resp(net_device*, cfg80211_bss*, const u8*, size_t, int, const u8*, size_t)'
  [A] 'function void cfg80211_rx_mlme_mgmt(net_device*, const u8*, size_t)'
  [A] 'function void cfg80211_tdls_oper_request(net_device*, const u8*, nl80211_tdls_operation, u16, gfp_t)'
  [A] 'function void cfg80211_tx_mlme_mgmt(net_device*, const u8*, size_t, bool)'
  [A] 'function unsigned int cpufreq_quick_get_max(unsigned int)'
  [A] 'function bool dev_valid_name(const char*)'
  [A] 'function int dma_heap_bufferfd_alloc(dma_heap*, size_t, unsigned int, unsigned int)'
  [A] 'function gpio_chip* gpiochip_find(void*, int (gpio_chip*, void*)*)'
  [A] 'function int hwspin_lock_get_id(hwspinlock*)'
  [A] 'function hwspinlock* hwspin_lock_request()'
  [A] 'function bool ieee80211_operating_class_to_band(u8, nl80211_band*)'
  [A] 'function iio_dev* iio_device_alloc(device*, int)'
  [A] 'function void iio_device_free(iio_dev*)'
  [A] 'function void napi_gro_flush(napi_struct*, bool)'
  [A] 'function void proc_set_user(proc_dir_entry*, kuid_t, kgid_t)'
  [A] 'function int rtc_set_alarm(rtc_device*, rtc_wkalrm*)'
  [A] 'function int sg_nents(scatterlist*)'
  [A] 'function void* skb_pull_rcsum(sk_buff*, unsigned int)'
  [A] 'function thermal_zone_device* thermal_zone_get_zone_by_name(const char*)'
  [A] 'function int usb_anchor_empty(usb_anchor*)'
  [A] 'function int usb_interrupt_msg(usb_device*, unsigned int, void*, int, int*, int)'
  [A] 'function void usb_kill_urb(urb*)'
  [A] 'function void usb_reset_endpoint(usb_device*, unsigned int)'
  [A] 'function int usb_string(usb_device*, int, char*, size_t)'
  [A] 'function int vsprintf(char*, const char*, va_list)'
  [A] 'function void wireless_send_event(net_device*, unsigned int, iwreq_data*, const char*)'
  [A] 'function int zlib_deflate(z_streamp, int)'
  [A] 'function int zlib_deflateInit2(z_streamp, int, int, int, int, int)'
  [A] 'function int zlib_deflateReset(z_streamp)'
  [A] 'function int zlib_deflate_workspacesize(int, int)'
  [A] 'function int zlib_inflate_workspacesize()'

Bug: 220996488
Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
Change-Id: I700546ab080b9ee907c358b3feb7a56c76520e54
Signed-off-by: Giuliano Procida <gprocida@google.com>
2022-02-25 16:20:48 +00:00
Fuad Tabba 29e2f13805 ANDROID: KVM: arm64: get_shadow_vcpu()'s vcpu_idx should be unsigned
Bug: 216808671
Signed-off-by: Fuad Tabba <tabba@google.com>
Change-Id: Ib6a1dfebfa21e14fbb098ef8c4e21f72ef701458
2022-02-25 15:15:55 +00:00
Fuad Tabba 5897711b74 ANDROID: KVM: arm64: Do not use kvm.created_vcpus to track the number of pinned vcpus
Do not use variable to reflect something it wasn't intended to reflect, i.e.,
number of created vcpus vs number of vcpus pinned so far.

Consolidate pinning and error handling to the same level to make
code more readable.

Ensure that the donated pgd is big enough for all vcpus.

Bug: 220830416
Bug: 216808671
Signed-off-by: Fuad Tabba <tabba@google.com>
Change-Id: Ibf41a93bb1175e59b3ab82d2f735f25505d2892a
2022-02-25 15:15:49 +00:00
Fuad Tabba 7ab22b914d ANDROID: KVM: arm64: Change variable names to avoid confusing size and count
Change the variable names to avoid confusion between total memory
area size or just the number of pages.

Use host_kvm.vtcr to make future refactoring easier.

Simplifies future fixes of the bug below.

Bug: 216808671
Signed-off-by: Fuad Tabba <tabba@google.com>
Change-Id: Ica0a0dfcf839dae0625a26a2095e56212385bbe7
2022-02-25 15:15:40 +00:00
Fuad Tabba 0e6b940fce ANDROID: KVM: arm64: Do not pass host struct pointers to pkvm_vcpu_put()
This function only works for loaded vcpus and no more information
is needed by hyp. This removes the need to access potentially
unsafe host memory.

Bug: 220830416
Signed-off-by: Fuad Tabba <tabba@google.com>
Change-Id: I09cb49b06e541bba09e91ce5885b963b88a3c315
2022-02-25 15:15:32 +00:00