Commit Graph

1148422 Commits

Author SHA1 Message Date
Paul Lawrence
8ff940b351 ANDROID: incremental fs: Evict inodes before freeing mount data
Since evicting inodes triggers writes to the backing file, which uses
the mi_owner field from the mount_info struct, make sure inodes are
evicted before we free the mount_info data

Test: incfs_test
Bug: 270117845
Change-Id: I673b2e0e04b5adc3998caf6f22443598a30338af
Signed-off-by: Paul Lawrence <paullawrence@google.com>
(cherry picked from commit 7899985277)
2023-04-04 22:27:50 +00:00
Daniel Rosenberg
c0b8bfdecf ANDROID: fsnotify: Notify lower fs of open
If the filesystem being watched supports d_canonical_path,
notify the lower filesystem of the open as well.

Fixes: f37e05049b ("ANDROID: vfs: d_canonical_path for stacked FS")
Test: atest CtsOsTestCases:android.os.cts.FileObserverTest
Bug: 70706497
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Signed-off-by: Alessio Balsini <balsini@google.com>
Change-Id: I7c9d210e8e6ee99928ad9db0b41ffc3ac3371dc0
(cherry picked from commit b289d1706b)
2023-04-04 22:21:44 +00:00
Paul Lawrence
3355e398f3 ANDROID: fuse-bpf: Run bpf with migration disabled
To avoid a BUG_ON, we must disable migration before running any bpf
program.

Bug: 273620140
Test: fuse-test passes, no bug with CONFIG_DEBUG_ATOMIC_SLEEP
Change-Id: I9ed69ae93fc4b922782fccde293cb02b3eae3f06
Signed-off-by: Paul Lawrence <paullawrence@google.com>
(cherry picked from commit 0411f8d9df)
2023-04-04 20:00:09 +00:00
Paul Lawrence
17e313abe9 ANDROID: fuse-bpf: Do not change bpf program in lookups
If a lookup finds an existing inode, it must not change the existing bpf
program since it may be in use.

Bug: 267095363
Test: fuse_test, atest CtsScopedStorageHostTest
Change-Id: Icb00681fbcd51fdd4b0764906509093d98caeec4
Signed-off-by: Paul Lawrence <paullawrence@google.com>
(cherry picked from commit 14a5cd6ae3)
2023-04-04 16:44:52 +00:00
Srinivas Kandagatla
24a4b7855f FROMGIT: ASoC: codecs: lpass: fix the order or clks turn off during suspend
The order in which clocks are stopped matters as some of the clock
like NPL are derived from MCLK.

Without this patch, Dragonboard RB5 DSP would crash with below error:
 qcom_q6v5_pas 17300000.remoteproc: fatal error received:
 ABT_dal.c:278:ABTimeout: AHB Bus hang is detected,
 Number of bus hang detected := 2 , addr0 = 0x3370000 , addr1 = 0x0!!!

Turn off  fsgen first, followed by npl and then finally mclk, which is exactly
the opposite order of enable sequence.

Fixes: 1dc3459009 ("ASoC: codecs: lpass: register mclk after runtime pm")
Reported-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Amit Pundir <amit.pundir@linaro.org>
Link: https://lore.kernel.org/r/20230323110125.23790-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>

Bug: 146449535
(cherry picked from commit a4a3203426
 https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/log/?h=for-next)
Change-Id: I73a42a21898195c98dfbb3e5c38b7c160866dd7b
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2023-04-04 16:24:44 +00:00
Junki Min
4754c5690b ANDROID: GKI: Add a filegroup instead of _aarch64_additional_kmi symbol list
_aarch64_additional_kmi_symbol_list has all vendor's kmi symbol list file,
but it is inaccessible from outside. Added a filegroup for it.

Bug: 275670969
Signed-off-by: Junki Min <joonki.min@samsung.com>
Change-Id: I65ad4008ae2135fae88c8eaf1c09d141ea562294
2023-04-04 11:46:56 +00:00
Johannes Berg
39ed42405e UPSTREAM: wifi: nl80211: fix puncturing bitmap policy
This was meant to be a u32, and while applying the patch
I tried to use policy validation for it. However, not only
did I copy/paste it to u8 instead of u32, but also used
the policy range erroneously. Fix both of these issues.

Fixes: d7c1a9a0ed ("wifi: nl80211: validate and configure puncturing bitmap")
Signed-offi-by: Johannes Berg <johannes.berg@intel.com>

Bug: 276824951
Change-Id: I1c91e034845615d15f9b1004c7bef16dd3eb5d2c
(cherry picked from commit b27f07c50a)
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2023-04-04 05:03:28 +00:00
zuoyonghua
2420a46a32 ANDROID: GKI: Update symbols to symbol list
Add initial symbol list for oplus in android/abi_gki_aarch64_oplus

