Merge 5.10.110 into android12-5.10-lts

Changes in 5.10.110
	swiotlb: fix info leak with DMA_FROM_DEVICE
	USB: serial: pl2303: add IBM device IDs
	USB: serial: simple: add Nokia phone driver
	hv: utils: add PTP_1588_CLOCK to Kconfig to fix build
	netdevice: add the case if dev is NULL
	HID: logitech-dj: add new lightspeed receiver id
	xfrm: fix tunnel model fragmentation behavior
	ARM: mstar: Select HAVE_ARM_ARCH_TIMER
	virtio_console: break out of buf poll on remove
	vdpa/mlx5: should verify CTRL_VQ feature exists for MQ
	tools/virtio: fix virtio_test execution
	ethernet: sun: Free the coherent when failing in probing
	gpio: Revert regression in sysfs-gpio (gpiolib.c)
	spi: Fix invalid sgs value
	net:mcf8390: Use platform_get_irq() to get the interrupt
	Revert "gpio: Revert regression in sysfs-gpio (gpiolib.c)"
	spi: Fix erroneous sgs value with min_t()
	Input: zinitix - do not report shadow fingers
	af_key: add __GFP_ZERO flag for compose_sadb_supported in function pfkey_register
	net: dsa: microchip: add spi_device_id tables
	locking/lockdep: Avoid potential access of invalid memory in lock_class
	iommu/iova: Improve 32-bit free space estimate
	tpm: fix reference counting for struct tpm_chip
	virtio-blk: Use blk_validate_block_size() to validate block size
	USB: usb-storage: Fix use of bitfields for hardware data in ene_ub6250.c
	xhci: fix garbage USBSTS being logged in some cases
	xhci: fix runtime PM imbalance in USB2 resume
	xhci: make xhci_handshake timeout for xhci_reset() adjustable
	xhci: fix uninitialized string returned by xhci_decode_ctrl_ctx()
	mei: me: add Alder Lake N device id.
	mei: avoid iterator usage outside of list_for_each_entry
	coresight: Fix TRCCONFIGR.QE sysfs interface
	iio: afe: rescale: use s64 for temporary scale calculations
	iio: inkern: apply consumer scale on IIO_VAL_INT cases
	iio: inkern: apply consumer scale when no channel scale is available
	iio: inkern: make a best effort on offset calculation
	greybus: svc: fix an error handling bug in gb_svc_hello()
	clk: uniphier: Fix fixed-rate initialization
	ptrace: Check PTRACE_O_SUSPEND_SECCOMP permission on PTRACE_SEIZE
	KEYS: fix length validation in keyctl_pkey_params_get_2()
	Documentation: add link to stable release candidate tree
	Documentation: update stable tree link
	firmware: stratix10-svc: add missing callback parameter on RSU
	HID: intel-ish-hid: Use dma_alloc_coherent for firmware update
	SUNRPC: avoid race between mod_timer() and del_timer_sync()
	NFSD: prevent underflow in nfssvc_decode_writeargs()
	NFSD: prevent integer overflow on 32 bit systems
	f2fs: fix to unlock page correctly in error path of is_alive()
	f2fs: quota: fix loop condition at f2fs_quota_sync()
	f2fs: fix to do sanity check on .cp_pack_total_block_count
	remoteproc: Fix count check in rproc_coredump_write()
	pinctrl: samsung: drop pin banks references on error paths
	spi: mxic: Fix the transmit path
	mtd: rawnand: protect access to rawnand devices while in suspend
	can: ems_usb: ems_usb_start_xmit(): fix double dev_kfree_skb() in error path
	jffs2: fix use-after-free in jffs2_clear_xattr_subsystem
	jffs2: fix memory leak in jffs2_do_mount_fs
	jffs2: fix memory leak in jffs2_scan_medium
	mm/pages_alloc.c: don't create ZONE_MOVABLE beyond the end of a node
	mm: invalidate hwpoison page cache page in fault path
	mempolicy: mbind_range() set_policy() after vma_merge()
	scsi: libsas: Fix sas_ata_qc_issue() handling of NCQ NON DATA commands
	qed: display VF trust config
	qed: validate and restrict untrusted VFs vlan promisc mode
	riscv: Fix fill_callchain return value
	riscv: Increase stack size under KASAN
	Revert "Input: clear BTN_RIGHT/MIDDLE on buttonpads"
	cifs: prevent bad output lengths in smb2_ioctl_query_info()
	cifs: fix NULL ptr dereference in smb2_ioctl_query_info()
	ALSA: cs4236: fix an incorrect NULL check on list iterator
	ALSA: hda: Avoid unsol event during RPM suspending
	ALSA: pcm: Fix potential AB/BA lock with buffer_mutex and mmap_lock
	ALSA: hda/realtek: Fix audio regression on Mi Notebook Pro 2020
	mm: madvise: skip unmapped vma holes passed to process_madvise
	mm: madvise: return correct bytes advised with process_madvise
	Revert "mm: madvise: skip unmapped vma holes passed to process_madvise"
	mm,hwpoison: unmap poisoned page before invalidation
	mm/kmemleak: reset tag when compare object pointer
	dm integrity: set journal entry unused when shrinking device
	drbd: fix potential silent data corruption
	can: isotp: sanitize CAN ID checks in isotp_bind()
	powerpc/kvm: Fix kvm_use_magic_page
	udp: call udp_encap_enable for v6 sockets when enabling encap
	arm64: signal: nofpsimd: Do not allocate fp/simd context when not available
	arm64: dts: ti: k3-am65: Fix gic-v3 compatible regs
	arm64: dts: ti: k3-j721e: Fix gic-v3 compatible regs
	arm64: dts: ti: k3-j7200: Fix gic-v3 compatible regs
	ACPI: properties: Consistently return -ENOENT if there are no more references
	coredump: Also dump first pages of non-executable ELF libraries
	ext4: fix ext4_fc_stats trace point
	ext4: fix fs corruption when tring to remove a non-empty directory with IO error
	drivers: hamradio: 6pack: fix UAF bug caused by mod_timer()
	mailbox: tegra-hsp: Flush whole channel
	block: limit request dispatch loop duration
	block: don't merge across cgroup boundaries if blkcg is enabled
	drm/edid: check basic audio support on CEA extension block
	video: fbdev: sm712fb: Fix crash in smtcfb_read()
	video: fbdev: atari: Atari 2 bpp (STe) palette bugfix
	ARM: dts: at91: sama5d2: Fix PMERRLOC resource size
	ARM: dts: exynos: fix UART3 pins configuration in Exynos5250
	ARM: dts: exynos: add missing HDMI supplies on SMDK5250
	ARM: dts: exynos: add missing HDMI supplies on SMDK5420
	mgag200 fix memmapsl configuration in GCTL6 register
	carl9170: fix missing bit-wise or operator for tx_params
	pstore: Don't use semaphores in always-atomic-context code
	thermal: int340x: Increase bitmap size
	lib/raid6/test: fix multiple definition linking error
	exec: Force single empty string when argv is empty
	crypto: rsa-pkcs1pad - only allow with rsa
	crypto: rsa-pkcs1pad - correctly get hash from source scatterlist
	crypto: rsa-pkcs1pad - restore signature length check
	crypto: rsa-pkcs1pad - fix buffer overread in pkcs1pad_verify_complete()
	bcache: fixup multiple threads crash
	DEC: Limit PMAX memory probing to R3k systems
	media: gpio-ir-tx: fix transmit with long spaces on Orange Pi PC
	media: davinci: vpif: fix unbalanced runtime PM get
	media: davinci: vpif: fix unbalanced runtime PM enable
	xtensa: fix stop_machine_cpuslocked call in patch_text
	xtensa: fix xtensa_wsr always writing 0
	brcmfmac: firmware: Allocate space for default boardrev in nvram
	brcmfmac: pcie: Release firmwares in the brcmf_pcie_setup error path
	brcmfmac: pcie: Replace brcmf_pcie_copy_mem_todev with memcpy_toio
	brcmfmac: pcie: Fix crashes due to early IRQs
	drm/i915/opregion: check port number bounds for SWSCI display power state
	drm/i915/gem: add missing boundary check in vm_access
	PCI: pciehp: Clear cmd_busy bit in polling mode
	PCI: xgene: Revert "PCI: xgene: Fix IB window setup"
	regulator: qcom_smd: fix for_each_child.cocci warnings
	selinux: check return value of sel_make_avc_files
	hwrng: cavium - Check health status while reading random data
	hwrng: cavium - HW_RANDOM_CAVIUM should depend on ARCH_THUNDER
	crypto: sun8i-ss - really disable hash on A80
	crypto: authenc - Fix sleep in atomic context in decrypt_tail
	crypto: mxs-dcp - Fix scatterlist processing
	thermal: int340x: Check for NULL after calling kmemdup()
	spi: tegra114: Add missing IRQ check in tegra_spi_probe
	arm64/mm: avoid fixmap race condition when create pud mapping
	selftests/x86: Add validity check and allow field splitting
	crypto: rockchip - ECB does not need IV
	audit: log AUDIT_TIME_* records only from rules
	EVM: fix the evm= __setup handler return value
	crypto: ccree - don't attempt 0 len DMA mappings
	spi: pxa2xx-pci: Balance reference count for PCI DMA device
	hwmon: (pmbus) Add mutex to regulator ops
	hwmon: (sch56xx-common) Replace WDOG_ACTIVE with WDOG_HW_RUNNING
	nvme: cleanup __nvme_check_ids
	block: don't delete queue kobject before its children
	PM: hibernate: fix __setup handler error handling
	PM: suspend: fix return value of __setup handler
	spi: spi-zynqmp-gqspi: Handle error for dma_set_mask
	hwrng: atmel - disable trng on failure path
	crypto: sun8i-ss - call finalize with bh disabled
	crypto: sun8i-ce - call finalize with bh disabled
	crypto: amlogic - call finalize with bh disabled
	crypto: vmx - add missing dependencies
	clocksource/drivers/timer-ti-dm: Fix regression from errata i940 fix
	clocksource/drivers/exynos_mct: Refactor resources allocation
	clocksource/drivers/exynos_mct: Handle DTS with higher number of interrupts
	clocksource/drivers/timer-microchip-pit64b: Use notrace
	clocksource/drivers/timer-of: Check return value of of_iomap in timer_of_base_init()
	ACPI: APEI: fix return value of __setup handlers
	crypto: ccp - ccp_dmaengine_unregister release dma channels
	crypto: ccree - Fix use after free in cc_cipher_exit()
	vfio: platform: simplify device removal
	amba: Make the remove callback return void
	hwrng: nomadik - Change clk_disable to clk_disable_unprepare
	hwmon: (pmbus) Add Vin unit off handling
	clocksource: acpi_pm: fix return value of __setup handler
	io_uring: terminate manual loop iterator loop correctly for non-vecs
	watch_queue: Fix NULL dereference in error cleanup
	watch_queue: Actually free the watch
	f2fs: fix to enable ATGC correctly via gc_idle sysfs interface
	sched/debug: Remove mpol_get/put and task_lock/unlock from sched_show_numa
	sched/core: Export pelt_thermal_tp
	rseq: Optimise rseq_get_rseq_cs() and clear_rseq_cs()
	rseq: Remove broken uapi field layout on 32-bit little endian
	perf/core: Fix address filter parser for multiple filters
	perf/x86/intel/pt: Fix address filter config for 32-bit kernel
	f2fs: fix missing free nid in f2fs_handle_failed_inode
	nfsd: more robust allocation failure handling in nfsd_file_cache_init
	f2fs: fix to avoid potential deadlock
	btrfs: fix unexpected error path when reflinking an inline extent
	f2fs: compress: remove unneeded read when rewrite whole cluster
	f2fs: fix compressed file start atomic write may cause data corruption
	selftests, x86: fix how check_cc.sh is being invoked
	kunit: make kunit_test_timeout compatible with comment
	media: staging: media: zoran: fix usage of vb2_dma_contig_set_max_seg_size
	media: v4l2-mem2mem: Apply DST_QUEUE_OFF_BASE on MMAP buffers across ioctls
	media: mtk-vcodec: potential dereference of null pointer
	media: bttv: fix WARNING regression on tunerless devices
	ASoC: xilinx: xlnx_formatter_pcm: Handle sysclk setting
	ASoC: generic: simple-card-utils: remove useless assignment
	media: coda: Fix missing put_device() call in coda_get_vdoa_data
	media: meson: vdec: potential dereference of null pointer
	media: hantro: Fix overfill bottom register field name
	media: aspeed: Correct value for h-total-pixels
	video: fbdev: matroxfb: set maxvram of vbG200eW to the same as vbG200 to avoid black screen
	video: fbdev: controlfb: Fix set but not used warnings
	video: fbdev: controlfb: Fix COMPILE_TEST build
	video: fbdev: smscufx: Fix null-ptr-deref in ufx_usb_probe()
	video: fbdev: atmel_lcdfb: fix an error code in atmel_lcdfb_probe()
	video: fbdev: fbcvt.c: fix printing in fb_cvt_print_name()
	firmware: qcom: scm: Remove reassignment to desc following initializer
	ARM: dts: qcom: ipq4019: fix sleep clock
	soc: qcom: rpmpd: Check for null return of devm_kcalloc
	soc: qcom: ocmem: Fix missing put_device() call in of_get_ocmem
	soc: qcom: aoss: remove spurious IRQF_ONESHOT flags
	arm64: dts: qcom: sdm845: fix microphone bias properties and values
	arm64: dts: qcom: sm8150: Correct TCS configuration for apps rsc
	firmware: ti_sci: Fix compilation failure when CONFIG_TI_SCI_PROTOCOL is not defined
	soc: ti: wkup_m3_ipc: Fix IRQ check in wkup_m3_ipc_probe
	ARM: dts: sun8i: v3s: Move the csi1 block to follow address order
	ARM: dts: imx: Add missing LVDS decoder on M53Menlo
	media: video/hdmi: handle short reads of hdmi info frame.
	media: em28xx: initialize refcount before kref_get
	media: usb: go7007: s2250-board: fix leak in probe()
	media: cedrus: H265: Fix neighbour info buffer size
	media: cedrus: h264: Fix neighbour info buffer size
	ASoC: codecs: wcd934x: fix return value of wcd934x_rx_hph_mode_put
	uaccess: fix nios2 and microblaze get_user_8()
	ASoC: rt5663: check the return value of devm_kzalloc() in rt5663_parse_dp()
	ASoC: ti: davinci-i2s: Add check for clk_enable()
	ALSA: spi: Add check for clk_enable()
	arm64: dts: ns2: Fix spi-cpol and spi-cpha property
	arm64: dts: broadcom: Fix sata nodename
	printk: fix return value of printk.devkmsg __setup handler
	ASoC: mxs-saif: Handle errors for clk_enable
	ASoC: atmel_ssc_dai: Handle errors for clk_enable
	ASoC: dwc-i2s: Handle errors for clk_enable
	ASoC: soc-compress: prevent the potentially use of null pointer
	memory: emif: Add check for setup_interrupts
	memory: emif: check the pointer temp in get_device_details()
	ALSA: firewire-lib: fix uninitialized flag for AV/C deferred transaction
	arm64: dts: rockchip: Fix SDIO regulator supply properties on rk3399-firefly
	m68k: coldfire/device.c: only build for MCF_EDMA when h/w macros are defined
	media: stk1160: If start stream fails, return buffers with VB2_BUF_STATE_QUEUED
	media: vidtv: Check for null return of vzalloc
	ASoC: atmel: Add missing of_node_put() in at91sam9g20ek_audio_probe
	ASoC: wm8350: Handle error for wm8350_register_irq
	ASoC: fsi: Add check for clk_enable
	video: fbdev: omapfb: Add missing of_node_put() in dvic_probe_of
	media: saa7134: convert list_for_each to entry variant
	media: saa7134: fix incorrect use to determine if list is empty
	ivtv: fix incorrect device_caps for ivtvfb
	ASoC: rockchip: i2s: Use devm_platform_get_and_ioremap_resource()
	ASoC: rockchip: i2s: Fix missing clk_disable_unprepare() in rockchip_i2s_probe
	ASoC: SOF: Add missing of_node_put() in imx8m_probe
	ASoC: dmaengine: do not use a NULL prepare_slave_config() callback
	ASoC: mxs: Fix error handling in mxs_sgtl5000_probe
	ASoC: fsl_spdif: Disable TX clock when stop
	ASoC: imx-es8328: Fix error return code in imx_es8328_probe()
	ASoC: msm8916-wcd-digital: Fix missing clk_disable_unprepare() in msm8916_wcd_digital_probe
	mmc: davinci_mmc: Handle error for clk_enable
	ASoC: atmel: sam9x5_wm8731: use devm_snd_soc_register_card()
	ASoC: atmel: Fix error handling in sam9x5_wm8731_driver_probe
	ASoC: msm8916-wcd-analog: Fix error handling in pm8916_wcd_analog_spmi_probe
	ASoC: codecs: wcd934x: Add missing of_node_put() in wcd934x_codec_parse_data
	ARM: configs: multi_v5_defconfig: re-enable CONFIG_V4L_PLATFORM_DRIVERS
	drm/meson: osd_afbcd: Add an exit callback to struct meson_afbcd_ops
	drm/bridge: Fix free wrong object in sii8620_init_rcp_input_dev
	drm/bridge: Add missing pm_runtime_disable() in __dw_mipi_dsi_probe
	drm/bridge: nwl-dsi: Fix PM disable depth imbalance in nwl_dsi_probe
	drm: bridge: adv7511: Fix ADV7535 HPD enablement
	ath10k: fix memory overwrite of the WoWLAN wakeup packet pattern
	drm/panfrost: Check for error num after setting mask
	libbpf: Fix possible NULL pointer dereference when destroying skeleton
	udmabuf: validate ubuf->pagecount
	Bluetooth: hci_serdev: call init_rwsem() before p->open()
	mtd: onenand: Check for error irq
	mtd: rawnand: gpmi: fix controller timings setting
	drm/edid: Don't clear formats if using deep color
	ionic: fix type complaint in ionic_dev_cmd_clean()
	drm/nouveau/acr: Fix undefined behavior in nvkm_acr_hsfw_load_bl()
	drm/amd/display: Fix a NULL pointer dereference in amdgpu_dm_connector_add_common_modes()
	drm/amd/pm: return -ENOTSUPP if there is no get_dpm_ultimate_freq function
	ath9k_htc: fix uninit value bugs
	RDMA/core: Set MR type in ib_reg_user_mr
	KVM: PPC: Fix vmx/vsx mixup in mmio emulation
	i40e: don't reserve excessive XDP_PACKET_HEADROOM on XSK Rx to skb
	i40e: respect metadata on XSK Rx to skb
	power: reset: gemini-poweroff: Fix IRQ check in gemini_poweroff_probe
	ray_cs: Check ioremap return value
	powerpc: dts: t1040rdb: fix ports names for Seville Ethernet switch
	KVM: PPC: Book3S HV: Check return value of kvmppc_radix_init
	powerpc/perf: Don't use perf_hw_context for trace IMC PMU
	mt76: mt7915: use proper aid value in mt7915_mcu_wtbl_generic_tlv in sta mode
	mt76: mt7915: use proper aid value in mt7915_mcu_sta_basic_tlv
	mt76: mt7603: check sta_rates pointer in mt7603_sta_rate_tbl_update
	mt76: mt7615: check sta_rates pointer in mt7615_sta_rate_tbl_update
	net: dsa: mv88e6xxx: Enable port policy support on 6097
	scripts/dtc: Call pkg-config POSIXly correct
	livepatch: Fix build failure on 32 bits processors
	PCI: aardvark: Fix reading PCI_EXP_RTSTA_PME bit on emulated bridge
	drm/bridge: dw-hdmi: use safe format when first in bridge chain
	power: supply: ab8500: Fix memory leak in ab8500_fg_sysfs_init
	HID: i2c-hid: fix GET/SET_REPORT for unnumbered reports
	iommu/ipmmu-vmsa: Check for error num after setting mask
	drm/amd/pm: enable pm sysfs write for one VF mode
	drm/amd/display: Add affected crtcs to atomic state for dsc mst unplug
	IB/cma: Allow XRC INI QPs to set their local ACK timeout
	dax: make sure inodes are flushed before destroy cache
	iwlwifi: Fix -EIO error code that is never returned
	iwlwifi: mvm: Fix an error code in iwl_mvm_up()
	drm/msm/dp: populate connector of struct dp_panel
	drm/msm/dpu: add DSPP blocks teardown
	drm/msm/dpu: fix dp audio condition
	dm crypt: fix get_key_size compiler warning if !CONFIG_KEYS
	scsi: pm8001: Fix command initialization in pm80XX_send_read_log()
	scsi: pm8001: Fix command initialization in pm8001_chip_ssp_tm_req()
	scsi: pm8001: Fix payload initialization in pm80xx_set_thermal_config()
	scsi: pm8001: Fix le32 values handling in pm80xx_set_sas_protocol_timer_config()
	scsi: pm8001: Fix payload initialization in pm80xx_encrypt_update()
	scsi: pm8001: Fix le32 values handling in pm80xx_chip_ssp_io_req()
	scsi: pm8001: Fix le32 values handling in pm80xx_chip_sata_req()
	scsi: pm8001: Fix NCQ NON DATA command task initialization
	scsi: pm8001: Fix NCQ NON DATA command completion handling
	scsi: pm8001: Fix abort all task initialization
	RDMA/mlx5: Fix the flow of a miss in the allocation of a cache ODP MR
	drm/amd/display: Remove vupdate_int_entry definition
	TOMOYO: fix __setup handlers return values
	ext2: correct max file size computing
	drm/tegra: Fix reference leak in tegra_dsi_ganged_probe
	power: supply: bq24190_charger: Fix bq24190_vbus_is_enabled() wrong false return
	scsi: hisi_sas: Change permission of parameter prot_mask
	drm/bridge: cdns-dsi: Make sure to to create proper aliases for dt
	bpf, arm64: Call build_prologue() first in first JIT pass
	bpf, arm64: Feed byte-offset into bpf line info
	gpu: host1x: Fix a memory leak in 'host1x_remove()'
	libbpf: Skip forward declaration when counting duplicated type names
	powerpc/mm/numa: skip NUMA_NO_NODE onlining in parse_numa_properties()
	powerpc/Makefile: Don't pass -mcpu=powerpc64 when building 32-bit
	KVM: x86: Fix emulation in writing cr8
	KVM: x86/emulator: Defer not-present segment check in __load_segment_descriptor()
	hv_balloon: rate-limit "Unhandled message" warning
	i2c: xiic: Make bus names unique
	power: supply: wm8350-power: Handle error for wm8350_register_irq
	power: supply: wm8350-power: Add missing free in free_charger_irq
	IB/hfi1: Allow larger MTU without AIP
	PCI: Reduce warnings on possible RW1C corruption
	net: axienet: fix RX ring refill allocation failure handling
	mips: DEC: honor CONFIG_MIPS_FP_SUPPORT=n
	powerpc/sysdev: fix incorrect use to determine if list is empty
	mfd: mc13xxx: Add check for mc13xxx_irq_request
	libbpf: Unmap rings when umem deleted
	selftests/bpf: Make test_lwt_ip_encap more stable and faster
	platform/x86: huawei-wmi: check the return value of device_create_file()
	powerpc: 8xx: fix a return value error in mpc8xx_pic_init
	vxcan: enable local echo for sent CAN frames
	ath10k: Fix error handling in ath10k_setup_msa_resources
	mips: cdmm: Fix refcount leak in mips_cdmm_phys_base
	MIPS: RB532: fix return value of __setup handler
	MIPS: pgalloc: fix memory leak caused by pgd_free()
	mtd: rawnand: atmel: fix refcount issue in atmel_nand_controller_init
	RDMA/mlx5: Fix memory leak in error flow for subscribe event routine
	bpf, sockmap: Fix memleak in tcp_bpf_sendmsg while sk msg is full
	bpf, sockmap: Fix more uncharged while msg has more_data
	bpf, sockmap: Fix double uncharge the mem of sk_msg
	samples/bpf, xdpsock: Fix race when running for fix duration of time
	USB: storage: ums-realtek: fix error code in rts51x_read_mem()
	can: isotp: return -EADDRNOTAVAIL when reading from unbound socket
	can: isotp: support MSG_TRUNC flag when reading from socket
	bareudp: use ipv6_mod_enabled to check if IPv6 enabled
	selftests/bpf: Fix error reporting from sock_fields programs
	Bluetooth: call hci_le_conn_failed with hdev lock in hci_le_conn_failed
	Bluetooth: btmtksdio: Fix kernel oops in btmtksdio_interrupt
	ipv4: Fix route lookups when handling ICMP redirects and PMTU updates
	af_netlink: Fix shift out of bounds in group mask calculation
	i2c: meson: Fix wrong speed use from probe
	i2c: mux: demux-pinctrl: do not deactivate a master that is not active
	selftests/bpf/test_lirc_mode2.sh: Exit with proper code
	PCI: Avoid broken MSI on SB600 USB devices
	net: bcmgenet: Use stronger register read/writes to assure ordering
	tcp: ensure PMTU updates are processed during fastopen
	openvswitch: always update flow key after nat
	tipc: fix the timer expires after interval 100ms
	mfd: asic3: Add missing iounmap() on error asic3_mfd_probe
	mxser: fix xmit_buf leak in activate when LSR == 0xff
	pwm: lpc18xx-sct: Initialize driver data and hardware before pwmchip_add()
	fsi: aspeed: convert to devm_platform_ioremap_resource
	fsi: Aspeed: Fix a potential double free
	misc: alcor_pci: Fix an error handling path
	cpufreq: qcom-cpufreq-nvmem: fix reading of PVS Valid fuse
	soundwire: intel: fix wrong register name in intel_shim_wake
	clk: qcom: ipq8074: fix PCI-E clock oops
	iio: mma8452: Fix probe failing when an i2c_device_id is used
	staging:iio:adc:ad7280a: Fix handing of device address bit reversing.
	pinctrl: renesas: r8a77470: Reduce size for narrow VIN1 channel
	pinctrl: renesas: checker: Fix miscalculation of number of states
	clk: qcom: ipq8074: Use floor ops for SDCC1 clock
	phy: dphy: Correct lpx parameter and its derivatives(ta_{get,go,sure})
	serial: 8250_mid: Balance reference count for PCI DMA device
	serial: 8250_lpss: Balance reference count for PCI DMA device
	NFS: Use of mapping_set_error() results in spurious errors
	serial: 8250: Fix race condition in RTS-after-send handling
	iio: adc: Add check for devm_request_threaded_irq
	habanalabs: Add check for pci_enable_device
	NFS: Return valid errors from nfs2/3_decode_dirent()
	dma-debug: fix return value of __setup handlers
	clk: imx7d: Remove audio_mclk_root_clk
	clk: at91: sama7g5: fix parents of PDMCs' GCLK
	clk: qcom: clk-rcg2: Update logic to calculate D value for RCG
	clk: qcom: clk-rcg2: Update the frac table for pixel clock
	dmaengine: hisi_dma: fix MSI allocate fail when reload hisi_dma
	remoteproc: qcom: Fix missing of_node_put in adsp_alloc_memory_region
	remoteproc: qcom_wcnss: Add missing of_node_put() in wcnss_alloc_memory_region
	remoteproc: qcom_q6v5_mss: Fix some leaks in q6v5_alloc_memory_region
	nvdimm/region: Fix default alignment for small regions
	clk: actions: Terminate clk_div_table with sentinel element
	clk: loongson1: Terminate clk_div_table with sentinel element
	clk: clps711x: Terminate clk_div_table with sentinel element
	clk: tegra: tegra124-emc: Fix missing put_device() call in emc_ensure_emc_driver
	NFS: remove unneeded check in decode_devicenotify_args()
	staging: mt7621-dts: fix LEDs and pinctrl on GB-PC1 devicetree
	staging: mt7621-dts: fix formatting
	staging: mt7621-dts: fix pinctrl properties for ethernet
	staging: mt7621-dts: fix GB-PC2 devicetree
	pinctrl: mediatek: Fix missing of_node_put() in mtk_pctrl_init
	pinctrl: mediatek: paris: Fix PIN_CONFIG_BIAS_* readback
	pinctrl: mediatek: paris: Fix "argument" argument type for mtk_pinconf_get()
	pinctrl: mediatek: paris: Fix pingroup pin config state readback
	pinctrl: mediatek: paris: Skip custom extra pin config dump for virtual GPIOs
	pinctrl: nomadik: Add missing of_node_put() in nmk_pinctrl_probe
	pinctrl/rockchip: Add missing of_node_put() in rockchip_pinctrl_probe
	tty: hvc: fix return value of __setup handler
	kgdboc: fix return value of __setup handler
	serial: 8250: fix XOFF/XON sending when DMA is used
	kgdbts: fix return value of __setup handler
	firmware: google: Properly state IOMEM dependency
	driver core: dd: fix return value of __setup handler
	jfs: fix divide error in dbNextAG
	netfilter: nf_conntrack_tcp: preserve liberal flag in tcp options
	NFSv4.1: don't retry BIND_CONN_TO_SESSION on session error
	kdb: Fix the putarea helper function
	clk: qcom: gcc-msm8994: Fix gpll4 width
	clk: Initialize orphan req_rate
	xen: fix is_xen_pmu()
	net: enetc: report software timestamping via SO_TIMESTAMPING
	net: hns3: fix bug when PF set the duplicate MAC address for VFs
	net: phy: broadcom: Fix brcm_fet_config_init()
	selftests: test_vxlan_under_vrf: Fix broken test case
	qlcnic: dcb: default to returning -EOPNOTSUPP
	net/x25: Fix null-ptr-deref caused by x25_disconnect
	NFSv4/pNFS: Fix another issue with a list iterator pointing to the head
	net: dsa: bcm_sf2_cfp: fix an incorrect NULL check on list iterator
	fs: fd tables have to be multiples of BITS_PER_LONG
	lib/test: use after free in register_test_dev_kmod()
	fs: fix fd table size alignment properly
	LSM: general protection fault in legacy_parse_param
	regulator: rpi-panel: Handle I2C errors/timing to the Atmel
	gcc-plugins/stackleak: Exactly match strings instead of prefixes
	pinctrl: npcm: Fix broken references to chip->parent_device
	block, bfq: don't move oom_bfqq
	selinux: use correct type for context length
	selinux: allow FIOCLEX and FIONCLEX with policy capability
	loop: use sysfs_emit() in the sysfs xxx show()
	Fix incorrect type in assignment of ipv6 port for audit
	irqchip/qcom-pdc: Fix broken locking
	irqchip/nvic: Release nvic_base upon failure
	fs/binfmt_elf: Fix AT_PHDR for unusual ELF files
	bfq: fix use-after-free in bfq_dispatch_request
	ACPICA: Avoid walking the ACPI Namespace if it is not there
	lib/raid6/test/Makefile: Use $(pound) instead of \# for Make 4.3
	Revert "Revert "block, bfq: honor already-setup queue merges""
	ACPI/APEI: Limit printable size of BERT table data
	PM: core: keep irq flags in device_pm_check_callbacks()
	parisc: Fix handling off probe non-access faults
	nvme-tcp: lockdep: annotate in-kernel sockets
	spi: tegra20: Use of_device_get_match_data()
	locking/lockdep: Iterate lock_classes directly when reading lockdep files
	ext4: correct cluster len and clusters changed accounting in ext4_mb_mark_bb
	ext4: fix ext4_mb_mark_bb() with flex_bg with fast_commit
	ext4: don't BUG if someone dirty pages without asking ext4 first
	f2fs: fix to do sanity check on curseg->alloc_type
	NFSD: Fix nfsd_breaker_owns_lease() return values
	f2fs: compress: fix to print raw data size in error path of lz4 decompression
	ntfs: add sanity check on allocation size
	media: staging: media: zoran: move videodev alloc
	media: staging: media: zoran: calculate the right buffer number for zoran_reap_stat_com
	media: staging: media: zoran: fix various V4L2 compliance errors
	media: ir_toy: free before error exiting
	video: fbdev: nvidiafb: Use strscpy() to prevent buffer overflow
	video: fbdev: w100fb: Reset global state
	video: fbdev: cirrusfb: check pixclock to avoid divide by zero
	video: fbdev: omapfb: acx565akm: replace snprintf with sysfs_emit
	ARM: dts: qcom: fix gic_irq_domain_translate warnings for msm8960
	ARM: dts: bcm2837: Add the missing L1/L2 cache information
	ASoC: madera: Add dependencies on MFD
	media: atomisp_gmin_platform: Add DMI quirk to not turn AXP ELDO2 regulator off on some boards
	media: atomisp: fix dummy_ptr check to avoid duplicate active_bo
	ARM: ftrace: avoid redundant loads or clobbering IP
	ARM: dts: imx7: Use audio_mclk_post_div instead audio_mclk_root_clk
	arm64: defconfig: build imx-sdma as a module
	video: fbdev: omapfb: panel-dsi-cm: Use sysfs_emit() instead of snprintf()
	video: fbdev: omapfb: panel-tpo-td043mtea1: Use sysfs_emit() instead of snprintf()
	video: fbdev: udlfb: replace snprintf in show functions with sysfs_emit
	ARM: dts: bcm2711: Add the missing L1/L2 cache information
	ASoC: soc-core: skip zero num_dai component in searching dai name
	media: cx88-mpeg: clear interrupt status register before streaming video
	uaccess: fix type mismatch warnings from access_ok()
	lib/test_lockup: fix kernel pointer check for separate address spaces
	ARM: tegra: tamonten: Fix I2C3 pad setting
	ARM: mmp: Fix failure to remove sram device
	video: fbdev: sm712fb: Fix crash in smtcfb_write()
	media: Revert "media: em28xx: add missing em28xx_close_extension"
	media: hdpvr: initialize dev->worker at hdpvr_register_videodev
	mmc: host: Return an error when ->enable_sdio_irq() ops is missing
	media: atomisp: fix bad usage at error handling logic
	ALSA: hda/realtek: Add alc256-samsung-headphone fixup
	KVM: x86/mmu: Check for present SPTE when clearing dirty bit in TDP MMU
	powerpc/kasan: Fix early region not updated correctly
	powerpc/lib/sstep: Fix 'sthcx' instruction
	powerpc/lib/sstep: Fix build errors with newer binutils
	powerpc: Fix build errors with newer binutils
	scsi: qla2xxx: Fix stuck session in gpdb
	scsi: qla2xxx: Fix scheduling while atomic
	scsi: qla2xxx: Fix wrong FDMI data for 64G adapter
	scsi: qla2xxx: Fix warning for missing error code
	scsi: qla2xxx: Fix device reconnect in loop topology
	scsi: qla2xxx: Add devids and conditionals for 28xx
	scsi: qla2xxx: Check for firmware dump already collected
	scsi: qla2xxx: Suppress a kernel complaint in qla_create_qpair()
	scsi: qla2xxx: Fix disk failure to rediscover
	scsi: qla2xxx: Fix incorrect reporting of task management failure
	scsi: qla2xxx: Fix hang due to session stuck
	scsi: qla2xxx: Fix missed DMA unmap for NVMe ls requests
	scsi: qla2xxx: Fix N2N inconsistent PLOGI
	scsi: qla2xxx: Reduce false trigger to login
	scsi: qla2xxx: Use correct feature type field during RFF_ID processing
	platform: chrome: Split trace include file
	KVM: x86: Forbid VMM to set SYNIC/STIMER MSRs when SynIC wasn't activated
	KVM: Prevent module exit until all VMs are freed
	KVM: x86: fix sending PV IPI
	KVM: SVM: fix panic on out-of-bounds guest IRQ
	ASoC: SOF: Intel: Fix NULL ptr dereference when ENOMEM
	ubifs: rename_whiteout: Fix double free for whiteout_ui->data
	ubifs: Fix deadlock in concurrent rename whiteout and inode writeback
	ubifs: Add missing iput if do_tmpfile() failed in rename whiteout
	ubifs: setflags: Make dirtied_ino_d 8 bytes aligned
	ubifs: Fix read out-of-bounds in ubifs_wbuf_write_nolock()
	ubifs: Fix to add refcount once page is set private
	ubifs: rename_whiteout: correct old_dir size computing
	wireguard: queueing: use CFI-safe ptr_ring cleanup function
	wireguard: socket: free skb in send6 when ipv6 is disabled
	wireguard: socket: ignore v6 endpoints when ipv6 is disabled
	XArray: Fix xas_create_range() when multi-order entry present
	can: mcba_usb: mcba_usb_start_xmit(): fix double dev_kfree_skb in error path
	can: mcba_usb: properly check endpoint type
	can: mcp251xfd: mcp251xfd_register_get_dev_id(): fix return of error value
	XArray: Update the LRU list in xas_split()
	rtc: check if __rtc_read_time was successful
	gfs2: Make sure FITRIM minlen is rounded up to fs block size
	net: hns3: fix software vlan talbe of vlan 0 inconsistent with hardware
	rxrpc: Fix call timer start racing with call destruction
	mailbox: imx: fix wakeup failure from freeze mode
	crypto: arm/aes-neonbs-cbc - Select generic cbc and aes
	watch_queue: Free the page array when watch_queue is dismantled
	pinctrl: pinconf-generic: Print arguments for bias-pull-*
	watchdog: rti-wdt: Add missing pm_runtime_disable() in probe function
	pinctrl: nuvoton: npcm7xx: Rename DS() macro to DSTR()
	pinctrl: nuvoton: npcm7xx: Use %zu printk format for ARRAY_SIZE()
	ASoC: mediatek: mt6358: add missing EXPORT_SYMBOLs
	ubi: Fix race condition between ctrl_cdev_ioctl and ubi_cdev_ioctl
	ARM: iop32x: offset IRQ numbers by 1
	io_uring: fix memory leak of uid in files registration
	riscv module: remove (NOLOAD)
	ACPI: CPPC: Avoid out of bounds access when parsing _CPC data
	platform/chrome: cros_ec_typec: Check for EC device
	can: isotp: restore accidentally removed MSG_PEEK feature
	proc: bootconfig: Add null pointer check
	staging: mt7621-dts: fix pinctrl-0 items to be size-1 items on ethernet
	ASoC: soc-compress: Change the check for codec_dai
	batman-adv: Check ptr for NULL before reducing its refcnt
	mm/mmap: return 1 from stack_guard_gap __setup() handler
	ARM: 9187/1: JIVE: fix return value of __setup handler
	mm/memcontrol: return 1 from cgroup.memory __setup() handler
	mm/usercopy: return 1 from hardened_usercopy __setup() handler
	bpf: Adjust BPF stack helper functions to accommodate skip > 0
	bpf: Fix comment for helper bpf_current_task_under_cgroup()
	dt-bindings: mtd: nand-controller: Fix the reg property description
	dt-bindings: mtd: nand-controller: Fix a comment in the examples
	dt-bindings: spi: mxic: The interrupt property is not mandatory
	ubi: fastmap: Return error code if memory allocation fails in add_aeb()
	ASoC: topology: Allow TLV control to be either read or write
	ARM: dts: spear1340: Update serial node properties
	ARM: dts: spear13xx: Update SPI dma properties
	um: Fix uml_mconsole stop/go
	docs: sysctl/kernel: add missing bit to panic_print
	openvswitch: Fixed nd target mask field in the flow dump.
	KVM: x86/mmu: do compare-and-exchange of gPTE via the user address
	can: m_can: m_can_tx_handler(): fix use after free of skb
	can: usb_8dev: usb_8dev_start_xmit(): fix double dev_kfree_skb() in error path
	coredump: Snapshot the vmas in do_coredump
	coredump: Remove the WARN_ON in dump_vma_snapshot
	coredump/elf: Pass coredump_params into fill_note_info
	coredump: Use the vma snapshot in fill_files_note
	arm64: Do not defer reserve_crashkernel() for platforms with no DMA memory zones
	PCI: xgene: Revert "PCI: xgene: Use inbound resources for setup"
	Linux 5.10.110

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I12fbe227793dd40c0582588e1700cf88cafd0ac6
This commit is contained in:
Greg Kroah-Hartman
2022-04-18 17:41:18 +02:00
622 changed files with 5354 additions and 2657 deletions

