Commit Graph

1067675 Commits

Author SHA1 Message Date
Chungkai Mei
26265ecbab ANDROID: binder: set default min and max uclamp to 0 and SCHED_CAPACITY_SCALE
Don't use the uclamp of current task as the default uclamp for
binders, because the uclamp of current task influence
binders' placement when not in a transaction.

Just use default value 0 and SCHED_CAPACITY_SCALE for binders'
default uclamp min and max. Also replace set_inherited_uclamp with
set_binder_prio_uclamp

Bug: 277389699
Change-Id: I07c4f40c2689dbc7eb23e7d3e2a2f435353dc25f
Signed-off-by: Chungkai Mei <chungkai@google.com>
2023-04-25 17:35:21 +00:00
Marc Zyngier
972b60b7d3 BACKPORT: KVM: arm64: Make vcpu flag updates non-preemptible
Per-vcpu flags are updated using a non-atomic RMW operation.
Which means it is possible to get preempted between the read and
write operations.

Another interesting thing to note is that preemption also updates
flags, as we have some flag manipulation in both the load and put
operations.

It is thus possible to lose information communicated by either
load or put, as the preempted flag update will overwrite the flags
when the thread is resumed. This is specially critical if either
load or put has stored information which depends on the physical
CPU the vcpu runs on.

This results in really elusive bugs, and kudos must be given to
Mostafa for the long hours of debugging, and finally spotting
the problem.

Fix it by disabling preemption during the RMW operation, which
ensures that the state stays consistent. Also upgrade vcpu_get_flag
path to use READ_ONCE() to make sure the field is always atomically
accessed.

Fixes: e87abb73e5 ("KVM: arm64: Add helpers to manipulate vcpu flags among a set")
Reported-by: Mostafa Saleh <smostafa@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230418125737.2327972-1-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
(cherry picked from commit 35dcb3ac66)
[willdeacon@: also update __vcpu_copy_flag()]
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 278750073
Change-Id: I63058ff1494e4092dab9d29cb66c295dd8fe9d86
2023-04-25 17:23:29 +00:00
Fuad Tabba
12d85b76fc BACKPORT: KVM: arm64: Advertise ID_AA64PFR0_EL1.CSV2/3 to protected VMs
The existing pKVM code attempts to advertise CSV2/3 using values
initialized to 0, but never set. To advertise CSV2/3 to protected
guests, pass the CSV2/3 values to hyp when initializing hyp's
view of guests' ID_AA64PFR0_EL1.

Similar to non-protected KVM, these are system-wide, rather than
per cpu, for simplicity.

Fixes: 6c30bfb18d ("KVM: arm64: Add handlers for protected VM System Registers")
Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20230404152321.413064-1-tabba@google.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
(cherry picked from commit e81625218b)
[willdeacon@: fixed_config.h has been moved into kvm_pkvm.h]
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 278750073
Change-Id: I27821a28bcde0dbce3d45bac6cf4de20dcf299f9
2023-04-25 17:23:29 +00:00
Wanwei Jiang
d152f9ec2e ANDROID: GKI: Update symbol list for Amlogic
9 function symbol(s) added
  'struct phy* devm_of_phy_get(struct device*, struct device_node*, const char*)'
  'struct pci_host_bridge* devm_pci_alloc_host_bridge(struct device*, size_t)'
  'int pci_host_probe(struct pci_host_bridge*)'
  'struct irq_domain* pci_msi_create_irq_domain(struct fwnode_handle*, struct msi_domain_info*, struct irq_domain*)'
  'int pci_msi_enabled()'
  'void pci_remove_root_bus(struct pci_bus*)'
  'void pci_stop_root_bus(struct pci_bus*)'
  'unsigned long timespec64_to_jiffies(const struct timespec64*)'
  'u64 trace_clock_local()'

Bug: 279568816
Change-Id: Ib022845e8cf9cece0c3a9c5c208ce7911d0c27e2
Signed-off-by: Wanwei Jiang <wanwei.jiang@amlogic.com>
2023-04-25 17:21:18 +00:00
xieliujie
f6f198900a ANDROID: ABI: Update oplus symbol list
1 function symbol(s) added
  'int __traceiter_android_vh_exit_signal(void*, struct task_struct*)'

1 variable symbol(s) added
  'struct tracepoint __tracepoint_android_vh_exit_signal'

Bug: 193384408
Change-Id: Ifc16f21ce65413633dc7d6efb9ccf83499ed6776
Signed-off-by: xieliujie <xieliujie@oppo.com>
2023-04-25 19:13:42 +08:00
xieliujie
226f36eddd ANDROID: vendor_hooks: Add hooks for signal
Add hook to boost thread when process killed.

Bug: 237749933
Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I7cc6f248397021f3a8271433144a0e582ed27cfa
(cherry picked from commit 709679142d583b0b7338d931fdd43b27b1bbf9e0)
2023-04-25 18:08:34 +08:00
xieliujie
a4d5b99e38 ANDROID: ABI: Update oplus symbol list
7 function symbol(s) added
  'int __traceiter_sched_stat_blocked(void*, struct task_struct*, u64)'
  'int __traceiter_sched_stat_iowait(void*, struct task_struct*, u64)'
  'int __traceiter_sched_stat_sleep(void*, struct task_struct*, u64)'
  'int __traceiter_sched_stat_wait(void*, struct task_struct*, u64)'
  'int __traceiter_sched_waking(void*, struct task_struct*)'
  'unsigned long get_wchan(struct task_struct*)'
  'void wq_worker_comm(char*, size_t, struct task_struct*)'

5 variable symbol(s) added
  'struct tracepoint __tracepoint_sched_stat_blocked'
  'struct tracepoint __tracepoint_sched_stat_iowait'
  'struct tracepoint __tracepoint_sched_stat_sleep'
  'struct tracepoint __tracepoint_sched_stat_wait'
  'struct tracepoint __tracepoint_sched_waking'

Bug: 193384408
Change-Id: Id64dd1beb21868d1c07d474cfc6346eeda4c9b74
Signed-off-by: xieliujie <xieliujie@oppo.com>
2023-04-25 02:14:19 +00:00
Liujie Xie
b7f527071c ANDROID: vendor_hooks: Export the tracepoints sched_stat_sleep
and sched_waking to let module probe them

Get task info about sleep and waking

Bug: 190422437
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: I828c93f531f84e6133c2c3a7f8faada51683afcf
(cherry picked from commit 13af062abf)
(cherry picked from commit 869954e72dac700580d0ea5734d07b574e41afe9)
2023-04-25 02:13:50 +00:00
Liujie Xie
c3c2917768 ANDROID: vendor_hooks: Export the tracepoints sched_stat_iowait, sched_stat_blocked, sched_stat_wait to let modules probe them
Get task info about scheduling delay, iowait, and block time.

It is used to get thread scheduling info when thread happened abnormal situation.

Bug: 189415303
Change-Id: Ib6b548f8a78de5b26d555e9a89e3cc79ea2d1024
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
(cherry picked from commit a6bb1af39d)
(cherry picked from commit 6d8d2ab52facfd6d5de2715e2470872e6a70cf22)
2023-04-25 02:12:21 +00:00
xieliujie
1bcf1fc767 ANDROID: vendor_hooks: export get_wchan
Export get_wchan to get the block reason.

It is used to get the block reason(why the thread blocked in Uninterrupted Sleep) when happened long D state. We use this information check if it's reasonable.

Bug: 205684022
Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I7b65bb502b805e7dac13e5f9d725da1ff70fe306
(cherry picked from commit 0db6925868)
(cherry picked from commit de72c813d12537ea6ced87b39ffcad446815609a)
2023-04-25 02:09:48 +00:00
zhengding chen
38a713dc80 ANDROID: workqueue: export symbol of the function wq_worker_comm()
Export symbol of the function wq_worker_comm() in kernel/workqueue.c for dlkm to get the description of the kworker process. It is used to get the description when kworker thread happened abnormal situation.

Bug: 208394207
Signed-off-by: zhengding chen <chenzhengding@oppo.com>
Change-Id: I2e7ddd52a15e22e99e6596f16be08243af1bb473
(cherry picked from commit 28de741861)
(cherry picked from commit 87e0e98c25ba8e121975708943335e3abad651d9)
2023-04-25 01:58:41 +00:00
Martin Liu
be7357c438 ANDROID: Update the ABI symbol list
1 function symbol(s) added
  'int __traceiter_android_vh_si_meminfo(void*, struct sysinfo*)'

1 variable symbol(s) added
  'struct tracepoint __tracepoint_android_vh_si_meminfo'

Bug: 277746082
Change-Id: I62025937489e1ddd61daf1377578bd8726707b8c
Signed-off-by: Martin Liu <liumartin@google.com>
2023-04-23 23:24:47 +00:00
Martin Liu
4d84e8c400 ANDROID: mm: Add vendor hook in si_meminfo
Add a vendor hook for meminfo fixup.

Bug: 277746082
Change-Id: Ifa7850f75ccdf862d900c9a6c00f165b07e84595
Signed-off-by: Martin Liu <liumartin@google.com>
2023-04-23 23:24:47 +00:00
Sajid Dalvi
336321c6f0 BACKPORT: FROMLIST: PCI: dwc: Wait for link up only if link is started
The upstream driver has added start/stop link inline functions that
result in quite a few changes to the designware code. The upstream patch
for this issue, builds on top of these changes. Since we are based on
5.15, it is cleaner to apply a simpler fix on top of the existing code.

In dw_pcie_host_init() regardless of whether the link has been started
or not, the code waits for the link to come up. Even in cases where
start_link() is not defined the code ends up spinning in a loop for 1
second. Since in some systems dw_pcie_host_init() gets called during
probe, this one second loop for each pcie interface instance ends up
extending the boot time.

Call trace when start_link() is not defined:
dw_pcie_wait_for_link << spins in a loop for 1 second
dw_pcie_host_init