74 function symbol(s) added
  'int __page_mapcount(struct page*)'
  'int __printk_ratelimit(const char*)'
  '__sum16 __skb_checksum_complete(struct sk_buff*)'
  'int __trace_puts(unsigned long, const char*, int)'
  'int _raw_write_trylock(rwlock_t*)'
  'int bio_add_page(struct bio*, struct page*, unsigned int, unsigned int)'
  'void bio_associate_blkg(struct bio*)'
  'void bio_put(struct bio*)'
  'int blk_rq_map_user(struct request_queue*, struct request*, struct rq_map_data*, void*, unsigned long, gfp_t)'
  'int blk_rq_map_user_iov(struct request_queue*, struct request*, struct rq_map_data*, const struct iov_iter*, gfp_t)'
  'int cpufreq_frequency_table_get_index(struct cpufreq_policy*, unsigned int)'
  'unsigned int cpufreq_policy_transition_delay_us(struct cpufreq_policy*)'
  'int device_create_bin_file(struct device*, const struct bin_attribute*)'
  'void device_remove_bin_file(struct device*, const struct bin_attribute*)'
  'int devres_destroy(struct device*, dr_release_t, dr_match_t, void*)'
  'int down_read_trylock(struct rw_semaphore*)'
  'int filp_close(struct file*, fl_owner_t)'
  'void for_each_kernel_tracepoint(void(*)(struct tracepoint*, void*), void*)'
  'int freq_qos_add_notifier(struct freq_constraints*, enum freq_qos_req_type, struct notifier_block*)'
  'int freq_qos_remove_notifier(struct freq_constraints*, enum freq_qos_req_type, struct notifier_block*)'
  'void gov_attr_set_get(struct gov_attr_set*, struct list_head*)'
  'struct gpio_chip* gpiod_to_chip(const struct gpio_desc*)'
  'bool have_governor_per_policy()'
  's32 i2c_smbus_read_word_data(const struct i2c_client*, u8)'
  's32 i2c_smbus_write_word_data(const struct i2c_client*, u8, u16)'
  'struct iio_channel* iio_channel_get(struct device*, const char*)'
  'void iio_channel_release(struct iio_channel*)'
  'int iio_get_channel_type(struct iio_channel*, enum iio_chan_type*)'
  'int ip6_local_out(struct net*, struct sock*, struct sk_buff*)'
  'int ip6_route_me_harder(struct net*, struct sock*, struct sk_buff*)'
  'int ip_route_me_harder(struct net*, struct sock*, struct sk_buff*, unsigned int)'
  'int ipv6_find_hdr(const struct sk_buff*, unsigned int*, int, unsigned short*, int*)'
  'u64 jiffies_64_to_clock_t(u64)'
  'void ktime_get_coarse_real_ts64(struct timespec64*)'
  'ssize_t mipi_dsi_generic_write(struct mipi_dsi_device*, const void*, size_t)'
  'int mmc_wait_for_cmd(struct mmc_host*, struct mmc_command*, int)'
  'void nf_ct_attach(struct sk_buff*, const struct sk_buff*)'
  'bool nf_ct_delete(struct nf_conn*, u32, int)'
  'int nf_register_net_hooks(struct net*, const struct nf_hook_ops*, unsigned int)'
  'void nf_unregister_net_hooks(struct net*, const struct nf_hook_ops*, unsigned int)'
  'struct cgroup_subsys_state* of_css(struct kernfs_open_file*)'
  'void pm_get_active_wakeup_sources(char*, size_t)'
  'struct proc_dir_entry* proc_symlink(const char*, struct proc_dir_entry*, const char*)'
  'struct reciprocal_value reciprocal_value(u32)'
  'int register_tcf_proto_ops(struct tcf_proto_ops*)'
  'int regulator_map_voltage_linear_range(struct regulator_dev*, int, int)'
  'int remove_proc_subtree(const char*, struct proc_dir_entry*)'
  'int rtc_read_alarm(struct rtc_device*, struct rtc_wkalrm*)'
  'int rtc_set_alarm(struct rtc_device*, struct rtc_wkalrm*)'
  'int sdio_memcpy_fromio(struct sdio_func*, void*, unsigned int, int)'
  'int sdio_memcpy_toio(struct sdio_func*, unsigned int, void*, int)'
  'int sdio_set_block_size(struct sdio_func*, unsigned int)'
  'u8 sdio_writeb_readb(struct sdio_func*, u8, unsigned int, int*)'
  'int send_sig(int, struct task_struct*, int)'
  'int send_sig_info(int, struct kernel_siginfo*, struct task_struct*)'
  'int set_blocksize(struct block_device*, int)'
  'int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime*, snd_pcm_hw_param_t, u_int64_t)'
  'struct snd_soc_dai* snd_soc_find_dai(const struct snd_soc_dai_link_component*)'
  'unsigned int stack_trace_save_tsk(struct task_struct*, unsigned long*, unsigned int, unsigned int)'
  'char* stpcpy(char*, const char*)'
  'struct rq* task_rq_lock(struct task_struct*, struct rq_flags*)'
  'int tcf_action_exec(struct sk_buff*, struct tc_action**, int, struct tcf_result*)'
  'void tcf_exts_destroy(struct tcf_exts*)'
  'int tcf_exts_dump(struct sk_buff*, struct tcf_exts*)'
  'int tcf_exts_dump_stats(struct sk_buff*, struct tcf_exts*)'
  'int tcf_exts_validate(struct net*, struct tcf_proto*, struct nlattr**, struct nlattr*, struct tcf_exts*, u32, struct netlink_ext_ack*)'
  'bool tcf_queue_work(struct rcu_work*, work_func_t)'
  'void* typec_mux_get_drvdata(struct typec_mux_dev*)'
  'void unregister_memory_notifier(struct notifier_block*)'
  'void unregister_tcf_proto_ops(struct tcf_proto_ops*)'
  'void v4l2_i2c_subdev_init(struct v4l2_subdev*, struct i2c_client*, const struct v4l2_subdev_ops*)'
  'unsigned long wait_for_completion_io_timeout(struct completion*, unsigned long)'
  'long wait_for_completion_killable_timeout(struct completion*, unsigned long)'
  'void wakeup_source_remove(struct wakeup_source*)'

4 variable symbol(s) added
  'int console_printk[4]'
  'struct cgroup_subsys memory_cgrp_subsys'
  'struct static_key_true memory_cgrp_subsys_enabled_key'
  'struct bus_type spi_bus_type'

Bug: 276674646
Signed-off-by: zuoyonghua <zuoyonghua@oppo.com>
Change-Id: I095fd140aefa5489992581332e584df4d1b94275
2023-04-03 18:36:58 +00:00
Vincent Donnefort
a6af57723d ANDROID: KVM: arm64: Remove the non-consuming hyp trace interface
Following ML discussion, it seems very much likely the non-consuming
upstream version for hyp tracing ("trace" files) will be delayed.

As we want to stick to upstream as much as possible for the next Android
releases, let's remove this interface, not used by our tools before
anyone relies on it.

Bug: 249050813
Link: https://lore.kernel.org/linux-trace-kernel/20230329070353.1e1b443b@gandalf.local.home/
Change-Id: I64b032512b85ed095bb402dc2997101777cb539b
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
2023-04-03 07:47:48 +00:00
Greg Kroah-Hartman
3a7f9f00f0 Revert "ANDROID: cpufreq: Add a restricted vendor hook for freq transition"
This reverts commit d723168991.

The hook it added:
	android_rvh_cpufreq_transition
is not used by anyone, so remove it.  If it is needed in the future it
can be submitted for review again.

