Commit Graph

1148698 Commits

Author SHA1 Message Date
Zhipeng Wang
ca2184b06c ANDROID: ABI: Add net related symbols for imx
39 function symbol(s) added
  'int __phy_modify(struct phy_device*, u32, u16, u16)'
  'int genphy_c37_config_aneg(struct phy_device*)'
  'int genphy_c37_read_status(struct phy_device*)'
  'int genphy_c45_fast_retrain(struct phy_device*, bool)'
  'int genphy_c45_pma_setup_forced(struct phy_device*)'
  'irqreturn_t genphy_handle_interrupt_no_ack(struct phy_device*)'
  'int genphy_setup_forced(struct phy_device*)'
  'int iw_handler_get_spy(struct net_device*, struct iw_request_info*, union iwreq_data*, char*)'
  'int iw_handler_get_thrspy(struct net_device*, struct iw_request_info*, union iwreq_data*, char*)'
  'int iw_handler_set_spy(struct net_device*, struct iw_request_info*, union iwreq_data*, char*)'
  'int iw_handler_set_thrspy(struct net_device*, struct iw_request_info*, union iwreq_data*, char*)'
  '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 mdio_device_reset(struct mdio_device*, int)'
  'int mmc_hw_reset(struct mmc_card*)'
  'void mmc_set_data_timeout(struct mmc_data*, const struct mmc_card*)'
  'void mmc_wait_for_req(struct mmc_host*, struct mmc_request*)'
  'pci_power_t pci_choose_state(struct pci_dev*, pm_message_t)'
  'void pci_disable_msix(struct pci_dev*)'
  'int pci_enable_msix_range(struct pci_dev*, struct msix_entry*, int, int)'
  'int pci_reset_function(struct pci_dev*)'
  'int phy_modify_changed(struct phy_device*, u32, u16, u16)'
  'int phy_modify_mmd_changed(struct phy_device*, int, u32, u16, u16)'
  'int phy_modify_paged(struct phy_device*, int, u32, u16, u16)'
  'int phy_modify_paged_changed(struct phy_device*, int, u32, u16, u16)'
  'int phy_read_paged(struct phy_device*, int, u32)'
  'void phy_resolve_aneg_pause(struct phy_device*)'
  'int phy_restore_page(struct phy_device*, int, int)'
  'int phy_select_page(struct phy_device*, int)'
  'void phy_sfp_attach(void*, struct sfp_bus*)'
  'void phy_sfp_detach(void*, struct sfp_bus*)'
  'int phy_sfp_probe(struct phy_device*, const struct sfp_upstream_ops*)'
  'int phy_write_paged(struct phy_device*, int, u32, u16)'
  'int regulator_list_voltage_table(struct regulator_dev*, unsigned int)'
  '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*)'
  'int sdio_set_host_pm_flags(struct sdio_func*, mmc_pm_flag_t)'

2 variable symbol(s) added
  'const struct kernel_param_ops param_ops_ushort'
  'unsigned long phy_basic_t1_features[2]'