Bug: 270085637
Link: https://lore.kernel.org/all/20230412093425.3659088-1-ajayagarwal@google.com/
Change-Id: Ibc42801fa06674e43e921b4976ec83c9fb5483cf
Signed-off-by: Sajid Dalvi <sdalvi@google.com>
2023-04-21 23:44:21 +00:00
Sebastian Ene
6e8704fc7a ANDROID: KVM: arm64: Clear the PTEs which are not refcounted on unmap path
With coalescing we don't refcount default PTE entries. Fix an issue
which clears out non-refcounted PTE entries on the unmap path.

Bug: 279165129
Change-Id: Ie4fdabcc420d54c1338272d38abbe393fc5ce75c
Signed-off-by: Sebastian Ene <sebastianene@google.com>
2023-04-21 16:56:37 +00:00
Wanwei Jiang
b53185721e ANDROID: GKI: Update symbol list for Amlogic
1 function symbol(s) added
  'int v4l2_ctrl_add_handler(struct v4l2_ctrl_handler*, struct v4l2_ctrl_handler*, bool(*)(const struct v4l2_ctrl*), bool)'

Bug: 279005287
Change-Id: I2138206b8a88cb00e76d5fc398f2e2ce6a8c37f6
Signed-off-by: Wanwei Jiang <wanwei.jiang@amlogic.com>
2023-04-21 15:48:04 +00:00
Jiantao Zhang
d711563536 BACKPORT: USB: gadget: Fix use-after-free during usb config switch
In the process of switching USB config from rndis to other config,
if the hardware does not support the ->pullup callback, or the
hardware encounters a low probability fault, both of them may cause
the ->pullup callback to fail, which will then cause a system panic
(use after free).

The gadget drivers sometimes need to be unloaded regardless of the
hardware's behavior.

Analysis as follows:
=======================================================================
(1) write /config/usb_gadget/g1/UDC "none"

gether_disconnect+0x2c/0x1f8
rndis_disable+0x4c/0x74
composite_disconnect+0x74/0xb0
configfs_composite_disconnect+0x60/0x7c
usb_gadget_disconnect+0x70/0x124
usb_gadget_unregister_driver+0xc8/0x1d8
gadget_dev_desc_UDC_store+0xec/0x1e4

(2) rm /config/usb_gadget/g1/configs/b.1/f1

rndis_deregister+0x28/0x54
rndis_free+0x44/0x7c
usb_put_function+0x14/0x1c
config_usb_cfg_unlink+0xc4/0xe0
configfs_unlink+0x124/0x1c8
vfs_unlink+0x114/0x1dc

(3) rmdir /config/usb_gadget/g1/functions/rndis.gs4

panic+0x1fc/0x3d0
do_page_fault+0xa8/0x46c
do_mem_abort+0x3c/0xac
el1_sync_handler+0x40/0x78
0xffffff801138f880
rndis_close+0x28/0x34
eth_stop+0x74/0x110
dev_close_many+0x48/0x194
rollback_registered_many+0x118/0x814
unregister_netdev+0x20/0x30
gether_cleanup+0x1c/0x38
rndis_attr_release+0xc/0x14
kref_put+0x74/0xb8
configfs_rmdir+0x314/0x374

If gadget->ops->pullup() return an error, function rndis_close() will be
called, then it will causes a use-after-free problem.
=======================================================================

Fixes: 0a55187a1e ("USB: gadget core: Issue ->disconnect() callback from usb_gadget_disconnect()")
Signed-off-by: Jiantao Zhang <water.zhangjiantao@huawei.com>
Signed-off-by: TaoXue <xuetao09@huawei.com>
Link: https://lore.kernel.org/r/20221121130805.10735-1-water.zhangjiantao@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 273510696
Bug: 275027942
Change-Id: I702f324c5852d3b2448081b092fef464f8691989
(cherry picked from commit afdc12887f)
[ray: Resolved minor conflict in drivers/usb/gadget/udc/core.c]
Signed-off-by: Ray Chi <raychi@google.com>
(cherry picked from commit 2ce4ee5f2e02702ce61b07a170eeb9ffede0601a)
2023-04-21 08:44:29 +00:00
Rick Yiu
e34090d715 ANDROID: Update the ABI symbol list
Adding the following symbols:
  - resched_curr
  - reweight_task
  - __traceiter_android_rvh_prepare_prio_fork
  - __traceiter_android_rvh_setscheduler
  - __traceiter_android_rvh_set_user_nice
  - __tracepoint_android_rvh_prepare_prio_fork
  - __tracepoint_android_rvh_setscheduler
  - __tracepoint_android_rvh_set_user_nice

Bug: 245675204
Change-Id: I5ff30450746ed2e31f9d214aefa531d1cffc1b5e
Signed-off-by: Rick Yiu <rickyiu@google.com>
2023-04-20 15:29:39 +00:00
ziwei.dai
71cf9c9835 BACKPORT: FROMGIT: rcu: Avoid freeing new kfree_rcu() memory after old grace period
Memory passed to kvfree_rcu() that is to be freed is tracked by a
per-CPU kfree_rcu_cpu structure, which in turn contains pointers
to kvfree_rcu_bulk_data structures that contain pointers to memory
that has not yet been handed to RCU, along with an kfree_rcu_cpu_work
structure that tracks the memory that has already been handed to RCU.
These structures track three categories of memory: (1) Memory for
kfree(), (2) Memory for kvfree(), and (3) Memory for both that arrived
during an OOM episode.  The first two categories are tracked in a
cache-friendly manner involving a dynamically allocated page of pointers
(the aforementioned kvfree_rcu_bulk_data structures), while the third
uses a simple (but decidedly cache-unfriendly) linked list through the
rcu_head structures in each block of memory.

On a given CPU, these three categories are handled as a unit, with that
CPU's kfree_rcu_cpu_work structure having one pointer for each of the
three categories.  Clearly, new memory for a given category cannot be
placed in the corresponding kfree_rcu_cpu_work structure until any old
memory has had its grace period elapse and thus has been removed.  And
the kfree_rcu_monitor() function does in fact check for this.

Except that the kfree_rcu_monitor() function checks these pointers one
at a time.  This means that if the previous kfree_rcu() memory passed
to RCU had only category 1 and the current one has only category 2, the
kfree_rcu_monitor() function will send that current category-2 memory
along immediately.  This can result in memory being freed too soon,
that is, out from under unsuspecting RCU readers.

To see this, consider the following sequence of events, in which:

o       Task A on CPU 0 calls rcu_read_lock(), then uses "from_cset",
        then is preempted.

o       CPU 1 calls kfree_rcu(cset, rcu_head) in order to free "from_cset"
        after a later grace period.  Except that "from_cset" is freed
        right after the previous grace period ended, so that "from_cset"
        is immediately freed.  Task A resumes and references "from_cset"'s
        member, after which nothing good happens.

In full detail:

CPU 0                                   CPU 1
----------------------                  ----------------------
count_memcg_event_mm()
|rcu_read_lock()  <---
|mem_cgroup_from_task()
 |// css_set_ptr is the "from_cset" mentioned on CPU 1
 |css_set_ptr = rcu_dereference((task)->cgroups)
 |// Hard irq comes, current task is scheduled out.

                                        cgroup_attach_task()
                                        |cgroup_migrate()
                                        |cgroup_migrate_execute()
                                        |css_set_move_task(task, from_cset, to_cset, true)
                                        |cgroup_move_task(task, to_cset)
                                        |rcu_assign_pointer(.., to_cset)
                                        |...
                                        |cgroup_migrate_finish()
                                        |put_css_set_locked(from_cset)
                                        |from_cset->refcount return 0
                                        |kfree_rcu(cset, rcu_head) // free from_cset after new gp
                                        |add_ptr_to_bulk_krc_lock()
                                        |schedule_delayed_work(&krcp->monitor_work, ..)

                                        kfree_rcu_monitor()
                                        |krcp->bulk_head[0]'s work attached to krwp->bulk_head_free[]
                                        |queue_rcu_work(system_wq, &krwp->rcu_work)
                                        |if rwork->rcu.work is not in WORK_STRUCT_PENDING_BIT state,
                                        |call_rcu(&rwork->rcu, rcu_work_rcufn) <--- request new gp

                                        // There is a perious call_rcu(.., rcu_work_rcufn)
                                        // gp end, rcu_work_rcufn() is called.
                                        rcu_work_rcufn()
                                        |__queue_work(.., rwork->wq, &rwork->work);

                                        |kfree_rcu_work()
                                        |krwp->bulk_head_free[0] bulk is freed before new gp end!!!
                                        |The "from_cset" is freed before new gp end.