Bug: 181889516
Cc: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
Change-Id: I770ef330c0e1e6095b74c0a22845f20b4b71fd70
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-31 18:25:45 +00:00
Greg Kroah-Hartman
7f4246b044 Revert "ANDROID: kernel: Add restricted vendor hook in creds"
This reverts commit 1abc68878a.

The hooks added in that commit:
	android_rvh_commit_creds
	android_rvh_exit_creds
	android_rvh_override_creds
	android_rvh_revert_creds
are not used by anyone, so remove them.

If they are needed in the future, they can be resubmitted for review.

Bug: 181639260
Cc: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: I1b371d6b0be827e39c5163e2ed2134307d81730a
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-31 18:25:45 +00:00
YOUNGJIN JOO
8f3de2b8da ANDROID: ABI: update symbol list for galaxy
23 function symbol(s) added
  'int __devm_irq_alloc_descs(struct device*, int, unsigned int, unsigned int, int, struct module*, const struct irq_affinity_desc*)'
  'void alarm_start(struct alarm*, ktime_t)'
  'int class_create_file_ns(struct class*, const struct class_attribute*, const void*)'
  'void class_remove_file_ns(struct class*, const struct class_attribute*, const void*)'
  'struct device* create_function_device(char*)'
  'char* get_options(const char*, int, int*)'
  'struct usb_request* gs_alloc_req(struct usb_ep*, unsigned int, gfp_t)'
  'void gs_free_req(struct usb_ep*, struct usb_request*)'
  'void gserial_free_line(unsigned char)'
  'void gserial_resume(struct gserial*)'
  'void gserial_suspend(struct gserial*)'
  's32 i2c_smbus_read_word_data(const struct i2c_client*, u8)'
  's32 i2c_smbus_write_word_data(const struct i2c_client*, u8, u16)'
  'struct iio_channel* iio_channel_get(struct device*, const char*)'
  'void iio_channel_release(struct iio_channel*)'
  'struct pinctrl* pinctrl_get(struct device*)'
  'void pinctrl_put(struct pinctrl*)'
  'int snd_soc_info_volsw_sx(struct snd_kcontrol*, struct snd_ctl_elem_info*)'
  'int snd_soc_put_volsw_sx(struct snd_kcontrol*, struct snd_ctl_elem_value*)'
  'char* stpcpy(char*, const char*)'
  'struct usb_string* usb_gstrings_attach(struct usb_composite_dev*, struct usb_gadget_strings**, unsigned int)'
  'void usb_set_device_state(struct usb_device*, enum usb_device_state)'
  'void wakeup_source_remove(struct wakeup_source*)'

1 variable symbol(s) added
  'struct bus_type spi_bus_type'

Bug: 276366807
Change-Id: Id4b78269669c60c802605f173d7992782222f208
Signed-off-by: YOUNGJIN JOO <youngjin79.joo@samsung.com>
2023-03-31 16:18:42 +00:00
Greg Kroah-Hartman
d9f36cae1c Revert "net: mdio: fix owner field for mdio buses registered using device-tree"
This reverts commit c2b6e1a440.

It breaks the current Android kernel abi.  It will be brought back at
the next KABI break update.