View File

@@ -787,6 +787,7 @@ bit 1 print system memory info
bit 2 print timer info bit 2 print timer info
bit 3 print locks info if ``CONFIG_LOCKDEP`` is on bit 3 print locks info if ``CONFIG_LOCKDEP`` is on
bit 4 print ftrace buffer bit 4 print ftrace buffer
bit 5 print all printk messages in buffer
===== ============================================ ===== ============================================
So for example to print tasks and memory info on panic, user can:: So for example to print tasks and memory info on panic, user can::

View File

@@ -130,3 +130,11 @@ accesses to DMA buffers in both privileged "supervisor" and unprivileged
subsystem that the buffer is fully accessible at the elevated privilege subsystem that the buffer is fully accessible at the elevated privilege
level (and ideally inaccessible or at least read-only at the level (and ideally inaccessible or at least read-only at the
lesser-privileged levels). lesser-privileged levels).
DMA_ATTR_OVERWRITE
------------------
This is a hint to the DMA-mapping subsystem that the device is expected to
overwrite the entire mapped size, thus the caller does not require any of the
previous buffer contents to be preserved. This allows bounce-buffering
implementations to optimise DMA_FROM_DEVICE transfers.

View File

@@ -44,7 +44,7 @@ patternProperties:
properties: properties:
reg: reg:
description: description:
Contains the native Ready/Busy IDs. Contains the chip-select IDs.
nand-ecc-mode: nand-ecc-mode:
description: description:
@@ -174,6 +174,6 @@ examples:
nand-ecc-mode = "soft"; nand-ecc-mode = "soft";
nand-ecc-algo = "bch"; nand-ecc-algo = "bch";
/* controller specific properties */ /* NAND chip specific properties */
}; };
}; };