// the task resumes some time later.
 |css_set_ptr->subsys[(subsys_id) <--- Caused kernel crash, because css_set_ptr is freed.

This commit therefore causes kfree_rcu_monitor() to refrain from moving
kfree_rcu() memory to the kfree_rcu_cpu_work structure until the RCU
grace period has completed for all three categories.

v2: Use helper function instead of inserted code block at kfree_rcu_monitor().

Fixes: 34c8817455 ("rcu: Support kfree_bulk() interface in kfree_rcu()")
Fixes: 5f3c8d6204 ("rcu/tree: Maintain separate array for vmalloc ptrs")
Reported-by: Mukesh Ojha <quic_mojha@quicinc.com>
Signed-off-by: Ziwei Dai <ziwei.dai@unisoc.com>
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

Bug: 275289142
Link: https://lore.kernel.org/rcu/1680266529-28429-1-git-send-email-ziwei.dai@unisoc.com/T/#m9d1d6a4542548acddee133a2807511bccf2b01b6
(cherry picked from commit e222f9a512539c3f4093a55d16624d9da614800b
 https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2023.03.30a)
[ziwei.dai: Added missing need_offload_krc() function ]

Change-Id: I63b618ed8454cb2826f04e8789c762be8f1ba1e1
Signed-off-by: Ziwei Dai <ziwei.dai@unisoc.com>
(cherry picked from commit 6ccb91c80a501c800cc48a3fcbb5473f1ec72c02)
2023-04-20 01:04:33 +00:00
Rick Yiu
9f74d5ca93 ANDROID: Update the ABI symbol list
Adding the following symbols:
  - __traceiter_android_rvh_attach_entity_load_avg
  - __traceiter_android_rvh_detach_entity_load_avg
  - __traceiter_android_rvh_remove_entity_load_avg
  - __traceiter_android_rvh_update_blocked_fair
  - __traceiter_android_rvh_update_load_avg
  - __tracepoint_android_rvh_attach_entity_load_avg
  - __tracepoint_android_rvh_detach_entity_load_avg
  - __tracepoint_android_rvh_remove_entity_load_avg
  - __tracepoint_android_rvh_update_blocked_fair
  - __tracepoint_android_rvh_update_load_avg

Bug: 201260585
Change-Id: I92da6f88f6dec03f4034aace3da091876102e006
Signed-off-by: Rick Yiu <rickyiu@google.com>
2023-04-19 23:55:10 +00:00
Lucas Wei
4e1ff0060f ANDROID: Update the ABI symbol list
Add the following symbols:
 - __arm_smccc_sve_check

Bug: 232434016
Change-Id: I8eb7bdfbffcfc46ed5e5ab845aa8e9d892c8d30e
Signed-off-by: Lucas Wei <lucaswei@google.com>
2023-04-19 17:29:33 +00:00
Qinglin Li
87bcc73a79 ANDROID: GKI: wifi drivers need ABI Symbol list for Amlogic SOC
rtl8852be wifi drivers need ABI Symbol list for Amlogic SOC

1 function symbol(s) added
  'void cfg80211_ch_switch_started_notify(struct net_device*, struct cfg80211_chan_def*, unsigned int, u8, bool)'

Bug: 278600971
Change-Id: I6782e9f7539a521dd300ed73b73289920d43722c
Signed-off-by: Qinglin Li <qinglin.li@amlogic.com>
2023-04-18 16:07:36 +00:00
Greg Kroah-Hartman
37a4d9f014 ANDROID: enable CONFIG_USB_XHCI_PCI_RENESAS in gki_defconfig
More platforms are using the Renesas XHCI controller, so enable it in
the configuration so that we do not have to export a bunch of internal
xhci controller functions that should not be part of any stable api.

Bug: 278153046
Change-Id: I9d8aa6a1783f0bb3bf0d794c7101d1762dd96b3d
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-04-18 08:05:08 +00:00
Benedict Wong
e7b6eb419e FROMLIST: xfrm: Skip checking of already-verified secpath entries
This change fixes a bug where inbound packets to nested IPsec tunnels
fails to pass policy checks due to the inner tunnel's policy checks
not having a reference to the outer policy/template. This causes the
policy check to fail, since the first entries in the secpath correlate
to the outer tunnel, while the templates being verified are for the
inner tunnel.

In order to ensure that the appropriate policy and template context is
searchable, the policy checks must be done incrementally between each
decryption step. As such, this marks secpath entries as having been
successfully matched, skipping them (treating as optional) on subsequent
policy checks

By skipping the immediate error return in the case where the secpath
entry had previously been validated, this change allows secpath entries
that matched a policy/template previously, while still requiring that
each searched template find a match in the secpath.

For security:
- All templates must have matching secpath entries
  - Unchanged by current patch; templates that do not match any secpath
    entry still return -1. This patch simply allows skipping earlier
    blocks of verified secpath entries
- All entries (except trailing transport mode entries) must have a
  matching template
  - Unvalidated entries, including transport-mode entries still return
    the errored index if it does not match the correct template.

Bug: 236423446
Bug: 277711867
Test: Tested against Android Kernel Unit Tests
Test: Tested against Android CTS
Link: https://lore.kernel.org/netdev/20220824221252.4130836-2-benedictwong@google.com/
[benedictwong: fixed minor style issues]
Signed-off-by: Benedict Wong <benedictwong@google.com>
(cherry picked from commit 970e02667c)
Merged-In: Ic32831cb00151d0de2e465f18ec37d5f7b680e54
Change-Id: Ic32831cb00151d0de2e465f18ec37d5f7b680e54
2023-04-17 22:31:20 +00:00
Kelvin Zhang
5e02a46709 Revert "Fix XFRM-I support for nested ESP tunnels"
This reverts commit 0b892d8fe9

After manual bisection, I found that 0b892d8fe9 is the culprit of the failed android.net.cts.IpSecManagerTunnelTest .

Bug: 277711867
Signed-off-by: Kelvin Zhang <zhangkelvin@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:f2aef35478ac3939f739b81fe23f57afc64c397a)
Merged-In: Ife350047225fb5d825ec92c5d087313c70965acf
Change-Id: Ife350047225fb5d825ec92c5d087313c70965acf
2023-04-17 22:31:20 +00:00
Benedict Wong
9bf7728b3b FROMLIST: xfrm: Ensure policy checked for nested ESP tunnels
This change ensures that all nested XFRM packets have their policy
checked before decryption of the next layer, so that policies are
verified at each intermediate step of the decryption process.

Notably, raw ESP/AH packets do not perform policy checks inherently,
whereas all other encapsulated packets (UDP, TCP encapsulated) do policy
checks after calling xfrm_input handling in the respective encapsulation
layer.

This is necessary especially for nested tunnels, as the IP addresses,
protocol and ports may all change, thus not matching the previous
policies. In order to ensure that packets match the relevant inbound
templates, the xfrm_policy_check should be done before handing off to
the inner XFRM protocol to decrypt and decapsulate.

In order to prevent double-checking packets both here and in the
encapsulation layers, this check is currently limited to nested
tunnel-mode transforms and checked prior to decapsulation of inner
tunnel layers (prior to hitting a nested tunnel's xfrm_input, there
is no great way to detect a nested tunnel). This is primarily a
performance consideration, as a general blanket check at the end of
xfrm_input would suffice, but may result in multiple policy checks.

Bug: 236423446
Bug: 277711867

Test: Tested against Android Kernel Unit Tests
Link: https://lore.kernel.org/netdev/20220824221252.4130836-3-benedictwong@google.com/
Signed-off-by: Benedict Wong <benedictwong@google.com>
(cherry picked from commit b5bf2997c3)
Merged-In: I20c5abf39512d7f6cf438c0921a78a84e281b4e9
Change-Id: I20c5abf39512d7f6cf438c0921a78a84e281b4e9
2023-04-17 18:10:29 +00:00
Christian Brauner
4187fa3fbe UPSTREAM: fs: drop peer group ids under namespace lock
commit cb2239c198 upstream.

When cleaning up peer group ids in the failure path we need to make sure
to hold on to the namespace lock. Otherwise another thread might just
turn the mount from a shared into a non-shared mount concurrently.

Link: https://lore.kernel.org/lkml/00000000000088694505f8132d77@google.com
Fixes: 2a1867219c ("fs: add mount_setattr()")
Reported-by: syzbot+8ac3859139c685c4f597@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org # 5.12+
Message-Id: <20230330-vfs-mount_setattr-propagation-fix-v1-1-37548d91533b@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 275196365
Change-Id: I0075d0057b61ed4a32a87a394c966ff0235cccdc
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
2023-04-17 06:08:10 +00:00
Arve Hjønnevåg
12d161b7ae FROMLIST: sched/wait: Fix a kthread_park race with wait_woken()
kthread_park and wait_woken have a similar race that kthread_stop and
wait_woken used to have before it was fixed in
cb6538e740. Extend that fix to also cover
kthread_park.

Bug: 274686101
Link: https://lore.kernel.org/lkml/20230406194053.876844-1-arve@android.com/
Change-Id: Iaec960d7e30862f4ccac5c98dd43d32bbcf9a72b
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit 69eba53950444890063b1e0469a61b69f8301767)
2023-04-14 21:07:17 +00:00
Badhri Jagan Sridharan
3d9d54cf37 ANDROID: Update the ABI symbol list typec mux
2 function symbol(s) added
  'void* typec_mux_get_drvdata(struct typec_mux*)'
  'struct typec_mux* typec_mux_register(struct device*, const struct typec_mux_desc*)'

Bug: 260915739
Change-Id: Ic3113c5cb932002c55674a565d3db9539669238d
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
2023-04-14 15:22:31 +00:00
Badhri Jagan Sridharan
0d708da1f5 ANDROID: Update the ABI symbol list typec port management
2 function symbol(s) added
  'void tcpm_port_clean(struct tcpm_port*)'
  'bool tcpm_port_is_toggling(struct tcpm_port*)'

Bug: 215766959
Change-Id: Iffaa5ac3a4af04d70d473d11de975c887450f702
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
2023-04-13 21:26:14 +00:00
Qinglin Li
9d04dbf3ec ANDROID: GKI: Add usb and pcie ABI Symbol list for Amlogic SOC
Add usb and pcie ABI Symbol list for Amlogic SOC