Bug: 161946584
Change-Id: I0e5a012f184f4d1a8ca158e45fe4a3e4f20050db
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-31 08:56:11 +00:00
Greg Kroah-Hartman
db50ac4d0a Merge 6.1.22 into android14-6.1
Changes in 6.1.22
	interconnect: qcom: osm-l3: fix icc_onecell_data allocation
	interconnect: qcom: sm8450: switch to qcom_icc_rpmh_* function
	interconnect: qcom: qcm2290: Fix MASTER_SNOC_BIMC_NRT
	perf/core: Fix perf_output_begin parameter is incorrectly invoked in perf_event_bpf_output
	perf: fix perf_event_context->time
	tracing/hwlat: Replace sched_setaffinity with set_cpus_allowed_ptr
	drm/amd/display: Include virtual signal to set k1 and k2 values
	drm/amd/display: fix k1 k2 divider programming for phantom streams
	drm/amd/display: Remove OTG DIV register write for Virtual signals.
	mptcp: refactor passive socket initialization
	mptcp: use the workqueue to destroy unaccepted sockets
	mptcp: fix UaF in listener shutdown
	drm/amd/display: Fix DP MST sinks removal issue
	arm64: dts: qcom: sm8450: Mark UFS controller as cache coherent
	power: supply: bq24190: Fix use after free bug in bq24190_remove due to race condition
	power: supply: da9150: Fix use after free bug in da9150_charger_remove due to race condition
	arm64: dts: imx8dxl-evk: Disable hibernation mode of AR8031 for EQOS
	arm64: dts: imx8dxl-evk: Fix eqos phy reset gpio
	ARM: dts: imx6sll: e70k02: fix usbotg1 pinctrl
	ARM: dts: imx6sll: e60k02: fix usbotg1 pinctrl
	ARM: dts: imx6sl: tolino-shine2hd: fix usbotg1 pinctrl
	arm64: dts: imx8mn: specify #sound-dai-cells for SAI nodes
	arm64: dts: imx93: add missing #address-cells and #size-cells to i2c nodes
	NFS: Fix /proc/PID/io read_bytes for buffered reads
	xsk: Add missing overflow check in xdp_umem_reg
	iavf: fix inverted Rx hash condition leading to disabled hash
	iavf: fix non-tunneled IPv6 UDP packet type and hashing
	iavf: do not track VLAN 0 filters
	intel/igbvf: free irq on the error path in igbvf_request_msix()
	igbvf: Regard vf reset nack as success
	igc: fix the validation logic for taprio's gate list
	i2c: imx-lpi2c: check only for enabled interrupt flags
	i2c: mxs: ensure that DMA buffers are safe for DMA
	i2c: hisi: Only use the completion interrupt to finish the transfer
	scsi: scsi_dh_alua: Fix memleak for 'qdata' in alua_activate()
	nfsd: don't replace page in rq_pages if it's a continuation of last page
	net: dsa: b53: mmap: fix device tree support
	net: usb: smsc95xx: Limit packet length to skb->len
	efi/libstub: smbios: Use length member instead of record struct size
	qed/qed_sriov: guard against NULL derefs from qed_iov_get_vf_info
	xirc2ps_cs: Fix use after free bug in xirc2ps_detach
	net: phy: Ensure state transitions are processed from phy_stop()
	net: mdio: fix owner field for mdio buses registered using device-tree
	net: mdio: fix owner field for mdio buses registered using ACPI
	net: stmmac: Fix for mismatched host/device DMA address width
	thermal/drivers/mellanox: Use generic thermal_zone_get_trip() function
	mlxsw: core_thermal: Fix fan speed in maximum cooling state
	drm/i915: Print return value on error
	drm/i915/fbdev: lock the fbdev obj before vma pin
	drm/i915/guc: Rename GuC register state capture node to be more obvious
	drm/i915/guc: Fix missing ecodes
	drm/i915/gt: perform uc late init after probe error injection
	net: qcom/emac: Fix use after free bug in emac_remove due to race condition
	net: usb: lan78xx: Limit packet length to skb->len
	net/ps3_gelic_net: Fix RX sk_buff length
	net/ps3_gelic_net: Use dma_mapping_error
	octeontx2-vf: Add missing free for alloc_percpu
	bootconfig: Fix testcase to increase max node
	keys: Do not cache key in task struct if key is requested from kernel thread
	ice: check if VF exists before mode check
	iavf: fix hang on reboot with ice
	i40e: fix flow director packet filter programming
	bpf: Adjust insufficient default bpf_jit_limit
	net/mlx5e: Set uplink rep as NETNS_LOCAL
	net/mlx5e: Block entering switchdev mode with ns inconsistency
	net/mlx5: Fix steering rules cleanup
	net/mlx5e: Overcome slow response for first macsec ASO WQE
	net/mlx5: Read the TC mapping of all priorities on ETS query
	net/mlx5: E-Switch, Fix an Oops in error handling code
	net: dsa: tag_brcm: legacy: fix daisy-chained switches
	atm: idt77252: fix kmemleak when rmmod idt77252
	erspan: do not use skb_mac_header() in ndo_start_xmit()
	net/sonic: use dma_mapping_error() for error check
	nvme-tcp: fix nvme_tcp_term_pdu to match spec
	mlxsw: spectrum_fid: Fix incorrect local port type
	hvc/xen: prevent concurrent accesses to the shared ring
	ksmbd: add low bound validation to FSCTL_SET_ZERO_DATA
	ksmbd: add low bound validation to FSCTL_QUERY_ALLOCATED_RANGES
	ksmbd: fix possible refcount leak in smb2_open()
	Bluetooth: hci_sync: Resume adv with no RPA when active scan
	Bluetooth: hci_core: Detect if an ACL packet is in fact an ISO packet
	Bluetooth: btusb: Remove detection of ISO packets over bulk
	Bluetooth: ISO: fix timestamped HCI ISO data packet parsing
	Bluetooth: Remove "Power-on" check from Mesh feature
	gve: Cache link_speed value from device
	net: asix: fix modprobe "sysfs: cannot create duplicate filename"
	net: dsa: mt7530: move enabling disabling core clock to mt7530_pll_setup()
	net: dsa: mt7530: move lowering TRGMII driving to mt7530_setup()
	net: dsa: mt7530: move setting ssc_delta to PHY_INTERFACE_MODE_TRGMII case
	net: mdio: thunder: Add missing fwnode_handle_put()
	drm/amd/display: Set dcn32 caps.seamless_odm
	Bluetooth: btqcomsmd: Fix command timeout after setting BD address
	Bluetooth: L2CAP: Fix responding with wrong PDU type
	Bluetooth: btsdio: fix use after free bug in btsdio_remove due to unfinished work
	Bluetooth: mgmt: Fix MGMT add advmon with RSSI command
	Bluetooth: HCI: Fix global-out-of-bounds
	platform/chrome: cros_ec_chardev: fix kernel data leak from ioctl
	entry: Fix noinstr warning in __enter_from_user_mode()
	perf/x86/amd/core: Always clear status for idx
	entry/rcu: Check TIF_RESCHED _after_ delayed RCU wake-up
	hwmon: fix potential sensor registration fail if of_node is missing
	hwmon (it87): Fix voltage scaling for chips with 10.9mV ADCs
	scsi: qla2xxx: Synchronize the IOCB count to be in order
	scsi: qla2xxx: Perform lockless command completion in abort path
	smb3: lower default deferred close timeout to address perf regression
	smb3: fix unusable share after force unmount failure
	uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS583Gen 2
	thunderbolt: Use scale field when allocating USB3 bandwidth
	thunderbolt: Call tb_check_quirks() after initializing adapters
	thunderbolt: Add quirk to disable CLx
	thunderbolt: Fix memory leak in margining
	thunderbolt: Disable interrupt auto clear for rings
	thunderbolt: Add missing UNSET_INBOUND_SBTX for retimer access
	thunderbolt: Use const qualifier for `ring_interrupt_index`
	thunderbolt: Rename shadowed variables bit to interrupt_bit and auto_clear_bit
	ASoC: amd: yp: Add OMEN by HP Gaming Laptop 16z-n000 to quirks
	ASoC: amd: yc: Add DMI entries to support HP OMEN 16-n0xxx (8A43)
	ACPI: x86: Drop quirk for HP Elitebook
	ACPI: x86: utils: Add Cezanne to the list for forcing StorageD3Enable
	riscv: Bump COMMAND_LINE_SIZE value to 1024
	drm/cirrus: NULL-check pipe->plane.state->fb in cirrus_pipe_update()
	HID: cp2112: Fix driver not registering GPIO IRQ chip as threaded
	ca8210: fix mac_len negative array access
	HID: logitech-hidpp: Add support for Logitech MX Master 3S mouse
	HID: intel-ish-hid: ipc: Fix potential use-after-free in work function
	m68k: mm: Fix systems with memory at end of 32-bit address space
	m68k: Only force 030 bus error if PC not in exception table
	selftests/bpf: check that modifier resolves after pointer
	scsi: target: iscsi: Fix an error message in iscsi_check_key()
	scsi: qla2xxx: Add option to disable FC2 Target support
	scsi: hisi_sas: Check devm_add_action() return value
	scsi: ufs: core: Add soft dependency on governor_simpleondemand
	scsi: lpfc: Check kzalloc() in lpfc_sli4_cgn_params_read()
	scsi: lpfc: Avoid usage of list iterator variable after loop
	scsi: mpi3mr: Driver unload crashes host when enhanced logging is enabled
	scsi: mpi3mr: Wait for diagnostic save during controller init
	scsi: mpi3mr: NVMe command size greater than 8K fails
	scsi: mpi3mr: Bad drive in topology results kernel crash
	scsi: storvsc: Handle BlockSize change in Hyper-V VHD/VHDX file
	platform/x86: int3472: Add GPIOs to Surface Go 3 Board data
	net: usb: cdc_mbim: avoid altsetting toggling for Telit FE990
	net: usb: qmi_wwan: add Telit 0x1080 composition
	drm/amd/display: Update clock table to include highest clock setting
	sh: sanitize the flags on sigreturn
	drm/amdgpu: Fix call trace warning and hang when removing amdgpu device
	drm/amd: Fix initialization mistake for NBIO 7.3.0
	net/sched: act_mirred: better wording on protection against excessive stack growth
	act_mirred: use the backlog for nested calls to mirred ingress
	cifs: lock chan_lock outside match_session
	cifs: append path to open_enter trace event
	cifs: do not poll server interfaces too regularly
	cifs: empty interface list when server doesn't support query interfaces
	cifs: dump pending mids for all channels in DebugData
	cifs: print session id while listing open files
	cifs: fix dentry lookups in directory handle cache
	x86/fpu/xstate: Prevent false-positive warning in __copy_xstate_uabi_buf()
	selftests/x86/amx: Add a ptrace test
	scsi: core: Add BLIST_SKIP_VPD_PAGES for SKhynix H28U74301AMR
	usb: misc: onboard-hub: add support for Microchip USB2517 USB 2.0 hub
	usb: dwc2: drd: fix inconsistent mode if role-switch-default-mode="host"
	usb: dwc2: fix a devres leak in hw_enable upon suspend resume
	usb: gadget: u_audio: don't let userspace block driver unbind
	btrfs: zoned: fix btrfs_can_activate_zone() to support DUP profile
	Bluetooth: Fix race condition in hci_cmd_sync_clear
	efi: sysfb_efi: Fix DMI quirks not working for simpledrm
	mm/slab: Fix undefined init_cache_node_node() for NUMA and !SMP
	fscrypt: destroy keyring after security_sb_delete()
	fsverity: Remove WQ_UNBOUND from fsverity read workqueue
	lockd: set file_lock start and end when decoding nlm4 testargs
	arm64: dts: imx8mm-nitrogen-r2: fix WM8960 clock name
	igb: revert rtnl_lock() that causes deadlock
	dm thin: fix deadlock when swapping to thin device
	usb: typec: tcpm: fix create duplicate source-capabilities file
	usb: typec: tcpm: fix warning when handle discover_identity message
	usb: cdns3: Fix issue with using incorrect PCI device function
	usb: cdnsp: Fixes issue with redundant Status Stage
	usb: cdnsp: changes PCI Device ID to fix conflict with CNDS3 driver
	usb: chipdea: core: fix return -EINVAL if request role is the same with current role
	usb: chipidea: core: fix possible concurrent when switch role
	usb: dwc3: gadget: Add 1ms delay after end transfer command without IOC
	usb: ucsi: Fix NULL pointer deref in ucsi_connector_change()
	usb: ucsi_acpi: Increase the command completion timeout
	mm: kfence: fix using kfence_metadata without initialization in show_object()
	kfence: avoid passing -g for test
	io_uring/net: avoid sending -ECONNABORTED on repeated connection requests
	io_uring/rsrc: fix null-ptr-deref in io_file_bitmap_get()
	Revert "kasan: drop skip_kasan_poison variable in free_pages_prepare"
	test_maple_tree: add more testing for mas_empty_area()
	maple_tree: fix mas_skip_node() end slot detection
	ksmbd: fix wrong signingkey creation when encryption is AES256
	ksmbd: set FILE_NAMED_STREAMS attribute in FS_ATTRIBUTE_INFORMATION
	ksmbd: don't terminate inactive sessions after a few seconds
	ksmbd: return STATUS_NOT_SUPPORTED on unsupported smb2.0 dialect
	ksmbd: return unsupported error on smb1 mount
	wifi: mac80211: fix qos on mesh interfaces
	nilfs2: fix kernel-infoleak in nilfs_ioctl_wrap_copy()
	drm/bridge: lt8912b: return EPROBE_DEFER if bridge is not found
	drm/amd/display: fix wrong index used in dccg32_set_dpstreamclk
	drm/meson: fix missing component unbind on bind errors
	drm/amdgpu/nv: Apply ASPM quirk on Intel ADL + AMD Navi
	drm/i915/active: Fix missing debug object activation
	drm/i915: Preserve crtc_state->inherited during state clearing
	drm/amdgpu: skip ASIC reset for APUs when go to S4
	drm/amdgpu: reposition the gpu reset checking for reuse
	riscv: mm: Fix incorrect ASID argument when flushing TLB
	riscv: Handle zicsr/zifencei issues between clang and binutils
	tee: amdtee: fix race condition in amdtee_open_session
	firmware: arm_scmi: Fix device node validation for mailbox transport
	arm64: dts: qcom: sc7280: Mark PCIe controller as cache coherent
	arm64: dts: qcom: sm8150: Fix the iommu mask used for PCIe controllers
	soc: qcom: llcc: Fix slice configuration values for SC8280XP
	mm/ksm: fix race with VMA iteration and mm_struct teardown
	bus: imx-weim: fix branch condition evaluates to a garbage value
	i2c: xgene-slimpro: Fix out-of-bounds bug in xgene_slimpro_i2c_xfer()
	dm stats: check for and propagate alloc_percpu failure
	dm crypt: add cond_resched() to dmcrypt_write()
	dm crypt: avoid accessing uninitialized tasklet
	sched/fair: sanitize vruntime of entity being placed
	sched/fair: Sanitize vruntime of entity being migrated
	drm/amdkfd: introduce dummy cache info for property asic
	drm/amdkfd: Fix the warning of array-index-out-of-bounds
	drm/amdkfd: add GC 11.0.4 KFD support
	drm/amdkfd: Fix the memory overrun
	Linux 6.1.22