View File

@@ -8,11 +8,13 @@ Required properties:
- reg: should contain 2 entries, one for the registers and one for the direct - reg: should contain 2 entries, one for the registers and one for the direct
mapping area mapping area
- reg-names: should contain "regs" and "dirmap" - reg-names: should contain "regs" and "dirmap"
- interrupts: interrupt line connected to the SPI controller
- clock-names: should contain "ps_clk", "send_clk" and "send_dly_clk" - clock-names: should contain "ps_clk", "send_clk" and "send_dly_clk"
- clocks: should contain 3 entries for the "ps_clk", "send_clk" and - clocks: should contain 3 entries for the "ps_clk", "send_clk" and
"send_dly_clk" clocks "send_dly_clk" clocks
Optional properties:
- interrupts: interrupt line connected to the SPI controller
Example: Example:
spi@43c30000 { spi@43c30000 {

View File

@@ -168,7 +168,16 @@ Trees
- The finalized and tagged releases of all stable kernels can be found - The finalized and tagged releases of all stable kernels can be found
in separate branches per version at: in separate branches per version at:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
- The release candidate of all stable kernel versions can be found at:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/
.. warning::
The -stable-rc tree is a snapshot in time of the stable-queue tree and
will change frequently, hence will be rebased often. It should only be
used for testing purposes (e.g. to be consumed by CI systems).
Review committee Review committee

View File

@@ -261,6 +261,10 @@ alc-sense-combo
huawei-mbx-stereo huawei-mbx-stereo
Enable initialization verbs for Huawei MBX stereo speakers; Enable initialization verbs for Huawei MBX stereo speakers;
might be risky, try this at your own risk might be risky, try this at your own risk
alc298-samsung-headphone
Samsung laptops with ALC298
alc256-samsung-headphone
Samsung laptops with ALC256
ALC66x/67x/892 ALC66x/67x/892
============== ==============

View File

@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
VERSION = 5 VERSION = 5
PATCHLEVEL = 10 PATCHLEVEL = 10
SUBLEVEL = 109 SUBLEVEL = 110
EXTRAVERSION = EXTRAVERSION =
NAME = Dare mighty things NAME = Dare mighty things

View File

@@ -43,7 +43,7 @@ SYSCALL_DEFINE0(arc_gettls)
return task_thread_info(current)->thr_ptr; return task_thread_info(current)->thr_ptr;
} }
SYSCALL_DEFINE3(arc_usr_cmpxchg, int *, uaddr, int, expected, int, new) SYSCALL_DEFINE3(arc_usr_cmpxchg, int __user *, uaddr, int, expected, int, new)
{ {
struct pt_regs *regs = current_pt_regs(); struct pt_regs *regs = current_pt_regs();
u32 uval; u32 uval;

View File

@@ -433,12 +433,26 @@
#size-cells = <0>; #size-cells = <0>;
enable-method = "brcm,bcm2836-smp"; // for ARM 32-bit enable-method = "brcm,bcm2836-smp"; // for ARM 32-bit
/* Source for d/i-cache-line-size and d/i-cache-sets
* https://developer.arm.com/documentation/100095/0003
* /Level-1-Memory-System/About-the-L1-memory-system?lang=en
* Source for d/i-cache-size
* https://www.raspberrypi.com/documentation/computers
* /processors.html#bcm2711
*/
cpu0: cpu@0 { cpu0: cpu@0 {
device_type = "cpu"; device_type = "cpu";
compatible = "arm,cortex-a72"; compatible = "arm,cortex-a72";
reg = <0>; reg = <0>;
enable-method = "spin-table"; enable-method = "spin-table";
cpu-release-addr = <0x0 0x000000d8>; cpu-release-addr = <0x0 0x000000d8>;
d-cache-size = <0x8000>;
d-cache-line-size = <64>;
d-cache-sets = <256>; // 32KiB(size)/64(line-size)=512ways/2-way set
i-cache-size = <0xc000>;
i-cache-line-size = <64>;
i-cache-sets = <256>; // 48KiB(size)/64(line-size)=768ways/3-way set
next-level-cache = <&l2>;
}; };
cpu1: cpu@1 { cpu1: cpu@1 {
@@ -447,6 +461,13 @@
reg = <1>; reg = <1>;
enable-method = "spin-table"; enable-method = "spin-table";
cpu-release-addr = <0x0 0x000000e0>; cpu-release-addr = <0x0 0x000000e0>;
d-cache-size = <0x8000>;
d-cache-line-size = <64>;
d-cache-sets = <256>; // 32KiB(size)/64(line-size)=512ways/2-way set
i-cache-size = <0xc000>;
i-cache-line-size = <64>;
i-cache-sets = <256>; // 48KiB(size)/64(line-size)=768ways/3-way set
next-level-cache = <&l2>;
}; };
cpu2: cpu@2 { cpu2: cpu@2 {
@@ -455,6 +476,13 @@
reg = <2>; reg = <2>;
enable-method = "spin-table"; enable-method = "spin-table";
cpu-release-addr = <0x0 0x000000e8>; cpu-release-addr = <0x0 0x000000e8>;
d-cache-size = <0x8000>;
d-cache-line-size = <64>;
d-cache-sets = <256>; // 32KiB(size)/64(line-size)=512ways/2-way set
i-cache-size = <0xc000>;
i-cache-line-size = <64>;
i-cache-sets = <256>; // 48KiB(size)/64(line-size)=768ways/3-way set
next-level-cache = <&l2>;
}; };
cpu3: cpu@3 { cpu3: cpu@3 {
@@ -463,6 +491,28 @@
reg = <3>; reg = <3>;
enable-method = "spin-table"; enable-method = "spin-table";
cpu-release-addr = <0x0 0x000000f0>; cpu-release-addr = <0x0 0x000000f0>;
d-cache-size = <0x8000>;
d-cache-line-size = <64>;
d-cache-sets = <256>; // 32KiB(size)/64(line-size)=512ways/2-way set
i-cache-size = <0xc000>;
i-cache-line-size = <64>;
i-cache-sets = <256>; // 48KiB(size)/64(line-size)=768ways/3-way set
next-level-cache = <&l2>;
};
/* Source for d/i-cache-line-size and d/i-cache-sets
* https://developer.arm.com/documentation/100095/0003
* /Level-2-Memory-System/About-the-L2-memory-system?lang=en
* Source for d/i-cache-size
* https://www.raspberrypi.com/documentation/computers
* /processors.html#bcm2711
*/
l2: l2-cache0 {
compatible = "cache";
cache-size = <0x100000>;
cache-line-size = <64>;
cache-sets = <1024>; // 1MiB(size)/64(line-size)=16384ways/16-way set
cache-level = <2>;
}; };
}; };

View File

@@ -40,12 +40,26 @@
#size-cells = <0>; #size-cells = <0>;
enable-method = "brcm,bcm2836-smp"; // for ARM 32-bit enable-method = "brcm,bcm2836-smp"; // for ARM 32-bit
/* Source for d/i-cache-line-size and d/i-cache-sets
* https://developer.arm.com/documentation/ddi0500/e/level-1-memory-system
* /about-the-l1-memory-system?lang=en
*
* Source for d/i-cache-size
* https://magpi.raspberrypi.com/articles/raspberry-pi-3-specs-benchmarks
*/
cpu0: cpu@0 { cpu0: cpu@0 {
device_type = "cpu"; device_type = "cpu";
compatible = "arm,cortex-a53"; compatible = "arm,cortex-a53";
reg = <0>; reg = <0>;
enable-method = "spin-table"; enable-method = "spin-table";
cpu-release-addr = <0x0 0x000000d8>; cpu-release-addr = <0x0 0x000000d8>;
d-cache-size = <0x8000>;
d-cache-line-size = <64>;
d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set
i-cache-size = <0x8000>;
i-cache-line-size = <64>;
i-cache-sets = <256>; // 32KiB(size)/64(line-size)=512ways/2-way set
next-level-cache = <&l2>;
}; };
cpu1: cpu@1 { cpu1: cpu@1 {
@@ -54,6 +68,13 @@
reg = <1>; reg = <1>;
enable-method = "spin-table"; enable-method = "spin-table";
cpu-release-addr = <0x0 0x000000e0>; cpu-release-addr = <0x0 0x000000e0>;
d-cache-size = <0x8000>;
d-cache-line-size = <64>;
d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set
i-cache-size = <0x8000>;
i-cache-line-size = <64>;
i-cache-sets = <256>; // 32KiB(size)/64(line-size)=512ways/2-way set
next-level-cache = <&l2>;
}; };
cpu2: cpu@2 { cpu2: cpu@2 {
@@ -62,6 +83,13 @@
reg = <2>; reg = <2>;
enable-method = "spin-table"; enable-method = "spin-table";
cpu-release-addr = <0x0 0x000000e8>; cpu-release-addr = <0x0 0x000000e8>;
d-cache-size = <0x8000>;
d-cache-line-size = <64>;
d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set
i-cache-size = <0x8000>;
i-cache-line-size = <64>;
i-cache-sets = <256>; // 32KiB(size)/64(line-size)=512ways/2-way set
next-level-cache = <&l2>;
}; };
cpu3: cpu@3 { cpu3: cpu@3 {
@@ -70,6 +98,27 @@
reg = <3>; reg = <3>;
enable-method = "spin-table"; enable-method = "spin-table";
cpu-release-addr = <0x0 0x000000f0>; cpu-release-addr = <0x0 0x000000f0>;
d-cache-size = <0x8000>;
d-cache-line-size = <64>;
d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set
i-cache-size = <0x8000>;
i-cache-line-size = <64>;
i-cache-sets = <256>; // 32KiB(size)/64(line-size)=512ways/2-way set
next-level-cache = <&l2>;
};
/* Source for cache-line-size + cache-sets
* https://developer.arm.com/documentation/ddi0500
* /e/level-2-memory-system/about-the-l2-memory-system?lang=en
* Source for cache-size
* https://datasheets.raspberrypi.com/cm/cm1-and-cm3-datasheet.pdf
*/
l2: l2-cache0 {
compatible = "cache";
cache-size = <0x80000>;
cache-line-size = <64>;
cache-sets = <512>; // 512KiB(size)/64(line-size)=8192ways/16-way set
cache-level = <2>;
}; };
}; };
}; };

View File

@@ -3448,8 +3448,7 @@
ti,timer-pwm; ti,timer-pwm;
}; };
}; };
timer15_target: target-module@2c000 { /* 0x4882c000, ap 17 02.0 */
target-module@2c000 { /* 0x4882c000, ap 17 02.0 */
compatible = "ti,sysc-omap4-timer", "ti,sysc"; compatible = "ti,sysc-omap4-timer", "ti,sysc";
reg = <0x2c000 0x4>, reg = <0x2c000 0x4>,
<0x2c010 0x4>; <0x2c010 0x4>;
@@ -3477,7 +3476,7 @@
}; };
}; };
target-module@2e000 { /* 0x4882e000, ap 19 14.0 */ timer16_target: target-module@2e000 { /* 0x4882e000, ap 19 14.0 */
compatible = "ti,sysc-omap4-timer", "ti,sysc"; compatible = "ti,sysc-omap4-timer", "ti,sysc";
reg = <0x2e000 0x4>, reg = <0x2e000 0x4>,
<0x2e010 0x4>; <0x2e010 0x4>;

View File

@@ -1093,20 +1093,20 @@
}; };
/* Local timers, see ARM architected timer wrap erratum i940 */ /* Local timers, see ARM architected timer wrap erratum i940 */
&timer3_target { &timer15_target {
ti,no-reset-on-init; ti,no-reset-on-init;
ti,no-idle; ti,no-idle;
timer@0 { timer@0 {
assigned-clocks = <&l4per_clkctrl DRA7_L4PER_TIMER3_CLKCTRL 24>; assigned-clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER15_CLKCTRL 24>;
assigned-clock-parents = <&timer_sys_clk_div>; assigned-clock-parents = <&timer_sys_clk_div>;
}; };
}; };
&timer4_target { &timer16_target {
ti,no-reset-on-init; ti,no-reset-on-init;
ti,no-idle; ti,no-idle;
timer@0 { timer@0 {
assigned-clocks = <&l4per_clkctrl DRA7_L4PER_TIMER4_CLKCTRL 24>; assigned-clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER16_CLKCTRL 24>;
assigned-clock-parents = <&timer_sys_clk_div>; assigned-clock-parents = <&timer_sys_clk_div>;
}; };
}; };

View File

@@ -260,7 +260,7 @@
}; };
uart3_data: uart3-data { uart3_data: uart3-data {
samsung,pins = "gpa1-4", "gpa1-4"; samsung,pins = "gpa1-4", "gpa1-5";
samsung,pin-function = <EXYNOS_PIN_FUNC_2>; samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;

View File

@@ -118,6 +118,9 @@
status = "okay"; status = "okay";
ddc = <&i2c_2>; ddc = <&i2c_2>;
hpd-gpios = <&gpx3 7 GPIO_ACTIVE_HIGH>; hpd-gpios = <&gpx3 7 GPIO_ACTIVE_HIGH>;
vdd-supply = <&ldo8_reg>;
vdd_osc-supply = <&ldo10_reg>;
vdd_pll-supply = <&ldo8_reg>;
}; };
&i2c_0 { &i2c_0 {

View File

@@ -124,6 +124,9 @@
hpd-gpios = <&gpx3 7 GPIO_ACTIVE_HIGH>; hpd-gpios = <&gpx3 7 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&hdmi_hpd_irq>; pinctrl-0 = <&hdmi_hpd_irq>;
vdd-supply = <&ldo6_reg>;
vdd_osc-supply = <&ldo7_reg>;
vdd_pll-supply = <&ldo6_reg>;
}; };
&hsi2c_4 { &hsi2c_4 {

View File

@@ -53,6 +53,31 @@
}; };
}; };
lvds-decoder {
compatible = "ti,ds90cf364a", "lvds-decoder";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
lvds_decoder_in: endpoint {
remote-endpoint = <&lvds0_out>;
};
};
port@1 {
reg = <1>;
lvds_decoder_out: endpoint {
remote-endpoint = <&panel_in>;
};
};
};
};
panel { panel {
compatible = "edt,etm0700g0dh6"; compatible = "edt,etm0700g0dh6";
pinctrl-0 = <&pinctrl_display_gpio>; pinctrl-0 = <&pinctrl_display_gpio>;
@@ -61,7 +86,7 @@
port { port {
panel_in: endpoint { panel_in: endpoint {
remote-endpoint = <&lvds0_out>; remote-endpoint = <&lvds_decoder_out>;
}; };
}; };
}; };
@@ -450,7 +475,7 @@
reg = <2>; reg = <2>;
lvds0_out: endpoint { lvds0_out: endpoint {
remote-endpoint = <&panel_in>; remote-endpoint = <&lvds_decoder_in>;
}; };
}; };
}; };

View File

@@ -40,7 +40,7 @@
dailink_master: simple-audio-card,codec { dailink_master: simple-audio-card,codec {
sound-dai = <&codec>; sound-dai = <&codec>;
clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
}; };
}; };
}; };
@@ -293,7 +293,7 @@
compatible = "fsl,sgtl5000"; compatible = "fsl,sgtl5000";
#sound-dai-cells = <0>; #sound-dai-cells = <0>;
reg = <0x0a>; reg = <0x0a>;
clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai1_mclk>; pinctrl-0 = <&pinctrl_sai1_mclk>;
VDDA-supply = <&reg_module_3v3_avdd>; VDDA-supply = <&reg_module_3v3_avdd>;

View File