31 function symbol(s) added
  'int __uio_register_device(struct module*, struct device*, struct uio_info*)'
  'void* devm_pci_remap_cfg_resource(struct device*, struct resource*)'
  'struct usb_phy* devm_usb_get_phy(struct device*, enum usb_phy_type)'
  'void dw_pcie_host_deinit(struct pcie_port*)'
  'int dw_pcie_wait_for_link(struct dw_pcie*)'
  'int generic_file_open(struct inode*, struct file*)'
  'ssize_t generic_file_splice_read(struct file*, loff_t*, struct pipe_inode_info*, size_t, unsigned int)'
  'void generic_fillattr(struct user_namespace*, struct inode*, struct kstat*)'
  'int get_tree_bdev(struct fs_context*, int(*)(struct super_block*, struct fs_context*))'
  'loff_t inode_get_bytes(struct inode*)'
  'void inode_set_bytes(struct inode*, loff_t)'
  'void invalidate_bdev(struct block_device*)'
  'ssize_t iter_file_splice_write(struct pipe_inode_info*, struct file*, loff_t*, size_t, unsigned int)'
  'void kill_block_super(struct super_block*)'
  'struct nls_table* load_nls_default()'
  'char* mangle_path(char*, const char*, const char*)'
  'struct pci_bus* pci_find_next_bus(const struct pci_bus*)'
  'void pci_lock_rescan_remove()'
  'void pci_stop_and_remove_bus_device_locked(struct pci_dev*)'
  'void pci_unlock_rescan_remove()'
  'int posix_acl_chmod(struct user_namespace*, struct inode*, umode_t)'
  'void* proc_get_parent_data(const struct inode*)'
  'int sb_set_blocksize(struct super_block*, int)'
  'int sync_blockdev(struct block_device*)'
  'int sync_filesystem(struct super_block*)'
  'void uio_unregister_device(struct uio_info*)'
  'void unload_nls(struct nls_table*)'
  'int usb_add_phy_dev(struct usb_phy*)'
  'int usb_gadget_probe_driver(struct usb_gadget_driver*)'
  'int usb_gadget_unregister_driver(struct usb_gadget_driver*)'
  'int vfs_fsync(struct file*, int)'

Bug: 276863283
Change-Id: I42d5006236004fade1b03772ee1151b3de491ab1
Signed-off-by: Qinglin Li <qinglin.li@amlogic.com>
2023-04-13 18:50:28 +00:00
Qinglin Li
f9bf714530 ANDROID: GKI: Add file system ABI Symbol list for Amlogic SOC
Add file system ABI Symbol list for Amlogic SOC

69 function symbol(s) added
  'int __fs_parse(struct p_log*, const struct fs_parameter_spec*, struct fs_parameter*, struct fs_parse_result*)'
  'struct buffer_head* __getblk_gfp(struct block_device*, sector_t, unsigned int, gfp_t)'
  'void __lock_buffer(struct buffer_head*)'
  'void __mark_inode_dirty(struct inode*, int)'
  'int __set_page_dirty_buffers(struct page*)'
  'void __wait_on_buffer(struct buffer_head*)'
  'struct dentry* d_find_alias(struct inode*)'
  'void d_instantiate(struct dentry*, struct inode*)'
  'struct dentry* d_make_root(struct inode*)'
  'struct dentry* d_obtain_alias(struct inode*)'
  'struct dentry* d_splice_alias(struct inode*, struct dentry*)'
  'char* dentry_path_raw(const struct dentry*, char*, int)'
  'void discard_new_inode(struct inode*)'
  'void dput(struct dentry*)'
  'void drop_nlink(struct inode*)'
  'void end_buffer_read_sync(struct buffer_head*, int)'
  'int fiemap_fill_next_extent(struct fiemap_extent_info*, u64, u64, u64, u32)'
  'int fiemap_prep(struct inode*, struct fiemap_extent_info*, u64, u64*, u32)'
  'int file_remove_privs(struct file*)'
  'int file_update_time(struct file*)'
  'int fs_param_is_string(struct p_log*, const struct fs_parameter_spec*, struct fs_parameter*, struct fs_parse_result*)'
  'int fs_param_is_u32(struct p_log*, const struct fs_parameter_spec*, struct fs_parameter*, struct fs_parse_result*)'
  'sector_t generic_block_bmap(struct address_space*, sector_t, get_block_t*)'
  'struct dentry* generic_fh_to_dentry(struct super_block*, struct fid*, int, int, struct inode*(*)(struct super_block*, u64, u32))'
  'struct dentry* generic_fh_to_parent(struct super_block*, struct fid*, int, int, struct inode*(*)(struct super_block*, u64, u32))'
  'int generic_file_fsync(struct file*, loff_t, loff_t, int)'
  'int generic_permission(struct user_namespace*, struct inode*, int)'
  'ssize_t generic_read_dir(struct file*, char*, size_t, loff_t*)'
  'int generic_write_end(struct file*, struct address_space*, loff_t, unsigned int, unsigned int, struct page*, void*)'
  'struct inode* iget5_locked(struct super_block*, unsigned long, int(*)(struct inode*, void*), int(*)(struct inode*, void*), void*)'
  'void iget_failed(struct inode*)'
  'void ihold(struct inode*)'
  'struct inode* ilookup(struct super_block*, unsigned long)'
  'void inc_nlink(struct inode*)'
  'void init_special_inode(struct inode*, umode_t, dev_t)'
  'void inode_dio_wait(struct inode*)'
  'void inode_init_once(struct inode*)'
  'void inode_init_owner(struct user_namespace*, struct inode*, const struct inode*, umode_t)'
  'int inode_needs_sync(struct inode*)'
  'int inode_newsize_ok(const struct inode*, loff_t)'
  'void inode_nohighmem(struct inode*)'
  'int insert_inode_locked(struct inode*)'
  'void invalidate_inode_buffers(struct inode*)'
  'bool is_bad_inode(struct inode*)'
  'void kfree_link(void*)'
  'void ll_rw_block(int, int, int, struct buffer_head**)'
  'struct nls_table* load_nls(char*)'
  'void logfc(struct fc_log*, const char*, char, const char*, ...)'
  'void make_bad_inode(struct inode*)'
  'void mark_buffer_dirty(struct buffer_head*)'
  'void mpage_readahead(struct readahead_control*, get_block_t*)'
  'int mpage_readpage(struct page*, get_block_t*)'
  'int mpage_writepages(struct address_space*, struct writeback_control*, get_block_t*)'
  'struct inode* new_inode(struct super_block*)'
  'int register_filesystem(struct file_system_type*)'
  'void set_bh_page(struct buffer_head*, struct page*, unsigned long)'
  'void set_nlink(struct inode*, unsigned int)'
  'void setattr_copy(struct user_namespace*, struct inode*, const struct iattr*)'
  'int setattr_prepare(struct user_namespace*, struct dentry*, struct iattr*)'
  'int submit_bh(int, int, struct buffer_head*)'
  'int sync_dirty_buffer(struct buffer_head*)'
  'int sync_inode_metadata(struct inode*, int)'
  'int sync_mapping_buffers(struct address_space*)'
  'void unlock_buffer(struct buffer_head*)'
  'void unlock_new_inode(struct inode*)'
  'int unregister_filesystem(struct file_system_type*)'
  'int utf16s_to_utf8s(const wchar_t*, int, enum utf16_endian, u8*, int)'
  'int utf8_to_utf32(const u8*, int, unicode_t*)'
  'int write_inode_now(struct inode*, int)'

1 variable symbol(s) added
  'struct kmem_cache* names_cachep'

Bug: 276863283
Change-Id: I5addeb8f83362c80e87a33726297d72bccc2f2ed
Signed-off-by: Qinglin Li <qinglin.li@amlogic.com>
2023-04-13 18:50:28 +00:00
Qinglin Li
42dd91524e ANDROID: GKI: Add kernel base and lib ABI Symbol list for Amlogic SOC
Add kernel base and lib ABI Symbol list for Amlogic SOC

62 function symbol(s) added
  'void __devm_release_region(struct device*, struct resource*, resource_size_t, resource_size_t)'
  'int __kfifo_from_user(struct __kfifo*, const void*, unsigned long, unsigned int*)'
  'unsigned int __kfifo_in_r(struct __kfifo*, const void*, unsigned int, size_t)'
  'unsigned int __kfifo_out_r(struct __kfifo*, void*, unsigned int, size_t)'
  'int __kfifo_to_user(struct __kfifo*, void*, unsigned long, unsigned int*)'
  'int __traceiter_android_vh_iommu_iovad_free_iova(void*, struct iova_domain*, dma_addr_t, size_t)'
  'int __traceiter_android_vh_sched_show_task(void*, struct task_struct*)'
  'unsigned long _find_last_bit(const unsigned long*, unsigned long)'
  'int default_wake_function(wait_queue_entry_t*, unsigned int, int, void*)'
  'int des_expand_key(struct des_ctx*, const u8*, unsigned int)'
  'void dev_pm_clear_wake_irq(struct device*)'
  'struct device* dev_pm_domain_attach_by_id(struct device*, unsigned int)'
  'int dev_pm_set_wake_irq(struct device*, int)'
  'int device_get_phy_mode(struct device*)'
  'char* devm_kvasprintf(struct device*, gfp_t, const char*, va_list)'
  'int down_timeout(struct semaphore*, long)'
  'size_t fault_in_iov_iter_readable(const struct iov_iter*, size_t)'
  'void flush_signals(struct task_struct*)'
  'bool fwnode_device_is_available(const struct fwnode_handle*)'
  'struct fwnode_handle* fwnode_graph_get_next_endpoint(const struct fwnode_handle*, struct fwnode_handle*)'
  'struct fwnode_handle* fwnode_graph_get_port_parent(const struct fwnode_handle*)'
  'struct fwnode_handle* fwnode_graph_get_remote_endpoint(const struct fwnode_handle*)'
  'struct fwnode_handle* fwnode_graph_get_remote_port_parent(const struct fwnode_handle*)'
  'int fwnode_graph_parse_endpoint(const struct fwnode_handle*, struct fwnode_endpoint*)'
  'struct fwnode_handle* fwnode_handle_get(struct fwnode_handle*)'
  'int fwnode_property_get_reference_args(const struct fwnode_handle*, const char*, const char*, unsigned int, unsigned int, struct fwnode_reference_args*)'
  'int fwnode_property_read_u64_array(const struct fwnode_handle*, const char*, u64*, size_t)'
  'phys_addr_t gen_pool_virt_to_phys(struct gen_pool*, unsigned long)'
  'int get_device_system_crosststamp(int(*)(ktime_t*, struct system_counterval_t*, void*), void*, struct system_time_snapshot*, struct system_device_crosststamp*)'
  'void* ioremap_cache(phys_addr_t, size_t)'
  'void iov_iter_init(struct iov_iter*, unsigned int, const struct iovec*, unsigned long, size_t)'
  'size_t iov_iter_zero(size_t, struct iov_iter*)'
  'unsigned int irq_create_fwspec_mapping(struct irq_fwspec*)'
  'void irq_domain_free_irqs_parent(struct irq_domain*, unsigned int, unsigned int)'
  'void kernel_sigaction(int, __sighandler_t)'
  'int kill_pid(struct pid*, int, int)'
  'void lockref_get(struct lockref*)'
  'char* next_arg(char*, char**, char**)'
  'int nla_append(struct sk_buff*, int, const void*)'
  'int param_get_charp(char*, const struct kernel_param*)'
  'int param_get_string(char*, const struct kernel_param*)'
  'int param_set_charp(const char*, const struct kernel_param*)'
  'int param_set_copystring(const char*, const struct kernel_param*)'
  'int platform_get_irq_byname_optional(struct platform_device*, const char*)'
  'struct rb_node* rb_last(const struct rb_root*)'
  'u64 read_sanitised_ftr_reg(u32)'
  'int register_module_notifier(struct notifier_block*)'
  'struct perf_event** register_wide_hw_breakpoint(struct perf_event_attr*, perf_overflow_handler_t, void*)'
  'int regmap_irq_chip_get_base(struct regmap_irq_chip_data*)'
  'int release_resource(struct resource*)'
  'size_t sg_copy_from_buffer(struct scatterlist*, unsigned int, const void*, size_t)'
  'size_t sg_copy_to_buffer(struct scatterlist*, unsigned int, void*, size_t)'
  'int sg_nents(struct scatterlist*)'
  'ssize_t show_class_attr_string(struct class*, struct class_attribute*, char*)'
  'void show_regs(struct pt_regs*)'
  'int smpboot_register_percpu_thread(struct smp_hotplug_thread*)'
  'void stack_trace_print(const unsigned long*, unsigned int, int)'
  'char* strchrnul(const char*, int)'
  'void symbol_put_addr(void*)'
  'int unregister_module_notifier(struct notifier_block*)'
  'void unregister_wide_hw_breakpoint(struct perf_event**)'
  'void yield()'