Change-Id: Id13b4655dbfb59c29a0b8953e5e0cda3703f1879
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-31 08:15:39 +00:00
Todd Kjos
01917193ac ANDROID: update ABI for gunyah series
INFO: 6 function symbol(s) added
  'int __auxiliary_driver_register(struct auxiliary_driver*, struct module*, const char*)'
  'void auxiliary_driver_unregister(struct auxiliary_driver*)'
  'int devm_gh_rm_register_platform_ops(struct device*, struct gh_rm_platform_ops*)'
  'int gh_rm_call(struct gh_rm*, u32, void*, size_t, void**, size_t*)'
  'int gh_rm_notifier_register(struct gh_rm*, struct notifier_block*)'
  'int gh_rm_notifier_unregister(struct gh_rm*, struct notifier_block*)'

Bug: 268234781
Change-Id: I2a139d63566ae1c7f323345837b7d5b1337baa47
Signed-off-by: Todd Kjos <tkjos@google.com>
2023-03-30 19:20:32 +00:00
Sreenad Menon
0c187fcc37 ANDROID: gunyah: Add protected VM firmware boot support
Add support for setting the protected VM firmware load location. This
change requires lent memory support, which will land in future kernel as
restricted_memfd. Until then, it is in Android Common Kernel following
the GH_VM_ANDROID_LEND_USER_MEMORY patches.