Bug: 277791334
Change-Id: I2972d36c836b34f46af5bed46934043ff05ca726
Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>
2023-04-24 10:43:55 +00:00
Zhipeng Wang
d28b7797ed ANDROID: ABI: Add sound/soc/ related symbols for imx
50 function symbol(s) added
  'struct device* dev_pm_domain_attach_by_id(struct device*, unsigned int)'
  'char* devm_kvasprintf(struct device*, gfp_t, const char*, va_list)'
  'int devm_snd_dmaengine_pcm_register(struct device*, const struct snd_dmaengine_pcm_config*, unsigned int)'
  'bool dpcm_end_walk_at_be(struct snd_soc_dapm_widget*, enum snd_soc_dapm_direction)'
  'int regmap_add_irq_chip(struct regmap*, int, int, int, const struct regmap_irq_chip*, struct regmap_irq_chip_data**)'
  'void regmap_del_irq_chip(int, struct regmap_irq_chip_data*)'
  'int regmap_reinit_cache(struct regmap*, const struct regmap_config*)'
  'void regulator_bulk_free(int, struct regulator_bulk_data*)'
  'int snd_compr_malloc_pages(struct snd_compr_stream*, size_t)'
  'int snd_ctl_boolean_stereo_info(struct snd_kcontrol*, struct snd_ctl_elem_info*)'
  'void snd_ctl_notify_one(struct snd_card*, unsigned int, struct snd_kcontrol*, unsigned int)'
  'void snd_dma_buffer_sync(struct snd_dma_buffer*, enum snd_dma_sync_mode)'
  'int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream*, struct snd_pcm_hw_params*, struct dma_slave_config*)'
  'int snd_dmaengine_pcm_refine_runtime_hwparams(struct snd_pcm_substream*, struct snd_dmaengine_dai_dma_data*, struct snd_pcm_hardware*, struct dma_chan*)'
  'void snd_dmaengine_pcm_set_config_from_dai_data(const struct snd_pcm_substream*, const struct snd_dmaengine_dai_dma_data*, struct dma_slave_config*)'
  'int snd_hwparams_to_dma_slave_config(const struct snd_pcm_substream*, const struct snd_pcm_hw_params*, struct dma_slave_config*)'
  'int snd_interval_ranges(struct snd_interval*, unsigned int, const struct snd_interval*, unsigned int)'
  'int snd_pcm_format_big_endian(snd_pcm_format_t)'
  'int snd_pcm_format_linear(snd_pcm_format_t)'
  'int snd_pcm_format_unsigned(snd_pcm_format_t)'
  'int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime*, unsigned int, snd_pcm_hw_param_t, const struct snd_pcm_hw_constraint_ratnums*)'
  'int snd_pcm_hw_rule_add(struct snd_pcm_runtime*, unsigned int, int, snd_pcm_hw_rule_func_t, void*, int, ...)'
  'dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer*, size_t)'
  'int snd_soc_bytes_get(struct snd_kcontrol*, struct snd_ctl_elem_value*)'
  'int snd_soc_bytes_info(struct snd_kcontrol*, struct snd_ctl_elem_info*)'
  'int snd_soc_bytes_put(struct snd_kcontrol*, struct snd_ctl_elem_value*)'
  'int snd_soc_dai_active(struct snd_soc_dai*)'
  'int snd_soc_dai_set_bclk_ratio(struct snd_soc_dai*, unsigned int)'
  'unsigned int snd_soc_daifmt_clock_provider_flipped(unsigned int)'
  'void snd_soc_dapm_dai_free_widgets(struct snd_soc_dapm_widget_list**)'
  'int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai*, int, struct snd_soc_dapm_widget_list**, bool(*)(struct snd_soc_dapm_widget*, enum snd_soc_dapm_direction))'
  'int snd_soc_dapm_del_routes(struct snd_soc_dapm_context*, const struct snd_soc_dapm_route*, int)'
  'int snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context*, const char*)'
  'int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context*, const char*)'
  'int snd_soc_dapm_force_bias_level(struct snd_soc_dapm_context*, enum snd_soc_bias_level)'
  'int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context*, const char*)'
  'int snd_soc_dapm_sync_unlocked(struct snd_soc_dapm_context*)'
  'struct snd_pcm_substream* snd_soc_dpcm_get_substream(struct snd_soc_pcm_runtime*, int)'
  'int snd_soc_get_dai_name(const struct of_phandle_args*, const char**)'
  'int snd_soc_get_volsw_sx(struct snd_kcontrol*, struct snd_ctl_elem_value*)'
  'int snd_soc_info_xr_sx(struct snd_kcontrol*, struct snd_ctl_elem_info*)'
  'int snd_soc_jack_add_gpios(struct snd_soc_jack*, int, struct snd_soc_jack_gpio*)'
  'void snd_soc_jack_notifier_register(struct snd_soc_jack*, struct notifier_block*)'
  'int snd_soc_limit_volume(struct snd_soc_card*, const char*, int)'
  'struct snd_soc_component* snd_soc_lookup_component_nolocked(struct device*, const char*)'
  'void snd_soc_of_parse_node_prefix(struct device_node*, struct snd_soc_codec_conf*, struct device_node*, const char*)'
  'int snd_soc_of_parse_tdm_slot(struct device_node*, unsigned int*, unsigned int*, unsigned int*, unsigned int*)'
  'int snd_soc_params_to_frame_size(struct snd_pcm_hw_params*)'
  'int snd_soc_runtime_calc_hw(struct snd_soc_pcm_runtime*, struct snd_pcm_hardware*, int)'
  'struct regmap* syscon_regmap_lookup_by_compatible(const char*)'

1 variable symbol(s) added
  'const guid_t guid_null'

Bug: 277791334
Change-Id: Ibc7bc46e46be4818fb7f6306728ba5ada686c42b
Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>
2023-04-24 10:43:55 +00:00
Sebastian Ene
5fdf78bd51 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>
Signed-off-by: Will Deacon <willdeacon@google.com>
2023-04-24 07:21:22 +00:00
William McVicker
3e97d25f51 Revert "ANDROID: Add utf8_data_table for case-folding support"
Revert submission 2540910-utf8-case-folding

Reason for revert: This causes issues on android14-5.15 which doesn't
have the utf8_data_table symbol. Let's just revert this topic and
leave it up to vendors to add utf8_data_table to their symbol lists.

Reverted changes: /q/submissionid:2540910-utf8-case-folding

Bug: 278561372
Signed-off-by: Will McVicker <willmcvicker@google.com>
Change-Id: I20712935e7880159cf734fb9e3667ce235a8fc78
2023-04-21 23:11:46 +00:00
Alistair Delva
d7595b4db4 ANDROID: Add filp_open_block() for zram
We currently plan to disallow use of filp_open() from drivers in GKI,
however the ZRAM driver still needs it. Add a new GKI-only variant of
filp_open() which only permits a block device to be opened, which can
be exported instead. This keeps ZRAM working but cuts down on drivers
that attempt to open and write files in kernel mode.

Bug: 179220339
Bug: 205141088
Change-Id: Id696b4aaf204b0499ce0a1b6416648670236e570
Signed-off-by: Alistair Delva <adelva@google.com>
(cherry picked from commit 62d9cb66f6)
2023-04-21 20:05:56 +00:00
litao
3183446493 ANDROID: GKI: add init symbol list file for vivo
6 function symbol(s) added
  'struct buffer_head* __getblk_gfp(struct block_device*, sector_t, unsigned int, gfp_t)'
  'void __lock_buffer(struct buffer_head*)'
  'void __wait_on_buffer(struct buffer_head*)'
  'void end_buffer_read_sync(struct buffer_head*, int)'
  'void submit_bh(blk_opf_t, struct buffer_head*)'
  'void unlock_buffer(struct buffer_head*)'

Bug: 278801617
Change-Id: I3d850f7de9c7acc1c3dc88e65ab811ee16f56a9d
Signed-off-by: litao <tao.li@vivo.corp-partner.google.com>
2023-04-21 15:05:10 +00:00
AngeloGioacchino Del Regno
cecdba9d60 FROMGIT: clocksource/drivers/timer-mediatek: Split out CPUXGPT timers
On MediaTek platforms, CPUXGPT is the source for the AArch64 System
Timer, read through CNTVCT_EL0.

The handling for starting this timer ASAP was introduced in commit
327e93cf9a ("clocksource/drivers/timer-mediatek: Implement CPUXGPT timers")
which description also contains an important full explanation of the
reasons why this driver is necessary and cannot be a module.