12 variable symbol(s) added
  'struct tracepoint __tracepoint_android_vh_iommu_iovad_free_iova'
  'struct tracepoint __tracepoint_android_vh_sched_show_task'
  'struct cma* dma_contiguous_default_area'
  'const char hex_asc[17]'
  'u64 jiffies_64'
  'int overflowgid'
  'int overflowuid'
  'const struct kernel_param_ops param_ops_short'
  'const struct kernel_param_ops param_ops_ullong'
  'const struct kernel_param_ops param_ops_ushort'
  'struct workqueue_struct* pm_wq'
  'const uuid_t uuid_null'

Bug: 276863283
Change-Id: I22fc86f1e769c06744948a8b60254b1172364e3f
Signed-off-by: Qinglin Li <qinglin.li@amlogic.com>
2023-04-13 18:50:28 +00:00
Qinglin Li
6c73bb759c ANDROID: GKI: Add mmc gpio pwm etc ABI Symbol list for Amlogic SOC
Add mmc gpio pwm etc ABI Symbol list for Amlogic SOC

71 function symbol(s) added
  'int __device_reset(struct device*, bool)'
  'int __mmc_claim_host(struct mmc_host*, struct mmc_ctx*, atomic_t*)'
  'void dev_pm_opp_free_cpufreq_table(struct device*, struct cpufreq_frequency_table**)'
  'struct opp_table* dev_pm_opp_get_opp_table(struct device*)'
  'int dev_pm_opp_init_cpufreq_table(struct device*, struct cpufreq_frequency_table**)'
  'int dev_pm_opp_of_add_table_indexed(struct device*, int)'
  'void dev_pm_opp_put_opp_table(struct opp_table*)'
  'int devm_clk_hw_register_clkdev(struct device*, struct clk_hw*, const char*, const char*)'
  'struct pwm_device* devm_of_pwm_get(struct device*, struct device_node*, const char*)'
  'struct pwm_device* devm_pwm_get(struct device*, const char*)'
  'int extcon_dev_register(struct extcon_dev*)'
  'int extcon_set_state(struct extcon_dev*, unsigned int, bool)'
  'struct gpio_desc* gpiod_get_index(struct device*, const char*, unsigned int, enum gpiod_flags)'
  'int hwspin_lock_register(struct hwspinlock_device*, struct device*, const struct hwspinlock_ops*, int, int)'
  'int hwspin_lock_unregister(struct hwspinlock_device*)'
  'void iio_buffer_init(struct iio_buffer*)'
  'void iio_buffer_put(struct iio_buffer*)'
  'int iio_device_attach_buffer(struct iio_dev*, struct iio_buffer*)'
  's64 iio_get_time_ns(const struct iio_dev*)'
  'int iio_push_to_buffers(struct iio_dev*, const void*)'
  'void led_trigger_blink_oneshot(struct led_trigger*, unsigned long*, unsigned long*, int)'
  'void led_trigger_event(struct led_trigger*, enum led_brightness)'
  'int led_trigger_register(struct led_trigger*)'
  'void led_trigger_register_simple(const char*, struct led_trigger**)'
  'void led_trigger_unregister(struct led_trigger*)'
  'void led_trigger_unregister_simple(struct led_trigger*)'
  'bool mmc_card_is_blockaddr(struct mmc_card*)'
  'void mmc_detect_change(struct mmc_host*, unsigned long)'
  'void mmc_release_host(struct mmc_host*)'
  'void mmc_set_data_timeout(struct mmc_data*, const struct mmc_card*)'
  'int mmc_sw_reset(struct mmc_host*)'
  'int mmc_switch(struct mmc_card*, u8, u8, u8, unsigned int)'
  'void mmc_wait_for_req(struct mmc_host*, struct mmc_request*)'
  'struct reset_control* of_reset_control_array_get(struct device_node*, bool, bool, bool)'
  'int pwm_adjust_config(struct pwm_device*)'
  'int pwm_apply_state(struct pwm_device*, const struct pwm_state*)'
  'int regulator_list_voltage(struct regulator*, unsigned int)'
  'int regulator_map_voltage_iterate(struct regulator_dev*, int, int)'
  'int rtc_add_group(struct rtc_device*, const struct attribute_group*)'
  'unsigned int sdio_align_size(struct sdio_func*, unsigned int)'
  'void sdio_claim_host(struct sdio_func*)'
  'int sdio_claim_irq(struct sdio_func*, sdio_irq_handler_t*)'
  'int sdio_disable_func(struct sdio_func*)'
  'int sdio_enable_func(struct sdio_func*)'
  'unsigned char sdio_f0_readb(struct sdio_func*, unsigned int, int*)'
  'void sdio_f0_writeb(struct sdio_func*, unsigned char, unsigned int, int*)'
  'mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func*)'
  'u8 sdio_readb(struct sdio_func*, unsigned int, int*)'
  'u32 sdio_readl(struct sdio_func*, unsigned int, int*)'
  'int sdio_readsb(struct sdio_func*, void*, unsigned int, int)'
  'u16 sdio_readw(struct sdio_func*, unsigned int, int*)'
  'int sdio_register_driver(struct sdio_driver*)'
  'void sdio_release_host(struct sdio_func*)'
  'int sdio_release_irq(struct sdio_func*)'
  'void sdio_retune_crc_disable(struct sdio_func*)'
  'void sdio_retune_crc_enable(struct sdio_func*)'
  'void sdio_retune_hold_now(struct sdio_func*)'
  'void sdio_retune_release(struct sdio_func*)'
  'int sdio_set_host_pm_flags(struct sdio_func*, mmc_pm_flag_t)'
  'void sdio_unregister_driver(struct sdio_driver*)'
  'void sdio_writeb(struct sdio_func*, u8, unsigned int, int*)'
  'void sdio_writel(struct sdio_func*, u32, unsigned int, int*)'
  'int sdio_writesb(struct sdio_func*, unsigned int, void*, int)'
  'void sdio_writew(struct sdio_func*, u16, unsigned int, int*)'
  'struct spi_device* spi_alloc_device(struct spi_controller*)'
  'struct spi_controller* spi_busnum_to_master(u16)'
  'int spi_mem_adjust_op_size(struct spi_mem*, struct spi_mem_op*)'
  'bool spi_mem_default_supports_op(struct spi_mem*, const struct spi_mem_op*)'
  'bool spi_mem_supports_op(struct spi_mem*, const struct spi_mem_op*)'
  'struct spi_device* spi_new_device(struct spi_controller*, struct spi_board_info*)'
  'void uart_insert_char(struct uart_port*, unsigned int, unsigned int, unsigned int, unsigned int)'

Bug: 276863283
Change-Id: I1df1316a23a6dcaf69b6244cb9d63b5c64fcd37a
Signed-off-by: Qinglin Li <qinglin.li@amlogic.com>
2023-04-13 18:50:28 +00:00
Qinglin Li
77fd1bdf70 ANDROID: GKI: Add net and memory ABI Symbol list for Amlogic SOC
Add net and memory ABI Symbol list for Amlogic SOC