Bug: 268234781
Change-Id: I1d1385ee6d4018d7a6e82868bf115b9bd6c785ca
Co-developed-by: Elliot Berman <quic_eberman@quicinc.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Signed-off-by: Sreenad Menon <quic_sreemeno@quicinc.com>
2023-03-30 19:20:32 +00:00
Elliot Berman
657af3fa64 ANDROID: gunyah: vm_mgr: Add lent memory
Add support for lending memory via GH_VM_ANDROID_LEND_USER_MEM. Lending
memory makes it inaccessible to the host.

pKVM and Gunyah aim to converge to a common design based around
restricted_memfd in kernel.org, but the base restricted_memfd support is
not available yet. So, carry the support to lend memory as an Android
patch.

Bug: 268234781
Change-Id: Iecef11891f40efe4a3df7585808d6fe28a14ab39
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2023-03-30 19:20:31 +00:00
Elliot Berman
e54e5e94a4 ANDROID: abi_gki_aarch64_qcom: Add Gunyah symbols
Add symbols needed to enable extra Gunyah support for Qualcomm
platforms.

__auxiliary_driver_register
auxiliary_driver_unregister
devm_gh_rm_register_platform_ops
gh_rm_call
gh_rm_notifier_register
gh_rm_notifier_unregister

Bug: 268234781
Change-Id: I7bd19c0712231fd4f084f0ee86b50efa937c52ce
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2023-03-30 19:20:31 +00:00
Prakruthi Deepak Heragu
234ad32526 ANDROID: gunyah: Enable gunyah configs
Make gunyah core driver a built in module to allow Gunyah vendor modules
to be a part of first stage ramdisk.

Bug: 268234781
Change-Id: I5b442baabb720362c7be7727d138ef8d9850bfbc
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2023-03-30 19:20:31 +00:00
Prakruthi Deepak Heragu
1dce9d7d4d ANDROID: gunyah: Add support for Gunyah vendor modules
Add support for further vendor features of Gunyah. To probe the vendor
features, add auxiliary device and export gh_rm_call to all the vendor
features to make not-yet-upstreamed RM RPC calls.

Bug: 268234781
Change-Id: I13de37b7c0d5d6c85bdd32a20c39fdde99cffbdd
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2023-03-30 19:20:31 +00:00
Elliot Berman
c2c0bebcdb FROMLIST: MAINTAINERS: Add Gunyah hypervisor drivers section
Add myself and Prakruthi as maintainers of Gunyah hypervisor drivers.

Change-Id: Ie3058bb7390e412a888c9dd32d2c22eccd3d6147
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-27-quic_eberman@quicinc.com/
2023-03-30 19:20:31 +00:00
Elliot Berman
7ac3fef966 FROMLIST: virt: gunyah: Add ioeventfd
Allow userspace to attach an ioeventfd to an mmio address within the guest.

Co-developed-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Change-Id: I9565c47de3cba3e76528e36088d773b3ce31178e
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-26-quic_eberman@quicinc.com/
2023-03-30 19:20:31 +00:00
Elliot Berman
45831b2fd5 FROMLIST: virt: gunyah: Add irqfd interface
Enable support for creating irqfds which can raise an interrupt on a
Gunyah virtual machine. irqfds are exposed to userspace as a Gunyah VM
function with the name "irqfd". If the VM devicetree is not configured
to create a doorbell with the corresponding label, userspace will still
be able to assert the eventfd but no interrupt will be raised on the
guest.

Co-developed-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Change-Id: Ia3a08edfa77f10519c56be9e332f79f08cd89d57
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-25-quic_eberman@quicinc.com/
2023-03-30 19:20:30 +00:00
Elliot Berman
94346082c1 FROMLIST: virt: gunyah: Add hypercalls for sending doorbell
Gunyah doorbells allow two virtual machines to signal each other using
interrupts. Add the hypercalls needed to assert the interrupt.

Change-Id: I2b7a8a96106e446a701dc53724f72ab8a94c1996
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-24-quic_eberman@quicinc.com/
2023-03-30 19:20:30 +00:00
Elliot Berman
aeccb8b9e9 FROMLIST: virt: gunyah: Add proxy-scheduled vCPUs
Gunyah allows host virtual machines to schedule guest virtual machines
and handle their MMIO accesses. vCPUs are presented to the host as a
Gunyah resource and represented to userspace as a Gunyah VM function.

Creating the vcpu VM function will create a file descriptor that:
 - can run an ioctl: GH_VCPU_RUN to schedule the guest vCPU until the
   next interrupt occurs on the host or when the guest vCPU can no
   longer be run.
 - can be mmap'd to share a gh_vcpu_run structure which can look up the
   reason why GH_VCPU_RUN returned and provide return values for MMIO
   access.

Co-developed-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Change-Id: I8939bdfa61a9836a5a61c6616818c1eb2078c0f1
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-23-quic_eberman@quicinc.com/
2023-03-30 19:20:30 +00:00
Elliot Berman
1679f7f667 FROMLIST: virt: gunyah: Add IO handlers
Add framework for VM functions to handle stage-2 write faults from Gunyah
guest virtual machines. IO handlers have a range of addresses which they
apply to. Optionally, they may apply to only when the value written
matches the IO handler's value.