In preparation for an eventual conversion of timer-mediatek to a
platform_driver that would be possibly built as a module, split out
the CPUXGPT timers driver to a new timer-mediatek-cpux.c driver.

This commit brings no functional changes.

Bug: 161675989
(cherry picked from commit ca394a540eb03f78c82580c860eb7c8659ab5a22
https://git.linaro.org/people/daniel.lezcano/linux.git
timers/drivers/next)
Change-Id: If9fab60a448ed022673ed96a57f26eadaa440c3d
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Walter Chang <walter.chang@mediatek.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20230309103913.116775-1-angelogioacchino.delregno@collabora.com
2023-04-21 14:54:53 +00:00
Vijayanand Jitta
701e5a06a1 ANDROID: dma-buf: Export is_dma_buf_file
Export is_dma_buf_file function which will be used
by several vendors to get dmabuf info.

Bug: 267248830
Bug: 264474028
Change-Id: Ic8f7dd4f0a620839ab19f52841e9a6541515133c
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
Signed-off-by: T.J. Mercier <tjmercier@google.com>
(cherry picked from commit 409aa4d675)
2023-04-20 20:45:48 +00:00
Will McVicker
6011492f62 ANDROID: ABI: Update the tcpci symbols for pixel
5 function symbol(s) added
  'int __traceiter_android_rvh_typec_tcpci_get_vbus(void*, struct tcpci*, struct tcpci_data*, int*, int*)'
  'int __traceiter_android_vh_typec_store_partner_src_caps(void*, unsigned int*, u32(*)[0])'
  'int __traceiter_android_vh_typec_tcpci_override_toggling(void*, struct tcpci*, struct tcpci_data*, int*)'
  'int __traceiter_android_vh_typec_tcpm_get_timer(void*, const char*, enum typec_timer, unsigned int*)'
  'int __traceiter_android_vh_typec_tcpm_log(void*, const char*, bool*)'

5 variable symbol(s) added
  'struct tracepoint __tracepoint_android_rvh_typec_tcpci_get_vbus'
  'struct tracepoint __tracepoint_android_vh_typec_store_partner_src_caps'
  'struct tracepoint __tracepoint_android_vh_typec_tcpci_override_toggling'
  'struct tracepoint __tracepoint_android_vh_typec_tcpm_get_timer'
  'struct tracepoint __tracepoint_android_vh_typec_tcpm_log'

Bug: 277396090
Change-Id: I3680d7c45adb32613fdc18cc9a8936a90f339148
Signed-off-by: Will McVicker <willmcvicker@google.com>
2023-04-19 20:25:38 +00:00
Venkata Rao Kakani
10713d70a8 ANDROID: ABI: Add drm_atomic_bridge_chain_disable and
drm_atomic_bridge_chain_enable in QCOM symbol list

following symbols are added to symbol list

drm_atomic_bridge_chain_disable
drm_atomic_bridge_chain_enable

function symbols added

'void drm_atomic_bridge_chain_disable(struct drm_bridge *bridge,struct drm_atomic_state *old_state)'
'void drm_atomic_bridge_chain_enable(struct drm_bridge *bridge,struct drm_atomic_state *old_state)'

Bug: 278512378