66 function symbol(s) added
  'struct net_device* __dev_get_by_name(struct net*, const char*)'
  'ssize_t __generic_file_write_iter(struct kiocb*, struct iov_iter*)'
  'int __ipv6_addr_type(const struct in6_addr*)'
  'struct sk_buff* __pskb_copy_fclone(struct sk_buff*, int, gfp_t, bool)'
  'struct net_device* devm_alloc_etherdev_mqs(struct device*, int, unsigned int, unsigned int)'
  'int eth_header(struct sk_buff*, struct net_device*, unsigned short, const void*, const void*, unsigned int)'
  'int eth_header_parse(const struct sk_buff*, unsigned char*)'
  'int filemap_fdatawait_range(struct address_space*, loff_t, loff_t)'
  'int filemap_fdatawrite(struct address_space*)'
  'int filemap_fdatawrite_range(struct address_space*, loff_t, loff_t)'
  'int filemap_flush(struct address_space*)'
  'int filemap_write_and_wait_range(struct address_space*, loff_t, loff_t)'
  'int flow_block_cb_setup_simple(struct flow_block_offload*, struct list_head*, flow_setup_cb_t*, void*, void*, bool)'
  'void flow_rule_match_basic(const struct flow_rule*, struct flow_match_basic*)'
  'void flow_rule_match_ipv4_addrs(const struct flow_rule*, struct flow_match_ipv4_addrs*)'
  'void flow_rule_match_ports(const struct flow_rule*, struct flow_match_ports*)'
  'void flow_rule_match_vlan(const struct flow_rule*, struct flow_match_vlan*)'
  'int generic_file_mmap(struct file*, struct vm_area_struct*)'
  'int get_kernel_pages(const struct kvec*, int, int, struct page**)'
  'unsigned long get_pfnblock_flags_mask(const struct page*, unsigned long, unsigned long)'
  'struct page* grab_cache_page_write_begin(struct address_space*, unsigned long, unsigned int)'
  'char* iwe_stream_add_event(struct iw_request_info*, char*, char*, struct iw_event*, int)'
  'char* iwe_stream_add_point(struct iw_request_info*, char*, char*, struct iw_event*, char*)'
  'char* iwe_stream_add_value(struct iw_request_info*, char*, char*, char*, struct iw_event*, int)'
  'void mod_node_page_state(struct pglist_data*, enum node_stat_item, long)'
  'void netdev_printk(const char*, const struct net_device*, const char*, ...)'
  'void netdev_rss_key_fill(void*, size_t)'
  'int of_get_phy_mode(struct device_node*, phy_interface_t*)'
  'struct page* page_pool_alloc_pages(struct page_pool*, gfp_t)'
  'struct page_pool* page_pool_create(const struct page_pool_params*)'
  'void page_pool_destroy(struct page_pool*)'
  'void page_pool_put_page(struct page_pool*, struct page*, unsigned int, bool)'
  'void page_pool_release_page(struct page_pool*, struct page*)'
  'struct page* pagecache_get_page(struct address_space*, unsigned long, int, gfp_t)'
  'int pagecache_write_begin(struct file*, struct address_space*, loff_t, unsigned int, unsigned int, struct page**, void**)'
  'int pagecache_write_end(struct file*, struct address_space*, loff_t, unsigned int, unsigned int, struct page*, void*)'
  'struct page* read_cache_page(struct address_space*, unsigned long, int(*)(void*, struct page*), void*)'
  'bool rfkill_set_sw_state(struct rfkill*, bool)'
  'void* skb_pull_rcsum(struct sk_buff*, unsigned int)'
  'void skb_scrub_packet(struct sk_buff*, bool)'
  'void truncate_inode_pages_final(struct address_space*)'
  'void truncate_pagecache(struct inode*, loff_t)'
  'void truncate_setsize(struct inode*, loff_t)'
  'void unpin_user_pages(struct page**, unsigned long)'
  'int vm_insert_page(struct vm_area_struct*, unsigned long, struct page*)'
  'void vm_unmap_aliases()'
  'unsigned long vmalloc_to_pfn(const void*)'
  'void wireless_send_event(struct net_device*, unsigned int, union iwreq_data*, const char*)'
  'bool xdp_rxq_info_is_reg(struct xdp_rxq_info*)'
  'void xdp_rxq_info_unreg_mem_model(struct xdp_rxq_info*)'
  'struct xdp_buff* xp_alloc(struct xsk_buff_pool*)'
  'int xp_dma_map(struct xsk_buff_pool*, struct device*, unsigned long, struct page**, u32)'
  'void xp_dma_sync_for_cpu_slow(struct xdp_buff_xsk*)'
  'void xp_dma_sync_for_device_slow(struct xsk_buff_pool*, dma_addr_t, size_t)'
  'void xp_dma_unmap(struct xsk_buff_pool*, unsigned long)'
  'void xp_free(struct xdp_buff_xsk*)'
  'dma_addr_t xp_raw_get_dma(struct xsk_buff_pool*, u64)'
  'void xp_set_rxq_info(struct xsk_buff_pool*, struct xdp_rxq_info*)'
  'void xsk_clear_rx_need_wakeup(struct xsk_buff_pool*)'
  'struct xsk_buff_pool* xsk_get_pool_from_qid(struct net_device*, u16)'
  'void xsk_set_rx_need_wakeup(struct xsk_buff_pool*)'
  'void xsk_set_tx_need_wakeup(struct xsk_buff_pool*)'
  'void xsk_tx_completed(struct xsk_buff_pool*, u32)'
  'bool xsk_tx_peek_desc(struct xsk_buff_pool*, struct xdp_desc*)'
  'void xsk_tx_release(struct xsk_buff_pool*)'
  'bool xsk_uses_need_wakeup(struct xsk_buff_pool*)'

2 variable symbol(s) added
  'void* high_memory'
  'struct backing_dev_info noop_backing_dev_info'

Bug: 276863283
Change-Id: I5fe6034fb0580e8c9cb81fa0128b6785069c3f3d
Signed-off-by: Qinglin Li <qinglin.li@amlogic.com>
2023-04-13 18:50:28 +00:00
Qinglin Li
2da1dda224 ANDROID: GKI: Add net ABI Symbol list for Amlogic SOC
Add net ABI Symbol list for Amlogic SOC

54 function symbol(s) added
  'int __of_mdiobus_register(struct mii_bus*, struct device_node*, struct module*)'
  'int genphy_aneg_done(struct phy_device*)'
  'int genphy_read_status(struct phy_device*)'
  'int genphy_restart_aneg(struct phy_device*)'
  'int genphy_resume(struct phy_device*)'
  'int genphy_soft_reset(struct phy_device*)'
  'int genphy_suspend(struct phy_device*)'
  'int genphy_update_link(struct phy_device*)'
  'struct mdio_device* mdio_device_create(struct mii_bus*, int)'
  'void mdio_device_free(struct mdio_device*)'
  'struct mii_bus* mdiobus_alloc_size(size_t)'
  'void mdiobus_free(struct mii_bus*)'
  'struct phy_device* mdiobus_get_phy(struct mii_bus*, int)'
  'int mdiobus_read(struct mii_bus*, int, u32)'
  'void mdiobus_unregister(struct mii_bus*)'
  'int mdiobus_write(struct mii_bus*, int, u32, u16)'
  'void netdev_alert(const struct net_device*, const char*, ...)'
  'struct mii_bus* of_mdio_find_bus(struct device_node*)'
  'bool of_phy_is_fixed_link(struct device_node*)'
  'void phy_attached_info(struct phy_device*)'
  'int phy_drivers_register(struct phy_driver*, int, struct module*)'
  'void phy_drivers_unregister(struct phy_driver*, int)'
  'void phy_error(struct phy_device*)'
  'int phy_init_eee(struct phy_device*, bool)'
  'void phy_print_status(struct phy_device*)'
  'void phy_trigger_machine(struct phy_device*)'
  'int phylink_connect_phy(struct phylink*, struct phy_device*)'
  'struct phylink* phylink_create(struct phylink_config*, struct fwnode_handle*, phy_interface_t, const struct phylink_mac_ops*)'
  'void phylink_destroy(struct phylink*)'
  'void phylink_disconnect_phy(struct phylink*)'
  'int phylink_ethtool_get_eee(struct phylink*, struct ethtool_eee*)'
  'void phylink_ethtool_get_pauseparam(struct phylink*, struct ethtool_pauseparam*)'
  'void phylink_ethtool_get_wol(struct phylink*, struct ethtool_wolinfo*)'
  'int phylink_ethtool_ksettings_get(struct phylink*, struct ethtool_link_ksettings*)'
  'int phylink_ethtool_ksettings_set(struct phylink*, const struct ethtool_link_ksettings*)'
  'int phylink_ethtool_nway_reset(struct phylink*)'
  'int phylink_ethtool_set_eee(struct phylink*, struct ethtool_eee*)'
  'int phylink_ethtool_set_pauseparam(struct phylink*, struct ethtool_pauseparam*)'
  'int phylink_ethtool_set_wol(struct phylink*, struct ethtool_wolinfo*)'
  'int phylink_get_eee_err(struct phylink*)'
  'int phylink_mii_ioctl(struct phylink*, struct ifreq*, int)'
  'int phylink_of_phy_connect(struct phylink*, struct device_node*, u32)'
  'void phylink_resume(struct phylink*)'
  'void phylink_set_pcs(struct phylink*, struct phylink_pcs*)'
  'void phylink_set_port_modes(unsigned long*)'
  'int phylink_speed_down(struct phylink*, bool)'
  'int phylink_speed_up(struct phylink*)'
  'void phylink_start(struct phylink*)'
  'void phylink_stop(struct phylink*)'
  'void phylink_suspend(struct phylink*, bool)'
  'void ptp_clock_event(struct ptp_clock*, struct ptp_clock_event*)'
  'int ptp_clock_index(struct ptp_clock*)'
  'struct ptp_clock* ptp_clock_register(struct ptp_clock_info*, struct device*)'
  'int ptp_clock_unregister(struct ptp_clock*)'