Co-developed-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Change-Id: I52339f24463e554b5b659b6bd0a868ffdc6a6915
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-22-quic_eberman@quicinc.com/
2023-03-30 19:20:30 +00:00
Elliot Berman
4e7721a266 BACKPORT: FROMLIST: virt: gunyah: Add resource tickets
Some VM functions need to acquire Gunyah resources. For instance, Gunyah
vCPUs are exposed to the host as a resource. The Gunyah vCPU function
will register a resource ticket and be able to interact with the
hypervisor once the resource ticket is filled.

Resource tickets are the mechanism for functions to acquire ownership of
Gunyah resources. Gunyah functions can be created before the VM's
resources are created and made available to Linux. A resource ticket
identifies a type of resource and a label of a resource which the ticket
holder is interested in.

Resources are created by Gunyah as configured in the VM's devicetree
configuration. Gunyah doesn't process the label and that makes it
possible for userspace to create multiple resources with the same label.
Resource ticket owners need to be prepared for populate to be called
multiple times if userspace created multiple resources with the same
label.

Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>

Change-Id: I34a590dc0010dd5aa6332701cb6e394836d1fb4b
[Elliot: resolve trivial merge conflicts]
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-21-quic_eberman@quicinc.com/
2023-03-30 19:20:30 +00:00
Elliot Berman
291489ffb6 BACKPORT: FROMLIST: gunyah: vm_mgr: Add framework to add VM Functions
Introduce a framework for Gunyah userspace to install VM functions. VM
functions are optional interfaces to the virtual machine. vCPUs,
ioeventfs, and irqfds are examples of such VM functions and are
implemented in subsequent patches.

A generic framework is implemented instead of individual ioctls to
create vCPUs, irqfds, etc., in order to simplify the VM manager core
implementation and allow dynamic loading of VM function modules.

Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>

Change-Id: I616fa24621348bb6a3a23b400a80423cb91a0d78
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-20-quic_eberman@quicinc.com/
[Elliot: gh_vm_free adjustments for gh_rm_vm_reset]
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2023-03-30 19:20:30 +00:00
Elliot Berman
4cf9feacb7 FROMLIST: virt: gunyah: Translate gh_rm_hyp_resource into gunyah_resource
When booting a Gunyah virtual machine, the host VM may gain capabilities
to interact with resources for the guest virtual machine. Examples of
such resources are vCPUs or message queues. To use those resources, we
need to translate the RM response into a gunyah_resource structure which
are useful to Linux drivers. Presently, Linux drivers need only to know
the type of resource, the capability ID, and an interrupt.

On ARM64 systems, the interrupt reported by Gunyah is the GIC interrupt
ID number and always a SPI.

Change-Id: Ia2ba79a8a12b70906b020ae3952ea2db746ff849
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-19-quic_eberman@quicinc.com/
2023-03-30 19:20:30 +00:00
Elliot Berman
adf7510f3b FROMLIST: docs: gunyah: Document Gunyah VM Manager
Document the ioctls and usage of Gunyah VM Manager driver.

Change-Id: I5f27421a5e20590295164963a5dd4f6ca74378b4
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-18-quic_eberman@quicinc.com/
2023-03-30 19:20:29 +00:00
Elliot Berman
1d5147b349 BACKPORT: FROMLIST: gunyah: rsc_mgr: Add platform ops on mem_lend/mem_reclaim
On Qualcomm platforms, there is a firmware entity which controls access
to physical pages. In order to share memory with another VM, this entity
needs to be informed that the guest VM should have access to the memory.

Co-developed-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>

Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-16-quic_eberman@quicinc.com/
Change-Id: I58afd74f0a2f0bcfa1e2eb33a64d7146121f4a3e
[eberman: Rename gunyah_rm_platform_ops as gh_rm_platform_ops]
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2023-03-30 19:20:29 +00:00
Elliot Berman
8f5b89a5bc FROMLIST: samples: Add sample userspace Gunyah VM Manager
Add a sample Gunyah VMM capable of launching a non-proxy scheduled VM.

Change-Id: Idb561b8479fa12edc856cc600f44ebeddefd761f
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-15-quic_eberman@quicinc.com/
2023-03-30 19:20:29 +00:00
Elliot Berman
fa4e7824da BACKPORT: FROMLIST: gunyah: vm_mgr: Add ioctls to support basic non-proxy VM boot
Add remaining ioctls to support non-proxy VM boot:

 - Gunyah Resource Manager uses the VM's devicetree to configure the
   virtual machine. The location of the devicetree in the guest's
   virtual memory can be declared via the SET_DTB_CONFIG ioctl.
 - Trigger start of the virtual machine with VM_START ioctl.

Co-developed-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>

Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-14-quic_eberman@quicinc.com/
Change-Id: Iade2105969dc9bde2274e124696a5fb914478236
[Elliot: fixup gh_vm_free flow to align with future v12 patch]
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2023-03-30 19:20:29 +00:00
Elliot Berman
afe9d3b501 FROMLIST: gunyah: vm_mgr: Add/remove user memory regions
When launching a virtual machine, Gunyah userspace allocates memory for
the guest and informs Gunyah about these memory regions through
SET_USER_MEMORY_REGION ioctl.

Co-developed-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Change-Id: Iddd31901bb8b0dc4e7db77d98a7692718ad65c2e
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-13-quic_eberman@quicinc.com/
2023-03-30 19:20:29 +00:00
Elliot Berman
4148b1fd17 FROMLIST: gunyah: rsc_mgr: Add RPC for sharing memory
Gunyah resource manager provides API to manipulate stage 2 page tables.
Manipulations are represented as a memory parcel. Memory parcels
describe a list of memory regions (intermediate physical address and
size), a list of new permissions for VMs, and the memory type (DDR or
MMIO). Memory parcels are uniquely identified by a handle allocated by
Gunyah. There are a few types of memory parcel sharing which Gunyah
supports:

 - Sharing: the guest and host VM both have access
 - Lending: only the guest has access; host VM loses access
 - Donating: Permanently lent (not reclaimed even if guest shuts down)