Change-Id: I46f6489b495f51f628d94120b3c1859ffafe5583
Signed-off-by: Venkata Rao Kakani <quic_vkakani@quicinc.com>
2023-04-19 15:48:45 +00:00
Will Deacon
4e45cae5e8 ANDROID: firmware/psci: Remove PSCI_1_1_FN64_MEM_PROTECT definition
The PSCI MEM_PROTECT function does not have a 64-bit function identifier,
so remove the unused definition which was erroneously left intact when
applying fe3157f328 ("ANDROID: KVM: arm64: Use 32-bit function ID for
PSCI MEM_PROTECT call").

Bug: 260316363
Cc: Quentin Perret <qperret@google.com>
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Ica948b202bf01175b6ab0961307899d269649880
2023-04-19 12:58:27 +00:00
Junki Min
d88ab885ee ANDROID: Add initial symbol list for Exynos SoC
This commit is for adding initial symbol list form Exynos SoC.
"abi_gki_aarch64_exynos" is generated from minimal configs for build.

2 function symbol(s) added
  'int devm_hwrng_register(struct device*, struct hwrng*)'
  'int irq_force_affinity(unsigned int, const struct cpumask*)'

Bug: 278466304
Change-Id: I6a700eda5639bf46f694524fefe91b759583704d
Signed-off-by: Junki Min <joonki.min@samsung.com>
2023-04-19 15:15:06 +09:00
Kuan-Ying Lee
9464c5644c ANDROID: Update symbol list for mtk
Add below vendor hook symbol.
  __traceiter_android_rvh_commit_creds
  __traceiter_android_rvh_exit_creds
  __traceiter_android_rvh_override_creds
  __traceiter_android_rvh_revert_creds
  __traceiter_android_rvh_selinux_is_initialized
  __traceiter_android_rvh_set_module_permit_before_init
  __traceiter_android_rvh_set_module_permit_after_init
  __traceiter_android_rvh_set_module_core_rw_nx
  __traceiter_android_rvh_set_module_init_rw_nx
  __traceiter_android_vh_check_mmap_file
  __traceiter_android_vh_check_file_open
  __traceiter_android_vh_check_bpf_syscall
  __tracepoint_android_rvh_commit_creds
  __tracepoint_android_rvh_exit_creds
  __tracepoint_android_rvh_override_creds
  __tracepoint_android_rvh_revert_creds
  __tracepoint_android_rvh_selinux_is_initialized
  __tracepoint_android_rvh_set_module_permit_before_init
  __tracepoint_android_rvh_set_module_permit_after_init
  __tracepoint_android_rvh_set_module_core_rw_nx
  __tracepoint_android_rvh_set_module_init_rw_nx
  __tracepoint_android_vh_check_mmap_file
  __tracepoint_android_vh_check_file_open
  __tracepoint_android_vh_check_bpf_syscall

Bug: 248994334

Change-Id: I95ac15d30aa04c5aca7eaf52392264ee94ed9653
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
2023-04-18 19:28:00 +00:00
Kuan-Ying Lee
b28620e7db ANDROID: module: Add vendor hooks
Add vendor hook for module init, so we can get memory type and
use it to do memory type check for architecture
dependent page table setting. To make sure the architecture
dependent tables are created correctly, we need to know when
module parts are initialized and their attributes.

For releasing modules, corresponding tables and attributes should be
destroyed and restored.

These hooks may be invoked in non-atomic context, so it's
necessary to use restricted ones.

Bug: 248994334
Change-Id: Ie9f415c36bca1fb98e021522b627e562d27cdef4
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
2023-04-18 19:28:00 +00:00
Kuan-Ying Lee
05b36413b6 ANDROID: kernel: Add restricted vendor hook in creds
Add restricted vendor hook for creds, so we get the creds
information to monitor cred lifetime. During the lifetime,
we store the creds information in a standalone protected
memory and keep track of integrity.

These hooks may be invoked in non-atomic context, so it's
necessary to use restricted ones.

Bug: 248994334
Change-Id: I57fbb759452302fa1ba1e720c76bfe671eab96b5
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
2023-04-18 19:28:00 +00:00
Greg Kroah-Hartman
4da8c1036e 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 18:11:06 +00:00
Will McVicker
7e35917775 ANDROID: Add utf8_data_table for case-folding support
The upstream commit 2b3d047870 ("unicode: Add utf8-data module") moved
the unicode nomalization functions into a module so that it could be
selectively included in the kernel based of support for case-folding.
In doing so, utf8-core.c uses symbol_request() to reference the
utf8_data_table symbol. Since GKI trims unused symbols, include
this symbol to our symbol list so that it doesn't get trimmed.

Link: https://lore.kernel.org/all/ZDnbW1qYmBLycefL@google.com/
Bug: 278561372
Change-Id: If6347087d8dffae63bb4af5d72b74f703f09b820
Signed-off-by: Will McVicker <willmcvicker@google.com>
2023-04-17 20:50:58 +00:00
Badhri Jagan Sridharan
8187bf6782 UPSTREAM: usb: typec: altmodes/displayport: Add hpd sysfs attribute
Exporsing HotPlugDetect(HPD) helps userspace to infer HPD
state as defined by VESA DisplayPort Alt Mode on USB Type-C Standard.
This allows userspace to notify users for self help, for instance,
to hint user that the display port cable is probably detached (or)
the display port sink (viz., monitors ect.,) is un-powered.
Also helps to debug issues reported from field.

This change adds an additional attribute "hpd" to the existing
"displayport" attributes.

VESA DisplayPort Alt Mode on USB Type-C Standard defines how
HotPlugDetect(HPD) shall be supported on the USB-C connector
when operating in DisplayPort Alt Mode. This is a read only
node which reflects the current state of HPD.

Valid values:
 - 1 when HPD’s logical state is high (HPD_High)
 - 0 when HPD’s logical state is low (HPD_Low)

Bug: 253534975
Bug: 260915739
Change-Id: Id72e8ef6ede84038479649c2b753acdac547dea1
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/lkml/20221211193755.1392128-1-badhri@google.com/T/
(cherry picked from commit 001b0c780e)
2023-04-14 23:21:17 +00:00
Badhri Jagan Sridharan
bbc22694d4 ANDROID: vendor_hooks: Add vendor hook for tcpm logs
Context: https://lore.kernel.org/lkml/CAPTae5LbWVc4Bdiwe69cwwxEGfSYvRv=419dUGR1u8n-WUkYAA@mail.gmail.com/t/

Logs in /sys/kernel/debug/usb/tcpm* are key to debug issues related to
USB charging or data. However, tcpm logbuffer logs do not wraparound once full. Whereas we want it to wrap around so that we capture relevant info in the bugreport when the user collects one. There is sentiment in upstream to get rid of the logbuffer altogether and move to tracing. But trace events are not default enabled in Android, so that implies, even if user can somehow enable the trace event, user would have repro the issue and collect the bugreport. That would cause inconvenience to the end user. The vendor hooks is needed till upstream either allows wrapping around logs (or) Android has a generic way to default enable trace events which can be captured in bugreport.

bypass_log is set to true by the handler if logging into logbuffer is
not needed.

Bug: 189792358
Bug: 271294543
Change-Id: Icacfed2264b6c49b8e803c62f8bd820a146c169a
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
(cherry picked from commit bcfe28b62f)
2023-04-14 19:25:17 +00:00
Kyle Tso
b499bac439 ANDROID: usb: typec: tcpm: Add vendor hook to modify port src caps
Add a vendor hook to modify the port Source Capabilities. If the caps
are changed and the port state is feasible, start a Power Negotiation
AMS to update the current contract to the new one.

Bug: 201006190
Bug: 206108037
Bug: 271294543
Signed-off-by: Kyle Tso <kyletso@google.com>
Change-Id: I8b524242353781cb39b3ba85c6a75bd5a204ebcf
(cherry picked from commit 00e3210a2f)
2023-04-14 17:11:19 +00:00
Kyle Tso
c8314fcb76 ANDROID: usb: typec: tcpm: Add vendor hook to store partner source capabilities
Add a hook after receiving the source capabilities from the partner
port. Pass the address of the source capability array so that vendor
code is able to access them.

OOT bug:
Bug: 181629276
Bug: 169215197
Bug: 271294543
Signed-off-by: Kyle Tso <kyletso@google.com>
Change-Id: I11c4a7919c248690e63c3bfbebfa6b8d711175a6
(cherry picked from commit af7214914a)
2023-04-14 17:11:19 +00:00
Badhri Jagan Sridharan
081a88febb ANDROID: usb: typec: tcpm: vendor hook for timer adjustments
linux/usb/pd.h has a bunch of timers for which the Type-C spec defines
a range of values. These values have to be tuned based on the latency
observed in a specific architecture. However, linux opensource sets
them to a specific value without providing a mechanism to set board
specific values. While a generic way is figured out, a vendor hook
is needed in the interim.

For instance, tCCDebounce can have a value between 100msec - 200msec.

Squashed <d98a1df78740eedcc4d3d4c8d44b39b73f81df2d>
"ANDROID: usb: typec: tcpm: Fixup the wait time for SNK_DISCOVERY"

OOT_bug:
Bug: 184308605
Bug: 168245874
Bug: 173252019
Bug: 271294543
Change-Id: I278b34654a7e48990b6ebe25fbe17e3aa4165098
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
(cherry picked from commit f694171a83)
2023-04-14 17:11:19 +00:00
Badhri Jagan Sridharan
eeffe02c96 ANDROID: usb: typec: tcpci: Add vendor hook to mask vbus present
This hook is for addressing hardware anomalies where
TCPC_POWER_STATUS_VBUS_PRES bit can return 0 even before falling
below sSinkDisconnect threshold.

Handler has to set bypass to override the value that would otherwise
be returned by this function.
Handler can set vbus or clear vbus to indicate vbus present or absent

Squashed <89f633a9f41259a168473917674dd5cb1bfb991d>
"ANDROID: usb: typec: tcpci: Migrate restricted vendor hook"

OOT_bug:
Bug: 183149028
Bug: 168245874
Bug: 173252019
Bug: 271294543
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: I2ca994d49b37bf8600c5913b892fde9acd0dc896
2023-04-14 17:11:19 +00:00
Badhri Jagan Sridharan
b6325c997c ANDROID: usb: typec: tcpci: Add vendor hooks for tcpci interface
Needed for controlling BC1.2 detection logic specific to the chip architecture.
Also, needed to implement additional logic to make debug accessorires
specifically designed for Pixel work. These are outside the purview of Type-C spec.

OOT_bug:
Bug: 169213252
Bug: 168245874
Bug: 173252019
Bug: 271294543
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: I36fe75dddd8cd4e2054db01ed4fee7ea08dd8702
(cherry picked from commit 08879ea0d6)
2023-04-14 17:11:19 +00:00
Asutosh Das
9a6275b5a6 UPSTREAM: scsi: ufs: mcq: Use active_reqs to check busy in clock scaling
Multi Circular Queue doesn't use outstanding_reqs. However, the UFS clock
scaling functions use outstanding_reqs to determine if there are requests
pending. When MCQ is enabled, this check always returns false.

Hence use active_reqs to check if there are pending requests.

Fixes: eacb139b77 ("scsi: ufs: core: mcq: Enable multi-circular queue")
Signed-off-by: Asutosh Das <quic_asutoshd@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://lore.kernel.org/r/a24e0d646aac70eae0fc5e05fac0c58bb7e6e680.1678317160.git.quic_asutoshd@quicinc.com
(cherry picked from commit c6001025d5)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 277690227
Change-Id: I77897af6f8d6d1c86837c67050165af5a00ae202
Signed-off-by: Ziqi Chen <quic_ziqichen@quicinc.com>
2023-04-14 16:42:39 +00:00
Benedict Wong
a705bf779b 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
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>
Change-Id: Ic32831cb00151d0de2e465f18ec37d5f7b680e54
(cherry picked from commit 970e02667c)
2023-04-14 12:37:23 +00:00
Kelvin Zhang
f2aef35478 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>
Change-Id: Ife350047225fb5d825ec92c5d087313c70965acf
2023-04-14 12:37:23 +00:00
Benedict Wong
0ddcb394f5 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>
Change-Id: I20c5abf39512d7f6cf438c0921a78a84e281b4e9
(cherry picked from commit b5bf2997c3)
2023-04-14 12:37:23 +00:00
Badhri Jagan Sridharan
b294edd3c1 ANDROID: Update the ABI symbol list for 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-13 21:20:30 +00:00
Badhri Jagan Sridharan
faee7b64df ANDROID: Update the ABI symbol list for 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:20:20 +00:00
Venkata Rao Kakani
ac53cab64c ANDROID: ABI: Add __irq_set_handler and irq_set_handler_data in QCOM symbol list
following symbols are updated to QCOM abi symbol list.
__irq_set_handler
irq_set_handler_data

2 function symbol(s) added
  'void __irq_set_handler(unsigned int, irq_flow_handler_t, int, const char*)'
  'int irq_set_handler_data(unsigned int, void*)'

Bug: 277873112
Change-Id: Ib4e96c5064e4ec408539d128e89737187082ab13
Signed-off-by: Venkata Rao Kakani <quic_vkakani@quicinc.com>
2023-04-13 16:59:15 +00:00
Visweswara Tanuku
33736be959 FROMGIT: soc: qcom: geni-se: Update Tx and Rx fifo depth based on QUP HW version
From QUP HW Version 3.10 and above the Tx and Rx
fifo depth bits are increased to 23:16 bits from
21:16 bits in SE_HW_PARAM registers accomodating
256bytes of fifo depth.

Updated geni_se_get_tx_fifo_depth and
geni_se_get_rx_fifo_depth to retrieve right fifo
depth based on QUP HW version.

Signed-off-by: Visweswara Tanuku <quic_vtanuku@quicinc.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230215050528.9507-1-quic_vtanuku@quicinc.com
(cherry picked from commit fe8aa1ba07
 https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git for-next)

Bug: 267697978
Change-Id: I0c32e4433b5c4424ad5d35edde4072116b337ed0
Signed-off-by: Visweswara Tanuku <quic_vtanuku@quicinc.com>
2023-04-13 14:26:27 +00:00
Elliot Berman
fb09c80f7c FROMGIT: soc: qcom: geni-se: Move qcom-geni-se.h to linux/soc/qcom/geni-se.h
Move include/linux/qcom-geni-se.h to include/linux/soc/qcom/geni-se.h.
This removes 1 of a few remaining Qualcomm-specific headers into a more
approciate subdirectory under include/.

Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Acked-by: Bjorn Andersson <andersson@kernel.org>
Acked-by: Wolfram Sang <wsa@kernel.org> # for I2C
Reviewed-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
Link: https://lore.kernel.org/r/20230203210133.3552796-1-quic_eberman@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 491581f40e
 https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git for-next)