Bug: 276863283
Change-Id: I11ada9bfd5d7c7b97bd50aba19fc37d1f2eb3f02
Signed-off-by: Qinglin Li <qinglin.li@amlogic.com>
2023-04-13 18:50:28 +00:00
Qinglin Li
9ff310d286 ANDROID: GKI: Add media gpu and sound ABI Symbol list for Amlogic SOC
Add media gpu and sound ABI Symbol list for Amlogic SOC

49 function symbol(s) added
  'void __drm_atomic_helper_connector_reset(struct drm_connector*, struct drm_connector_state*)'
  'unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream*)'
  'void drm_atomic_helper_async_commit(struct drm_device*, struct drm_atomic_state*)'
  'void drm_atomic_helper_commit_tail_rpm(struct drm_atomic_state*)'
  'int drm_atomic_helper_resume(struct drm_device*, struct drm_atomic_state*)'
  'struct drm_atomic_state* drm_atomic_helper_suspend(struct drm_device*)'
  'int drm_atomic_set_mode_for_crtc(struct drm_crtc_state*, const struct drm_display_mode*)'
  'int drm_connector_attach_content_protection_property(struct drm_connector*, bool)'
  'int drm_connector_attach_content_type_property(struct drm_connector*)'
  'int drm_connector_attach_max_bpc_property(struct drm_connector*, int, int)'
  'int drm_connector_attach_vrr_capable_property(struct drm_connector*)'
  'void drm_connector_set_vrr_capable_property(struct drm_connector*, bool)'
  'struct drm_crtc* drm_crtc_from_index(struct drm_device*, int)'
  'struct drm_framebuffer* drm_framebuffer_lookup(struct drm_device*, struct drm_file*, uint32_t)'
  'int drm_gem_handle_delete(struct drm_file*, u32)'
  'void drm_hdcp_update_content_protection(struct drm_connector*, u64)'
  'struct drm_display_mode* drm_mode_create(struct drm_device*)'
  'void drm_mode_get_hv_timing(const struct drm_display_mode*, int*, int*)'
  'int drm_property_add_enum(struct drm_property*, uint64_t, const char*)'
  'void drm_property_destroy(struct drm_device*, struct drm_property*)'
  'void drm_self_refresh_helper_update_avg_times(struct drm_atomic_state*, unsigned int, unsigned int)'
  'void hdmi_avi_infoframe_init(struct hdmi_avi_infoframe*)'
  'int hdmi_drm_infoframe_init(struct hdmi_drm_infoframe*)'
  'ssize_t hdmi_drm_infoframe_pack(struct hdmi_drm_infoframe*, void*, size_t)'
  'int hdmi_infoframe_unpack(union hdmi_infoframe*, const void*, size_t)'
  'ssize_t hdmi_spd_infoframe_pack(struct hdmi_spd_infoframe*, void*, size_t)'
  'int hdmi_vendor_infoframe_init(struct hdmi_vendor_infoframe*)'
  'ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe*, void*, size_t)'
  'int snd_pcm_kernel_ioctl(struct snd_pcm_substream*, unsigned int, void*)'
  'int snd_pcm_lib_default_mmap(struct snd_pcm_substream*, struct vm_area_struct*)'
  'unsigned int snd_pcm_rate_to_rate_bit(unsigned int)'
  'int snd_pcm_stop(struct snd_pcm_substream*, snd_pcm_state_t)'
  'int snd_pcm_stop_xrun(struct snd_pcm_substream*)'
  'void snd_pcm_stream_unlock_irqrestore(struct snd_pcm_substream*, unsigned long)'
  'int snd_soc_add_card_controls(struct snd_soc_card*, const struct snd_kcontrol_new*, int)'
  'void snd_soc_jack_free_gpios(struct snd_soc_jack*, int, struct snd_soc_jack_gpio*)'
  'int snd_soc_of_get_slot_mask(struct device_node*, const char*, unsigned int*)'
  'int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card*, const char*)'
  'int snd_soc_of_parse_tdm_slot(struct device_node*, unsigned int*, unsigned int*, unsigned int*, unsigned int*)'
  'int v4l2_ctrl_subscribe_event(struct v4l2_fh*, const struct v4l2_event_subscription*)'
  'int v4l2_device_register_subdev(struct v4l2_device*, struct v4l2_subdev*)'
  'void v4l2_device_unregister_subdev(struct v4l2_subdev*)'
  'void v4l2_event_queue_fh(struct v4l2_fh*, const struct v4l2_event*)'
  'int v4l2_event_subscribe(struct v4l2_fh*, const struct v4l2_event_subscription*, unsigned int, const struct v4l2_subscribed_event_ops*)'
  'int v4l2_event_unsubscribe(struct v4l2_fh*, const struct v4l2_event_subscription*)'
  'void v4l2_i2c_subdev_init(struct v4l2_subdev*, struct i2c_client*, const struct v4l2_subdev_ops*)'
  'int v4l2_m2m_ioctl_create_bufs(struct file*, void*, struct v4l2_create_buffers*)'
  'int v4l2_m2m_ioctl_expbuf(struct file*, void*, struct v4l2_exportbuffer*)'
  'int v4l2_src_change_event_subscribe(struct v4l2_fh*, const struct v4l2_event_subscription*)'

2 variable symbol(s) added
  'const struct vm_operations_struct drm_gem_cma_vm_ops'
  'const struct vb2_mem_ops vb2_dma_contig_memops'

Bug: 276863283
Change-Id: I609bdb9c65d7db391550fd85507d8c961d1034e7
Signed-off-by: Qinglin Li <qinglin.li@amlogic.com>
2023-04-13 18:50:28 +00:00
Vincent Donnefort
086eb3eacb ANDROID: CONFIG_PKVM_MODULE_PATH to /lib/modules/
Android places by default the modules into /lib/modules/ instead of using
the default path /lib/modules/<uname>.

Bug: 254835242
Change-Id: I49ed4be25c29302fc9b99a9f2ef5f1c84df3adc9
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
2023-04-13 11:27:05 +01:00
Vincent Donnefort
b147bc4b64 ANDROID: KVM: arm64: Add a fallback for pKVM module loading
Fallback to the default module path (/lib/modules/<uname>) if module
loading failed for the selected path in CONFIG_PKVM_MODULE_PATH. This
intends to follow the same mechanism as Android init.

Bug: 254835242
Change-Id: Ia7764d57fe71521e4a1fe6d2c85ba057790069a8
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
2023-04-13 11:19:33 +01:00
Vincent Donnefort
09ed60476a ANDROID: KVM: arm64: Add a custom module path for pKVM module loading
Currently, no module path will be given to modprobe when loading a pKVM
module, the module must then be found in /lib/modules/<uname>. Add
CONFIG_PKVM_MODULE_PATH to allow setting a different path from the
kernel config.

Bug: 254835242
Change-Id: I4f355518628b44ac03de2cee3d7a90e1ad5bf1e2
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
2023-04-13 11:19:33 +01:00
Yu Zhao
18580efd2f UPSTREAM: mm: multi-gen LRU: simplify arch_has_hw_pte_young() check
Scanning page tables when hardware does not set the accessed bit has
no real use cases.

Link: https://lkml.kernel.org/r/20221222041905.2431096-9-yuzhao@google.com
Change-Id: If6c1232a5d5f8f7e3ce3e076f7e865c18ee2a6c0
Signed-off-by: Yu Zhao <yuzhao@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Michael Larabel <Michael@MichaelLarabel.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit f386e93140)
Bug: 274865848
Signed-off-by: T.J. Mercier <tjmercier@google.com>
2023-04-12 16:01:20 +00:00
Yu Zhao
4c26a5c7ca UPSTREAM: mm: support POSIX_FADV_NOREUSE
This patch adds POSIX_FADV_NOREUSE to vma_has_recency() so that the LRU
algorithm can ignore access to mapped files marked by this flag.

The advantages of POSIX_FADV_NOREUSE are:
1. Unlike MADV_SEQUENTIAL and MADV_RANDOM, it does not alter the
   default readahead behavior.
2. Unlike MADV_SEQUENTIAL and MADV_RANDOM, it does not split VMAs and
   therefore does not take mmap_lock.
3. Unlike MADV_COLD, setting it has a negligible cost, regardless of
   how many pages it affects.

Its limitations are:
1. Like POSIX_FADV_RANDOM and POSIX_FADV_SEQUENTIAL, it currently does
   not support range. IOW, its scope is the entire file.
2. It currently does not ignore access through file descriptors.
   Specifically, for the active/inactive LRU, given a file page shared
   by two users and one of them having set POSIX_FADV_NOREUSE on the
   file, this page will be activated upon the second user accessing
   it. This corner case can be covered by checking POSIX_FADV_NOREUSE
   before calling folio_mark_accessed() on the read path. But it is
   considered not worth the effort.

There have been a few attempts to support POSIX_FADV_NOREUSE, e.g., [1].
This time the goal is to fill a niche: a few desktop applications, e.g.,
large file transferring and video encoding/decoding, want fast file
streaming with mmap() rather than direct IO.  Among those applications, an
SVT-AV1 regression was reported when running with MGLRU [2].  The
following test can reproduce that regression.

  kb=$(awk '/MemTotal/ { print $2 }' /proc/meminfo)
  kb=$((kb - 8*1024*1024))

  modprobe brd rd_nr=1 rd_size=$kb
  dd if=/dev/zero of=/dev/ram0 bs=1M

  mkfs.ext4 /dev/ram0
  mount /dev/ram0 /mnt/
  swapoff -a

  fallocate -l 8G /mnt/swapfile
  mkswap /mnt/swapfile
  swapon /mnt/swapfile

  wget http://ultravideo.cs.tut.fi/video/Bosphorus_3840x2160_120fps_420_8bit_YUV_Y4M.7z
  7z e -o/mnt/ Bosphorus_3840x2160_120fps_420_8bit_YUV_Y4M.7z
  SvtAv1EncApp --preset 12 -w 3840 -h 2160 \
               -i /mnt/Bosphorus_3840x2160.y4m