@@ -250,7 +250,7 @@
tlv320aic32x4: audio-codec@18 { tlv320aic32x4: audio-codec@18 {
compatible = "ti,tlv320aic32x4"; compatible = "ti,tlv320aic32x4";
reg = <0x18>; reg = <0x18>;
clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
clock-names = "mclk"; clock-names = "mclk";
ldoin-supply = <&reg_audio_3v3>; ldoin-supply = <&reg_audio_3v3>;
iov-supply = <&reg_audio_3v3>; iov-supply = <&reg_audio_3v3>;

View File

@@ -288,7 +288,7 @@
codec: wm8960@1a { codec: wm8960@1a {
compatible = "wlf,wm8960"; compatible = "wlf,wm8960";
reg = <0x1a>; reg = <0x1a>;
clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
clock-names = "mclk"; clock-names = "mclk";
wlf,shared-lrclk; wlf,shared-lrclk;
}; };

View File

@@ -31,7 +31,7 @@
dailink_master: simple-audio-card,codec { dailink_master: simple-audio-card,codec {
sound-dai = <&sgtl5000>; sound-dai = <&sgtl5000>;
clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
}; };
}; };
}; };
@@ -41,7 +41,7 @@
#sound-dai-cells = <0>; #sound-dai-cells = <0>;
reg = <0x0a>; reg = <0x0a>;
compatible = "fsl,sgtl5000"; compatible = "fsl,sgtl5000";
clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
VDDA-supply = <&reg_2p5v>; VDDA-supply = <&reg_2p5v>;
VDDIO-supply = <&reg_vref_1v8>; VDDIO-supply = <&reg_vref_1v8>;
}; };

View File

@@ -31,7 +31,7 @@
dailink_master: simple-audio-card,codec { dailink_master: simple-audio-card,codec {
sound-dai = <&sgtl5000>; sound-dai = <&sgtl5000>;
clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
}; };
}; };
}; };
@@ -41,7 +41,7 @@
#sound-dai-cells = <0>; #sound-dai-cells = <0>;
reg = <0x0a>; reg = <0x0a>;
compatible = "fsl,sgtl5000"; compatible = "fsl,sgtl5000";
clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
VDDA-supply = <&reg_2p5v>; VDDA-supply = <&reg_2p5v>;
VDDIO-supply = <&reg_vref_1v8>; VDDIO-supply = <&reg_vref_1v8>;
}; };

View File

@@ -378,14 +378,14 @@
codec: wm8960@1a { codec: wm8960@1a {
compatible = "wlf,wm8960"; compatible = "wlf,wm8960";
reg = <0x1a>; reg = <0x1a>;
clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
clock-names = "mclk"; clock-names = "mclk";
wlf,shared-lrclk; wlf,shared-lrclk;
wlf,hp-cfg = <2 2 3>; wlf,hp-cfg = <2 2 3>;
wlf,gpio-cfg = <1 3>; wlf,gpio-cfg = <1 3>;
assigned-clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_SRC>, assigned-clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_SRC>,
<&clks IMX7D_PLL_AUDIO_POST_DIV>, <&clks IMX7D_PLL_AUDIO_POST_DIV>,
<&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>; assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
assigned-clock-rates = <0>, <884736000>, <12288000>; assigned-clock-rates = <0>, <884736000>, <12288000>;
}; };

View File

@@ -75,7 +75,7 @@
dailink_master: simple-audio-card,codec { dailink_master: simple-audio-card,codec {
sound-dai = <&codec>; sound-dai = <&codec>;
clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
}; };
}; };
}; };
@@ -232,7 +232,7 @@
#sound-dai-cells = <0>; #sound-dai-cells = <0>;
reg = <0x0a>; reg = <0x0a>;
compatible = "fsl,sgtl5000"; compatible = "fsl,sgtl5000";
clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai1_mclk>; pinctrl-0 = <&pinctrl_sai1_mclk>;
VDDA-supply = <&vgen4_reg>; VDDA-supply = <&vgen4_reg>;

View File

@@ -142,7 +142,8 @@
clocks { clocks {
sleep_clk: sleep_clk { sleep_clk: sleep_clk {
compatible = "fixed-clock"; compatible = "fixed-clock";
clock-frequency = <32768>; clock-frequency = <32000>;
clock-output-names = "gcc_sleep_clk_src";
#clock-cells = <0>; #clock-cells = <0>;
}; };

View File

@@ -146,7 +146,9 @@
reg = <0x108000 0x1000>; reg = <0x108000 0x1000>;
qcom,ipc = <&l2cc 0x8 2>; qcom,ipc = <&l2cc 0x8 2>;
interrupts = <0 19 0>, <0 21 0>, <0 22 0>; interrupts = <GIC_SPI 19 IRQ_TYPE_EDGE_RISING>,
<GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
<GIC_SPI 22 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "ack", "err", "wakeup"; interrupt-names = "ack", "err", "wakeup";
regulators { regulators {
@@ -192,7 +194,7 @@
compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm"; compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
reg = <0x16440000 0x1000>, reg = <0x16440000 0x1000>,
<0x16400000 0x1000>; <0x16400000 0x1000>;
interrupts = <0 154 0x0>; interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&gcc GSBI5_UART_CLK>, <&gcc GSBI5_H_CLK>; clocks = <&gcc GSBI5_UART_CLK>, <&gcc GSBI5_H_CLK>;
clock-names = "core", "iface"; clock-names = "core", "iface";
status = "disabled"; status = "disabled";
@@ -318,7 +320,7 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
reg = <0x16080000 0x1000>; reg = <0x16080000 0x1000>;
interrupts = <0 147 0>; interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
spi-max-frequency = <24000000>; spi-max-frequency = <24000000>;
cs-gpios = <&msmgpio 8 0>; cs-gpios = <&msmgpio 8 0>;

View File

@@ -413,7 +413,7 @@
pmecc: ecc-engine@f8014070 { pmecc: ecc-engine@f8014070 {
compatible = "atmel,sama5d2-pmecc"; compatible = "atmel,sama5d2-pmecc";
reg = <0xf8014070 0x490>, reg = <0xf8014070 0x490>,
<0xf8014500 0x100>; <0xf8014500 0x200>;
}; };
}; };

View File

@@ -136,9 +136,9 @@
reg = <0xb4100000 0x1000>; reg = <0xb4100000 0x1000>;
interrupts = <0 105 0x4>; interrupts = <0 105 0x4>;
status = "disabled"; status = "disabled";
dmas = <&dwdma0 12 0 1>, dmas = <&dwdma0 13 0 1>,
<&dwdma0 13 1 0>; <&dwdma0 12 1 0>;
dma-names = "tx", "rx"; dma-names = "rx", "tx";
}; };
thermal@e07008c4 { thermal@e07008c4 {

View File

@@ -284,9 +284,9 @@
#size-cells = <0>; #size-cells = <0>;
interrupts = <0 31 0x4>; interrupts = <0 31 0x4>;
status = "disabled"; status = "disabled";
dmas = <&dwdma0 4 0 0>, dmas = <&dwdma0 5 0 0>,
<&dwdma0 5 0 0>; <&dwdma0 4 0 0>;
dma-names = "tx", "rx"; dma-names = "rx", "tx";
}; };
rtc@e0580000 { rtc@e0580000 {

View File

@@ -524,6 +524,17 @@
#size-cells = <0>; #size-cells = <0>;
}; };
gic: interrupt-controller@1c81000 {
compatible = "arm,gic-400";
reg = <0x01c81000 0x1000>,
<0x01c82000 0x2000>,
<0x01c84000 0x2000>,
<0x01c86000 0x2000>;
interrupt-controller;
#interrupt-cells = <3>;
interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
};
csi1: camera@1cb4000 { csi1: camera@1cb4000 {
compatible = "allwinner,sun8i-v3s-csi"; compatible = "allwinner,sun8i-v3s-csi";
reg = <0x01cb4000 0x3000>; reg = <0x01cb4000 0x3000>;
@@ -535,16 +546,5 @@
resets = <&ccu RST_BUS_CSI>; resets = <&ccu RST_BUS_CSI>;
status = "disabled"; status = "disabled";
}; };
gic: interrupt-controller@1c81000 {
compatible = "arm,gic-400";
reg = <0x01c81000 0x1000>,
<0x01c82000 0x2000>,
<0x01c84000 0x2000>,
<0x01c86000 0x2000>;
interrupt-controller;
#interrupt-cells = <3>;
interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
};
}; };
}; };

View File