Bug: 267697978
Change-Id: I4170dbbfc428d815b4341828d9b29ad059bd241e
Signed-off-by: Visweswara Tanuku <quic_vtanuku@quicinc.com>
2023-04-13 14:26:27 +00:00
Vincent Donnefort
56e6f8a2c8 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 08:32:05 +00:00
Vincent Donnefort
ba57835693 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 08:32:05 +00:00
Vincent Donnefort
c8e53ed372 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 08:32:05 +00:00
Will McVicker
39db5c7241 ANDROID: update the pixel symbol list
Add the symbols:
  kthread_create_on_cpu
  pm_runtime_get_if_active
  usb_udc_vbus_handler

Bug: 277396090
Change-Id: I29fc958d50cd28901333755d11001789215d1c57
Signed-off-by: Will McVicker <willmcvicker@google.com>
2023-04-12 21:01:15 +00:00
蔡宗軒
74975d13f3 ANDROID: Add ufs symbol for mtk
Add android_vh_ufs_clock_scaling to MTK symbol list

Bug: 277668337

Change-Id: Ieda17e4daff8ce5ee699fbfbf5d4238303b81ef2
Signed-off-by: Ed Tsai <ed.tsai@mediatek.com>
2023-04-12 18:38:23 +00:00
Sachin Gupta
e29773ec20 ANDROID: scsi: ufs: Add hook to influence the UFS clock scaling policy
Add a vendor hook in ufshcd_devfreq_target() to allow vendor modules to
influence the UFS clock scaling policy.