For MGLRU, the following change showed a [9-11]% increase in FPS,
which makes it on par with the active/inactive LRU.

  patch Source/App/EncApp/EbAppMain.c <<EOF
  31a32
  > #include <fcntl.h>
  35d35
  < #include <fcntl.h> /* _O_BINARY */
  117a118
  >             posix_fadvise(config->mmap.fd, 0, 0, POSIX_FADV_NOREUSE);
  EOF

[1] https://lore.kernel.org/r/1308923350-7932-1-git-send-email-andrea@betterlinux.com/
[2] https://openbenchmarking.org/result/2209259-PTS-MGLRU8GB57

Link: https://lkml.kernel.org/r/20221230215252.2628425-2-yuzhao@google.com
Change-Id: Iee2a7df5ccd86162089e007e32f9fa9b2b9f198b
Signed-off-by: Yu Zhao <yuzhao@google.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andrea Righi <andrea.righi@canonical.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michael Larabel <Michael@MichaelLarabel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 17e810229c)
Bug: 274865848
Signed-off-by: T.J. Mercier <tjmercier@google.com>
2023-04-12 16:01:20 +00:00
Yu Zhao
3b9ab09cf5 BACKPORT: mm: add vma_has_recency()
Add vma_has_recency() to indicate whether a VMA may exhibit temporal
locality that the LRU algorithm relies on.

This function returns false for VMAs marked by VM_SEQ_READ or
VM_RAND_READ.  While the former flag indicates linear access, i.e., a
special case of spatial locality, both flags indicate a lack of temporal
locality, i.e., the reuse of an area within a relatively small duration.

"Recency" is chosen over "locality" to avoid confusion between temporal
and spatial localities.

Before this patch, the active/inactive LRU only ignored the accessed bit
from VMAs marked by VM_SEQ_READ.  After this patch, the active/inactive
LRU and MGLRU share the same logic: they both ignore the accessed bit if
vma_has_recency() returns false.

For the active/inactive LRU, the following fio test showed a [6, 8]%
increase in IOPS when randomly accessing mapped files under memory
pressure.

  kb=$(awk '/MemTotal/ { print $2 }' /proc/meminfo)
  kb=$((kb - 8*1024*1024))

  modprobe brd rd_nr=1 rd_size=$kb
  dd if=/dev/zero of=/dev/ram0 bs=1M

  mkfs.ext4 /dev/ram0
  mount /dev/ram0 /mnt/
  swapoff -a

  fio --name=test --directory=/mnt/ --ioengine=mmap --numjobs=8 \
      --size=8G --rw=randrw --time_based --runtime=10m \
      --group_reporting

The discussion that led to this patch is here [1].  Additional test
results are available in that thread.

[1] https://lore.kernel.org/r/Y31s%2FK8T85jh05wH@google.com/

Link: https://lkml.kernel.org/r/20221230215252.2628425-1-yuzhao@google.com
Change-Id: I3e0dfa1ca2a3c14fb0239b8f612c697e1d8d6a64
Signed-off-by: Yu Zhao <yuzhao@google.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andrea Righi <andrea.righi@canonical.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michael Larabel <Michael@MichaelLarabel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 8788f67814)
[TJ: #include <linux/mm_inline.h>, folio -> page renames]
Bug: 274865848
Signed-off-by: T.J. Mercier <tjmercier@google.com>
2023-04-12 16:01:20 +00:00
Juergen Gross
23811798a3 UPSTREAM: mm: introduce arch_has_hw_nonleaf_pmd_young()
When running as a Xen PV guests commit eed9a328aa ("mm: x86: add
CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG") can cause a protection violation in
pmdp_test_and_clear_young():

 BUG: unable to handle page fault for address: ffff8880083374d0
 #PF: supervisor write access in kernel mode
 #PF: error_code(0x0003) - permissions violation
 PGD 3026067 P4D 3026067 PUD 3027067 PMD 7fee5067 PTE 8010000008337065
 Oops: 0003 [#1] PREEMPT SMP NOPTI
 CPU: 7 PID: 158 Comm: kswapd0 Not tainted 6.1.0-rc5-20221118-doflr+ #1
 RIP: e030:pmdp_test_and_clear_young+0x25/0x40

This happens because the Xen hypervisor can't emulate direct writes to
page table entries other than PTEs.

This can easily be fixed by introducing arch_has_hw_nonleaf_pmd_young()
similar to arch_has_hw_pte_young() and test that instead of
CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG.

Link: https://lkml.kernel.org/r/20221123064510.16225-1-jgross@suse.com
Fixes: eed9a328aa ("mm: x86: add CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG")
Change-Id: Ib88d54891c619feccc7eb40a14d5ba6e349912d6
Signed-off-by: Juergen Gross <jgross@suse.com>
Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Acked-by: Yu Zhao <yuzhao@google.com>
Tested-by: Sander Eikelenboom <linux@eikelenboom.it>
Acked-by: David Hildenbrand <david@redhat.com>	[core changes]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 4aaf269c76)
Bug: 274865848
Signed-off-by: T.J. Mercier <tjmercier@google.com>
2023-04-12 16:01:20 +00:00
Juergen Gross
7f400d66ad BACKPORT: mm: add dummy pmd_young() for architectures not having it
In order to avoid #ifdeffery add a dummy pmd_young() implementation as a
fallback.  This is required for the later patch "mm: introduce
arch_has_hw_nonleaf_pmd_young()".

Link: https://lkml.kernel.org/r/fd3ac3cd-7349-6bbd-890a-71a9454ca0b3@suse.com
Change-Id: I3e62702e3eed4b2adb2b49c2bce7aecc349a337c
Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Yu Zhao <yuzhao@google.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 6617da8fb5)
[TJ: loongarch is not present]
Bug: 274865848
Signed-off-by: T.J. Mercier <tjmercier@google.com>
2023-04-12 16:01:20 +00:00
Carlos Llamas
f9e7e861b5 ANDROID: 4/12/2023 KMI update
Set KMI_GENERATION=4 for 4/12 KMI update

function symbol 'struct block_device* I_BDEV(struct inode*)' changed
  CRC changed from 0x6d0d2bcc to 0xf2df037e

function symbol 'void* PDE_DATA(const struct inode*)' changed
  CRC changed from 0xbb8786db to 0x3c36f860

function symbol 'void __ClearPageMovable(struct page*)' changed
  CRC changed from 0x6cd6821a to 0xafefd4e

... 2828 omitted; 2831 symbols have only CRC changes

type 'struct dentry_operations' changed
  member changed from 'void(* d_canonical_path)(const struct path*, struct path*)' to 'int(* d_canonical_path)(const struct path*, struct path*)'
    type changed from 'void(*)(const struct path*, struct path*)' to 'int(*)(const struct path*, struct path*)'
      pointed-to type changed from 'void(const struct path*, struct path*)' to 'int(const struct path*, struct path*)'
        return type changed from 'void' to 'int'

Bug: 277759776
Change-Id: I5f3ed46e6804dcf0db745d4e6dc7c3a317f64648
Signed-off-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2023-04-11 22:13:26 +00:00
Paul Lawrence
3f5c9f5cf5 ANDROID: fuse: Support errors from fuse daemon in canonical path
Previously errors from the daemon in FUSE_CANONICAL_PATH were simply
ignored. In order to block inotifys, it is useful to be able to return
errors from this opcode.

Bug: 238619640
Test: inotify no longer works on /storage/emulated/0/Android/media but
      does on child folders
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Icb15c090c6286c174338471a787712f8388de316
2023-04-11 20:43:00 +00:00
Jim Wylder
aacdf4e7ea ANDROID: Update the ABI symbol list
Add the following symbols:
  - gpiod_get_direction
  - irq_domain_simple_ops
  - regmap_get_max_register

Bug: 275412100
Change-Id: I25479fa4134130698f5e52274c66f73861486095
Signed-off-by: Jim Wylder <jwylder@google.com>
2023-04-11 19:02:03 +00:00
Will Deacon
18c78ecd82 ANDROID: arm64: Implement hypervisor workaround for SoCs with DMA beyond the PoC
SoCs featuring peripherals that can issue non-coherent DMA traffic
beyond the point of coherency (PoC) present multiple challenges for the
DMA-API implementation in Linux. Many of these challenges can be
overcome by suitable configuration of the interconnect, however the
presence of a cacheable alias for non-cacheable buffers can still lead
to coherence issues arising when stale clean lines are back-snooped from
the cache hierarchy to satisfy a non-cacheable transaction at the PoC.

Removing all cacheable aliases on a case-by-cases basis is both
error-prone and expensive. Instead, leverage the stage-2 identity
mapping installed by pKVM to enforce consistent cacheability for all
stage-1 aliases.

Bug: 240786634
Change-Id: I78b0aa51fe3e23811bbd25481173086aa957c4bf
Signed-off-by: Will Deacon <willdeacon@google.com>
2023-04-11 18:13:47 +00:00
Varad Gokhale
148ab83891 ANDROID: Update the ABI symbol list
Adding the following symbols:
  - i3c_generic_ibi_alloc_pool
  - i3c_generic_ibi_free_pool
  - i3c_generic_ibi_get_free_slot
  - i3c_generic_ibi_recycle_slot
  - i3c_master_add_i3c_dev_locked
  - i3c_master_defslvs_locked
  - i3c_master_disec_locked
  - i3c_master_do_daa
  - i3c_master_enec_locked
  - i3c_master_entdaa_locked
  - i3c_master_get_free_addr
  - i3c_master_queue_ibi
  - i3c_master_register
  - i3c_master_set_info
  - i3c_master_unregister

Bug: 277319736

Change-Id: I2908c0f02bc7deee742bd0f992fd181238d0ef06
Signed-off-by: Varad Gokhale <gokv@google.com>
2023-04-11 17:21:46 +00:00