Memory parcels that have been shared or lent can be reclaimed by the
host via an additional call. The reclaim operation restores the original
access the host VM had to the memory parcel and removes the access to
other VM.

One point to note that memory parcels don't describe where in the guest
VM the memory parcel should reside. The guest VM must accept the memory
parcel either explicitly via a "gh_rm_mem_accept" call (not introduced
here) or be configured to accept it automatically at boot. As the guest
VM accepts the memory parcel, it also mentions the IPA it wants to place
memory parcel.

Co-developed-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Change-Id: I0b36063c2d809448b8fec68a5043c94dbab23806
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-12-quic_eberman@quicinc.com/
2023-03-30 19:20:29 +00:00
Elliot Berman
f251362242 BACKPORT: FROMLIST: gunyah: vm_mgr: Introduce basic VM Manager
Gunyah VM manager is a kernel moduel which exposes an interface to
Gunyah userspace to load, run, and interact with other Gunyah virtual
machines. The interface is a character device at /dev/gunyah.

Add a basic VM manager driver. Upcoming patches will add more ioctls
into this driver.

Co-developed-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>

Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-11-quic_eberman@quicinc.com/
[Elliot: switch ENOIOCTLCMD to ENOTTY]
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Change-Id: I593c754d0a56f274fa92a3f165dde2e31b85af45
2023-03-30 19:20:28 +00:00
Elliot Berman
7cfd6e6f7d FROMLIST: gunyah: rsc_mgr: Add VM lifecycle RPC
Add Gunyah Resource Manager RPC to launch an unauthenticated VM.

Change-Id: I1ff2e58b1f3249a9387ec10adeea1b04600369e4
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-10-quic_eberman@quicinc.com/
2023-03-30 19:20:28 +00:00
Elliot Berman
d5e8df2cc4 FROMLIST: gunyah: rsc_mgr: Add resource manager RPC core
The resource manager is a special virtual machine which is always
running on a Gunyah system. It provides APIs for creating and destroying
VMs, secure memory management, sharing/lending of memory between VMs,
and setup of inter-VM communication. Calls to the resource manager are
made via message queues.

This patch implements the basic probing and RPC mechanism to make those
API calls. Request/response calls can be made with gh_rm_call.
Drivers can also register to notifications pushed by RM via
gh_rm_register_notifier

Specific API calls that resource manager supports will be implemented in
subsequent patches.

Change-Id: I118738f2bf0d038b175ce346ec75a648a12653f1
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-9-quic_eberman@quicinc.com/
2023-03-30 19:20:28 +00:00
Elliot Berman
24bfb2e90d FROMLIST: mailbox: Add Gunyah message queue mailbox
Gunyah message queues are a unidirectional inter-VM pipe for messages up
to 1024 bytes. This driver supports pairing a receiver message queue and
a transmitter message queue to expose a single mailbox channel.

Change-Id: I46d07e553a6887212d9c294d2a796f7f837e23b2
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-8-quic_eberman@quicinc.com/
2023-03-30 19:20:28 +00:00
Elliot Berman
5943689fc3 FROMLIST: virt: gunyah: msgq: Add hypercalls to send and receive messages
Add hypercalls to send and receive messages on a Gunyah message queue.

Change-Id: I4ee7893c4ce76ea273fa4db7c43c345905f87ed0
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-7-quic_eberman@quicinc.com/
2023-03-30 19:20:28 +00:00
Elliot Berman
cc7db24050 FROMLIST: virt: gunyah: Identify hypervisor version
Export the version of Gunyah which is reported via the hyp_identify
hypercall. Increments of the major API version indicate possibly
backwards incompatible changes.

Export the hypervisor identity so that Gunyah drivers can act according
to the major API version.

Change-Id: I170271229a851641949076a6eeadc1df32dffe17
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-6-quic_eberman@quicinc.com/
2023-03-30 19:20:28 +00:00
Elliot Berman
b30fcf8c58 FROMLIST: virt: gunyah: Add hypercalls to identify Gunyah
Add hypercalls to identify when Linux is running a virtual machine under
Gunyah.

There are two calls to help identify Gunyah:

1. gh_hypercall_get_uid() returns a UID when running under a Gunyah
   hypervisor.
2. gh_hypercall_hyp_identify() returns build information and a set of
   feature flags that are supported by Gunyah.

Change-Id: Ie11b9cad6854b3dabcc406e82ea9f7a1c7f67b9c
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-5-quic_eberman@quicinc.com/
2023-03-30 19:20:27 +00:00
Elliot Berman
256b469b57 FROMLIST: gunyah: Common types and error codes for Gunyah hypercalls
Add architecture-independent standard error codes, types, and macros for
Gunyah hypercalls.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Change-Id: Ib4a98bf881639d0b7e11a9e667beaf54456eecc7
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-4-quic_eberman@quicinc.com/
2023-03-30 19:20:27 +00:00
Elliot Berman
1a54a27528 FROMLIST: dt-bindings: Add binding for gunyah hypervisor
When Linux is booted as a guest under the Gunyah hypervisor, the Gunyah
Resource Manager applies a devicetree overlay describing the virtual
platform configuration of the guest VM, such as the message queue
capability IDs for communicating with the Resource Manager. This
information is not otherwise discoverable by a VM: the Gunyah hypervisor
core does not provide a direct interface to discover capability IDs nor
a way to communicate with RM without having already known the
corresponding message queue capability ID. Add the DT bindings that
Gunyah adheres for the hypervisor node and message queues.

Reviewed-by: Rob Herring <robh@kernel.org>
Change-Id: I2e438f59c42e169380d4e3212619af4acf282578
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Bug: 268234781
Link: https://lore.kernel.org/all/20230304010632.2127470-3-quic_eberman@quicinc.com/
2023-03-30 19:20:27 +00:00
Elliot Berman
de3283f904 FROMLIST: docs: gunyah: Introduce Gunyah Hypervisor
Gunyah is an open-source Type-1 hypervisor developed by Qualcomm. It
does not depend on any lower-privileged OS/kernel code for its core
functionality. This increases its security and can support a smaller
trusted computing based when compared to Type-2 hypervisors.

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

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

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

The KMI changes include:

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

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

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

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

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

Bug: 273448633
Change-Id: I83a3ac822275d2464af7eb25b869b816fdb7276e
Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>
2023-03-30 15:35:48 +00:00