Bug: 277668337

Change-Id: I64b9b77661fffc6cc96fa610985483e6cfc6542b
Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>
Signed-off-by: Sachin Gupta <quic_sachgupt@quicinc.com>
Signed-off-by: Ed Tsai <ed.tsai@mediatek.com>
(cherry picked from commit c8ed7439af)
2023-04-12 18:38:23 +00:00
T.J. Alumbaugh
451d7c42ea UPSTREAM: mm: multi-gen LRU: simplify lru_gen_look_around()
Update the folio generation in place with or without
current->reclaim_state->mm_walk.  The LRU lock is held for longer, if
mm_walk is NULL and the number of folios to update is more than
PAGEVEC_SIZE.

This causes a measurable regression from the LRU lock contention during a
microbencmark.  But a tiny regression is not worth the complexity.

Link: https://lkml.kernel.org/r/20230118001827.1040870-8-talumbau@google.com
Change-Id: I9ce18b4f4062e6c1c13c98ece9422478eb8e1846
Signed-off-by: T.J. Alumbaugh <talumbau@google.com>
Cc: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit abf086721a)
Bug: 274865848
Signed-off-by: T.J. Mercier <tjmercier@google.com>
2023-04-12 16:02:15 +00:00
T.J. Alumbaugh
fae7f9ea58 UPSTREAM: mm: multi-gen LRU: improve walk_pmd_range()
Improve readability of walk_pmd_range() and walk_pmd_range_locked().

Link: https://lkml.kernel.org/r/20230118001827.1040870-7-talumbau@google.com
Change-Id: Ia084fbf53fe989673b7804ca8ca520af12d7d52a
Signed-off-by: T.J. Alumbaugh <talumbau@google.com>
Cc: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit b5ff413361)
Bug: 274865848
Signed-off-by: T.J. Mercier <tjmercier@google.com>
2023-04-12 16:02:15 +00:00
T.J. Alumbaugh
24307a538b UPSTREAM: mm: multi-gen LRU: improve lru_gen_exit_memcg()
Add warnings and poison ->next.

Link: https://lkml.kernel.org/r/20230118001827.1040870-6-talumbau@google.com
Change-Id: I53de9e04c1ae941e122b33cd45d2bbb5f34aae0c
Signed-off-by: T.J. Alumbaugh <talumbau@google.com>
Cc: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 37cc99979d)
Bug: 274865848
Signed-off-by: T.J. Mercier <tjmercier@google.com>
2023-04-12 16:02:15 +00:00
T.J. Alumbaugh
e1cf082319 UPSTREAM: mm: multi-gen LRU: section for memcg LRU
Move memcg LRU code into a dedicated section.  Improve the design doc to
outline its architecture.

Link: https://lkml.kernel.org/r/20230118001827.1040870-5-talumbau@google.com
Change-Id: Id252e420cff7a858acb098cf2b3642da5c40f602
Signed-off-by: T.J. Alumbaugh <talumbau@google.com>
Cc: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 36c7b4db7c)
Bug: 274865848
Signed-off-by: T.J. Mercier <tjmercier@google.com>
2023-04-12 16:02:15 +00:00
T.J. Alumbaugh
282363eb6f UPSTREAM: mm: multi-gen LRU: section for Bloom filters
Move Bloom filters code into a dedicated section.  Improve the design doc
to explain Bloom filter usage and connection between aging and eviction in
their use.