@@ -183,8 +183,8 @@
}; };
conf_ata { conf_ata {
nvidia,pins = "ata", "atb", "atc", "atd", "ate", nvidia,pins = "ata", "atb", "atc", "atd", "ate",
"cdev1", "cdev2", "dap1", "dtb", "gma", "cdev1", "cdev2", "dap1", "dtb", "dtf",
"gmb", "gmc", "gmd", "gme", "gpu7", "gma", "gmb", "gmc", "gmd", "gme", "gpu7",
"gpv", "i2cp", "irrx", "irtx", "pta", "gpv", "i2cp", "irrx", "irtx", "pta",
"rm", "slxa", "slxk", "spia", "spib", "rm", "slxa", "slxk", "spia", "spib",
"uac"; "uac";
@@ -203,7 +203,7 @@
}; };
conf_crtp { conf_crtp {
nvidia,pins = "crtp", "dap2", "dap3", "dap4", nvidia,pins = "crtp", "dap2", "dap3", "dap4",
"dtc", "dte", "dtf", "gpu", "sdio1", "dtc", "dte", "gpu", "sdio1",
"slxc", "slxd", "spdi", "spdo", "spig", "slxc", "slxd", "spdi", "spdo", "spig",
"uda"; "uda";
nvidia,pull = <TEGRA_PIN_PULL_NONE>; nvidia,pull = <TEGRA_PIN_PULL_NONE>;

View File

@@ -187,6 +187,7 @@ CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_MEDIA_SUPPORT=y CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_CAMERA_SUPPORT=y CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_PLATFORM_SUPPORT=y
CONFIG_V4L_PLATFORM_DRIVERS=y CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_VIDEO_ASPEED=m CONFIG_VIDEO_ASPEED=m
CONFIG_VIDEO_ATMEL_ISI=m CONFIG_VIDEO_ATMEL_ISI=m

View File

@@ -102,6 +102,8 @@ config CRYPTO_AES_ARM_BS
depends on KERNEL_MODE_NEON depends on KERNEL_MODE_NEON
select CRYPTO_SKCIPHER select CRYPTO_SKCIPHER
select CRYPTO_LIB_AES select CRYPTO_LIB_AES
select CRYPTO_AES
select CRYPTO_CBC
select CRYPTO_SIMD select CRYPTO_SIMD
help help
Use a faster and more secure NEON based implementation of AES in CBC, Use a faster and more secure NEON based implementation of AES in CBC,

View File

@@ -22,10 +22,7 @@
* mcount can be thought of as a function called in the middle of a subroutine * mcount can be thought of as a function called in the middle of a subroutine
* call. As such, it needs to be transparent for both the caller and the * call. As such, it needs to be transparent for both the caller and the
* callee: the original lr needs to be restored when leaving mcount, and no * callee: the original lr needs to be restored when leaving mcount, and no
* registers should be clobbered. (In the __gnu_mcount_nc implementation, we * registers should be clobbered.
* clobber the ip register. This is OK because the ARM calling convention
* allows it to be clobbered in subroutines and doesn't use it to hold
* parameters.)
* *
* When using dynamic ftrace, we patch out the mcount call by a "pop {lr}" * When using dynamic ftrace, we patch out the mcount call by a "pop {lr}"
* instead of the __gnu_mcount_nc call (see arch/arm/kernel/ftrace.c). * instead of the __gnu_mcount_nc call (see arch/arm/kernel/ftrace.c).
@@ -70,26 +67,25 @@
.macro __ftrace_regs_caller .macro __ftrace_regs_caller
sub sp, sp, #8 @ space for PC and CPSR OLD_R0, str lr, [sp, #-8]! @ store LR as PC and make space for CPSR/OLD_R0,
@ OLD_R0 will overwrite previous LR @ OLD_R0 will overwrite previous LR
add ip, sp, #12 @ move in IP the value of SP as it was ldr lr, [sp, #8] @ get previous LR
@ before the push {lr} of the mcount mechanism
str lr, [sp, #0] @ store LR instead of PC
ldr lr, [sp, #8] @ get previous LR
str r0, [sp, #8] @ write r0 as OLD_R0 over previous LR str r0, [sp, #8] @ write r0 as OLD_R0 over previous LR
stmdb sp!, {ip, lr} str lr, [sp, #-4]! @ store previous LR as LR
stmdb sp!, {r0-r11, lr}
add lr, sp, #16 @ move in LR the value of SP as it was
@ before the push {lr} of the mcount mechanism
push {r0-r11, ip, lr}
@ stack content at this point: @ stack content at this point:
@ 0 4 48 52 56 60 64 68 72 @ 0 4 48 52 56 60 64 68 72
@ R0 | R1 | ... | LR | SP + 4 | previous LR | LR | PSR | OLD_R0 | @ R0 | R1 | ... | IP | SP + 4 | previous LR | LR | PSR | OLD_R0 |
mov r3, sp @ struct pt_regs* mov r3, sp @ struct pt_regs*
ldr r2, =function_trace_op ldr r2, =function_trace_op
ldr r2, [r2] @ pointer to the current ldr r2, [r2] @ pointer to the current
@@ -112,11 +108,9 @@ ftrace_graph_regs_call:
#endif #endif
@ pop saved regs @ pop saved regs
ldmia sp!, {r0-r12} @ restore r0 through r12 pop {r0-r11, ip, lr} @ restore r0 through r12
ldr ip, [sp, #8] @ restore PC ldr lr, [sp], #4 @ restore LR
ldr lr, [sp, #4] @ restore LR ldr pc, [sp], #12
ldr sp, [sp, #0] @ restore SP
mov pc, ip @ return
.endm .endm
#ifdef CONFIG_FUNCTION_GRAPH_TRACER #ifdef CONFIG_FUNCTION_GRAPH_TRACER
@@ -132,11 +126,9 @@ ftrace_graph_regs_call:
bl prepare_ftrace_return bl prepare_ftrace_return
@ pop registers saved in ftrace_regs_caller @ pop registers saved in ftrace_regs_caller
ldmia sp!, {r0-r12} @ restore r0 through r12 pop {r0-r11, ip, lr} @ restore r0 through r12
ldr ip, [sp, #8] @ restore PC ldr lr, [sp], #4 @ restore LR
ldr lr, [sp, #4] @ restore LR ldr pc, [sp], #12
ldr sp, [sp, #0] @ restore SP
mov pc, ip @ return
.endm .endm
#endif #endif
@@ -202,16 +194,17 @@ ftrace_graph_call\suffix:
.endm .endm
.macro mcount_exit .macro mcount_exit
ldmia sp!, {r0-r3, ip, lr} ldmia sp!, {r0-r3}
ret ip ldr lr, [sp, #4]
ldr pc, [sp], #8
.endm .endm
ENTRY(__gnu_mcount_nc) ENTRY(__gnu_mcount_nc)
UNWIND(.fnstart) UNWIND(.fnstart)
#ifdef CONFIG_DYNAMIC_FTRACE #ifdef CONFIG_DYNAMIC_FTRACE
mov ip, lr push {lr}
ldmia sp!, {lr} ldr lr, [sp, #4]
ret ip ldr pc, [sp], #8
#else #else
__mcount __mcount
#endif #endif

View File

@@ -195,7 +195,7 @@ static int swp_handler(struct pt_regs *regs, unsigned int instr)
destreg, EXTRACT_REG_NUM(instr, RT2_OFFSET), data); destreg, EXTRACT_REG_NUM(instr, RT2_OFFSET), data);
/* Check access in reasonable access range for both SWP and SWPB */ /* Check access in reasonable access range for both SWP and SWPB */
if (!access_ok((address & ~3), 4)) { if (!access_ok((void __user *)(address & ~3), 4)) {
pr_debug("SWP{B} emulation: access to %p not allowed!\n", pr_debug("SWP{B} emulation: access to %p not allowed!\n",
(void *)address); (void *)address);
res = -EFAULT; res = -EFAULT;

View File

@@ -589,7 +589,7 @@ do_cache_op(unsigned long start, unsigned long end, int flags)
if (end < start || flags) if (end < start || flags)
return -EINVAL; return -EINVAL;
if (!access_ok(start, end - start)) if (!access_ok((void __user *)start, end - start))
return -EFAULT; return -EFAULT;
return __do_cache_op(start, end); return __do_cache_op(start, end);

View File

@@ -20,7 +20,7 @@
mrc p6, 0, \irqstat, c8, c0, 0 @ Read IINTSRC mrc p6, 0, \irqstat, c8, c0, 0 @ Read IINTSRC
cmp \irqstat, #0 cmp \irqstat, #0
clzne \irqnr, \irqstat clzne \irqnr, \irqstat
rsbne \irqnr, \irqnr, #31 rsbne \irqnr, \irqnr, #32
.endm .endm
.macro arch_ret_to_user, tmp1, tmp2 .macro arch_ret_to_user, tmp1, tmp2

View File

@@ -9,6 +9,6 @@
#ifndef __IRQS_H #ifndef __IRQS_H
#define __IRQS_H #define __IRQS_H
#define NR_IRQS 32 #define NR_IRQS 33
#endif #endif

View File

@@ -32,14 +32,14 @@ static void intstr_write(u32 val)
static void static void
iop32x_irq_mask(struct irq_data *d) iop32x_irq_mask(struct irq_data *d)
{ {
iop32x_mask &= ~(1 << d->irq); iop32x_mask &= ~(1 << (d->irq - 1));
intctl_write(iop32x_mask); intctl_write(iop32x_mask);
} }
static void static void
iop32x_irq_unmask(struct irq_data *d) iop32x_irq_unmask(struct irq_data *d)
{ {
iop32x_mask |= 1 << d->irq; iop32x_mask |= 1 << (d->irq - 1);
intctl_write(iop32x_mask); intctl_write(iop32x_mask);
} }
@@ -65,7 +65,7 @@ void __init iop32x_init_irq(void)
machine_is_em7210()) machine_is_em7210())
*IOP3XX_PCIIRSR = 0x0f; *IOP3XX_PCIIRSR = 0x0f;
for (i = 0; i < NR_IRQS; i++) { for (i = 1; i < NR_IRQS; i++) {
irq_set_chip_and_handler(i, &ext_chip, handle_level_irq); irq_set_chip_and_handler(i, &ext_chip, handle_level_irq);
irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE); irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE);
} }

View File

@@ -7,36 +7,40 @@
#ifndef __IOP32X_IRQS_H #ifndef __IOP32X_IRQS_H
#define __IOP32X_IRQS_H #define __IOP32X_IRQS_H
/* Interrupts in Linux start at 1, hardware starts at 0 */
#define IOP_IRQ(x) ((x) + 1)
/* /*
* IOP80321 chipset interrupts * IOP80321 chipset interrupts
*/ */
#define IRQ_IOP32X_DMA0_EOT 0 #define IRQ_IOP32X_DMA0_EOT IOP_IRQ(0)
#define IRQ_IOP32X_DMA0_EOC 1 #define IRQ_IOP32X_DMA0_EOC IOP_IRQ(1)
#define IRQ_IOP32X_DMA1_EOT 2 #define IRQ_IOP32X_DMA1_EOT IOP_IRQ(2)
#define IRQ_IOP32X_DMA1_EOC 3 #define IRQ_IOP32X_DMA1_EOC IOP_IRQ(3)
#define IRQ_IOP32X_AA_EOT 6 #define IRQ_IOP32X_AA_EOT IOP_IRQ(6)
#define IRQ_IOP32X_AA_EOC 7 #define IRQ_IOP32X_AA_EOC IOP_IRQ(7)
#define IRQ_IOP32X_CORE_PMON 8 #define IRQ_IOP32X_CORE_PMON IOP_IRQ(8)
#define IRQ_IOP32X_TIMER0 9 #define IRQ_IOP32X_TIMER0 IOP_IRQ(9)
#define IRQ_IOP32X_TIMER1 10 #define IRQ_IOP32X_TIMER1 IOP_IRQ(10)
#define IRQ_IOP32X_I2C_0 11 #define IRQ_IOP32X_I2C_0 IOP_IRQ(11)
#define IRQ_IOP32X_I2C_1 12 #define IRQ_IOP32X_I2C_1 IOP_IRQ(12)
#define IRQ_IOP32X_MESSAGING 13 #define IRQ_IOP32X_MESSAGING IOP_IRQ(13)
#define IRQ_IOP32X_ATU_BIST 14 #define IRQ_IOP32X_ATU_BIST IOP_IRQ(14)
#define IRQ_IOP32X_PERFMON 15 #define IRQ_IOP32X_PERFMON IOP_IRQ(15)
#define IRQ_IOP32X_CORE_PMU 16 #define IRQ_IOP32X_CORE_PMU IOP_IRQ(16)
#define IRQ_IOP32X_BIU_ERR 17 #define IRQ_IOP32X_BIU_ERR IOP_IRQ(17)
#define IRQ_IOP32X_ATU_ERR 18 #define IRQ_IOP32X_ATU_ERR IOP_IRQ(18)
#define IRQ_IOP32X_MCU_ERR 19 #define IRQ_IOP32X_MCU_ERR IOP_IRQ(19)
#define IRQ_IOP32X_DMA0_ERR 20 #define IRQ_IOP32X_DMA0_ERR IOP_IRQ(20)
#define IRQ_IOP32X_DMA1_ERR 21 #define IRQ_IOP32X_DMA1_ERR IOP_IRQ(21)
#define IRQ_IOP32X_AA_ERR 23 #define IRQ_IOP32X_AA_ERR IOP_IRQ(23)
#define IRQ_IOP32X_MSG_ERR 24 #define IRQ_IOP32X_MSG_ERR IOP_IRQ(24)
#define IRQ_IOP32X_SSP 25 #define IRQ_IOP32X_SSP IOP_IRQ(25)
#define IRQ_IOP32X_XINT0 27 #define IRQ_IOP32X_XINT0 IOP_IRQ(27)
#define IRQ_IOP32X_XINT1 28 #define IRQ_IOP32X_XINT1 IOP_IRQ(28)
#define IRQ_IOP32X_XINT2 29 #define IRQ_IOP32X_XINT2 IOP_IRQ(29)
#define IRQ_IOP32X_XINT3 30 #define IRQ_IOP32X_XINT3 IOP_IRQ(30)
#define IRQ_IOP32X_HPI 31 #define IRQ_IOP32X_HPI IOP_IRQ(31)
#endif #endif

View File

@@ -72,6 +72,8 @@ static int sram_probe(struct platform_device *pdev)
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
platform_set_drvdata(pdev, info);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res == NULL) { if (res == NULL) {
dev_err(&pdev->dev, "no memory resource defined\n"); dev_err(&pdev->dev, "no memory resource defined\n");
@@ -107,8 +109,6 @@ static int sram_probe(struct platform_device *pdev)
list_add(&info->node, &sram_bank_list); list_add(&info->node, &sram_bank_list);
mutex_unlock(&sram_lock); mutex_unlock(&sram_lock);
platform_set_drvdata(pdev, info);
dev_info(&pdev->dev, "initialized\n"); dev_info(&pdev->dev, "initialized\n");
return 0; return 0;
@@ -127,17 +127,19 @@ static int sram_remove(struct platform_device *pdev)
struct sram_bank_info *info; struct sram_bank_info *info;
info = platform_get_drvdata(pdev); info = platform_get_drvdata(pdev);
if (info == NULL)
return -ENODEV;
mutex_lock(&sram_lock); if (info->sram_size) {
list_del(&info->node); mutex_lock(&sram_lock);
mutex_unlock(&sram_lock); list_del(&info->node);
mutex_unlock(&sram_lock);
gen_pool_destroy(info->gpool);
iounmap(info->sram_virt);
kfree(info->pool_name);
}
gen_pool_destroy(info->gpool);
iounmap(info->sram_virt);
kfree(info->pool_name);
kfree(info); kfree(info);
return 0; return 0;
} }

View File

@@ -3,6 +3,7 @@ menuconfig ARCH_MSTARV7
depends on ARCH_MULTI_V7 depends on ARCH_MULTI_V7
select ARM_GIC select ARM_GIC
select ARM_HEAVY_MB select ARM_HEAVY_MB
select HAVE_ARM_ARCH_TIMER
select MST_IRQ select MST_IRQ
help help
Support for newer MStar/Sigmastar SoC families that are Support for newer MStar/Sigmastar SoC families that are

View File

@@ -236,11 +236,11 @@ static int __init jive_mtdset(char *options)
unsigned long set; unsigned long set;
if (options == NULL || options[0] == '\0') if (options == NULL || options[0] == '\0')
return 0; return 1;
if (kstrtoul(options, 10, &set)) { if (kstrtoul(options, 10, &set)) {
printk(KERN_ERR "failed to parse mtdset=%s\n", options); printk(KERN_ERR "failed to parse mtdset=%s\n", options);
return 0; return 1;
} }
switch (set) { switch (set) {
@@ -255,7 +255,7 @@ static int __init jive_mtdset(char *options)
"using default.", set); "using default.", set);
} }
return 0; return 1;
} }
/* parse the mtdset= option given to the kernel command line */ /* parse the mtdset= option given to the kernel command line */

View File

@@ -111,8 +111,8 @@
compatible = "silabs,si3226x"; compatible = "silabs,si3226x";
reg = <0>; reg = <0>;
spi-max-frequency = <5000000>; spi-max-frequency = <5000000>;
spi-cpha = <1>; spi-cpha;
spi-cpol = <1>; spi-cpol;
pl022,hierarchy = <0>; pl022,hierarchy = <0>;
pl022,interface = <0>; pl022,interface = <0>;
pl022,slave-tx-disable = <0>; pl022,slave-tx-disable = <0>;
@@ -135,8 +135,8 @@
at25,byte-len = <0x8000>; at25,byte-len = <0x8000>;
at25,addr-mode = <2>; at25,addr-mode = <2>;
at25,page-size = <64>; at25,page-size = <64>;
spi-cpha = <1>; spi-cpha;
spi-cpol = <1>; spi-cpol;
pl022,hierarchy = <0>; pl022,hierarchy = <0>;
pl022,interface = <0>; pl022,interface = <0>;
pl022,slave-tx-disable = <0>; pl022,slave-tx-disable = <0>;

View File

@@ -687,7 +687,7 @@
}; };
}; };
sata: ahci@663f2000 { sata: sata@663f2000 {
compatible = "brcm,iproc-ahci", "generic-ahci"; compatible = "brcm,iproc-ahci", "generic-ahci";
reg = <0x663f2000 0x1000>; reg = <0x663f2000 0x1000>;
dma-coherent; dma-coherent;

View File

@@ -3406,10 +3406,10 @@
#clock-cells = <0>; #clock-cells = <0>;
clock-frequency = <9600000>; clock-frequency = <9600000>;
clock-output-names = "mclk"; clock-output-names = "mclk";
qcom,micbias1-millivolt = <1800>; qcom,micbias1-microvolt = <1800000>;
qcom,micbias2-millivolt = <1800>; qcom,micbias2-microvolt = <1800000>;
qcom,micbias3-millivolt = <1800>; qcom,micbias3-microvolt = <1800000>;
qcom,micbias4-millivolt = <1800>; qcom,micbias4-microvolt = <1800000>;
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;

View File

@@ -1114,9 +1114,9 @@
qcom,tcs-offset = <0xd00>; qcom,tcs-offset = <0xd00>;
qcom,drv-id = <2>; qcom,drv-id = <2>;
qcom,tcs-config = <ACTIVE_TCS 2>, qcom,tcs-config = <ACTIVE_TCS 2>,
<SLEEP_TCS 1>, <SLEEP_TCS 3>,
<WAKE_TCS 1>, <WAKE_TCS 3>,
<CONTROL_TCS 0>; <CONTROL_TCS 1>;
rpmhcc: clock-controller { rpmhcc: clock-controller {
compatible = "qcom,sm8150-rpmh-clk"; compatible = "qcom,sm8150-rpmh-clk";

View File

@@ -665,8 +665,8 @@
sd-uhs-sdr104; sd-uhs-sdr104;
/* Power supply */ /* Power supply */
vqmmc-supply = &vcc1v8_s3; /* IO line */ vqmmc-supply = <&vcc1v8_s3>; /* IO line */
vmmc-supply = &vcc_sdio; /* card's power */ vmmc-supply = <&vcc_sdio>; /* card's power */
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View File

@@ -35,7 +35,10 @@
#interrupt-cells = <3>; #interrupt-cells = <3>;
interrupt-controller; interrupt-controller;
reg = <0x00 0x01800000 0x00 0x10000>, /* GICD */ reg = <0x00 0x01800000 0x00 0x10000>, /* GICD */
<0x00 0x01880000 0x00 0x90000>; /* GICR */ <0x00 0x01880000 0x00 0x90000>, /* GICR */
<0x00 0x6f000000 0x00 0x2000>, /* GICC */
<0x00 0x6f010000 0x00 0x1000>, /* GICH */
<0x00 0x6f020000 0x00 0x2000>; /* GICV */
/* /*
* vcpumntirq: * vcpumntirq:
* virtual CPU interface maintenance interrupt * virtual CPU interface maintenance interrupt

View File

@@ -84,6 +84,7 @@
<0x00 0x46000000 0x00 0x46000000 0x00 0x00200000>, <0x00 0x46000000 0x00 0x46000000 0x00 0x00200000>,
<0x00 0x47000000 0x00 0x47000000 0x00 0x00068400>, <0x00 0x47000000 0x00 0x47000000 0x00 0x00068400>,
<0x00 0x50000000 0x00 0x50000000 0x00 0x8000000>, <0x00 0x50000000 0x00 0x50000000 0x00 0x8000000>,
<0x00 0x6f000000 0x00 0x6f000000 0x00 0x00310000>, /* A53 PERIPHBASE */
<0x00 0x70000000 0x00 0x70000000 0x00 0x200000>, <0x00 0x70000000 0x00 0x70000000 0x00 0x200000>,
<0x05 0x00000000 0x05 0x00000000 0x01 0x0000000>, <0x05 0x00000000 0x05 0x00000000 0x01 0x0000000>,
<0x07 0x00000000 0x07 0x00000000 0x01 0x0000000>; <0x07 0x00000000 0x07 0x00000000 0x01 0x0000000>;

View File

@@ -47,7 +47,10 @@
#interrupt-cells = <3>; #interrupt-cells = <3>;
interrupt-controller; interrupt-controller;
reg = <0x00 0x01800000 0x00 0x10000>, /* GICD */ reg = <0x00 0x01800000 0x00 0x10000>, /* GICD */
<0x00 0x01900000 0x00 0x100000>; /* GICR */ <0x00 0x01900000 0x00 0x100000>, /* GICR */
<0x00 0x6f000000 0x00 0x2000>, /* GICC */
<0x00 0x6f010000 0x00 0x1000>, /* GICH */
<0x00 0x6f020000 0x00 0x2000>; /* GICV */
/* vcpumntirq: virtual CPU interface maintenance interrupt */ /* vcpumntirq: virtual CPU interface maintenance interrupt */
interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;

View File

@@ -127,6 +127,7 @@
<0x00 0x00a40000 0x00 0x00a40000 0x00 0x00000800>, /* timesync router */ <0x00 0x00a40000 0x00 0x00a40000 0x00 0x00000800>, /* timesync router */
<0x00 0x01000000 0x00 0x01000000 0x00 0x0d000000>, /* Most peripherals */ <0x00 0x01000000 0x00 0x01000000 0x00 0x0d000000>, /* Most peripherals */
<0x00 0x30000000 0x00 0x30000000 0x00 0x0c400000>, /* MAIN NAVSS */ <0x00 0x30000000 0x00 0x30000000 0x00 0x0c400000>, /* MAIN NAVSS */
<0x00 0x6f000000 0x00 0x6f000000 0x00 0x00310000>, /* A72 PERIPHBASE */
<0x00 0x70000000 0x00 0x70000000 0x00 0x00800000>, /* MSMC RAM */ <0x00 0x70000000 0x00 0x70000000 0x00 0x00800000>, /* MSMC RAM */
<0x00 0x18000000 0x00 0x18000000 0x00 0x08000000>, /* PCIe1 DAT0 */ <0x00 0x18000000 0x00 0x18000000 0x00 0x08000000>, /* PCIe1 DAT0 */
<0x41 0x00000000 0x41 0x00000000 0x01 0x00000000>, /* PCIe1 DAT1 */ <0x41 0x00000000 0x41 0x00000000 0x01 0x00000000>, /* PCIe1 DAT1 */

View File

@@ -108,7 +108,10 @@
#interrupt-cells = <3>; #interrupt-cells = <3>;
interrupt-controller; interrupt-controller;
reg = <0x00 0x01800000 0x00 0x10000>, /* GICD */ reg = <0x00 0x01800000 0x00 0x10000>, /* GICD */
<0x00 0x01900000 0x00 0x100000>; /* GICR */ <0x00 0x01900000 0x00 0x100000>, /* GICR */
<0x00 0x6f000000 0x00 0x2000>, /* GICC */
<0x00 0x6f010000 0x00 0x1000>, /* GICH */
<0x00 0x6f020000 0x00 0x2000>; /* GICV */
/* vcpumntirq: virtual CPU interface maintenance interrupt */ /* vcpumntirq: virtual CPU interface maintenance interrupt */
interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;

View File

@@ -136,6 +136,7 @@
<0x00 0x0e000000 0x00 0x0e000000 0x00 0x01800000>, /* PCIe Core*/ <0x00 0x0e000000 0x00 0x0e000000 0x00 0x01800000>, /* PCIe Core*/
<0x00 0x10000000 0x00 0x10000000 0x00 0x10000000>, /* PCIe DAT */ <0x00 0x10000000 0x00 0x10000000 0x00 0x10000000>, /* PCIe DAT */
<0x00 0x64800000 0x00 0x64800000 0x00 0x00800000>, /* C71 */ <0x00 0x64800000 0x00 0x64800000 0x00 0x00800000>, /* C71 */
<0x00 0x6f000000 0x00 0x6f000000 0x00 0x00310000>, /* A72 PERIPHBASE */
<0x44 0x00000000 0x44 0x00000000 0x00 0x08000000>, /* PCIe2 DAT */ <0x44 0x00000000 0x44 0x00000000 0x00 0x08000000>, /* PCIe2 DAT */
<0x44 0x10000000 0x44 0x10000000 0x00 0x08000000>, /* PCIe3 DAT */ <0x44 0x10000000 0x44 0x10000000 0x00 0x08000000>, /* PCIe3 DAT */
<0x4d 0x80800000 0x4d 0x80800000 0x00 0x00800000>, /* C66_0 */ <0x4d 0x80800000 0x4d 0x80800000 0x00 0x00800000>, /* C66_0 */

View File

@@ -840,7 +840,7 @@ CONFIG_DMADEVICES=y
CONFIG_DMA_BCM2835=y CONFIG_DMA_BCM2835=y
CONFIG_DMA_SUN6I=m CONFIG_DMA_SUN6I=m
CONFIG_FSL_EDMA=y CONFIG_FSL_EDMA=y
CONFIG_IMX_SDMA=y CONFIG_IMX_SDMA=m
CONFIG_K3_DMA=y CONFIG_K3_DMA=y
CONFIG_MV_XOR=y CONFIG_MV_XOR=y
CONFIG_MV_XOR_V2=y CONFIG_MV_XOR_V2=y

View File

@@ -572,10 +572,12 @@ static int setup_sigframe_layout(struct rt_sigframe_user_layout *user,
{ {
int err; int err;
err = sigframe_alloc(user, &user->fpsimd_offset, if (system_supports_fpsimd()) {
sizeof(struct fpsimd_context)); err = sigframe_alloc(user, &user->fpsimd_offset,
if (err) sizeof(struct fpsimd_context));
return err; if (err)
return err;
}
/* fault information, if valid */ /* fault information, if valid */
if (add_all || current->thread.fault_code) { if (add_all || current->thread.fault_code) {

View File

@@ -59,8 +59,34 @@ EXPORT_SYMBOL(memstart_addr);
* unless restricted on specific platforms (e.g. 30-bit on Raspberry Pi 4). * unless restricted on specific platforms (e.g. 30-bit on Raspberry Pi 4).
* In such case, ZONE_DMA32 covers the rest of the 32-bit addressable memory, * In such case, ZONE_DMA32 covers the rest of the 32-bit addressable memory,
* otherwise it is empty. * otherwise it is empty.
*
* Memory reservation for crash kernel either done early or deferred
* depending on DMA memory zones configs (ZONE_DMA) --
*
* In absence of ZONE_DMA configs arm64_dma_phys_limit initialized
* here instead of max_zone_phys(). This lets early reservation of
* crash kernel memory which has a dependency on arm64_dma_phys_limit.
* Reserving memory early for crash kernel allows linear creation of block
* mappings (greater than page-granularity) for all the memory bank rangs.
* In this scheme a comparatively quicker boot is observed.
*
* If ZONE_DMA configs are defined, crash kernel memory reservation
* is delayed until DMA zone memory range size initilazation performed in
* zone_sizes_init(). The defer is necessary to steer clear of DMA zone
* memory range to avoid overlap allocation. So crash kernel memory boundaries
* are not known when mapping all bank memory ranges, which otherwise means
* not possible to exclude crash kernel range from creating block mappings
* so page-granularity mappings are created for the entire memory range.
* Hence a slightly slower boot is observed.
*
* Note: Page-granularity mapppings are necessary for crash kernel memory
* range for shrinking its size via /sys/kernel/kexec_crash_size interface.
*/ */
phys_addr_t arm64_dma_phys_limit __ro_after_init; #if IS_ENABLED(CONFIG_ZONE_DMA) || IS_ENABLED(CONFIG_ZONE_DMA32)
phys_addr_t __ro_after_init arm64_dma_phys_limit;
#else
phys_addr_t __ro_after_init arm64_dma_phys_limit = PHYS_MASK + 1;
#endif
/* /*
* Provide a run-time mean of disabling ZONE_DMA32 if it is enabled via * Provide a run-time mean of disabling ZONE_DMA32 if it is enabled via
@@ -217,8 +243,6 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
if (!arm64_dma_phys_limit) if (!arm64_dma_phys_limit)
arm64_dma_phys_limit = dma32_phys_limit; arm64_dma_phys_limit = dma32_phys_limit;
#endif #endif
if (!arm64_dma_phys_limit)
arm64_dma_phys_limit = PHYS_MASK + 1;
max_zone_pfns[ZONE_NORMAL] = max; max_zone_pfns[ZONE_NORMAL] = max;
free_area_init(max_zone_pfns); free_area_init(max_zone_pfns);
@@ -429,6 +453,9 @@ void __init arm64_memblock_init(void)
reserve_elfcorehdr(); reserve_elfcorehdr();
if (!IS_ENABLED(CONFIG_ZONE_DMA) && !IS_ENABLED(CONFIG_ZONE_DMA32))
reserve_crashkernel();
high_memory = __va(memblock_end_of_DRAM() - 1) + 1; high_memory = __va(memblock_end_of_DRAM() - 1) + 1;
} }
@@ -475,7 +502,8 @@ void __init bootmem_init(void)
* request_standard_resources() depends on crashkernel's memory being * request_standard_resources() depends on crashkernel's memory being
* reserved, so do it here. * reserved, so do it here.
*/ */
reserve_crashkernel(); if (IS_ENABLED(CONFIG_ZONE_DMA) || IS_ENABLED(CONFIG_ZONE_DMA32))
reserve_crashkernel();
memblock_dump_all(); memblock_dump_all();
} }

View File

@@ -61,6 +61,7 @@ static pmd_t bm_pmd[PTRS_PER_PMD] __page_aligned_bss __maybe_unused;
static pud_t bm_pud[PTRS_PER_PUD] __page_aligned_bss __maybe_unused; static pud_t bm_pud[PTRS_PER_PUD] __page_aligned_bss __maybe_unused;
static DEFINE_SPINLOCK(swapper_pgdir_lock); static DEFINE_SPINLOCK(swapper_pgdir_lock);
static DEFINE_MUTEX(fixmap_lock);
void set_swapper_pgd(pgd_t *pgdp, pgd_t pgd) void set_swapper_pgd(pgd_t *pgdp, pgd_t pgd)
{ {
@@ -314,6 +315,12 @@ static void alloc_init_pud(pgd_t *pgdp, unsigned long addr, unsigned long end,
} }
BUG_ON(p4d_bad(p4d)); BUG_ON(p4d_bad(p4d));
/*
* No need for locking during early boot. And it doesn't work as
* expected with KASLR enabled.
*/
if (system_state != SYSTEM_BOOTING)
mutex_lock(&fixmap_lock);
pudp = pud_set_fixmap_offset(p4dp, addr); pudp = pud_set_fixmap_offset(p4dp, addr);
do { do {
pud_t old_pud = READ_ONCE(*pudp); pud_t old_pud = READ_ONCE(*pudp);
@@ -344,6 +351,8 @@ static void alloc_init_pud(pgd_t *pgdp, unsigned long addr, unsigned long end,
} while (pudp++, addr = next, addr != end); } while (pudp++, addr = next, addr != end);
pud_clear_fixmap(); pud_clear_fixmap();
if (system_state != SYSTEM_BOOTING)
mutex_unlock(&fixmap_lock);
} }
static void __create_pgd_mapping(pgd_t *pgdir, phys_addr_t phys, static void __create_pgd_mapping(pgd_t *pgdir, phys_addr_t phys,
@@ -492,7 +501,7 @@ static void __init map_mem(pgd_t *pgdp)
int flags = 0; int flags = 0;
u64 i; u64 i;
if (rodata_full || crash_mem_map || debug_pagealloc_enabled() || if (rodata_full || debug_pagealloc_enabled() ||
IS_ENABLED(CONFIG_KFENCE)) IS_ENABLED(CONFIG_KFENCE))
flags = NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS; flags = NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS;
@@ -504,6 +513,17 @@ static void __init map_mem(pgd_t *pgdp)
*/ */
memblock_mark_nomap(kernel_start, kernel_end - kernel_start); memblock_mark_nomap(kernel_start, kernel_end - kernel_start);
#ifdef CONFIG_KEXEC_CORE
if (crash_mem_map) {
if (IS_ENABLED(CONFIG_ZONE_DMA) ||
IS_ENABLED(CONFIG_ZONE_DMA32))
flags |= NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS;
else if (crashk_res.end)
memblock_mark_nomap(crashk_res.start,
resource_size(&crashk_res));
}
#endif
/* map all the memory banks */ /* map all the memory banks */
for_each_mem_range(i, &start, &end) { for_each_mem_range(i, &start, &end) {
if (start >= end) if (start >= end)
@@ -530,6 +550,25 @@ static void __init map_mem(pgd_t *pgdp)
__map_memblock(pgdp, kernel_start, kernel_end, __map_memblock(pgdp, kernel_start, kernel_end,
PAGE_KERNEL, NO_CONT_MAPPINGS); PAGE_KERNEL, NO_CONT_MAPPINGS);
memblock_clear_nomap(kernel_start, kernel_end - kernel_start); memblock_clear_nomap(kernel_start, kernel_end - kernel_start);
/*
* Use page-level mappings here so that we can shrink the region
* in page granularity and put back unused memory to buddy system
* through /sys/kernel/kexec_crash_size interface.
*/
#ifdef CONFIG_KEXEC_CORE
if (crash_mem_map &&
!IS_ENABLED(CONFIG_ZONE_DMA) && !IS_ENABLED(CONFIG_ZONE_DMA32)) {
if (crashk_res.end) {
__map_memblock(pgdp, crashk_res.start,
crashk_res.end + 1,
PAGE_KERNEL,
NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS);
memblock_clear_nomap(crashk_res.start,
resource_size(&crashk_res));
}
}
#endif
} }
void mark_rodata_ro(void) void mark_rodata_ro(void)

View File

@@ -1041,15 +1041,18 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
goto out_off; goto out_off;
} }
/* 1. Initial fake pass to compute ctx->idx. */ /*
* 1. Initial fake pass to compute ctx->idx and ctx->offset.
/* Fake pass to fill in ctx->offset. */ *
if (build_body(&ctx, extra_pass)) { * BPF line info needs ctx->offset[i] to be the offset of
* instruction[i] in jited image, so build prologue first.
*/
if (build_prologue(&ctx, was_classic)) {
prog = orig_prog; prog = orig_prog;
goto out_off; goto out_off;
} }
if (build_prologue(&ctx, was_classic)) { if (build_body(&ctx, extra_pass)) {
prog = orig_prog; prog = orig_prog;
goto out_off; goto out_off;
} }
@@ -1124,6 +1127,11 @@ skip_init_ctx:
prog->jited_len = prog_size; prog->jited_len = prog_size;
if (!prog->is_func || extra_pass) { if (!prog->is_func || extra_pass) {
int i;
/* offset[prog->len] is the size of program */
for (i = 0; i <= prog->len; i++)
ctx.offset[i] *= AARCH64_INSN_SIZE;
bpf_prog_fill_jited_linfo(prog, ctx.offset + 1); bpf_prog_fill_jited_linfo(prog, ctx.offset + 1);
out_off: out_off:
kfree(ctx.offset); kfree(ctx.offset);

View File

@@ -49,7 +49,7 @@ static unsigned long user_backtrace(struct perf_callchain_entry_ctx *entry,
{ {
struct stackframe buftail; struct stackframe buftail;
unsigned long lr = 0; unsigned long lr = 0;
unsigned long *user_frame_tail = (unsigned long *)fp; unsigned long __user *user_frame_tail = (unsigned long __user *)fp;
/* Check accessibility of one struct frame_tail beyond */ /* Check accessibility of one struct frame_tail beyond */
if (!access_ok(user_frame_tail, sizeof(buftail))) if (!access_ok(user_frame_tail, sizeof(buftail)))

View File

@@ -136,7 +136,7 @@ static inline void __user *get_sigframe(struct ksignal *ksig,
static int static int
setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs) setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
{ {
struct rt_sigframe *frame; struct rt_sigframe __user *frame;
int err = 0; int err = 0;
struct csky_vdso *vdso = current->mm->context.vdso; struct csky_vdso *vdso = current->mm->context.vdso;

View File

@@ -480,7 +480,7 @@ static struct platform_device mcf_i2c5 = {
#endif /* MCFI2C_BASE5 */ #endif /* MCFI2C_BASE5 */
#endif /* IS_ENABLED(CONFIG_I2C_IMX) */ #endif /* IS_ENABLED(CONFIG_I2C_IMX) */
#if IS_ENABLED(CONFIG_MCF_EDMA) #ifdef MCFEDMA_BASE
static const struct dma_slave_map mcf_edma_map[] = { static const struct dma_slave_map mcf_edma_map[] = {
{ "dreq0", "rx-tx", MCF_EDMA_FILTER_PARAM(0) }, { "dreq0", "rx-tx", MCF_EDMA_FILTER_PARAM(0) },
@@ -552,7 +552,7 @@ static struct platform_device mcf_edma = {
.platform_data = &mcf_edma_data, .platform_data = &mcf_edma_data,
} }
}; };
#endif /* IS_ENABLED(CONFIG_MCF_EDMA) */ #endif /* MCFEDMA_BASE */
#ifdef MCFSDHC_BASE #ifdef MCFSDHC_BASE
static struct mcf_esdhc_platform_data mcf_esdhc_data = { static struct mcf_esdhc_platform_data mcf_esdhc_data = {
@@ -610,7 +610,7 @@ static struct platform_device *mcf_devices[] __initdata = {
&mcf_i2c5, &mcf_i2c5,
#endif #endif
#endif #endif
#if IS_ENABLED(CONFIG_MCF_EDMA) #ifdef MCFEDMA_BASE
&mcf_edma, &mcf_edma,
#endif #endif
#ifdef MCFSDHC_BASE #ifdef MCFSDHC_BASE

View File

@@ -167,27 +167,27 @@ extern long __user_bad(void);
#define __get_user(x, ptr) \ #define __get_user(x, ptr) \
({ \ ({ \
unsigned long __gu_val = 0; \
long __gu_err; \ long __gu_err; \
switch (sizeof(*(ptr))) { \ switch (sizeof(*(ptr))) { \
case 1: \ case 1: \
__get_user_asm("lbu", (ptr), __gu_val, __gu_err); \ __get_user_asm("lbu", (ptr), x, __gu_err); \
break; \ break; \
case 2: \ case 2: \
__get_user_asm("lhu", (ptr), __gu_val, __gu_err); \ __get_user_asm("lhu", (ptr), x, __gu_err); \
break; \ break; \
case 4: \ case 4: \
__get_user_asm("lw", (ptr), __gu_val, __gu_err); \ __get_user_asm("lw", (ptr), x, __gu_err); \
break; \ break; \
case 8: \ case 8: { \
__gu_err = __copy_from_user(&__gu_val, ptr, 8); \ __u64 __x = 0; \
if (__gu_err) \ __gu_err = raw_copy_from_user(&__x, ptr, 8) ? \
__gu_err = -EFAULT; \ -EFAULT : 0; \
(x) = (typeof(x))(typeof((x) - (x)))__x; \
break; \ break; \
} \
default: \ default: \
/* __gu_val = 0; __gu_err = -EINVAL;*/ __gu_err = __user_bad();\ /* __gu_val = 0; __gu_err = -EINVAL;*/ __gu_err = __user_bad();\
} \ } \
x = (__force __typeof__(*(ptr))) __gu_val; \
__gu_err; \ __gu_err; \
}) })

View File

@@ -131,7 +131,7 @@
*/ */
mfc0 t0,CP0_CAUSE # get pending interrupts mfc0 t0,CP0_CAUSE # get pending interrupts
mfc0 t1,CP0_STATUS mfc0 t1,CP0_STATUS
#ifdef CONFIG_32BIT #if defined(CONFIG_32BIT) && defined(CONFIG_MIPS_FP_SUPPORT)
lw t2,cpu_fpu_mask lw t2,cpu_fpu_mask
#endif #endif
andi t0,ST0_IM # CAUSE.CE may be non-zero! andi t0,ST0_IM # CAUSE.CE may be non-zero!
@@ -139,7 +139,7 @@
beqz t0,spurious beqz t0,spurious
#ifdef CONFIG_32BIT #if defined(CONFIG_32BIT) && defined(CONFIG_MIPS_FP_SUPPORT)
and t2,t0 and t2,t0
bnez t2,fpu # handle FPU immediately bnez t2,fpu # handle FPU immediately
#endif #endif
@@ -280,7 +280,7 @@ handle_it:
j dec_irq_dispatch j dec_irq_dispatch
nop nop
#ifdef CONFIG_32BIT #if defined(CONFIG_32BIT) && defined(CONFIG_MIPS_FP_SUPPORT)
fpu: fpu:
lw t0,fpu_kstat_irq lw t0,fpu_kstat_irq
nop nop

View File

@@ -6,4 +6,4 @@
lib-y += init.o memory.o cmdline.o identify.o console.o lib-y += init.o memory.o cmdline.o identify.o console.o
lib-$(CONFIG_32BIT) += locore.o lib-$(CONFIG_CPU_R3000) += locore.o

View File

@@ -746,7 +746,8 @@ void __init arch_init_irq(void)
dec_interrupt[DEC_IRQ_HALT] = -1; dec_interrupt[DEC_IRQ_HALT] = -1;
/* Register board interrupts: FPU and cascade. */ /* Register board interrupts: FPU and cascade. */
if (dec_interrupt[DEC_IRQ_FPU] >= 0 && cpu_has_fpu) { if (IS_ENABLED(CONFIG_MIPS_FP_SUPPORT) &&
dec_interrupt[DEC_IRQ_FPU] >= 0 && cpu_has_fpu) {
struct irq_desc *desc_fpu; struct irq_desc *desc_fpu;
int irq_fpu; int irq_fpu;

View File

@@ -43,16 +43,11 @@
*/ */
#define REX_PROM_MAGIC 0x30464354 #define REX_PROM_MAGIC 0x30464354
#ifdef CONFIG_64BIT /* KN04 and KN05 are REX PROMs, so only do the check for R3k systems. */
static inline bool prom_is_rex(u32 magic)
#define prom_is_rex(magic) 1 /* KN04 and KN05 are REX PROMs. */ {
return !IS_ENABLED(CONFIG_CPU_R3000) || magic == REX_PROM_MAGIC;
#else /* !CONFIG_64BIT */ }
#define prom_is_rex(magic) ((magic) == REX_PROM_MAGIC)
#endif /* !CONFIG_64BIT */
/* /*
* 3MIN/MAXINE PROM entry points for DS5000/1xx's, DS5000/xx's and * 3MIN/MAXINE PROM entry points for DS5000/1xx's, DS5000/xx's and

View File

@@ -15,6 +15,7 @@
#define __HAVE_ARCH_PMD_ALLOC_ONE #define __HAVE_ARCH_PMD_ALLOC_ONE
#define __HAVE_ARCH_PUD_ALLOC_ONE #define __HAVE_ARCH_PUD_ALLOC_ONE
#define __HAVE_ARCH_PGD_FREE
#include <asm-generic/pgalloc.h> #include <asm-generic/pgalloc.h>
static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
@@ -49,6 +50,11 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
extern void pgd_init(unsigned long page); extern void pgd_init(unsigned long page);
extern pgd_t *pgd_alloc(struct mm_struct *mm); extern pgd_t *pgd_alloc(struct mm_struct *mm);
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
{
free_pages((unsigned long)pgd, PGD_ORDER);
}
#define __pte_free_tlb(tlb,pte,address) \ #define __pte_free_tlb(tlb,pte,address) \
do { \ do { \
pgtable_pte_page_dtor(pte); \ pgtable_pte_page_dtor(pte); \

View File

@@ -310,11 +310,9 @@ static int __init plat_setup_devices(void)
static int __init setup_kmac(char *s) static int __init setup_kmac(char *s)
{ {
printk(KERN_INFO "korina mac = %s\n", s); printk(KERN_INFO "korina mac = %s\n", s);
if (!mac_pton(s, korina_dev0_data.mac)) { if (!mac_pton(s, korina_dev0_data.mac))
printk(KERN_ERR "Invalid mac\n"); printk(KERN_ERR "Invalid mac\n");
return -EINVAL; return 1;
}
return 0;
} }
__setup("kmac=", setup_kmac); __setup("kmac=", setup_kmac);

View File

@@ -89,6 +89,7 @@ extern __must_check long strnlen_user(const char __user *s, long n);
/* Optimized macros */ /* Optimized macros */
#define __get_user_asm(val, insn, addr, err) \ #define __get_user_asm(val, insn, addr, err) \
{ \ { \
unsigned long __gu_val; \
__asm__ __volatile__( \ __asm__ __volatile__( \
" movi %0, %3\n" \ " movi %0, %3\n" \
"1: " insn " %1, 0(%2)\n" \ "1: " insn " %1, 0(%2)\n" \
@@ -97,14 +98,20 @@ extern __must_check long strnlen_user(const char __user *s, long n);
" .section __ex_table,\"a\"\n" \ " .section __ex_table,\"a\"\n" \
" .word 1b, 2b\n" \ " .word 1b, 2b\n" \
" .previous" \ " .previous" \
: "=&r" (err), "=r" (val) \ : "=&r" (err), "=r" (__gu_val) \
: "r" (addr), "i" (-EFAULT)); \ : "r" (addr), "i" (-EFAULT)); \
val = (__force __typeof__(*(addr)))__gu_val; \
} }
#define __get_user_unknown(val, size, ptr, err) do { \ extern void __get_user_unknown(void);
#define __get_user_8(val, ptr, err) do { \
u64 __val = 0; \
err = 0; \ err = 0; \
if (__copy_from_user(&(val), ptr, size)) { \ if (raw_copy_from_user(&(__val), ptr, sizeof(val))) { \
err = -EFAULT; \ err = -EFAULT; \
} else { \
val = (typeof(val))(typeof((val) - (val)))__val; \
} \ } \
} while (0) } while (0)
@@ -120,8 +127,11 @@ do { \
case 4: \ case 4: \
__get_user_asm(val, "ldw", ptr, err); \ __get_user_asm(val, "ldw", ptr, err); \
break; \ break; \
case 8: \
__get_user_8(val, ptr, err); \
break; \
default: \ default: \
__get_user_unknown(val, size, ptr, err); \ __get_user_unknown(); \
break; \ break; \
} \ } \
} while (0) } while (0)
@@ -130,9 +140,7 @@ do { \
({ \ ({ \
long __gu_err = -EFAULT; \ long __gu_err = -EFAULT; \
const __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \ const __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \
unsigned long __gu_val = 0; \ __get_user_common(x, sizeof(*(ptr)), __gu_ptr, __gu_err); \
__get_user_common(__gu_val, sizeof(*(ptr)), __gu_ptr, __gu_err);\
(x) = (__force __typeof__(x))__gu_val; \
__gu_err; \ __gu_err; \
}) })
@@ -140,11 +148,9 @@ do { \
({ \ ({ \
long __gu_err = -EFAULT; \ long __gu_err = -EFAULT; \
const __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \ const __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \
unsigned long __gu_val = 0; \
if (access_ok( __gu_ptr, sizeof(*__gu_ptr))) \ if (access_ok( __gu_ptr, sizeof(*__gu_ptr))) \
__get_user_common(__gu_val, sizeof(*__gu_ptr), \ __get_user_common(x, sizeof(*__gu_ptr), \
__gu_ptr, __gu_err); \ __gu_ptr, __gu_err); \
(x) = (__force __typeof__(x))__gu_val; \
__gu_err; \ __gu_err; \
}) })

View File

@@ -36,10 +36,10 @@ struct rt_sigframe {
static inline int rt_restore_ucontext(struct pt_regs *regs, static inline int rt_restore_ucontext(struct pt_regs *regs,
struct switch_stack *sw, struct switch_stack *sw,
struct ucontext *uc, int *pr2) struct ucontext __user *uc, int *pr2)
{ {
int temp; int temp;
unsigned long *gregs = uc->uc_mcontext.gregs; unsigned long __user *gregs = uc->uc_mcontext.gregs;
int err; int err;
/* Always make any pending restarted system calls return -EINTR */ /* Always make any pending restarted system calls return -EINTR */
@@ -102,10 +102,11 @@ asmlinkage int do_rt_sigreturn(struct switch_stack *sw)
{ {
struct pt_regs *regs = (struct pt_regs *)(sw + 1); struct pt_regs *regs = (struct pt_regs *)(sw + 1);
/* Verify, can we follow the stack back */ /* Verify, can we follow the stack back */
struct rt_sigframe *frame = (struct rt_sigframe *) regs->sp; struct rt_sigframe __user *frame;
sigset_t set; sigset_t set;
int rval; int rval;
frame = (struct rt_sigframe __user *) regs->sp;
if (!access_ok(frame, sizeof(*frame))) if (!access_ok(frame, sizeof(*frame)))
goto badframe; goto badframe;
@@ -124,10 +125,10 @@ badframe:
return 0; return 0;
} }
static inline int rt_setup_ucontext(struct ucontext *uc, struct pt_regs *regs) static inline int rt_setup_ucontext(struct ucontext __user *uc, struct pt_regs *regs)
{ {
struct switch_stack *sw = (struct switch_stack *)regs - 1; struct switch_stack *sw = (struct switch_stack *)regs - 1;
unsigned long *gregs = uc->uc_mcontext.gregs; unsigned long __user *gregs = uc->uc_mcontext.gregs;
int err = 0; int err = 0;
err |= __put_user(MCONTEXT_VERSION, &uc->uc_mcontext.version); err |= __put_user(MCONTEXT_VERSION, &uc->uc_mcontext.version);
@@ -162,8 +163,9 @@ static inline int rt_setup_ucontext(struct ucontext *uc, struct pt_regs *regs)
return err; return err;
} }
static inline void *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, static inline void __user *get_sigframe(struct ksignal *ksig,
size_t frame_size) struct pt_regs *regs,
size_t frame_size)
{ {
unsigned long usp; unsigned long usp;
@@ -174,13 +176,13 @@ static inline void *get_sigframe(struct ksignal *ksig, struct pt_regs *regs,
usp = sigsp(usp, ksig); usp = sigsp(usp, ksig);
/* Verify, is it 32 or 64 bit aligned */ /* Verify, is it 32 or 64 bit aligned */
return (void *)((usp - frame_size) & -8UL); return (void __user *)((usp - frame_size) & -8UL);
} }
static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
struct pt_regs *regs) struct pt_regs *regs)
{ {
struct rt_sigframe *frame; struct rt_sigframe __user *frame;
int err = 0; int err = 0;
frame = get_sigframe(ksig, regs, sizeof(*frame)); frame = get_sigframe(ksig, regs, sizeof(*frame));

View File

@@ -17,6 +17,7 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err);
const char *trap_name(unsigned long code); const char *trap_name(unsigned long code);
void do_page_fault(struct pt_regs *regs, unsigned long code, void do_page_fault(struct pt_regs *regs, unsigned long code,
unsigned long address); unsigned long address);
int handle_nadtlb_fault(struct pt_regs *regs);
#endif #endif
#endif #endif

View File

@@ -661,6 +661,8 @@ void notrace handle_interruption(int code, struct pt_regs *regs)
by hand. Technically we need to emulate: by hand. Technically we need to emulate:
fdc,fdce,pdc,"fic,4f",prober,probeir,probew, probeiw fdc,fdce,pdc,"fic,4f",prober,probeir,probew, probeiw
*/ */
if (code == 17 && handle_nadtlb_fault(regs))
return;
fault_address = regs->ior; fault_address = regs->ior;
fault_space = regs->isr; fault_space = regs->isr;
break; break;

View File

@@ -424,3 +424,92 @@ no_context:
goto no_context; goto no_context;
pagefault_out_of_memory(); pagefault_out_of_memory();
} }
/* Handle non-access data TLB miss faults.
*
* For probe instructions, accesses to userspace are considered allowed
* if they lie in a valid VMA and the access type matches. We are not
* allowed to handle MM faults here so there may be situations where an
* actual access would fail even though a probe was successful.
*/
int
handle_nadtlb_fault(struct pt_regs *regs)
{
unsigned long insn = regs->iir;
int breg, treg, xreg, val = 0;
struct vm_area_struct *vma, *prev_vma;
struct task_struct *tsk;
struct mm_struct *mm;
unsigned long address;
unsigned long acc_type;
switch (insn & 0x380) {
case 0x280:
/* FDC instruction */
fallthrough;
case 0x380:
/* PDC and FIC instructions */
if (printk_ratelimit()) {
pr_warn("BUG: nullifying cache flush/purge instruction\n");
show_regs(regs);
}
if (insn & 0x20) {
/* Base modification */
breg = (insn >> 21) & 0x1f;
xreg = (insn >> 16) & 0x1f;
if (breg && xreg)
regs->gr[breg] += regs->gr[xreg];
}
regs->gr[0] |= PSW_N;
return 1;
case 0x180:
/* PROBE instruction */
treg = insn & 0x1f;
if (regs->isr) {
tsk = current;
mm = tsk->mm;
if (mm) {
/* Search for VMA */
address = regs->ior;
mmap_read_lock(mm);
vma = find_vma_prev(mm, address, &prev_vma);
mmap_read_unlock(mm);
/*
* Check if access to the VMA is okay.
* We don't allow for stack expansion.
*/
acc_type = (insn & 0x40) ? VM_WRITE : VM_READ;
if (vma
&& address >= vma->vm_start
&& (vma->vm_flags & acc_type) == acc_type)
val = 1;
}
}
if (treg)
regs->gr[treg] = val;
regs->gr[0] |= PSW_N;
return 1;
case 0x300:
/* LPA instruction */
if (insn & 0x20) {
/* Base modification */
breg = (insn >> 21) & 0x1f;
xreg = (insn >> 16) & 0x1f;
if (breg && xreg)
regs->gr[breg] += regs->gr[xreg];
}
treg = insn & 0x1f;
if (treg)
regs->gr[treg] = 0;
regs->gr[0] |= PSW_N;
return 1;
default:
break;
}
return 0;
}

View File

@@ -172,7 +172,7 @@ else
CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,$(call cc-option,-mtune=power5)) CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,$(call cc-option,-mtune=power5))
CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mcpu=power5,-mcpu=power4) CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mcpu=power5,-mcpu=power4)
endif endif
else else ifdef CONFIG_PPC_BOOK3E_64
CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64 CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64
endif endif

View File

@@ -0,0 +1,30 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* T1040RDB-REV-A Device Tree Source
*
* Copyright 2014 - 2015 Freescale Semiconductor Inc.
*
*/
#include "t1040rdb.dts"
/ {
model = "fsl,T1040RDB-REV-A";
compatible = "fsl,T1040RDB-REV-A";
};
&seville_port0 {
label = "ETH5";
};
&seville_port2 {
label = "ETH7";
};
&seville_port4 {
label = "ETH9";
};
&seville_port6 {
label = "ETH11";
};

View File

@@ -119,7 +119,7 @@
managed = "in-band-status"; managed = "in-band-status";
phy-handle = <&phy_qsgmii_0>; phy-handle = <&phy_qsgmii_0>;
phy-mode = "qsgmii"; phy-mode = "qsgmii";
label = "ETH5"; label = "ETH3";
status = "okay"; status = "okay";
}; };
@@ -135,7 +135,7 @@
managed = "in-band-status"; managed = "in-band-status";
phy-handle = <&phy_qsgmii_2>; phy-handle = <&phy_qsgmii_2>;
phy-mode = "qsgmii"; phy-mode = "qsgmii";
label = "ETH7"; label = "ETH5";
status = "okay"; status = "okay";
}; };
@@ -151,7 +151,7 @@
managed = "in-band-status"; managed = "in-band-status";
phy-handle = <&phy_qsgmii_4>; phy-handle = <&phy_qsgmii_4>;
phy-mode = "qsgmii"; phy-mode = "qsgmii";
label = "ETH9"; label = "ETH7";
status = "okay"; status = "okay";
}; };
@@ -167,7 +167,7 @@
managed = "in-band-status"; managed = "in-band-status";
phy-handle = <&phy_qsgmii_6>; phy-handle = <&phy_qsgmii_6>;
phy-mode = "qsgmii"; phy-mode = "qsgmii";
label = "ETH11"; label = "ETH9";
status = "okay"; status = "okay";
}; };

View File

@@ -344,25 +344,37 @@ static inline void __raw_writeq_be(unsigned long v, volatile void __iomem *addr)
*/ */
static inline void __raw_rm_writeb(u8 val, volatile void __iomem *paddr) static inline void __raw_rm_writeb(u8 val, volatile void __iomem *paddr)
{ {
__asm__ __volatile__("stbcix %0,0,%1" __asm__ __volatile__(".machine push; \
.machine power6; \
stbcix %0,0,%1; \
.machine pop;"
: : "r" (val), "r" (paddr) : "memory"); : : "r" (val), "r" (paddr) : "memory");
} }
static inline void __raw_rm_writew(u16 val, volatile void __iomem *paddr) static inline void __raw_rm_writew(u16 val, volatile void __iomem *paddr)
{ {
__asm__ __volatile__("sthcix %0,0,%1" __asm__ __volatile__(".machine push; \
.machine power6; \
sthcix %0,0,%1; \
.machine pop;"
: : "r" (val), "r" (paddr) : "memory"); : : "r" (val), "r" (paddr) : "memory");
} }
static inline void __raw_rm_writel(u32 val, volatile void __iomem *paddr) static inline void __raw_rm_writel(u32 val, volatile void __iomem *paddr)
{ {
__asm__ __volatile__("stwcix %0,0,%1" __asm__ __volatile__(".machine push; \
.machine power6; \
stwcix %0,0,%1; \
.machine pop;"
: : "r" (val), "r" (paddr) : "memory"); : : "r" (val), "r" (paddr) : "memory");
} }
static inline void __raw_rm_writeq(u64 val, volatile void __iomem *paddr) static inline void __raw_rm_writeq(u64 val, volatile void __iomem *paddr)
{ {
__asm__ __volatile__("stdcix %0,0,%1" __asm__ __volatile__(".machine push; \
.machine power6; \
stdcix %0,0,%1; \
.machine pop;"
: : "r" (val), "r" (paddr) : "memory"); : : "r" (val), "r" (paddr) : "memory");
} }
@@ -374,7 +386,10 @@ static inline void __raw_rm_writeq_be(u64 val, volatile void __iomem *paddr)
static inline u8 __raw_rm_readb(volatile void __iomem *paddr) static inline u8 __raw_rm_readb(volatile void __iomem *paddr)
{ {
u8 ret; u8 ret;
__asm__ __volatile__("lbzcix %0,0, %1" __asm__ __volatile__(".machine push; \
.machine power6; \
lbzcix %0,0, %1; \
.machine pop;"
: "=r" (ret) : "r" (paddr) : "memory"); : "=r" (ret) : "r" (paddr) : "memory");
return ret; return ret;
} }
@@ -382,7 +397,10 @@ static inline u8 __raw_rm_readb(volatile void __iomem *paddr)
static inline u16 __raw_rm_readw(volatile void __iomem *paddr) static inline u16 __raw_rm_readw(volatile void __iomem *paddr)
{ {
u16 ret; u16 ret;
__asm__ __volatile__("lhzcix %0,0, %1" __asm__ __volatile__(".machine push; \
.machine power6; \
lhzcix %0,0, %1; \
.machine pop;"
: "=r" (ret) : "r" (paddr) : "memory"); : "=r" (ret) : "r" (paddr) : "memory");
return ret; return ret;
} }
@@ -390,7 +408,10 @@ static inline u16 __raw_rm_readw(volatile void __iomem *paddr)
static inline u32 __raw_rm_readl(volatile void __iomem *paddr) static inline u32 __raw_rm_readl(volatile void __iomem *paddr)
{ {
u32 ret; u32 ret;
__asm__ __volatile__("lwzcix %0,0, %1" __asm__ __volatile__(".machine push; \
.machine power6; \
lwzcix %0,0, %1; \
.machine pop;"
: "=r" (ret) : "r" (paddr) : "memory"); : "=r" (ret) : "r" (paddr) : "memory");
return ret; return ret;
} }
@@ -398,7 +419,10 @@ static inline u32 __raw_rm_readl(volatile void __iomem *paddr)
static inline u64 __raw_rm_readq(volatile void __iomem *paddr) static inline u64 __raw_rm_readq(volatile void __iomem *paddr)
{ {
u64 ret; u64 ret;
__asm__ __volatile__("ldcix %0,0, %1" __asm__ __volatile__(".machine push; \
.machine power6; \
ldcix %0,0, %1; \
.machine pop;"
: "=r" (ret) : "r" (paddr) : "memory"); : "=r" (ret) : "r" (paddr) : "memory");
return ret; return ret;
} }

View File

@@ -229,8 +229,11 @@ extern long __get_user_bad(void);
*/ */
#define __get_user_atomic_128_aligned(kaddr, uaddr, err) \ #define __get_user_atomic_128_aligned(kaddr, uaddr, err) \
__asm__ __volatile__( \ __asm__ __volatile__( \
".machine push\n" \
".machine altivec\n" \
"1: lvx 0,0,%1 # get user\n" \ "1: lvx 0,0,%1 # get user\n" \
" stvx 0,0,%2 # put kernel\n" \ " stvx 0,0,%2 # put kernel\n" \
".machine pop\n" \
"2:\n" \ "2:\n" \
".section .fixup,\"ax\"\n" \ ".section .fixup,\"ax\"\n" \
"3: li %0,%3\n" \ "3: li %0,%3\n" \

View File

@@ -669,7 +669,7 @@ static void __init kvm_use_magic_page(void)
on_each_cpu(kvm_map_magic_page, &features, 1); on_each_cpu(kvm_map_magic_page, &features, 1);
/* Quick self-test to see if the mapping works */ /* Quick self-test to see if the mapping works */
if (!fault_in_pages_readable((const char *)KVM_MAGIC_PAGE, sizeof(u32))) { if (fault_in_pages_readable((const char *)KVM_MAGIC_PAGE, sizeof(u32))) {
kvm_patching_worked = false; kvm_patching_worked = false;
return; return;
} }

View File

@@ -5752,8 +5752,11 @@ static int kvmppc_book3s_init_hv(void)
if (r) if (r)
return r; return r;
if (kvmppc_radix_possible()) if (kvmppc_radix_possible()) {
r = kvmppc_radix_init(); r = kvmppc_radix_init();
if (r)
return r;
}
/* /*
* POWER9 chips before version 2.02 can't have some threads in * POWER9 chips before version 2.02 can't have some threads in

View File

@@ -1500,7 +1500,7 @@ int kvmppc_handle_vmx_load(struct kvm_vcpu *vcpu,
{ {
enum emulation_result emulated = EMULATE_DONE; enum emulation_result emulated = EMULATE_DONE;
if (vcpu->arch.mmio_vsx_copy_nums > 2) if (vcpu->arch.mmio_vmx_copy_nums > 2)
return EMULATE_FAIL; return EMULATE_FAIL;
while (vcpu->arch.mmio_vmx_copy_nums) { while (vcpu->arch.mmio_vmx_copy_nums) {
@@ -1597,7 +1597,7 @@ int kvmppc_handle_vmx_store(struct kvm_vcpu *vcpu,
unsigned int index = rs & KVM_MMIO_REG_MASK; unsigned int index = rs & KVM_MMIO_REG_MASK;
enum emulation_result emulated = EMULATE_DONE; enum emulation_result emulated = EMULATE_DONE;
if (vcpu->arch.mmio_vsx_copy_nums > 2) if (vcpu->arch.mmio_vmx_copy_nums > 2)
return EMULATE_FAIL; return EMULATE_FAIL;
vcpu->arch.io_gpr = rs; vcpu->arch.io_gpr = rs;

View File

@@ -108,9 +108,9 @@ static nokprobe_inline long address_ok(struct pt_regs *regs,
{ {
if (!user_mode(regs)) if (!user_mode(regs))
return 1; return 1;
if (__access_ok(ea, nb)) if (access_ok((void __user *)ea, nb))
return 1; return 1;
if (__access_ok(ea, 1)) if (access_ok((void __user *)ea, 1))
/* Access overlaps the end of the user region */ /* Access overlaps the end of the user region */
regs->dar = TASK_SIZE_MAX - 1; regs->dar = TASK_SIZE_MAX - 1;
else else
@@ -949,7 +949,10 @@ NOKPROBE_SYMBOL(emulate_dcbz);
#define __put_user_asmx(x, addr, err, op, cr) \ #define __put_user_asmx(x, addr, err, op, cr) \
__asm__ __volatile__( \ __asm__ __volatile__( \
".machine push\n" \
".machine power8\n" \
"1: " op " %2,0,%3\n" \ "1: " op " %2,0,%3\n" \
".machine pop\n" \
" mfcr %1\n" \ " mfcr %1\n" \
"2:\n" \ "2:\n" \
".section .fixup,\"ax\"\n" \ ".section .fixup,\"ax\"\n" \
@@ -962,7 +965,10 @@ NOKPROBE_SYMBOL(emulate_dcbz);
#define __get_user_asmx(x, addr, err, op) \ #define __get_user_asmx(x, addr, err, op) \
__asm__ __volatile__( \ __asm__ __volatile__( \
".machine push\n" \
".machine power8\n" \
"1: "op" %1,0,%2\n" \ "1: "op" %1,0,%2\n" \
".machine pop\n" \
"2:\n" \ "2:\n" \
".section .fixup,\"ax\"\n" \ ".section .fixup,\"ax\"\n" \
"3: li %0,%3\n" \ "3: li %0,%3\n" \
@@ -3187,7 +3193,7 @@ int emulate_loadstore(struct pt_regs *regs, struct instruction_op *op)
__put_user_asmx(op->val, ea, err, "stbcx.", cr); __put_user_asmx(op->val, ea, err, "stbcx.", cr);
break; break;
case 2: case 2:
__put_user_asmx(op->val, ea, err, "stbcx.", cr); __put_user_asmx(op->val, ea, err, "sthcx.", cr);
break; break;
#endif #endif
case 4: case 4:

View File

@@ -83,13 +83,12 @@ void __init
kasan_update_early_region(unsigned long k_start, unsigned long k_end, pte_t pte) kasan_update_early_region(unsigned long k_start, unsigned long k_end, pte_t pte)
{ {
unsigned long k_cur; unsigned long k_cur;
phys_addr_t pa = __pa(kasan_early_shadow_page);
for (k_cur = k_start; k_cur != k_end; k_cur += PAGE_SIZE) { for (k_cur = k_start; k_cur != k_end; k_cur += PAGE_SIZE) {
pmd_t *pmd = pmd_off_k(k_cur); pmd_t *pmd = pmd_off_k(k_cur);
pte_t *ptep = pte_offset_kernel(pmd, k_cur); pte_t *ptep = pte_offset_kernel(pmd, k_cur);
if ((pte_val(*ptep) & PTE_RPN_MASK) != pa) if (pte_page(*ptep) != virt_to_page(lm_alias(kasan_early_shadow_page)))
continue; continue;
__set_pte_at(&init_mm, k_cur, ptep, pte, 0); __set_pte_at(&init_mm, k_cur, ptep, pte, 0);

View File

@@ -742,7 +742,9 @@ static int __init parse_numa_properties(void)
of_node_put(cpu); of_node_put(cpu);
} }
node_set_online(nid); /* node_set_online() is an UB if 'nid' is negative */
if (likely(nid >= 0))
node_set_online(nid);
} }
get_n_mem_cells(&n_mem_addr_cells, &n_mem_size_cells); get_n_mem_cells(&n_mem_addr_cells, &n_mem_size_cells);

View File

@@ -1457,7 +1457,11 @@ static int trace_imc_event_init(struct perf_event *event)
event->hw.idx = -1; event->hw.idx = -1;
event->pmu->task_ctx_nr = perf_hw_context; /*
* There can only be a single PMU for perf_hw_context events which is assigned to
* core PMU. Hence use "perf_sw_context" for trace_imc.
*/
event->pmu->task_ctx_nr = perf_sw_context;
event->destroy = reset_global_refc; event->destroy = reset_global_refc;
return 0; return 0;
} }

View File

@@ -153,6 +153,7 @@ int __init mpc8xx_pic_init(void)
if (mpc8xx_pic_host == NULL) { if (mpc8xx_pic_host == NULL) {
printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n"); printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n");
ret = -ENOMEM; ret = -ENOMEM;
goto out;
} }
ret = 0; ret = 0;

View File

@@ -43,7 +43,11 @@ static unsigned long rng_whiten(struct powernv_rng *rng, unsigned long val)
unsigned long parity; unsigned long parity;
/* Calculate the parity of the value */ /* Calculate the parity of the value */
asm ("popcntd %0,%1" : "=r" (parity) : "r" (val)); asm (".machine push; \
.machine power7; \
popcntd %0,%1; \
.machine pop;"
: "=r" (parity) : "r" (val));
/* xor our value with the previous mask */ /* xor our value with the previous mask */
val ^= rng->mask; val ^= rng->mask;

View File

@@ -86,7 +86,7 @@ static LIST_HEAD(gtms);
*/ */
struct gtm_timer *gtm_get_timer16(void) struct gtm_timer *gtm_get_timer16(void)
{ {
struct gtm *gtm = NULL; struct gtm *gtm;
int i; int i;
list_for_each_entry(gtm, &gtms, list_node) { list_for_each_entry(gtm, &gtms, list_node) {
@@ -103,7 +103,7 @@ struct gtm_timer *gtm_get_timer16(void)
spin_unlock_irq(&gtm->lock); spin_unlock_irq(&gtm->lock);
} }
if (gtm) if (!list_empty(&gtms))
return ERR_PTR(-EBUSY); return ERR_PTR(-EBUSY);
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
} }

View File

@@ -2,8 +2,8 @@
/* Copyright (C) 2017 Andes Technology Corporation */ /* Copyright (C) 2017 Andes Technology Corporation */
#ifdef CONFIG_MODULE_SECTIONS #ifdef CONFIG_MODULE_SECTIONS
SECTIONS { SECTIONS {
.plt (NOLOAD) : { BYTE(0) } .plt : { BYTE(0) }
.got (NOLOAD) : { BYTE(0) } .got : { BYTE(0) }
.got.plt (NOLOAD) : { BYTE(0) } .got.plt : { BYTE(0) }
} }
#endif #endif

View File

@@ -11,11 +11,17 @@
#include <asm/page.h> #include <asm/page.h>
#include <linux/const.h> #include <linux/const.h>
#ifdef CONFIG_KASAN
#define KASAN_STACK_ORDER 1
#else
#define KASAN_STACK_ORDER 0
#endif
/* thread information allocation */ /* thread information allocation */
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
#define THREAD_SIZE_ORDER (2) #define THREAD_SIZE_ORDER (2 + KASAN_STACK_ORDER)
#else #else
#define THREAD_SIZE_ORDER (1) #define THREAD_SIZE_ORDER (1 + KASAN_STACK_ORDER)
#endif #endif
#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)

View File

@@ -19,8 +19,8 @@ static unsigned long user_backtrace(struct perf_callchain_entry_ctx *entry,
{ {
struct stackframe buftail; struct stackframe buftail;
unsigned long ra = 0; unsigned long ra = 0;
unsigned long *user_frame_tail = unsigned long __user *user_frame_tail =
(unsigned long *)(fp - sizeof(struct stackframe)); (unsigned long __user *)(fp - sizeof(struct stackframe));
/* Check accessibility of one struct frame_tail beyond */ /* Check accessibility of one struct frame_tail beyond */
if (!access_ok(user_frame_tail, sizeof(buftail))) if (!access_ok(user_frame_tail, sizeof(buftail)))
@@ -77,7 +77,7 @@ void perf_callchain_user(struct perf_callchain_entry_ctx *entry,
bool fill_callchain(unsigned long pc, void *entry) bool fill_callchain(unsigned long pc, void *entry)
{ {
return perf_callchain_store(entry, pc); return perf_callchain_store(entry, pc) == 0;
} }
void notrace walk_stackframe(struct task_struct *task, void notrace walk_stackframe(struct task_struct *task,

View File

@@ -65,7 +65,7 @@ struct rt_signal_frame {
*/ */
static inline bool invalid_frame_pointer(void __user *fp, int fplen) static inline bool invalid_frame_pointer(void __user *fp, int fplen)
{ {
if ((((unsigned long) fp) & 15) || !__access_ok((unsigned long)fp, fplen)) if ((((unsigned long) fp) & 15) || !access_ok(fp, fplen))
return true; return true;
return false; return false;

View File

@@ -223,7 +223,7 @@ void mconsole_go(struct mc_request *req)
void mconsole_stop(struct mc_request *req) void mconsole_stop(struct mc_request *req)
{ {
deactivate_fd(req->originating_fd, MCONSOLE_IRQ); block_signals();
os_set_fd_block(req->originating_fd, 1); os_set_fd_block(req->originating_fd, 1);
mconsole_reply(req, "stopped", 0, 0); mconsole_reply(req, "stopped", 0, 0);
for (;;) { for (;;) {
@@ -246,6 +246,7 @@ void mconsole_stop(struct mc_request *req)
} }
os_set_fd_block(req->originating_fd, 0); os_set_fd_block(req->originating_fd, 0);
mconsole_reply(req, "", 0, 0); mconsole_reply(req, "", 0, 0);
unblock_signals();
} }
static DEFINE_SPINLOCK(mc_devices_lock); static DEFINE_SPINLOCK(mc_devices_lock);

View File

@@ -472,7 +472,7 @@ static u64 pt_config_filters(struct perf_event *event)
pt->filters.filter[range].msr_b = filter->msr_b; pt->filters.filter[range].msr_b = filter->msr_b;
} }
rtit_ctl |= filter->config << pt_address_ranges[range].reg_off; rtit_ctl |= (u64)filter->config << pt_address_ranges[range].reg_off;
} }
return rtit_ctl; return rtit_ctl;

View File

@@ -532,7 +532,7 @@ static void __send_ipi_mask(const struct cpumask *mask, int vector)
} else if (apic_id < min && max - apic_id < KVM_IPI_CLUSTER_SIZE) { } else if (apic_id < min && max - apic_id < KVM_IPI_CLUSTER_SIZE) {
ipi_bitmap <<= min - apic_id; ipi_bitmap <<= min - apic_id;
min = apic_id; min = apic_id;
} else if (apic_id < min + KVM_IPI_CLUSTER_SIZE) { } else if (apic_id > min && apic_id < min + KVM_IPI_CLUSTER_SIZE) {
max = apic_id < max ? max : apic_id; max = apic_id < max ? max : apic_id;
} else { } else {
ret = kvm_hypercall4(KVM_HC_SEND_IPI, (unsigned long)ipi_bitmap, ret = kvm_hypercall4(KVM_HC_SEND_IPI, (unsigned long)ipi_bitmap,

View File

@@ -1718,11 +1718,6 @@ static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
goto exception; goto exception;
} }
if (!seg_desc.p) {
err_vec = (seg == VCPU_SREG_SS) ? SS_VECTOR : NP_VECTOR;
goto exception;
}
dpl = seg_desc.dpl; dpl = seg_desc.dpl;
switch (seg) { switch (seg) {
@@ -1762,6 +1757,10 @@ static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
case VCPU_SREG_TR: case VCPU_SREG_TR:
if (seg_desc.s || (seg_desc.type != 1 && seg_desc.type != 9)) if (seg_desc.s || (seg_desc.type != 1 && seg_desc.type != 9))
goto exception; goto exception;
if (!seg_desc.p) {
err_vec = NP_VECTOR;
goto exception;
}
old_desc = seg_desc; old_desc = seg_desc;
seg_desc.type |= 2; /* busy */ seg_desc.type |= 2; /* busy */
ret = ctxt->ops->cmpxchg_emulated(ctxt, desc_addr, &old_desc, &seg_desc, ret = ctxt->ops->cmpxchg_emulated(ctxt, desc_addr, &old_desc, &seg_desc,
@@ -1786,6 +1785,11 @@ static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
break; break;
} }
if (!seg_desc.p) {
err_vec = (seg == VCPU_SREG_SS) ? SS_VECTOR : NP_VECTOR;
goto exception;
}
if (seg_desc.s) { if (seg_desc.s) {
/* mark segment as accessed */ /* mark segment as accessed */
if (!(seg_desc.type & 1)) { if (!(seg_desc.type & 1)) {

View File

@@ -207,7 +207,7 @@ static int synic_set_msr(struct kvm_vcpu_hv_synic *synic,
struct kvm_vcpu *vcpu = synic_to_vcpu(synic); struct kvm_vcpu *vcpu = synic_to_vcpu(synic);
int ret; int ret;
if (!synic->active && !host) if (!synic->active && (!host || data))
return 1; return 1;
trace_kvm_hv_synic_set_msr(vcpu->vcpu_id, msr, data, host); trace_kvm_hv_synic_set_msr(vcpu->vcpu_id, msr, data, host);
@@ -253,6 +253,9 @@ static int synic_set_msr(struct kvm_vcpu_hv_synic *synic,
case HV_X64_MSR_EOM: { case HV_X64_MSR_EOM: {
int i; int i;
if (!synic->active)
break;
for (i = 0; i < ARRAY_SIZE(synic->sint); i++) for (i = 0; i < ARRAY_SIZE(synic->sint); i++)
kvm_hv_notify_acked_sint(vcpu, i); kvm_hv_notify_acked_sint(vcpu, i);
break; break;
@@ -636,7 +639,7 @@ static int stimer_set_config(struct kvm_vcpu_hv_stimer *stimer, u64 config,
struct kvm_vcpu *vcpu = stimer_to_vcpu(stimer); struct kvm_vcpu *vcpu = stimer_to_vcpu(stimer);
struct kvm_vcpu_hv_synic *synic = vcpu_to_synic(vcpu); struct kvm_vcpu_hv_synic *synic = vcpu_to_synic(vcpu);
if (!synic->active && !host) if (!synic->active && (!host || config))
return 1; return 1;
trace_kvm_hv_stimer_set_config(stimer_to_vcpu(stimer)->vcpu_id, trace_kvm_hv_stimer_set_config(stimer_to_vcpu(stimer)->vcpu_id,
@@ -660,7 +663,7 @@ static int stimer_set_count(struct kvm_vcpu_hv_stimer *stimer, u64 count,
struct kvm_vcpu *vcpu = stimer_to_vcpu(stimer); struct kvm_vcpu *vcpu = stimer_to_vcpu(stimer);
struct kvm_vcpu_hv_synic *synic = vcpu_to_synic(vcpu); struct kvm_vcpu_hv_synic *synic = vcpu_to_synic(vcpu);
if (!synic->active && !host) if (!synic->active && (!host || count))
return 1; return 1;
trace_kvm_hv_stimer_set_count(stimer_to_vcpu(stimer)->vcpu_id, trace_kvm_hv_stimer_set_count(stimer_to_vcpu(stimer)->vcpu_id,

View File

@@ -2227,10 +2227,7 @@ void kvm_set_lapic_tscdeadline_msr(struct kvm_vcpu *vcpu, u64 data)
void kvm_lapic_set_tpr(struct kvm_vcpu *vcpu, unsigned long cr8) void kvm_lapic_set_tpr(struct kvm_vcpu *vcpu, unsigned long cr8)
{ {
struct kvm_lapic *apic = vcpu->arch.apic; apic_set_tpr(vcpu->arch.apic, (cr8 & 0x0f) << 4);
apic_set_tpr(apic, ((cr8 & 0x0f) << 4)
| (kvm_lapic_get_reg(apic, APIC_TASKPRI) & 4));
} }
u64 kvm_lapic_get_cr8(struct kvm_vcpu *vcpu) u64 kvm_lapic_get_cr8(struct kvm_vcpu *vcpu)

View File

@@ -34,9 +34,8 @@
#define PT_HAVE_ACCESSED_DIRTY(mmu) true #define PT_HAVE_ACCESSED_DIRTY(mmu) true
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
#define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL #define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL
#define CMPXCHG cmpxchg #define CMPXCHG "cmpxchgq"
#else #else
#define CMPXCHG cmpxchg64
#define PT_MAX_FULL_LEVELS 2 #define PT_MAX_FULL_LEVELS 2
#endif #endif
#elif PTTYPE == 32 #elif PTTYPE == 32
@@ -52,7 +51,7 @@
#define PT_GUEST_DIRTY_SHIFT PT_DIRTY_SHIFT #define PT_GUEST_DIRTY_SHIFT PT_DIRTY_SHIFT
#define PT_GUEST_ACCESSED_SHIFT PT_ACCESSED_SHIFT #define PT_GUEST_ACCESSED_SHIFT PT_ACCESSED_SHIFT
#define PT_HAVE_ACCESSED_DIRTY(mmu) true #define PT_HAVE_ACCESSED_DIRTY(mmu) true
#define CMPXCHG cmpxchg #define CMPXCHG "cmpxchgl"
#elif PTTYPE == PTTYPE_EPT #elif PTTYPE == PTTYPE_EPT
#define pt_element_t u64 #define pt_element_t u64
#define guest_walker guest_walkerEPT #define guest_walker guest_walkerEPT
@@ -65,7 +64,9 @@
#define PT_GUEST_DIRTY_SHIFT 9 #define PT_GUEST_DIRTY_SHIFT 9
#define PT_GUEST_ACCESSED_SHIFT 8 #define PT_GUEST_ACCESSED_SHIFT 8
#define PT_HAVE_ACCESSED_DIRTY(mmu) ((mmu)->ept_ad) #define PT_HAVE_ACCESSED_DIRTY(mmu) ((mmu)->ept_ad)
#define CMPXCHG cmpxchg64 #ifdef CONFIG_X86_64
#define CMPXCHG "cmpxchgq"
#endif
#define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL #define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL
#else #else
#error Invalid PTTYPE value #error Invalid PTTYPE value
@@ -147,43 +148,39 @@ static int FNAME(cmpxchg_gpte)(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu,
pt_element_t __user *ptep_user, unsigned index, pt_element_t __user *ptep_user, unsigned index,
pt_element_t orig_pte, pt_element_t new_pte) pt_element_t orig_pte, pt_element_t new_pte)
{ {
int npages; int r = -EFAULT;
pt_element_t ret;
pt_element_t *table;
struct page *page;
npages = get_user_pages_fast((unsigned long)ptep_user, 1, FOLL_WRITE, &page); if (!user_access_begin(ptep_user, sizeof(pt_element_t)))
if (likely(npages == 1)) { return -EFAULT;
table = kmap_atomic(page);
ret = CMPXCHG(&table[index], orig_pte, new_pte);
kunmap_atomic(table);
kvm_release_page_dirty(page); #ifdef CMPXCHG
} else { asm volatile("1:" LOCK_PREFIX CMPXCHG " %[new], %[ptr]\n"
struct vm_area_struct *vma; "mov $0, %[r]\n"
unsigned long vaddr = (unsigned long)ptep_user & PAGE_MASK; "setnz %b[r]\n"
unsigned long pfn; "2:"
unsigned long paddr; _ASM_EXTABLE_UA(1b, 2b)
: [ptr] "+m" (*ptep_user),
[old] "+a" (orig_pte),
[r] "+q" (r)
: [new] "r" (new_pte)
: "memory");
#else
asm volatile("1:" LOCK_PREFIX "cmpxchg8b %[ptr]\n"
"movl $0, %[r]\n"
"jz 2f\n"
"incl %[r]\n"
"2:"
_ASM_EXTABLE_UA(1b, 2b)
: [ptr] "+m" (*ptep_user),
[old] "+A" (orig_pte),
[r] "+rm" (r)
: [new_lo] "b" ((u32)new_pte),
[new_hi] "c" ((u32)(new_pte >> 32))
: "memory");
#endif
mmap_read_lock(current->mm); user_access_end();
vma = find_vma_intersection(current->mm, vaddr, vaddr + PAGE_SIZE); return r;
if (!vma || !(vma->vm_flags & VM_PFNMAP)) {
mmap_read_unlock(current->mm);
return -EFAULT;
}
pfn = ((vaddr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
paddr = pfn << PAGE_SHIFT;
table = memremap(paddr, PAGE_SIZE, MEMREMAP_WB);
if (!table) {
mmap_read_unlock(current->mm);
return -EFAULT;
}
ret = CMPXCHG(&table[index], orig_pte, new_pte);
memunmap(table);
mmap_read_unlock(current->mm);
}
return (ret != orig_pte);
} }
static bool FNAME(prefetch_invalid_gpte)(struct kvm_vcpu *vcpu, static bool FNAME(prefetch_invalid_gpte)(struct kvm_vcpu *vcpu,

View File

@@ -902,6 +902,9 @@ static bool clear_dirty_gfn_range(struct kvm *kvm, struct kvm_mmu_page *root,
if (tdp_mmu_iter_cond_resched(kvm, &iter, false)) if (tdp_mmu_iter_cond_resched(kvm, &iter, false))
continue; continue;
if (!is_shadow_present_pte(iter.old_spte))
continue;
if (spte_ad_need_write_protect(iter.old_spte)) { if (spte_ad_need_write_protect(iter.old_spte)) {
if (is_writable_pte(iter.old_spte)) if (is_writable_pte(iter.old_spte))
new_spte = iter.old_spte & ~PT_WRITABLE_MASK; new_spte = iter.old_spte & ~PT_WRITABLE_MASK;

Some files were not shown because too many files have changed in this diff Show More