Link: https://lkml.kernel.org/r/20230118001827.1040870-4-talumbau@google.com
Change-Id: I73e866f687c1ed9f5c8538086aa39408b79897db
Signed-off-by: T.J. Alumbaugh <talumbau@google.com>
Cc: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit ccbbbb8594)
Bug: 274865848
Signed-off-by: T.J. Mercier <tjmercier@google.com>
2023-04-12 16:02:15 +00:00
T.J. Alumbaugh
4d8cf6f6f0 UPSTREAM: mm: multi-gen LRU: section for rmap/PT walk feedback
Add a section for lru_gen_look_around() in the code and the design doc.

Link: https://lkml.kernel.org/r/20230118001827.1040870-3-talumbau@google.com
Change-Id: I5097af63f61b3b69ec2abee6cdbdc33c296df213
Signed-off-by: T.J. Alumbaugh <talumbau@google.com>
Cc: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit db19a43d9b)
Bug: 274865848
Signed-off-by: T.J. Mercier <tjmercier@google.com>
2023-04-12 16:02:15 +00:00
T.J. Alumbaugh
014c372cc3 UPSTREAM: mm: multi-gen LRU: section for working set protection
Patch series "mm: multi-gen LRU: improve".

This patch series improves a few MGLRU functions, collects related
functions, and adds additional documentation.

This patch (of 7):

Add a section for working set protection in the code and the design doc.
The admin doc already contains its usage.

Link: https://lkml.kernel.org/r/20230118001827.1040870-1-talumbau@google.com
Link: https://lkml.kernel.org/r/20230118001827.1040870-2-talumbau@google.com
Change-Id: I65599075fd42951db7739a2ab7cee78516e157b3
Signed-off-by: T.J. Alumbaugh <talumbau@google.com>
Cc: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 7b8144e63d)
Bug: 274865848
Signed-off-by: T.J. Mercier <tjmercier@google.com>
2023-04-12 16:02:15 +00:00
Yu Zhao
8666944cf9 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: I0b7f5f971d78014ea1ba44cee6a8ec902a4330d0
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:02:15 +00:00
Yu Zhao
6ddfdb3d53 UPSTREAM: 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: I291dcb795197659e40e46539cd32b857677c34ad
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)
Bug: 274865848
Signed-off-by: T.J. Mercier <tjmercier@google.com>
2023-04-12 16:02:15 +00:00
Todd Kjos
9cd2f3498d ANDROID: 4/12/2023 KMI update
Set KMI_GENERATION=4 for 4/12 KMI update

1 function symbol(s) removed
  'int of_mdiobus_register(struct mii_bus*, struct device_node*)'

2 function symbol(s) added
  'void* memremap_pages(struct dev_pagemap*, int)'
  'void memunmap_pages(struct dev_pagemap*)'

function symbol changed from 'bool cfg80211_rx_control_port(struct net_device*, struct sk_buff*, bool)' to 'bool cfg80211_rx_control_port(struct net_device*, struct sk_buff*, bool, int)'
  CRC changed from 0x19c30d56 to 0x70d8333f
  type changed from 'bool(struct net_device*, struct sk_buff*, bool)' to 'bool(struct net_device*, struct sk_buff*, bool, int)'
    parameter 4 of type 'int' was added

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

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

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

... 3672 omitted; 3675 symbols have only CRC changes

type 'struct pglist_data' changed
  byte size changed from 7168 to 9088
  member changed from 'struct zone node_zones[3]' to 'struct zone node_zones[4]'
    type changed from 'struct zone[3]' to 'struct zone[4]'
      number of elements changed from 3 to 4
  member 'struct zonelist node_zonelists[1]' changed
    offset changed by 12800
  22 members ('int nr_zones' .. 'unsigned long totalreserve_pages') changed
    offset changed by 12928
  3 members ('struct cacheline_padding _pad1_' .. 'struct lruvec __lruvec') changed
    offset changed by 13312
  2 members ('unsigned long flags' .. 'struct lru_gen_mm_walk mm_walk') changed
    offset changed by 14848
  member 'struct lru_gen_memcg memcg_lru' changed
    offset changed by 15104
  3 members ('struct cacheline_padding _pad2_' .. 'atomic_long_t vm_stat[42]') changed
    offset changed by 15360

type 'struct iommu_group' changed
  byte size changed from 208 to 224
  member 'struct xarray pasid_array' was added
  11 members ('struct mutex mutex' .. 'void* owner') changed
    offset changed by 128

type 'struct iommu_domain' changed
  byte size changed from 72 to 88
  member 'iommu_fault_handler_t handler' was removed
  member 'void* handler_token' was removed
  2 members ('struct iommu_domain_geometry geometry' .. 'struct iommu_dma_cookie* iova_cookie') changed
    offset changed by -128
  member 'enum iommu_page_response_code(* iopf_handler)(struct iommu_fault*, void*)' was added
  member 'void* fault_data' was added
  member 'union { struct { iommu_fault_handler_t handler; void* handler_token; }; struct { struct mm_struct* mm; int users; }; }' was added

type 'struct iommu_device' changed
  byte size changed from 40 to 48
  member 'u32 max_pasids' was added

type 'struct iommu_ops' changed
  byte size changed from 152 to 136
  member 'struct iommu_sva*(* sva_bind)(struct device*, struct mm_struct*, void*)' was removed
  member 'void(* sva_unbind)(struct iommu_sva*)' was removed
  member 'u32(* sva_get_pasid)(struct iommu_sva*)' was removed
  2 members ('int(* page_response)(struct device*, struct iommu_fault_event*, struct iommu_page_response*)' .. 'int(* def_domain_type)(struct device*)') changed
    offset changed by -192
  member 'void(* remove_dev_pasid)(struct device*, ioasid_t)' was added
  3 members ('const struct iommu_domain_ops* default_domain_ops' .. 'struct module* owner') changed
    offset changed by -128

type 'struct vm_event_state' changed
  byte size changed from 728 to 752
  member changed from 'unsigned long event[91]' to 'unsigned long event[94]'
    type changed from 'unsigned long[91]' to 'unsigned long[94]'
      number of elements changed from 91 to 94

type 'struct dev_iommu' changed
  byte size changed from 72 to 80
  member 'u32 max_pasids' was added

type 'struct io_uring_cmd' changed
  member changed from 'union { void(* task_work_cb)(struct io_uring_cmd*); void* cookie; }' to 'union { void(* task_work_cb)(struct io_uring_cmd*, unsigned int); void* cookie; }'
    type changed from 'union { void(* task_work_cb)(struct io_uring_cmd*); void* cookie; }' to 'union { void(* task_work_cb)(struct io_uring_cmd*, unsigned int); void* cookie; }'
      member changed from 'void(* task_work_cb)(struct io_uring_cmd*)' to 'void(* task_work_cb)(struct io_uring_cmd*, unsigned int)'
        type changed from 'void(*)(struct io_uring_cmd*)' to 'void(*)(struct io_uring_cmd*, unsigned int)'
          pointed-to type changed from 'void(struct io_uring_cmd*)' to 'void(struct io_uring_cmd*, unsigned int)'
            parameter 2 of type 'unsigned int' was added

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'

type 'struct fscrypt_operations' changed
  byte size changed from 72 to 104
  member 'u64 android_kabi_reserved1' was added
  member 'u64 android_kabi_reserved2' was added
  member 'u64 android_kabi_reserved3' was added
  member 'u64 android_kabi_reserved4' was added

type 'struct zone' changed
  member changed from 'long lowmem_reserve[3]' to 'long lowmem_reserve[4]'
    type changed from 'long[3]' to 'long[4]'
      number of elements changed from 3 to 4
  15 members ('struct pglist_data* zone_pgdat' .. 'int initialized') changed
    offset changed by 64

type 'struct zonelist' changed
  byte size changed from 64 to 80
  member changed from 'struct zoneref _zonerefs[4]' to 'struct zoneref _zonerefs[5]'
    type changed from 'struct zoneref[4]' to 'struct zoneref[5]'
      number of elements changed from 4 to 5

type 'enum zone_type' changed
  enumerator 'ZONE_DEVICE' (3) was added
  enumerator '__MAX_NR_ZONES' value changed from 3 to 4

type 'struct lruvec' changed
  byte size changed from 1224 to 1416
  2 members ('struct lru_gen_mm_state mm_state' .. 'struct pglist_data* pgdat') changed
    offset changed by 1536

type 'struct lru_gen_mm_walk' changed
  byte size changed from 152 to 184
  member changed from 'int nr_pages[4][2][3]' to 'int nr_pages[4][2][4]'
    type changed from 'int[4][2][3]' to 'int[4][2][4]'
      element type changed from 'int[2][3]' to 'int[2][4]'
        element type changed from 'int[3]' to 'int[4]'
          number of elements changed from 3 to 4
  4 members ('int mm_stats[6]' .. 'bool force_scan') changed
    offset changed by 256

type 'struct iommu_domain_ops' changed
  byte size changed from 112 to 120
  member 'int(* set_dev_pasid)(struct iommu_domain*, struct device*, ioasid_t)' was added
  12 members ('int(* map)(struct iommu_domain*, unsigned long, phys_addr_t, size_t, int, gfp_t)' .. 'void(* free)(struct iommu_domain*)') changed
    offset changed by 64

type 'struct mem_cgroup_per_node' changed
  byte size changed from 2096 to 2328
  2 members ('struct lruvec_stats_percpu* lruvec_stats_percpu' .. 'struct lruvec_stats lruvec_stats') changed
    offset changed by 1536
  member changed from 'unsigned long lru_zone_size[3][5]' to 'unsigned long lru_zone_size[4][5]'
    offset changed from 15232 to 16768
    type changed from 'unsigned long[3][5]' to 'unsigned long[4][5]'
      number of elements changed from 3 to 4
  6 members ('struct mem_cgroup_reclaim_iter iter' .. 'struct mem_cgroup* memcg') changed
    offset changed by 1856

type 'struct lru_gen_folio' changed
  byte size changed from 960 to 1152
  member changed from 'struct list_head folios[4][2][3]' to 'struct list_head folios[4][2][4]'
    type changed from 'struct list_head[4][2][3]' to 'struct list_head[4][2][4]'
      element type changed from 'struct list_head[2][3]' to 'struct list_head[2][4]'
        element type changed from 'struct list_head[3]' to 'struct list_head[4]'
          number of elements changed from 3 to 4
  member changed from 'long nr_pages[4][2][3]' to 'long nr_pages[4][2][4]'
    offset changed from 3520 to 4544
    type changed from 'long[4][2][3]' to 'long[4][2][4]'
      element type changed from 'long[2][3]' to 'long[2][4]'
        element type changed from 'long[3]' to 'long[4]'
          number of elements changed from 3 to 4
  9 members ('unsigned long avg_refaulted[2][4]' .. 'struct hlist_nulls_node list') changed
    offset changed by 1536

Bug: 277759776
Change-Id: I31065f7aa7589d55cf402ed8e00da061cffe1246
Signed-off-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2023-04-12 03:00:45 +00:00
Carlos Llamas
6937d457bb ANDROID: ABI: remove stale symbol
The following symbol was removed by commit c2b6e1a440 ("net: mdio: fix
owner field for mdio buses registered using device-tree"). It also needs
to be removed from this symbol list to reflect this update.

- of_mdiobus_register

Bug: 277759776
Change-Id: I4ab79a86f13404c2d0b2e423154aaa8b512bc1c4
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2023-04-12 03:00:45 +00:00