
* refs/heads/tmp-b92ac32: FROMGIT: usb: gadget: uvc: calculate the number of request depending on framesize ANDROID: GKI: Add tracing_is_on interface into symbol list UPSTREAM: usb: gadget: f_mass_storage: Make CD-ROM emulation work with Mac OS-X BACKPORT: io_uring: fix race between timeout flush and removal BACKPORT: net/sched: cls_u32: fix netns refcount changes in u32_change() UPSTREAM: io_uring: always use original task when preparing req identity FROMLIST: remoteproc: Fix dma_mem leak after rproc_shutdown FROMLIST: dma-mapping: Add dma_release_coherent_memory to DMA API ANDROID: Update QCOM symbol list for __reset_control_get ANDROID: vendor_hooks: Add hooks for mutex BACKPORT: can: ems_usb: ems_usb_start_xmit(): fix double dev_kfree_skb() in error path ANDROID: fix up abi issue with struct snd_pcm_runtime, again Revert "coredump: Snapshot the vmas in do_coredump" Revert "coredump: Remove the WARN_ON in dump_vma_snapshot" Revert "coredump: Use the vma snapshot in fill_files_note" Revert "pstore: Don't use semaphores in always-atomic-context code" Revert "PCI: Reduce warnings on possible RW1C corruption" ANDROID: GKI: fix crc issue with commitce1927b8cf
("block: don't merge across cgroup boundaries if blkcg is enabled") ANDROID: remove CONFIG_HW_RANDOM_CAVIUM from arm64 gki_defconfig Linux 5.10.110 PCI: xgene: Revert "PCI: xgene: Use inbound resources for setup" arm64: Do not defer reserve_crashkernel() for platforms with no DMA memory zones coredump: Use the vma snapshot in fill_files_note coredump/elf: Pass coredump_params into fill_note_info coredump: Remove the WARN_ON in dump_vma_snapshot coredump: Snapshot the vmas in do_coredump can: usb_8dev: usb_8dev_start_xmit(): fix double dev_kfree_skb() in error path can: m_can: m_can_tx_handler(): fix use after free of skb KVM: x86/mmu: do compare-and-exchange of gPTE via the user address openvswitch: Fixed nd target mask field in the flow dump. docs: sysctl/kernel: add missing bit to panic_print um: Fix uml_mconsole stop/go ARM: dts: spear13xx: Update SPI dma properties ARM: dts: spear1340: Update serial node properties ASoC: topology: Allow TLV control to be either read or write ubi: fastmap: Return error code if memory allocation fails in add_aeb() dt-bindings: spi: mxic: The interrupt property is not mandatory dt-bindings: mtd: nand-controller: Fix a comment in the examples dt-bindings: mtd: nand-controller: Fix the reg property description bpf: Fix comment for helper bpf_current_task_under_cgroup() bpf: Adjust BPF stack helper functions to accommodate skip > 0 mm/usercopy: return 1 from hardened_usercopy __setup() handler mm/memcontrol: return 1 from cgroup.memory __setup() handler ARM: 9187/1: JIVE: fix return value of __setup handler mm/mmap: return 1 from stack_guard_gap __setup() handler batman-adv: Check ptr for NULL before reducing its refcnt ASoC: soc-compress: Change the check for codec_dai staging: mt7621-dts: fix pinctrl-0 items to be size-1 items on ethernet proc: bootconfig: Add null pointer check can: isotp: restore accidentally removed MSG_PEEK feature platform/chrome: cros_ec_typec: Check for EC device ACPI: CPPC: Avoid out of bounds access when parsing _CPC data riscv module: remove (NOLOAD) io_uring: fix memory leak of uid in files registration ARM: iop32x: offset IRQ numbers by 1 ubi: Fix race condition between ctrl_cdev_ioctl and ubi_cdev_ioctl ASoC: mediatek: mt6358: add missing EXPORT_SYMBOLs pinctrl: nuvoton: npcm7xx: Use %zu printk format for ARRAY_SIZE() pinctrl: nuvoton: npcm7xx: Rename DS() macro to DSTR() watchdog: rti-wdt: Add missing pm_runtime_disable() in probe function pinctrl: pinconf-generic: Print arguments for bias-pull-* watch_queue: Free the page array when watch_queue is dismantled crypto: arm/aes-neonbs-cbc - Select generic cbc and aes mailbox: imx: fix wakeup failure from freeze mode rxrpc: Fix call timer start racing with call destruction net: hns3: fix software vlan talbe of vlan 0 inconsistent with hardware gfs2: Make sure FITRIM minlen is rounded up to fs block size rtc: check if __rtc_read_time was successful XArray: Update the LRU list in xas_split() can: mcp251xfd: mcp251xfd_register_get_dev_id(): fix return of error value can: mcba_usb: properly check endpoint type can: mcba_usb: mcba_usb_start_xmit(): fix double dev_kfree_skb in error path XArray: Fix xas_create_range() when multi-order entry present wireguard: socket: ignore v6 endpoints when ipv6 is disabled wireguard: socket: free skb in send6 when ipv6 is disabled wireguard: queueing: use CFI-safe ptr_ring cleanup function ubifs: rename_whiteout: correct old_dir size computing ubifs: Fix to add refcount once page is set private ubifs: Fix read out-of-bounds in ubifs_wbuf_write_nolock() ubifs: setflags: Make dirtied_ino_d 8 bytes aligned ubifs: Add missing iput if do_tmpfile() failed in rename whiteout ubifs: Fix deadlock in concurrent rename whiteout and inode writeback ubifs: rename_whiteout: Fix double free for whiteout_ui->data ASoC: SOF: Intel: Fix NULL ptr dereference when ENOMEM KVM: SVM: fix panic on out-of-bounds guest IRQ KVM: x86: fix sending PV IPI KVM: Prevent module exit until all VMs are freed KVM: x86: Forbid VMM to set SYNIC/STIMER MSRs when SynIC wasn't activated platform: chrome: Split trace include file scsi: qla2xxx: Use correct feature type field during RFF_ID processing scsi: qla2xxx: Reduce false trigger to login scsi: qla2xxx: Fix N2N inconsistent PLOGI scsi: qla2xxx: Fix missed DMA unmap for NVMe ls requests scsi: qla2xxx: Fix hang due to session stuck scsi: qla2xxx: Fix incorrect reporting of task management failure scsi: qla2xxx: Fix disk failure to rediscover scsi: qla2xxx: Suppress a kernel complaint in qla_create_qpair() scsi: qla2xxx: Check for firmware dump already collected scsi: qla2xxx: Add devids and conditionals for 28xx scsi: qla2xxx: Fix device reconnect in loop topology scsi: qla2xxx: Fix warning for missing error code scsi: qla2xxx: Fix wrong FDMI data for 64G adapter scsi: qla2xxx: Fix scheduling while atomic scsi: qla2xxx: Fix stuck session in gpdb powerpc: Fix build errors with newer binutils powerpc/lib/sstep: Fix build errors with newer binutils powerpc/lib/sstep: Fix 'sthcx' instruction powerpc/kasan: Fix early region not updated correctly KVM: x86/mmu: Check for present SPTE when clearing dirty bit in TDP MMU ALSA: hda/realtek: Add alc256-samsung-headphone fixup media: atomisp: fix bad usage at error handling logic mmc: host: Return an error when ->enable_sdio_irq() ops is missing media: hdpvr: initialize dev->worker at hdpvr_register_videodev media: Revert "media: em28xx: add missing em28xx_close_extension" video: fbdev: sm712fb: Fix crash in smtcfb_write() ARM: mmp: Fix failure to remove sram device ARM: tegra: tamonten: Fix I2C3 pad setting lib/test_lockup: fix kernel pointer check for separate address spaces uaccess: fix type mismatch warnings from access_ok() media: cx88-mpeg: clear interrupt status register before streaming video ASoC: soc-core: skip zero num_dai component in searching dai name ARM: dts: bcm2711: Add the missing L1/L2 cache information video: fbdev: udlfb: replace snprintf in show functions with sysfs_emit video: fbdev: omapfb: panel-tpo-td043mtea1: Use sysfs_emit() instead of snprintf() video: fbdev: omapfb: panel-dsi-cm: Use sysfs_emit() instead of snprintf() arm64: defconfig: build imx-sdma as a module ARM: dts: imx7: Use audio_mclk_post_div instead audio_mclk_root_clk ARM: ftrace: avoid redundant loads or clobbering IP media: atomisp: fix dummy_ptr check to avoid duplicate active_bo media: atomisp_gmin_platform: Add DMI quirk to not turn AXP ELDO2 regulator off on some boards ASoC: madera: Add dependencies on MFD ARM: dts: bcm2837: Add the missing L1/L2 cache information ARM: dts: qcom: fix gic_irq_domain_translate warnings for msm8960 video: fbdev: omapfb: acx565akm: replace snprintf with sysfs_emit video: fbdev: cirrusfb: check pixclock to avoid divide by zero video: fbdev: w100fb: Reset global state video: fbdev: nvidiafb: Use strscpy() to prevent buffer overflow media: ir_toy: free before error exiting media: staging: media: zoran: fix various V4L2 compliance errors media: staging: media: zoran: calculate the right buffer number for zoran_reap_stat_com media: staging: media: zoran: move videodev alloc ntfs: add sanity check on allocation size f2fs: compress: fix to print raw data size in error path of lz4 decompression NFSD: Fix nfsd_breaker_owns_lease() return values f2fs: fix to do sanity check on curseg->alloc_type ext4: don't BUG if someone dirty pages without asking ext4 first ext4: fix ext4_mb_mark_bb() with flex_bg with fast_commit ext4: correct cluster len and clusters changed accounting in ext4_mb_mark_bb locking/lockdep: Iterate lock_classes directly when reading lockdep files spi: tegra20: Use of_device_get_match_data() nvme-tcp: lockdep: annotate in-kernel sockets parisc: Fix handling off probe non-access faults PM: core: keep irq flags in device_pm_check_callbacks() ACPI/APEI: Limit printable size of BERT table data Revert "Revert "block, bfq: honor already-setup queue merges"" lib/raid6/test/Makefile: Use $(pound) instead of \# for Make 4.3 ACPICA: Avoid walking the ACPI Namespace if it is not there bfq: fix use-after-free in bfq_dispatch_request fs/binfmt_elf: Fix AT_PHDR for unusual ELF files irqchip/nvic: Release nvic_base upon failure irqchip/qcom-pdc: Fix broken locking Fix incorrect type in assignment of ipv6 port for audit loop: use sysfs_emit() in the sysfs xxx show() selinux: allow FIOCLEX and FIONCLEX with policy capability selinux: use correct type for context length block, bfq: don't move oom_bfqq pinctrl: npcm: Fix broken references to chip->parent_device gcc-plugins/stackleak: Exactly match strings instead of prefixes regulator: rpi-panel: Handle I2C errors/timing to the Atmel LSM: general protection fault in legacy_parse_param fs: fix fd table size alignment properly lib/test: use after free in register_test_dev_kmod() fs: fd tables have to be multiples of BITS_PER_LONG net: dsa: bcm_sf2_cfp: fix an incorrect NULL check on list iterator NFSv4/pNFS: Fix another issue with a list iterator pointing to the head net/x25: Fix null-ptr-deref caused by x25_disconnect qlcnic: dcb: default to returning -EOPNOTSUPP selftests: test_vxlan_under_vrf: Fix broken test case net: phy: broadcom: Fix brcm_fet_config_init() net: hns3: fix bug when PF set the duplicate MAC address for VFs net: enetc: report software timestamping via SO_TIMESTAMPING xen: fix is_xen_pmu() clk: Initialize orphan req_rate clk: qcom: gcc-msm8994: Fix gpll4 width kdb: Fix the putarea helper function NFSv4.1: don't retry BIND_CONN_TO_SESSION on session error netfilter: nf_conntrack_tcp: preserve liberal flag in tcp options jfs: fix divide error in dbNextAG driver core: dd: fix return value of __setup handler firmware: google: Properly state IOMEM dependency kgdbts: fix return value of __setup handler serial: 8250: fix XOFF/XON sending when DMA is used kgdboc: fix return value of __setup handler tty: hvc: fix return value of __setup handler pinctrl/rockchip: Add missing of_node_put() in rockchip_pinctrl_probe pinctrl: nomadik: Add missing of_node_put() in nmk_pinctrl_probe pinctrl: mediatek: paris: Skip custom extra pin config dump for virtual GPIOs pinctrl: mediatek: paris: Fix pingroup pin config state readback pinctrl: mediatek: paris: Fix "argument" argument type for mtk_pinconf_get() pinctrl: mediatek: paris: Fix PIN_CONFIG_BIAS_* readback pinctrl: mediatek: Fix missing of_node_put() in mtk_pctrl_init staging: mt7621-dts: fix GB-PC2 devicetree staging: mt7621-dts: fix pinctrl properties for ethernet staging: mt7621-dts: fix formatting staging: mt7621-dts: fix LEDs and pinctrl on GB-PC1 devicetree NFS: remove unneeded check in decode_devicenotify_args() clk: tegra: tegra124-emc: Fix missing put_device() call in emc_ensure_emc_driver clk: clps711x: Terminate clk_div_table with sentinel element clk: loongson1: Terminate clk_div_table with sentinel element clk: actions: Terminate clk_div_table with sentinel element nvdimm/region: Fix default alignment for small regions remoteproc: qcom_q6v5_mss: Fix some leaks in q6v5_alloc_memory_region remoteproc: qcom_wcnss: Add missing of_node_put() in wcnss_alloc_memory_region remoteproc: qcom: Fix missing of_node_put in adsp_alloc_memory_region dmaengine: hisi_dma: fix MSI allocate fail when reload hisi_dma clk: qcom: clk-rcg2: Update the frac table for pixel clock clk: qcom: clk-rcg2: Update logic to calculate D value for RCG clk: at91: sama7g5: fix parents of PDMCs' GCLK clk: imx7d: Remove audio_mclk_root_clk dma-debug: fix return value of __setup handlers NFS: Return valid errors from nfs2/3_decode_dirent() habanalabs: Add check for pci_enable_device iio: adc: Add check for devm_request_threaded_irq serial: 8250: Fix race condition in RTS-after-send handling NFS: Use of mapping_set_error() results in spurious errors serial: 8250_lpss: Balance reference count for PCI DMA device serial: 8250_mid: Balance reference count for PCI DMA device phy: dphy: Correct lpx parameter and its derivatives(ta_{get,go,sure}) clk: qcom: ipq8074: Use floor ops for SDCC1 clock pinctrl: renesas: checker: Fix miscalculation of number of states pinctrl: renesas: r8a77470: Reduce size for narrow VIN1 channel staging:iio:adc:ad7280a: Fix handing of device address bit reversing. iio: mma8452: Fix probe failing when an i2c_device_id is used clk: qcom: ipq8074: fix PCI-E clock oops soundwire: intel: fix wrong register name in intel_shim_wake cpufreq: qcom-cpufreq-nvmem: fix reading of PVS Valid fuse misc: alcor_pci: Fix an error handling path fsi: Aspeed: Fix a potential double free fsi: aspeed: convert to devm_platform_ioremap_resource pwm: lpc18xx-sct: Initialize driver data and hardware before pwmchip_add() mxser: fix xmit_buf leak in activate when LSR == 0xff mfd: asic3: Add missing iounmap() on error asic3_mfd_probe tipc: fix the timer expires after interval 100ms openvswitch: always update flow key after nat tcp: ensure PMTU updates are processed during fastopen net: bcmgenet: Use stronger register read/writes to assure ordering PCI: Avoid broken MSI on SB600 USB devices selftests/bpf/test_lirc_mode2.sh: Exit with proper code i2c: mux: demux-pinctrl: do not deactivate a master that is not active i2c: meson: Fix wrong speed use from probe af_netlink: Fix shift out of bounds in group mask calculation ipv4: Fix route lookups when handling ICMP redirects and PMTU updates Bluetooth: btmtksdio: Fix kernel oops in btmtksdio_interrupt Bluetooth: call hci_le_conn_failed with hdev lock in hci_le_conn_failed selftests/bpf: Fix error reporting from sock_fields programs bareudp: use ipv6_mod_enabled to check if IPv6 enabled can: isotp: support MSG_TRUNC flag when reading from socket can: isotp: return -EADDRNOTAVAIL when reading from unbound socket USB: storage: ums-realtek: fix error code in rts51x_read_mem() samples/bpf, xdpsock: Fix race when running for fix duration of time bpf, sockmap: Fix double uncharge the mem of sk_msg bpf, sockmap: Fix more uncharged while msg has more_data bpf, sockmap: Fix memleak in tcp_bpf_sendmsg while sk msg is full RDMA/mlx5: Fix memory leak in error flow for subscribe event routine mtd: rawnand: atmel: fix refcount issue in atmel_nand_controller_init MIPS: pgalloc: fix memory leak caused by pgd_free() MIPS: RB532: fix return value of __setup handler mips: cdmm: Fix refcount leak in mips_cdmm_phys_base ath10k: Fix error handling in ath10k_setup_msa_resources vxcan: enable local echo for sent CAN frames powerpc: 8xx: fix a return value error in mpc8xx_pic_init platform/x86: huawei-wmi: check the return value of device_create_file() selftests/bpf: Make test_lwt_ip_encap more stable and faster libbpf: Unmap rings when umem deleted mfd: mc13xxx: Add check for mc13xxx_irq_request powerpc/sysdev: fix incorrect use to determine if list is empty mips: DEC: honor CONFIG_MIPS_FP_SUPPORT=n net: axienet: fix RX ring refill allocation failure handling PCI: Reduce warnings on possible RW1C corruption IB/hfi1: Allow larger MTU without AIP power: supply: wm8350-power: Add missing free in free_charger_irq power: supply: wm8350-power: Handle error for wm8350_register_irq i2c: xiic: Make bus names unique hv_balloon: rate-limit "Unhandled message" warning KVM: x86/emulator: Defer not-present segment check in __load_segment_descriptor() KVM: x86: Fix emulation in writing cr8 powerpc/Makefile: Don't pass -mcpu=powerpc64 when building 32-bit powerpc/mm/numa: skip NUMA_NO_NODE onlining in parse_numa_properties() libbpf: Skip forward declaration when counting duplicated type names gpu: host1x: Fix a memory leak in 'host1x_remove()' bpf, arm64: Feed byte-offset into bpf line info bpf, arm64: Call build_prologue() first in first JIT pass drm/bridge: cdns-dsi: Make sure to to create proper aliases for dt scsi: hisi_sas: Change permission of parameter prot_mask power: supply: bq24190_charger: Fix bq24190_vbus_is_enabled() wrong false return drm/tegra: Fix reference leak in tegra_dsi_ganged_probe ext2: correct max file size computing TOMOYO: fix __setup handlers return values drm/amd/display: Remove vupdate_int_entry definition RDMA/mlx5: Fix the flow of a miss in the allocation of a cache ODP MR scsi: pm8001: Fix abort all task initialization scsi: pm8001: Fix NCQ NON DATA command completion handling scsi: pm8001: Fix NCQ NON DATA command task initialization scsi: pm8001: Fix le32 values handling in pm80xx_chip_sata_req() scsi: pm8001: Fix le32 values handling in pm80xx_chip_ssp_io_req() scsi: pm8001: Fix payload initialization in pm80xx_encrypt_update() scsi: pm8001: Fix le32 values handling in pm80xx_set_sas_protocol_timer_config() scsi: pm8001: Fix payload initialization in pm80xx_set_thermal_config() scsi: pm8001: Fix command initialization in pm8001_chip_ssp_tm_req() scsi: pm8001: Fix command initialization in pm80XX_send_read_log() dm crypt: fix get_key_size compiler warning if !CONFIG_KEYS drm/msm/dpu: fix dp audio condition drm/msm/dpu: add DSPP blocks teardown drm/msm/dp: populate connector of struct dp_panel iwlwifi: mvm: Fix an error code in iwl_mvm_up() iwlwifi: Fix -EIO error code that is never returned dax: make sure inodes are flushed before destroy cache IB/cma: Allow XRC INI QPs to set their local ACK timeout drm/amd/display: Add affected crtcs to atomic state for dsc mst unplug drm/amd/pm: enable pm sysfs write for one VF mode iommu/ipmmu-vmsa: Check for error num after setting mask HID: i2c-hid: fix GET/SET_REPORT for unnumbered reports power: supply: ab8500: Fix memory leak in ab8500_fg_sysfs_init drm/bridge: dw-hdmi: use safe format when first in bridge chain PCI: aardvark: Fix reading PCI_EXP_RTSTA_PME bit on emulated bridge livepatch: Fix build failure on 32 bits processors scripts/dtc: Call pkg-config POSIXly correct net: dsa: mv88e6xxx: Enable port policy support on 6097 mt76: mt7615: check sta_rates pointer in mt7615_sta_rate_tbl_update mt76: mt7603: check sta_rates pointer in mt7603_sta_rate_tbl_update mt76: mt7915: use proper aid value in mt7915_mcu_sta_basic_tlv mt76: mt7915: use proper aid value in mt7915_mcu_wtbl_generic_tlv in sta mode powerpc/perf: Don't use perf_hw_context for trace IMC PMU KVM: PPC: Book3S HV: Check return value of kvmppc_radix_init powerpc: dts: t1040rdb: fix ports names for Seville Ethernet switch ray_cs: Check ioremap return value power: reset: gemini-poweroff: Fix IRQ check in gemini_poweroff_probe i40e: respect metadata on XSK Rx to skb i40e: don't reserve excessive XDP_PACKET_HEADROOM on XSK Rx to skb KVM: PPC: Fix vmx/vsx mixup in mmio emulation RDMA/core: Set MR type in ib_reg_user_mr ath9k_htc: fix uninit value bugs drm/amd/pm: return -ENOTSUPP if there is no get_dpm_ultimate_freq function drm/amd/display: Fix a NULL pointer dereference in amdgpu_dm_connector_add_common_modes() drm/nouveau/acr: Fix undefined behavior in nvkm_acr_hsfw_load_bl() ionic: fix type complaint in ionic_dev_cmd_clean() drm/edid: Don't clear formats if using deep color mtd: rawnand: gpmi: fix controller timings setting mtd: onenand: Check for error irq Bluetooth: hci_serdev: call init_rwsem() before p->open() udmabuf: validate ubuf->pagecount libbpf: Fix possible NULL pointer dereference when destroying skeleton drm/panfrost: Check for error num after setting mask ath10k: fix memory overwrite of the WoWLAN wakeup packet pattern drm: bridge: adv7511: Fix ADV7535 HPD enablement drm/bridge: nwl-dsi: Fix PM disable depth imbalance in nwl_dsi_probe drm/bridge: Add missing pm_runtime_disable() in __dw_mipi_dsi_probe drm/bridge: Fix free wrong object in sii8620_init_rcp_input_dev drm/meson: osd_afbcd: Add an exit callback to struct meson_afbcd_ops ARM: configs: multi_v5_defconfig: re-enable CONFIG_V4L_PLATFORM_DRIVERS ASoC: codecs: wcd934x: Add missing of_node_put() in wcd934x_codec_parse_data ASoC: msm8916-wcd-analog: Fix error handling in pm8916_wcd_analog_spmi_probe ASoC: atmel: Fix error handling in sam9x5_wm8731_driver_probe ASoC: atmel: sam9x5_wm8731: use devm_snd_soc_register_card() mmc: davinci_mmc: Handle error for clk_enable ASoC: msm8916-wcd-digital: Fix missing clk_disable_unprepare() in msm8916_wcd_digital_probe ASoC: imx-es8328: Fix error return code in imx_es8328_probe() ASoC: fsl_spdif: Disable TX clock when stop ASoC: mxs: Fix error handling in mxs_sgtl5000_probe ASoC: dmaengine: do not use a NULL prepare_slave_config() callback ASoC: SOF: Add missing of_node_put() in imx8m_probe ASoC: rockchip: i2s: Fix missing clk_disable_unprepare() in rockchip_i2s_probe ASoC: rockchip: i2s: Use devm_platform_get_and_ioremap_resource() ivtv: fix incorrect device_caps for ivtvfb media: saa7134: fix incorrect use to determine if list is empty media: saa7134: convert list_for_each to entry variant video: fbdev: omapfb: Add missing of_node_put() in dvic_probe_of ASoC: fsi: Add check for clk_enable ASoC: wm8350: Handle error for wm8350_register_irq ASoC: atmel: Add missing of_node_put() in at91sam9g20ek_audio_probe media: vidtv: Check for null return of vzalloc media: stk1160: If start stream fails, return buffers with VB2_BUF_STATE_QUEUED m68k: coldfire/device.c: only build for MCF_EDMA when h/w macros are defined arm64: dts: rockchip: Fix SDIO regulator supply properties on rk3399-firefly ALSA: firewire-lib: fix uninitialized flag for AV/C deferred transaction memory: emif: check the pointer temp in get_device_details() memory: emif: Add check for setup_interrupts ASoC: soc-compress: prevent the potentially use of null pointer ASoC: dwc-i2s: Handle errors for clk_enable ASoC: atmel_ssc_dai: Handle errors for clk_enable ASoC: mxs-saif: Handle errors for clk_enable printk: fix return value of printk.devkmsg __setup handler arm64: dts: broadcom: Fix sata nodename arm64: dts: ns2: Fix spi-cpol and spi-cpha property ALSA: spi: Add check for clk_enable() ASoC: ti: davinci-i2s: Add check for clk_enable() ASoC: rt5663: check the return value of devm_kzalloc() in rt5663_parse_dp() uaccess: fix nios2 and microblaze get_user_8() ASoC: codecs: wcd934x: fix return value of wcd934x_rx_hph_mode_put media: cedrus: h264: Fix neighbour info buffer size media: cedrus: H265: Fix neighbour info buffer size media: usb: go7007: s2250-board: fix leak in probe() media: em28xx: initialize refcount before kref_get media: video/hdmi: handle short reads of hdmi info frame. ARM: dts: imx: Add missing LVDS decoder on M53Menlo ARM: dts: sun8i: v3s: Move the csi1 block to follow address order soc: ti: wkup_m3_ipc: Fix IRQ check in wkup_m3_ipc_probe firmware: ti_sci: Fix compilation failure when CONFIG_TI_SCI_PROTOCOL is not defined arm64: dts: qcom: sm8150: Correct TCS configuration for apps rsc arm64: dts: qcom: sdm845: fix microphone bias properties and values soc: qcom: aoss: remove spurious IRQF_ONESHOT flags soc: qcom: ocmem: Fix missing put_device() call in of_get_ocmem soc: qcom: rpmpd: Check for null return of devm_kcalloc ARM: dts: qcom: ipq4019: fix sleep clock firmware: qcom: scm: Remove reassignment to desc following initializer video: fbdev: fbcvt.c: fix printing in fb_cvt_print_name() video: fbdev: atmel_lcdfb: fix an error code in atmel_lcdfb_probe() video: fbdev: smscufx: Fix null-ptr-deref in ufx_usb_probe() video: fbdev: controlfb: Fix COMPILE_TEST build video: fbdev: controlfb: Fix set but not used warnings video: fbdev: matroxfb: set maxvram of vbG200eW to the same as vbG200 to avoid black screen media: aspeed: Correct value for h-total-pixels media: hantro: Fix overfill bottom register field name media: meson: vdec: potential dereference of null pointer media: coda: Fix missing put_device() call in coda_get_vdoa_data ASoC: generic: simple-card-utils: remove useless assignment ASoC: xilinx: xlnx_formatter_pcm: Handle sysclk setting media: bttv: fix WARNING regression on tunerless devices media: mtk-vcodec: potential dereference of null pointer media: v4l2-mem2mem: Apply DST_QUEUE_OFF_BASE on MMAP buffers across ioctls media: staging: media: zoran: fix usage of vb2_dma_contig_set_max_seg_size kunit: make kunit_test_timeout compatible with comment selftests, x86: fix how check_cc.sh is being invoked f2fs: fix compressed file start atomic write may cause data corruption f2fs: compress: remove unneeded read when rewrite whole cluster btrfs: fix unexpected error path when reflinking an inline extent f2fs: fix to avoid potential deadlock nfsd: more robust allocation failure handling in nfsd_file_cache_init f2fs: fix missing free nid in f2fs_handle_failed_inode perf/x86/intel/pt: Fix address filter config for 32-bit kernel perf/core: Fix address filter parser for multiple filters rseq: Remove broken uapi field layout on 32-bit little endian rseq: Optimise rseq_get_rseq_cs() and clear_rseq_cs() sched/core: Export pelt_thermal_tp sched/debug: Remove mpol_get/put and task_lock/unlock from sched_show_numa f2fs: fix to enable ATGC correctly via gc_idle sysfs interface watch_queue: Actually free the watch watch_queue: Fix NULL dereference in error cleanup io_uring: terminate manual loop iterator loop correctly for non-vecs clocksource: acpi_pm: fix return value of __setup handler hwmon: (pmbus) Add Vin unit off handling hwrng: nomadik - Change clk_disable to clk_disable_unprepare amba: Make the remove callback return void vfio: platform: simplify device removal crypto: ccree - Fix use after free in cc_cipher_exit() crypto: ccp - ccp_dmaengine_unregister release dma channels ACPI: APEI: fix return value of __setup handlers clocksource/drivers/timer-of: Check return value of of_iomap in timer_of_base_init() clocksource/drivers/timer-microchip-pit64b: Use notrace clocksource/drivers/exynos_mct: Handle DTS with higher number of interrupts clocksource/drivers/exynos_mct: Refactor resources allocation clocksource/drivers/timer-ti-dm: Fix regression from errata i940 fix crypto: vmx - add missing dependencies crypto: amlogic - call finalize with bh disabled crypto: sun8i-ce - call finalize with bh disabled crypto: sun8i-ss - call finalize with bh disabled hwrng: atmel - disable trng on failure path spi: spi-zynqmp-gqspi: Handle error for dma_set_mask PM: suspend: fix return value of __setup handler PM: hibernate: fix __setup handler error handling block: don't delete queue kobject before its children nvme: cleanup __nvme_check_ids hwmon: (sch56xx-common) Replace WDOG_ACTIVE with WDOG_HW_RUNNING hwmon: (pmbus) Add mutex to regulator ops spi: pxa2xx-pci: Balance reference count for PCI DMA device crypto: ccree - don't attempt 0 len DMA mappings EVM: fix the evm= __setup handler return value audit: log AUDIT_TIME_* records only from rules crypto: rockchip - ECB does not need IV selftests/x86: Add validity check and allow field splitting arm64/mm: avoid fixmap race condition when create pud mapping spi: tegra114: Add missing IRQ check in tegra_spi_probe thermal: int340x: Check for NULL after calling kmemdup() crypto: mxs-dcp - Fix scatterlist processing crypto: authenc - Fix sleep in atomic context in decrypt_tail crypto: sun8i-ss - really disable hash on A80 hwrng: cavium - HW_RANDOM_CAVIUM should depend on ARCH_THUNDER hwrng: cavium - Check health status while reading random data selinux: check return value of sel_make_avc_files regulator: qcom_smd: fix for_each_child.cocci warnings PCI: xgene: Revert "PCI: xgene: Fix IB window setup" PCI: pciehp: Clear cmd_busy bit in polling mode drm/i915/gem: add missing boundary check in vm_access drm/i915/opregion: check port number bounds for SWSCI display power state brcmfmac: pcie: Fix crashes due to early IRQs brcmfmac: pcie: Replace brcmf_pcie_copy_mem_todev with memcpy_toio brcmfmac: pcie: Release firmwares in the brcmf_pcie_setup error path brcmfmac: firmware: Allocate space for default boardrev in nvram xtensa: fix xtensa_wsr always writing 0 xtensa: fix stop_machine_cpuslocked call in patch_text media: davinci: vpif: fix unbalanced runtime PM enable media: davinci: vpif: fix unbalanced runtime PM get media: gpio-ir-tx: fix transmit with long spaces on Orange Pi PC DEC: Limit PMAX memory probing to R3k systems bcache: fixup multiple threads crash crypto: rsa-pkcs1pad - fix buffer overread in pkcs1pad_verify_complete() crypto: rsa-pkcs1pad - restore signature length check crypto: rsa-pkcs1pad - correctly get hash from source scatterlist crypto: rsa-pkcs1pad - only allow with rsa exec: Force single empty string when argv is empty lib/raid6/test: fix multiple definition linking error thermal: int340x: Increase bitmap size pstore: Don't use semaphores in always-atomic-context code carl9170: fix missing bit-wise or operator for tx_params mgag200 fix memmapsl configuration in GCTL6 register ARM: dts: exynos: add missing HDMI supplies on SMDK5420 ARM: dts: exynos: add missing HDMI supplies on SMDK5250 ARM: dts: exynos: fix UART3 pins configuration in Exynos5250 ARM: dts: at91: sama5d2: Fix PMERRLOC resource size video: fbdev: atari: Atari 2 bpp (STe) palette bugfix video: fbdev: sm712fb: Fix crash in smtcfb_read() drm/edid: check basic audio support on CEA extension block block: don't merge across cgroup boundaries if blkcg is enabled block: limit request dispatch loop duration mailbox: tegra-hsp: Flush whole channel drivers: hamradio: 6pack: fix UAF bug caused by mod_timer() ext4: fix fs corruption when tring to remove a non-empty directory with IO error ext4: fix ext4_fc_stats trace point coredump: Also dump first pages of non-executable ELF libraries ACPI: properties: Consistently return -ENOENT if there are no more references arm64: dts: ti: k3-j7200: Fix gic-v3 compatible regs arm64: dts: ti: k3-j721e: Fix gic-v3 compatible regs arm64: dts: ti: k3-am65: Fix gic-v3 compatible regs arm64: signal: nofpsimd: Do not allocate fp/simd context when not available udp: call udp_encap_enable for v6 sockets when enabling encap powerpc/kvm: Fix kvm_use_magic_page can: isotp: sanitize CAN ID checks in isotp_bind() drbd: fix potential silent data corruption dm integrity: set journal entry unused when shrinking device mm/kmemleak: reset tag when compare object pointer mm,hwpoison: unmap poisoned page before invalidation Revert "mm: madvise: skip unmapped vma holes passed to process_madvise" mm: madvise: return correct bytes advised with process_madvise mm: madvise: skip unmapped vma holes passed to process_madvise ALSA: hda/realtek: Fix audio regression on Mi Notebook Pro 2020 ALSA: pcm: Fix potential AB/BA lock with buffer_mutex and mmap_lock ALSA: hda: Avoid unsol event during RPM suspending ALSA: cs4236: fix an incorrect NULL check on list iterator cifs: fix NULL ptr dereference in smb2_ioctl_query_info() cifs: prevent bad output lengths in smb2_ioctl_query_info() Revert "Input: clear BTN_RIGHT/MIDDLE on buttonpads" riscv: Increase stack size under KASAN riscv: Fix fill_callchain return value qed: validate and restrict untrusted VFs vlan promisc mode qed: display VF trust config scsi: libsas: Fix sas_ata_qc_issue() handling of NCQ NON DATA commands mempolicy: mbind_range() set_policy() after vma_merge() mm: invalidate hwpoison page cache page in fault path mm/pages_alloc.c: don't create ZONE_MOVABLE beyond the end of a node jffs2: fix memory leak in jffs2_scan_medium jffs2: fix memory leak in jffs2_do_mount_fs jffs2: fix use-after-free in jffs2_clear_xattr_subsystem can: ems_usb: ems_usb_start_xmit(): fix double dev_kfree_skb() in error path mtd: rawnand: protect access to rawnand devices while in suspend spi: mxic: Fix the transmit path pinctrl: samsung: drop pin banks references on error paths remoteproc: Fix count check in rproc_coredump_write() f2fs: fix to do sanity check on .cp_pack_total_block_count f2fs: quota: fix loop condition at f2fs_quota_sync() f2fs: fix to unlock page correctly in error path of is_alive() NFSD: prevent integer overflow on 32 bit systems NFSD: prevent underflow in nfssvc_decode_writeargs() SUNRPC: avoid race between mod_timer() and del_timer_sync() HID: intel-ish-hid: Use dma_alloc_coherent for firmware update firmware: stratix10-svc: add missing callback parameter on RSU Documentation: update stable tree link Documentation: add link to stable release candidate tree KEYS: fix length validation in keyctl_pkey_params_get_2() ptrace: Check PTRACE_O_SUSPEND_SECCOMP permission on PTRACE_SEIZE clk: uniphier: Fix fixed-rate initialization greybus: svc: fix an error handling bug in gb_svc_hello() iio: inkern: make a best effort on offset calculation iio: inkern: apply consumer scale when no channel scale is available iio: inkern: apply consumer scale on IIO_VAL_INT cases iio: afe: rescale: use s64 for temporary scale calculations coresight: Fix TRCCONFIGR.QE sysfs interface mei: avoid iterator usage outside of list_for_each_entry mei: me: add Alder Lake N device id. xhci: fix uninitialized string returned by xhci_decode_ctrl_ctx() xhci: make xhci_handshake timeout for xhci_reset() adjustable xhci: fix runtime PM imbalance in USB2 resume xhci: fix garbage USBSTS being logged in some cases USB: usb-storage: Fix use of bitfields for hardware data in ene_ub6250.c virtio-blk: Use blk_validate_block_size() to validate block size tpm: fix reference counting for struct tpm_chip iommu/iova: Improve 32-bit free space estimate locking/lockdep: Avoid potential access of invalid memory in lock_class net: dsa: microchip: add spi_device_id tables af_key: add __GFP_ZERO flag for compose_sadb_supported in function pfkey_register Input: zinitix - do not report shadow fingers spi: Fix erroneous sgs value with min_t() Revert "gpio: Revert regression in sysfs-gpio (gpiolib.c)" net:mcf8390: Use platform_get_irq() to get the interrupt spi: Fix invalid sgs value gpio: Revert regression in sysfs-gpio (gpiolib.c) ethernet: sun: Free the coherent when failing in probing tools/virtio: fix virtio_test execution vdpa/mlx5: should verify CTRL_VQ feature exists for MQ virtio_console: break out of buf poll on remove ARM: mstar: Select HAVE_ARM_ARCH_TIMER xfrm: fix tunnel model fragmentation behavior HID: logitech-dj: add new lightspeed receiver id netdevice: add the case if dev is NULL hv: utils: add PTP_1588_CLOCK to Kconfig to fix build USB: serial: simple: add Nokia phone driver USB: serial: pl2303: add IBM device IDs swiotlb: fix info leak with DMA_FROM_DEVICE ANDROID: fix up abi issue with struct snd_pcm_runtime Linux 5.10.109 llc: only change llc->dev when bind() succeeds nds32: fix access_ok() checks in get/put_user wcn36xx: Differentiate wcn3660 from wcn3620 tpm: use try_get_ops() in tpm-space.c mac80211: fix potential double free on mesh join rcu: Don't deboost before reporting expedited quiescent state Revert "ath: add support for special 0x0 regulatory domain" crypto: qat - disable registration of algorithms ACPI: video: Force backlight native for Clevo NL5xRU and NL5xNU ACPI: battery: Add device HID and quirk for Microsoft Surface Go 3 ACPI / x86: Work around broken XSDT on Advantech DAC-BJ01 board netfilter: nf_tables: initialize registers in nft_do_chain() drivers: net: xgene: Fix regression in CRC stripping ALSA: pci: fix reading of swapped values from pcmreg in AC97 codec ALSA: cmipci: Restore aux vol on suspend/resume ALSA: usb-audio: Add mute TLV for playback volumes on RODE NT-USB ALSA: pcm: Add stream lock during PCM reset ioctl operations ALSA: pcm: Fix races among concurrent prealloc proc writes ALSA: pcm: Fix races among concurrent prepare and hw_params/hw_free calls ALSA: pcm: Fix races among concurrent read/write and buffer changes ALSA: pcm: Fix races among concurrent hw_params and hw_free calls ALSA: hda/realtek: Add quirk for ASUS GA402 ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671 ALSA: hda/realtek: Add quirk for Clevo NP50PNJ ALSA: hda/realtek: Add quirk for Clevo NP70PNJ ALSA: usb-audio: add mapping for new Corsair Virtuoso SE ALSA: oss: Fix PCM OSS buffer allocation overflow ASoC: sti: Fix deadlock via snd_pcm_stop_xrun() call llc: fix netdevice reference leaks in llc_ui_bind() staging: fbtft: fb_st7789v: reset display before initialization tpm: Fix error handling in async work cgroup-v1: Correct privileges check in release_agent writes cgroup: Use open-time cgroup namespace for process migration perm checks cgroup: Allocate cgroup_file_ctx for kernfs_open_file->priv exfat: avoid incorrectly releasing for root inode net: ipv6: fix skb_over_panic in __ip6_append_data nfc: st21nfca: Fix potential buffer overflows in EVT_TRANSACTION Revert "vsock: each transport cycles only on its own sockets" Linux 5.10.108 Revert "selftests/bpf: Add test for bpf_timer overwriting crash" esp: Fix possible buffer overflow in ESP transformation smsc95xx: Ignore -ENODEV errors when device is unplugged net: usb: Correct reset handling of smsc95xx net: usb: Correct PHY handling of smsc95xx perf symbols: Fix symbol size calculation condition Input: aiptek - properly check endpoint type scsi: mpt3sas: Page fault in reply q processing usb: usbtmc: Fix bug in pipe direction for control transfers usb: gadget: Fix use-after-free bug by not setting udc->dev.driver usb: gadget: rndis: prevent integer overflow in rndis_set_response() arm64: fix clang warning about TRAMP_VALIAS net: mscc: ocelot: fix backwards compatibility with single-chain tc-flower offload net: bcmgenet: skip invalid partial checksums bnx2x: fix built-in kernel driver load failure net: phy: mscc: Add MODULE_FIRMWARE macros net: dsa: Add missing of_node_put() in dsa_port_parse_of net: handle ARPHRD_PIMREG in dev_is_mac_header_xmit() drm/panel: simple: Fix Innolux G070Y2-L01 BPP settings drm/imx: parallel-display: Remove bus flags check in imx_pd_bridge_atomic_check() hv_netvsc: Add check for kvmalloc_array atm: eni: Add check for dma_map_single net/packet: fix slab-out-of-bounds access in packet_recvmsg() net: phy: marvell: Fix invalid comparison in the resume and suspend functions esp6: fix check on ipv6_skip_exthdr's return value vsock: each transport cycles only on its own sockets efi: fix return value of __setup handlers mm: swap: get rid of livelock in swapin readahead ocfs2: fix crash when initialize filecheck kobj fails crypto: qcom-rng - ensure buffer for generate is completely filled Linux 5.10.107 arm64: kvm: Fix copy-and-paste error in bhb templates for v5.10 stable io_uring: return back safer resurrect kselftest/vm: fix tests build with old libc sfc: extend the locking on mcdi->seqno tcp: make tcp_read_sock() more robust nl80211: Update bss channel on channel switch for P2P_CLIENT drm/vrr: Set VRR capable prop only if it is attached to connector iwlwifi: don't advertise TWT support atm: firestream: check the return value of ioremap() in fs_init() can: rcar_canfd: rcar_canfd_channel_probe(): register the CAN device when fully ready ARM: 9178/1: fix unmet dependency on BITREVERSE for HAVE_ARCH_BITREVERSE MIPS: smp: fill in sibling and core maps earlier mac80211: refuse aggregations sessions before authorized ARM: dts: rockchip: fix a typo on rk3288 crypto-controller ARM: dts: rockchip: reorder rk322x hmdi clocks arm64: dts: agilex: use the compatible "intel,socfpga-agilex-hsotg" arm64: dts: rockchip: reorder rk3399 hdmi clocks arm64: dts: rockchip: fix rk3399-puma eMMC HS400 signal integrity xfrm: Fix xfrm migrate issues when address family changes xfrm: Check if_id in xfrm_migrate sctp: fix the processing for INIT chunk Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0" UPSTREAM: arm64: proton-pack: Include unprivileged eBPF status in Spectre v2 mitigation reporting UPSTREAM: arm64: Use the clearbhb instruction in mitigations UPSTREAM: KVM: arm64: Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated UPSTREAM: arm64: Mitigate spectre style branch history side channels UPSTREAM: arm64: Do not include __READ_ONCE() block in assembly files UPSTREAM: KVM: arm64: Allow indirect vectors to be used without SPECTRE_V3A UPSTREAM: arm64: proton-pack: Report Spectre-BHB vulnerabilities as part of Spectre-v2 UPSTREAM: arm64: Add percpu vectors for EL1 Linux 5.10.106 watch_queue: Fix filter limit check ARM: fix Thumb2 regression with Spectre BHB ext4: add check to prevent attempting to resize an fs with sparse_super2 x86/traps: Mark do_int3() NOKPROBE_SYMBOL x86/boot: Add setup_indirect support in early_memremap_is_setup_data() x86/boot: Fix memremap of setup_indirect structures watch_queue: Make comment about setting ->defunct more accurate watch_queue: Fix lack of barrier/sync/lock between post and read watch_queue: Free the alloc bitmap when the watch_queue is torn down watch_queue: Fix the alloc bitmap size to reflect notes allocated watch_queue: Fix to always request a pow-of-2 pipe ring size watch_queue: Fix to release page in ->release() watch_queue, pipe: Free watchqueue state after clearing pipe ring virtio: acknowledge all features before access virtio: unexport virtio_finalize_features arm64: dts: marvell: armada-37xx: Remap IO space to bus address 0x0 riscv: Fix auipc+jalr relocation range checks mmc: meson: Fix usage of meson_mmc_post_req() net: macb: Fix lost RX packet wakeup race in NAPI receive staging: gdm724x: fix use after free in gdm_lte_rx() staging: rtl8723bs: Fix access-point mode deadlock fuse: fix pipe buffer lifetime for direct_io ARM: Spectre-BHB: provide empty stub for non-config selftests/memfd: clean up mapping in mfd_fail_write selftest/vm: fix map_fixed_noreplace test failure tracing: Ensure trace buffer is at least 4096 bytes large ipv6: prevent a possible race condition with lifetimes Revert "xen-netback: Check for hotplug-status existence before watching" Revert "xen-netback: remove 'hotplug-status' once it has served its purpose" gpio: Return EPROBE_DEFER if gc->to_irq is NULL hwmon: (pmbus) Clear pmbus fault/warning bits after read net-sysfs: add check for netdevice being present to speed_show spi: rockchip: terminate dma transmission when slave abort spi: rockchip: Fix error in getting num-cs property selftests/bpf: Add test for bpf_timer overwriting crash net: bcmgenet: Don't claim WOL when its not available sctp: fix kernel-infoleak for SCTP sockets net: phy: DP83822: clear MISR2 register to disable interrupts gianfar: ethtool: Fix refcount leak in gfar_get_ts_info gpio: ts4900: Do not set DAT and OE together selftests: pmtu.sh: Kill tcpdump processes launched by subshell. NFC: port100: fix use-after-free in port100_send_complete net/mlx5e: Lag, Only handle events from highest priority multipath entry net/mlx5: Fix a race on command flush flow net/mlx5: Fix size field in bufferx_reg struct ax25: Fix NULL pointer dereference in ax25_kill_by_device net: ethernet: lpc_eth: Handle error for clk_enable net: ethernet: ti: cpts: Handle error for clk_enable tipc: fix incorrect order of state message data sanity check ethernet: Fix error handling in xemaclite_of_probe ice: Fix curr_link_speed advertised speed ice: Rename a couple of variables ice: Remove unnecessary checker loop ice: Align macro names to the specification ice: stop disabling VFs due to PF error responses i40e: stop disabling VFs due to PF error responses ARM: dts: aspeed: Fix AST2600 quad spi group net: dsa: mt7530: fix incorrect test in mt753x_phylink_validate() drm/sun4i: mixer: Fix P010 and P210 format numbers qed: return status of qed_iov_get_link esp: Fix BEET mode inter address family tunneling on GSO net: qlogic: check the return value of dma_alloc_coherent() in qed_vf_hw_prepare() isdn: hfcpci: check the return value of dma_set_mask() in setup_hw() virtio-blk: Don't use MAX_DISCARD_SEGMENTS if max_discard_seg is zero mISDN: Fix memory leak in dsp_pipeline_build() mISDN: Remove obsolete PIPELINE_DEBUG debugging information tipc: fix kernel panic when enabling bearer arm64: dts: armada-3720-turris-mox: Add missing ethernet0 alias HID: vivaldi: fix sysfs attributes leak clk: qcom: gdsc: Add support to update GDSC transition delay ARM: boot: dts: bcm2711: Fix HVS register range UPSTREAM: ARM: fix Thumb2 regression with Spectre BHB UPSTREAM: ARM: Spectre-BHB: provide empty stub for non-config UPSTREAM: ARM: fix build warning in proc-v7-bugs.c UPSTREAM: ARM: Do not use NOCROSSREFS directive with ld.lld UPSTREAM: ARM: fix co-processor register typo UPSTREAM: ARM: fix build error when BPF_SYSCALL is disabled ANDROID: fix up rndis ABI breakage Linux 5.10.105 Revert "ACPI: PM: s2idle: Cancel wakeup before dispatching EC GPE" xen/netfront: react properly to failing gnttab_end_foreign_access_ref() xen/gnttab: fix gnttab_end_foreign_access() without page specified xen/pvcalls: use alloc/free_pages_exact() xen/9p: use alloc/free_pages_exact() xen: remove gnttab_query_foreign_access() xen/gntalloc: don't use gnttab_query_foreign_access() xen/scsifront: don't use gnttab_query_foreign_access() for mapped status xen/netfront: don't use gnttab_query_foreign_access() for mapped status xen/blkfront: don't use gnttab_query_foreign_access() for mapped status xen/grant-table: add gnttab_try_end_foreign_access() xen/xenbus: don't let xenbus_grant_ring() remove grants in error case arm64: proton-pack: Include unprivileged eBPF status in Spectre v2 mitigation reporting ARM: fix build warning in proc-v7-bugs.c arm64: Use the clearbhb instruction in mitigations ARM: Do not use NOCROSSREFS directive with ld.lld KVM: arm64: Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated ARM: fix co-processor register typo arm64: Mitigate spectre style branch history side channels ARM: fix build error when BPF_SYSCALL is disabled KVM: arm64: Allow indirect vectors to be used without SPECTRE_V3A arm64: proton-pack: Report Spectre-BHB vulnerabilities as part of Spectre-v2 arm64: entry: Add macro for reading symbol addresses from the trampoline arm64: Add percpu vectors for EL1 arm64: entry: Add vectors that have the bhb mitigation sequences arm64: entry: Add non-kpti __bp_harden_el1_vectors for mitigations arm64: entry: Allow the trampoline text to occupy multiple pages arm64: entry: Make the kpti trampoline's kpti sequence optional arm64: entry: Move trampoline macros out of ifdef'd section arm64: entry: Don't assume tramp_vectors is the start of the vectors arm64: entry: Allow tramp_alias to access symbols after the 4K boundary arm64: entry: Move the trampoline data page before the text page arm64: entry: Free up another register on kpti's tramp_exit path arm64: Add HWCAP for self-synchronising virtual counter arm64: Add Cortex-A510 CPU part definition arm64: Add Neoverse-N2, Cortex-A710 CPU part definition arm64: entry: Make the trampoline cleanup optional arm64: Add Cortex-X2 CPU part definition arm64: spectre: Rename spectre_v4_patch_fw_mitigation_conduit arm64: entry.S: Add ventry overflow sanity checks arm64: cpufeature: add HWCAP for FEAT_RPRES arm64: cpufeature: add HWCAP for FEAT_AFP arm64: add ID_AA64ISAR2_EL1 sys register ARM: include unprivileged BPF status in Spectre V2 reporting x86/speculation: Warn about eIBRS + LFENCE + Unprivileged eBPF + SMT arm64: cputype: Add CPU implementor & types for the Apple M1 cores ARM: Spectre-BHB workaround x86/speculation: Warn about Spectre v2 LFENCE mitigation ARM: use LOADADDR() to get load address of sections x86/speculation: Update link to AMD speculation whitepaper ARM: early traps initialisation x86/speculation: Use generic retpoline by default on AMD ARM: report Spectre v2 status through sysfs x86/speculation: Include unprivileged eBPF status in Spectre v2 mitigation reporting Documentation/hw-vuln: Update spectre doc x86/speculation: Add eIBRS + Retpoline options x86/speculation: Rename RETPOLINE_AMD to RETPOLINE_LFENCE x86,bugs: Unconditionally allow spectre_v2=retpoline,amd Linux 5.10.104 hamradio: fix macro redefine warning Revert "xfrm: xfrm_state_mtu should return at least 1280 for ipv6" btrfs: add missing run of delayed items after unlink during log replay btrfs: qgroup: fix deadlock between rescan worker and remove qgroup btrfs: fix lost prealloc extents beyond eof after full fsync tracing: Fix return value of __setup handlers tracing/histogram: Fix sorting on old "cpu" value HID: add mapping for KEY_ALL_APPLICATIONS HID: add mapping for KEY_DICTATE Input: samsung-keypad - properly state IOMEM dependency Input: elan_i2c - fix regulator enable count imbalance after suspend/resume Input: elan_i2c - move regulator_[en|dis]able() out of elan_[en|dis]able_power() net: dcb: disable softirqs in dcbnl_flush_dev() drm/amdgpu: fix suspend/resume hang regression nl80211: Handle nla_memdup failures in handle_nan_filter iavf: Refactor iavf state machine tracking net: chelsio: cxgb3: check the return value of pci_find_capability() ibmvnic: complete init_done on transport events ARM: tegra: Move panels to AUX bus soc: fsl: qe: Check of ioremap return value soc: fsl: guts: Add a missing memory allocation failure check soc: fsl: guts: Revert commit3c0d64e867
ARM: dts: Use 32KiHz oscillator on devkit8000 ARM: dts: switch timer config to common devkit8000 devicetree s390/extable: fix exception table sorting memfd: fix F_SEAL_WRITE after shmem huge page allocated ibmvnic: free reset-work-item when flushing igc: igc_write_phy_reg_gpy: drop premature return pinctrl: sunxi: Use unique lockdep classes for IRQs selftests: mlxsw: tc_police_scale: Make test more robust ARM: 9182/1: mmu: fix returns from early_param() and __setup() functions ARM: Fix kgdb breakpoint for Thumb2 igc: igc_read_phy_reg_gpy: drop premature return arm64: dts: rockchip: Switch RK3399-Gru DP to SPDIF output can: gs_usb: change active_channels's type from atomic_t to u8 ASoC: cs4265: Fix the duplicated control name firmware: arm_scmi: Remove space in MODULE_ALIAS name efivars: Respect "block" flag in efivar_entry_set_safe() ixgbe: xsk: change !netif_carrier_ok() handling in ixgbe_xmit_zc() net: arcnet: com20020: Fix null-ptr-deref in com20020pci_probe() ibmvnic: register netdev after init of adapter net: sxgbe: fix return value of __setup handler iavf: Fix missing check for running netdev mac80211: treat some SAE auth steps as final net: stmmac: fix return value of __setup handler mac80211: fix forwarded mesh frames AC & queue selection ia64: ensure proper NUMA distance and possible map initialization sched/topology: Fix sched_domain_topology_level alloc in sched_init_numa() sched/topology: Make sched_init_numa() use a set for the deduplicating sort ice: fix concurrent reset and removal of VFs ice: Fix race conditions between virtchnl handling and VF ndo ops rcu/nocb: Fix missed nocb_timer requeue net/smc: fix unexpected SMC_CLC_DECL_ERR_REGRMB error cause by server net/smc: fix unexpected SMC_CLC_DECL_ERR_REGRMB error generated by client net/smc: fix connection leak net: dcb: flush lingering app table entries for unregistered devices net: ipv6: ensure we call ipv6_mc_down() at most once batman-adv: Don't expect inter-netns unique iflink indices batman-adv: Request iflink once in batadv_get_real_netdevice batman-adv: Request iflink once in batadv-on-batadv check netfilter: nf_queue: handle socket prefetch netfilter: nf_queue: fix possible use-after-free netfilter: nf_queue: don't assume sk is full socket net: fix up skbs delta_truesize in UDP GRO frag_list e1000e: Correct NVM checksum verification flow xfrm: enforce validity of offload input flags xfrm: fix the if_id check in changelink bpf, sockmap: Do not ignore orig_len parameter netfilter: fix use-after-free in __nf_register_net_hook() xfrm: fix MTU regression mm: Consider __GFP_NOWARN flag for oversized kvmalloc() calls ntb: intel: fix port config status offset for SPR thermal: core: Fix TZ_GET_TRIP NULL pointer dereference xen/netfront: destroy queues before real_num_tx_queues is zeroed drm/i915: s/JSP2/ICP2/ PCH iommu/amd: Recover from event log overflow ASoC: ops: Shift tested values in snd_soc_put_volsw() by +min riscv: Fix config KASAN && DEBUG_VIRTUAL riscv: Fix config KASAN && SPARSEMEM && !SPARSE_VMEMMAP riscv/efi_stub: Fix get_boot_hartid_from_fdt() return value ALSA: intel_hdmi: Fix reference to PCM buffer address tracing: Add ustring operation to filtering string pointers drm/amdgpu: check vm ready by amdgpu_vm->evicting flag ata: pata_hpt37x: fix PCI clock detection serial: stm32: prevent TDR register overwrite when sending x_char tracing: Add test for user space strings when filtering on string pointers exfat: fix i_blocks for files truncated over 4 GiB exfat: reuse exfat_inode_info variable instead of calling EXFAT_I() usb: gadget: clear related members when goto fail usb: gadget: don't release an existing dev->buf net: usb: cdc_mbim: avoid altsetting toggling for Telit FN990 i2c: qup: allow COMPILE_TEST i2c: cadence: allow COMPILE_TEST dmaengine: shdma: Fix runtime PM imbalance on error selftests/seccomp: Fix seccomp failure by adding missing headers cifs: fix double free race when mount fails in cifs_get_root() tipc: fix a bit overflow in tipc_crypto_key_rcv() KVM: arm64: vgic: Read HW interrupt pending state from the HW Input: clear BTN_RIGHT/MIDDLE on buttonpads regulator: core: fix false positive in regulator_late_cleanup() ASoC: rt5682: do not block workqueue if card is unbound ASoC: rt5668: do not block workqueue if card is unbound i2c: bcm2835: Avoid clock stretching timeouts mac80211_hwsim: initialize ieee80211_tx_info at hw_scan_work mac80211_hwsim: report NOACK frames in tx_status Linux 5.10.103 memblock: use kfree() to release kmalloced memblock regions gpio: tegra186: Fix chip_data type confusion tty: n_gsm: fix deadlock in gsmtty_open() tty: n_gsm: fix wrong tty control line for flow control tty: n_gsm: fix NULL pointer access due to DLCI release tty: n_gsm: fix proper link termination after failed open tty: n_gsm: fix encoding of control signal octet bit DV riscv: fix oops caused by irqsoff latency tracer thermal: int340x: fix memory leak in int3400_notify() RDMA/cma: Do not change route.addr.src_addr outside state checks driver core: Free DMA range map when device is released xhci: Prevent futile URB re-submissions due to incorrect return value. xhci: re-initialize the HC during resume if HCE was set usb: dwc3: gadget: Let the interrupt handler disable bottom halves. usb: dwc3: pci: Fix Bay Trail phy GPIO mappings usb: dwc2: drd: fix soft connect when gadget is unconfigured USB: serial: option: add Telit LE910R1 compositions USB: serial: option: add support for DW5829e tracefs: Set the group ownership in apply_options() not parse_options() USB: gadget: validate endpoint index for xilinx udc usb: gadget: rndis: add spinlock for rndis response list Revert "USB: serial: ch341: add new Product ID for CH341A" ata: pata_hpt37x: disable primary channel on HPT371 sc16is7xx: Fix for incorrect data being transmitted iio: Fix error handling for PM iio: imu: st_lsm6dsx: wait for settling time in st_lsm6dsx_read_oneshot iio: adc: ad7124: fix mask used for setting AIN_BUFP & AIN_BUFM bits iio: adc: men_z188_adc: Fix a resource leak in an error handling path tracing: Have traceon and traceoff trigger honor the instance RDMA/ib_srp: Fix a deadlock configfs: fix a race in configfs_{,un}register_subsystem() RDMA/rtrs-clt: Move free_permit from free_clt to rtrs_clt_close RDMA/rtrs-clt: Kill wait_for_inflight_permits RDMA/rtrs-clt: Fix possible double free in error case regmap-irq: Update interrupt clear register for proper reset spi: spi-zynq-qspi: Fix a NULL pointer dereference in zynq_qspi_exec_mem_op() net/mlx5e: kTLS, Use CHECKSUM_UNNECESSARY for device-offloaded packets net/mlx5: Fix wrong limitation of metadata match on ecpf net/mlx5: Fix possible deadlock on rule deletion udp_tunnel: Fix end of loop test in udp_tunnel_nic_unregister() surface: surface3_power: Fix battery readings on batteries without a serial number net/smc: Use a mutex for locking "struct smc_pnettable" netfilter: nf_tables: fix memory leak during stateful obj update nfp: flower: Fix a potential leak in nfp_tunnel_add_shared_mac() net: Force inlining of checksum functions in net/checksum.h net: ll_temac: check the return value of devm_kmalloc() net/sched: act_ct: Fix flow table lookup after ct clear or switching zones net/mlx5e: Fix wrong return value on ioctl EEPROM query failure drm/edid: Always set RGB444 openvswitch: Fix setting ipv6 fields causing hw csum failure gso: do not skip outer ip header in case of ipip and net_failover tipc: Fix end of loop tests for list_for_each_entry() net: __pskb_pull_tail() & pskb_carve_frag_list() drop_monitor friends io_uring: add a schedule point in io_add_buffers() bpf: Add schedule points in batch ops selftests: bpf: Check bpf_msg_push_data return value bpf: Do not try bpf_msg_push_data with len 0 hwmon: Handle failure to register sensor with thermal zone correctly bnxt_en: Fix active FEC reporting to ethtool bnx2x: fix driver load from initrd perf data: Fix double free in perf_session__delete() ping: remove pr_err from ping_lookup optee: use driver internal tee_context for some rpc tee: export teedev_open() and teedev_close_context() x86/fpu: Correct pkru/xstate inconsistency netfilter: nf_tables_offload: incorrect flow offload action array size CDC-NCM: avoid overflow in sanity checking USB: zaurus: support another broken Zaurus sr9700: sanity check for packet length drm/i915: Correctly populate use_sagv_wm for all pipes drm/amdgpu: disable MMHUB PG for Picasso KVM: x86/mmu: make apf token non-zero to fix bug parisc/unaligned: Fix ldw() and stw() unalignment handlers parisc/unaligned: Fix fldd and fstd unaligned handlers on 32-bit kernel vhost/vsock: don't check owner in vhost_vsock_stop() while releasing clk: jz4725b: fix mmc0 clock gating btrfs: tree-checker: check item_size for dev_item btrfs: tree-checker: check item_size for inode_item cgroup/cpuset: Fix a race between cpuset_attach() and cpu hotplug Revert "ipv6: per-netns exclusive flowlabel checks" Linux 5.10.102 lockdep: Correct lock_classes index mapping i2c: brcmstb: fix support for DSL and CM variants copy_process(): Move fd_install() out of sighand->siglock critical section i2c: qcom-cci: don't put a device tree node before i2c_add_adapter() i2c: qcom-cci: don't delete an unregistered adapter dmaengine: sh: rcar-dmac: Check for error num after dma_set_max_seg_size dmaengine: stm32-dmamux: Fix PM disable depth imbalance in stm32_dmamux_probe dmaengine: sh: rcar-dmac: Check for error num after setting mask net: sched: limit TC_ACT_REPEAT loops EDAC: Fix calculation of returned address and next offset in edac_align_ptr() scsi: lpfc: Fix pt2pt NVMe PRLI reject LOGO loop kconfig: fix failing to generate auto.conf net: macb: Align the dma and coherent dma masks net: usb: qmi_wwan: Add support for Dell DW5829e tracing: Fix tp_printk option related with tp_printk_stop_on_boot drm/rockchip: dw_hdmi: Do not leave clock enabled in error case xprtrdma: fix pointer derefs in error cases of rpcrdma_ep_create soc: aspeed: lpc-ctrl: Block error printing on probe defer cases ata: libata-core: Disable TRIM on M88V29 lib/iov_iter: initialize "flags" in new pipe_buffer kconfig: let 'shell' return enough output for deep path names selftests: fixup build warnings in pidfd / clone3 tests pidfd: fix test failure due to stack overflow on some arches arm64: dts: meson-g12: drop BL32 region from SEI510/SEI610 arm64: dts: meson-g12: add ATF BL32 reserved-memory region arm64: dts: meson-gx: add ATF BL32 reserved-memory region netfilter: conntrack: don't refresh sctp entries in closed state irqchip/sifive-plic: Add missing thead,c900-plic match string phy: usb: Leave some clocks running during suspend ARM: OMAP2+: adjust the location of put_device() call in omapdss_init_of ARM: OMAP2+: hwmod: Add of_node_put() before break NFS: Don't set NFS_INO_INVALID_XATTR if there is no xattr cache KVM: x86/pmu: Use AMD64_RAW_EVENT_MASK for PERF_TYPE_RAW KVM: x86/pmu: Don't truncate the PerfEvtSeln MSR when creating a perf event KVM: x86/pmu: Refactoring find_arch_event() to pmc_perf_hw_id() Drivers: hv: vmbus: Fix memory leak in vmbus_add_channel_kobj mtd: rawnand: brcmnand: Fixed incorrect sub-page ECC status mtd: rawnand: qcom: Fix clock sequencing in qcom_nandc_probe() tty: n_tty: do not look ahead for EOL character past the end of the buffer NFS: Do not report writeback errors in nfs_getattr() NFS: LOOKUP_DIRECTORY is also ok with symlinks block/wbt: fix negative inflight counter when remove scsi device ASoC: tas2770: Insert post reset delay KVM: SVM: Never reject emulation due to SMAP errata for !SEV guests mtd: rawnand: gpmi: don't leak PM reference in error path powerpc/lib/sstep: fix 'ptesync' build error ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw_range() ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw() ALSA: hda: Fix missing codec probe on Shenker Dock 15 ALSA: hda: Fix regression on forced probe mask option ALSA: hda/realtek: Fix deadlock by COEF mutex ALSA: hda/realtek: Add quirk for Legion Y9000X 2019 selftests/exec: Add non-regular to TEST_GEN_PROGS perf bpf: Defer freeing string after possible strlen() on it dpaa2-eth: Initialize mutex used in one step timestamping path libsubcmd: Fix use-after-free for realloc(..., 0) bonding: fix data-races around agg_select_timer net_sched: add __rcu annotation to netdev->qdisc drop_monitor: fix data-race in dropmon_net_event / trace_napi_poll_hit bonding: force carrier update when releasing slave ping: fix the dif and sdif check in ping_lookup net: ieee802154: ca8210: Fix lifs/sifs periods net: dsa: lantiq_gswip: fix use after free in gswip_remove() net: dsa: lan9303: fix reset on probe ipv6: per-netns exclusive flowlabel checks netfilter: nft_synproxy: unregister hooks on init error path selftests: netfilter: fix exit value for nft_concat_range iwlwifi: pcie: gen2: fix locking when "HW not ready" iwlwifi: pcie: fix locking when "HW not ready" drm/i915/gvt: Make DRM_I915_GVT depend on X86 vsock: remove vsock from connected table when connect is interrupted by a signal drm/i915/opregion: check port number bounds for SWSCI display power state drm/radeon: Fix backlight control on iMac 12,1 iwlwifi: fix use-after-free kbuild: lto: Merge module sections if and only if CONFIG_LTO_CLANG is enabled kbuild: lto: merge module sections random: wake up /dev/random writers after zap gcc-plugins/stackleak: Use noinstr in favor of notrace Revert "module, async: async_synchronize_full() on module init iff async is used" x86/Xen: streamline (and fix) PV CPU enumeration drm/amdgpu: fix logic inversion in check nvme-rdma: fix possible use-after-free in transport error_recovery work nvme-tcp: fix possible use-after-free in transport error_recovery work nvme: fix a possible use-after-free in controller reset during load scsi: pm8001: Fix use-after-free for aborted SSP/STP sas_task scsi: pm8001: Fix use-after-free for aborted TMF sas_task quota: make dquot_quota_sync return errors from ->sync_fs vfs: make freeze_super abort when sync_filesystem returns error ax25: improve the incomplete fix to avoid UAF and NPD bugs selftests: skip mincore.check_file_mmap when fs lacks needed support selftests: openat2: Skip testcases that fail with EOPNOTSUPP selftests: openat2: Add missing dependency in Makefile selftests: openat2: Print also errno in failure messages selftests/zram: Adapt the situation that /dev/zram0 is being used selftests/zram01.sh: Fix compression ratio calculation selftests/zram: Skip max_comp_streams interface on newer kernel net: ieee802154: at86rf230: Stop leaking skb's kselftest: signal all child processes selftests: rtc: Increase test timeout so that all tests run platform/x86: ISST: Fix possible circular locking dependency detected platform/x86: touchscreen_dmi: Add info for the RWC NANOTE P8 AY07J 2-in-1 btrfs: send: in case of IO error log it parisc: Add ioread64_lo_hi() and iowrite64_lo_hi() PCI: hv: Fix NUMA node assignment when kernel boots with custom NUMA topology mm: don't try to NUMA-migrate COW pages that have other uses mmc: block: fix read single on recovery logic parisc: Fix sglist access in ccio-dma.c parisc: Fix data TLB miss in sba_unmap_sg parisc: Drop __init from map_pages declaration serial: parisc: GSC: fix build when IOSAPIC is not set Revert "svm: Add warning message for AVIC IPI invalid target" HID:Add support for UGTABLET WP5540 scsi: lpfc: Fix mailbox command failure during driver initialization can: isotp: add SF_BROADCAST support for functional addressing can: isotp: prevent race between isotp_bind() and isotp_setsockopt() fs/proc: task_mmu.c: don't read mapcount for migration entry fget: clarify and improve __fget_files() implementation rcu: Do not report strict GPs for outgoing CPUs mm: memcg: synchronize objcg lists with a dedicated spinlock drm/nouveau/pmu/gm200-: use alternate falcon reset sequence Conflicts: Documentation/devicetree/bindings Documentation/devicetree/bindings/mtd/nand-controller.yaml Documentation/devicetree/bindings/spi/spi-mxic.txt drivers/clk/qcom/clk-rcg2.c drivers/irqchip/qcom-pdc.c Change-Id: Ib0f6438a4f0ce0db27881a4d07a50a0835d6f270 Signed-off-by: Sivasri Kumar, Vanka <quic_svanka@quicinc.com>
1787 lines
47 KiB
C
1787 lines
47 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* linux/arch/arm/mm/mmu.c
|
|
*
|
|
* Copyright (C) 1995-2005 Russell King
|
|
*/
|
|
#include <linux/module.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/errno.h>
|
|
#include <linux/init.h>
|
|
#include <linux/mman.h>
|
|
#include <linux/nodemask.h>
|
|
#include <linux/memblock.h>
|
|
#include <linux/fs.h>
|
|
#include <linux/vmalloc.h>
|
|
#include <linux/sizes.h>
|
|
|
|
#include <asm/cp15.h>
|
|
#include <asm/cputype.h>
|
|
#include <asm/cachetype.h>
|
|
#include <asm/fixmap.h>
|
|
#include <asm/sections.h>
|
|
#include <asm/setup.h>
|
|
#include <asm/smp_plat.h>
|
|
#include <asm/tlb.h>
|
|
#include <asm/highmem.h>
|
|
#include <asm/system_info.h>
|
|
#include <asm/traps.h>
|
|
#include <asm/procinfo.h>
|
|
#include <asm/memory.h>
|
|
#include <asm/pgalloc.h>
|
|
|
|
#include <asm/mach/arch.h>
|
|
#include <asm/mach/map.h>
|
|
#include <asm/mach/pci.h>
|
|
#include <asm/fixmap.h>
|
|
|
|
#include "fault.h"
|
|
#include "mm.h"
|
|
#include "tcm.h"
|
|
|
|
extern unsigned long __atags_pointer;
|
|
|
|
/*
|
|
* empty_zero_page is a special page that is used for
|
|
* zero-initialized data and COW.
|
|
*/
|
|
struct page *empty_zero_page;
|
|
EXPORT_SYMBOL(empty_zero_page);
|
|
|
|
/*
|
|
* The pmd table for the upper-most set of pages.
|
|
*/
|
|
pmd_t *top_pmd;
|
|
|
|
pmdval_t user_pmd_table = _PAGE_USER_TABLE;
|
|
|
|
#define CPOLICY_UNCACHED 0
|
|
#define CPOLICY_BUFFERED 1
|
|
#define CPOLICY_WRITETHROUGH 2
|
|
#define CPOLICY_WRITEBACK 3
|
|
#define CPOLICY_WRITEALLOC 4
|
|
|
|
static unsigned int cachepolicy __initdata = CPOLICY_WRITEBACK;
|
|
static unsigned int ecc_mask __initdata = 0;
|
|
pgprot_t pgprot_user;
|
|
pgprot_t pgprot_kernel;
|
|
|
|
EXPORT_SYMBOL(pgprot_user);
|
|
EXPORT_SYMBOL(pgprot_kernel);
|
|
|
|
struct cachepolicy {
|
|
const char policy[16];
|
|
unsigned int cr_mask;
|
|
pmdval_t pmd;
|
|
pteval_t pte;
|
|
};
|
|
|
|
static struct cachepolicy cache_policies[] __initdata = {
|
|
{
|
|
.policy = "uncached",
|
|
.cr_mask = CR_W|CR_C,
|
|
.pmd = PMD_SECT_UNCACHED,
|
|
.pte = L_PTE_MT_UNCACHED,
|
|
}, {
|
|
.policy = "buffered",
|
|
.cr_mask = CR_C,
|
|
.pmd = PMD_SECT_BUFFERED,
|
|
.pte = L_PTE_MT_BUFFERABLE,
|
|
}, {
|
|
.policy = "writethrough",
|
|
.cr_mask = 0,
|
|
.pmd = PMD_SECT_WT,
|
|
.pte = L_PTE_MT_WRITETHROUGH,
|
|
}, {
|
|
.policy = "writeback",
|
|
.cr_mask = 0,
|
|
.pmd = PMD_SECT_WB,
|
|
.pte = L_PTE_MT_WRITEBACK,
|
|
}, {
|
|
.policy = "writealloc",
|
|
.cr_mask = 0,
|
|
.pmd = PMD_SECT_WBWA,
|
|
.pte = L_PTE_MT_WRITEALLOC,
|
|
}
|
|
};
|
|
|
|
#ifdef CONFIG_CPU_CP15
|
|
static unsigned long initial_pmd_value __initdata = 0;
|
|
|
|
/*
|
|
* Initialise the cache_policy variable with the initial state specified
|
|
* via the "pmd" value. This is used to ensure that on ARMv6 and later,
|
|
* the C code sets the page tables up with the same policy as the head
|
|
* assembly code, which avoids an illegal state where the TLBs can get
|
|
* confused. See comments in early_cachepolicy() for more information.
|
|
*/
|
|
void __init init_default_cache_policy(unsigned long pmd)
|
|
{
|
|
int i;
|
|
|
|
initial_pmd_value = pmd;
|
|
|
|
pmd &= PMD_SECT_CACHE_MASK;
|
|
|
|
for (i = 0; i < ARRAY_SIZE(cache_policies); i++)
|
|
if (cache_policies[i].pmd == pmd) {
|
|
cachepolicy = i;
|
|
break;
|
|
}
|
|
|
|
if (i == ARRAY_SIZE(cache_policies))
|
|
pr_err("ERROR: could not find cache policy\n");
|
|
}
|
|
|
|
/*
|
|
* These are useful for identifying cache coherency problems by allowing
|
|
* the cache or the cache and writebuffer to be turned off. (Note: the
|
|
* write buffer should not be on and the cache off).
|
|
*/
|
|
static int __init early_cachepolicy(char *p)
|
|
{
|
|
int i, selected = -1;
|
|
|
|
for (i = 0; i < ARRAY_SIZE(cache_policies); i++) {
|
|
int len = strlen(cache_policies[i].policy);
|
|
|
|
if (memcmp(p, cache_policies[i].policy, len) == 0) {
|
|
selected = i;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (selected == -1)
|
|
pr_err("ERROR: unknown or unsupported cache policy\n");
|
|
|
|
/*
|
|
* This restriction is partly to do with the way we boot; it is
|
|
* unpredictable to have memory mapped using two different sets of
|
|
* memory attributes (shared, type, and cache attribs). We can not
|
|
* change these attributes once the initial assembly has setup the
|
|
* page tables.
|
|
*/
|
|
if (cpu_architecture() >= CPU_ARCH_ARMv6 && selected != cachepolicy) {
|
|
pr_warn("Only cachepolicy=%s supported on ARMv6 and later\n",
|
|
cache_policies[cachepolicy].policy);
|
|
return 0;
|
|
}
|
|
|
|
if (selected != cachepolicy) {
|
|
unsigned long cr = __clear_cr(cache_policies[selected].cr_mask);
|
|
cachepolicy = selected;
|
|
flush_cache_all();
|
|
set_cr(cr);
|
|
}
|
|
return 0;
|
|
}
|
|
early_param("cachepolicy", early_cachepolicy);
|
|
|
|
static int __init early_nocache(char *__unused)
|
|
{
|
|
char *p = "buffered";
|
|
pr_warn("nocache is deprecated; use cachepolicy=%s\n", p);
|
|
early_cachepolicy(p);
|
|
return 0;
|
|
}
|
|
early_param("nocache", early_nocache);
|
|
|
|
static int __init early_nowrite(char *__unused)
|
|
{
|
|
char *p = "uncached";
|
|
pr_warn("nowb is deprecated; use cachepolicy=%s\n", p);
|
|
early_cachepolicy(p);
|
|
return 0;
|
|
}
|
|
early_param("nowb", early_nowrite);
|
|
|
|
#ifndef CONFIG_ARM_LPAE
|
|
static int __init early_ecc(char *p)
|
|
{
|
|
if (memcmp(p, "on", 2) == 0)
|
|
ecc_mask = PMD_PROTECTION;
|
|
else if (memcmp(p, "off", 3) == 0)
|
|
ecc_mask = 0;
|
|
return 0;
|
|
}
|
|
early_param("ecc", early_ecc);
|
|
#endif
|
|
|
|
#else /* ifdef CONFIG_CPU_CP15 */
|
|
|
|
static int __init early_cachepolicy(char *p)
|
|
{
|
|
pr_warn("cachepolicy kernel parameter not supported without cp15\n");
|
|
return 0;
|
|
}
|
|
early_param("cachepolicy", early_cachepolicy);
|
|
|
|
static int __init noalign_setup(char *__unused)
|
|
{
|
|
pr_warn("noalign kernel parameter not supported without cp15\n");
|
|
return 1;
|
|
}
|
|
__setup("noalign", noalign_setup);
|
|
|
|
#endif /* ifdef CONFIG_CPU_CP15 / else */
|
|
|
|
#define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_XN
|
|
#define PROT_PTE_S2_DEVICE PROT_PTE_DEVICE
|
|
#define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE
|
|
|
|
static struct mem_type mem_types[] __ro_after_init = {
|
|
[MT_DEVICE] = { /* Strongly ordered / ARMv6 shared device */
|
|
.prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_SHARED |
|
|
L_PTE_SHARED,
|
|
.prot_l1 = PMD_TYPE_TABLE,
|
|
.prot_sect = PROT_SECT_DEVICE | PMD_SECT_S,
|
|
.domain = DOMAIN_IO,
|
|
},
|
|
[MT_DEVICE_NONSHARED] = { /* ARMv6 non-shared device */
|
|
.prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_NONSHARED,
|
|
.prot_l1 = PMD_TYPE_TABLE,
|
|
.prot_sect = PROT_SECT_DEVICE,
|
|
.domain = DOMAIN_IO,
|
|
},
|
|
[MT_DEVICE_CACHED] = { /* ioremap_cache */
|
|
.prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_CACHED,
|
|
.prot_l1 = PMD_TYPE_TABLE,
|
|
.prot_sect = PROT_SECT_DEVICE | PMD_SECT_WB,
|
|
.domain = DOMAIN_IO,
|
|
},
|
|
[MT_DEVICE_WC] = { /* ioremap_wc */
|
|
.prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_WC,
|
|
.prot_l1 = PMD_TYPE_TABLE,
|
|
.prot_sect = PROT_SECT_DEVICE,
|
|
.domain = DOMAIN_IO,
|
|
},
|
|
[MT_UNCACHED] = {
|
|
.prot_pte = PROT_PTE_DEVICE,
|
|
.prot_l1 = PMD_TYPE_TABLE,
|
|
.prot_sect = PMD_TYPE_SECT | PMD_SECT_XN,
|
|
.domain = DOMAIN_IO,
|
|
},
|
|
[MT_CACHECLEAN] = {
|
|
.prot_sect = PMD_TYPE_SECT | PMD_SECT_XN,
|
|
.domain = DOMAIN_KERNEL,
|
|
},
|
|
#ifndef CONFIG_ARM_LPAE
|
|
[MT_MINICLEAN] = {
|
|
.prot_sect = PMD_TYPE_SECT | PMD_SECT_XN | PMD_SECT_MINICACHE,
|
|
.domain = DOMAIN_KERNEL,
|
|
},
|
|
#endif
|
|
[MT_LOW_VECTORS] = {
|
|
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
|
|
L_PTE_RDONLY,
|
|
.prot_l1 = PMD_TYPE_TABLE,
|
|
.domain = DOMAIN_VECTORS,
|
|
},
|
|
[MT_HIGH_VECTORS] = {
|
|
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
|
|
L_PTE_USER | L_PTE_RDONLY,
|
|
.prot_l1 = PMD_TYPE_TABLE,
|
|
.domain = DOMAIN_VECTORS,
|
|
},
|
|
[MT_MEMORY_RWX] = {
|
|
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY,
|
|
.prot_l1 = PMD_TYPE_TABLE,
|
|
.prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
|
|
.domain = DOMAIN_KERNEL,
|
|
},
|
|
[MT_MEMORY_RW] = {
|
|
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
|
|
L_PTE_XN,
|
|
.prot_l1 = PMD_TYPE_TABLE,
|
|
.prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
|
|
.domain = DOMAIN_KERNEL,
|
|
},
|
|
[MT_ROM] = {
|
|
.prot_sect = PMD_TYPE_SECT,
|
|
.domain = DOMAIN_KERNEL,
|
|
},
|
|
[MT_MEMORY_RWX_NONCACHED] = {
|
|
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
|
|
L_PTE_MT_BUFFERABLE,
|
|
.prot_l1 = PMD_TYPE_TABLE,
|
|
.prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
|
|
.domain = DOMAIN_KERNEL,
|
|
},
|
|
[MT_MEMORY_RW_DTCM] = {
|
|
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
|
|
L_PTE_XN,
|
|
.prot_l1 = PMD_TYPE_TABLE,
|
|
.prot_sect = PMD_TYPE_SECT | PMD_SECT_XN,
|
|
.domain = DOMAIN_KERNEL,
|
|
},
|
|
[MT_MEMORY_RWX_ITCM] = {
|
|
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY,
|
|
.prot_l1 = PMD_TYPE_TABLE,
|
|
.domain = DOMAIN_KERNEL,
|
|
},
|
|
[MT_MEMORY_RW_SO] = {
|
|
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
|
|
L_PTE_MT_UNCACHED | L_PTE_XN,
|
|
.prot_l1 = PMD_TYPE_TABLE,
|
|
.prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_S |
|
|
PMD_SECT_UNCACHED | PMD_SECT_XN,
|
|
.domain = DOMAIN_KERNEL,
|
|
},
|
|
[MT_MEMORY_DMA_READY] = {
|
|
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
|
|
L_PTE_XN,
|
|
.prot_l1 = PMD_TYPE_TABLE,
|
|
.domain = DOMAIN_KERNEL,
|
|
},
|
|
};
|
|
|
|
const struct mem_type *get_mem_type(unsigned int type)
|
|
{
|
|
return type < ARRAY_SIZE(mem_types) ? &mem_types[type] : NULL;
|
|
}
|
|
EXPORT_SYMBOL(get_mem_type);
|
|
|
|
static pte_t *(*pte_offset_fixmap)(pmd_t *dir, unsigned long addr);
|
|
|
|
static pte_t bm_pte[PTRS_PER_PTE + PTE_HWTABLE_PTRS]
|
|
__aligned(PTE_HWTABLE_OFF + PTE_HWTABLE_SIZE) __initdata;
|
|
|
|
static pte_t * __init pte_offset_early_fixmap(pmd_t *dir, unsigned long addr)
|
|
{
|
|
return &bm_pte[pte_index(addr)];
|
|
}
|
|
|
|
static pte_t *pte_offset_late_fixmap(pmd_t *dir, unsigned long addr)
|
|
{
|
|
return pte_offset_kernel(dir, addr);
|
|
}
|
|
|
|
static inline pmd_t * __init fixmap_pmd(unsigned long addr)
|
|
{
|
|
return pmd_off_k(addr);
|
|
}
|
|
|
|
void __init early_fixmap_init(void)
|
|
{
|
|
pmd_t *pmd;
|
|
|
|
/*
|
|
* The early fixmap range spans multiple pmds, for which
|
|
* we are not prepared:
|
|
*/
|
|
BUILD_BUG_ON((__fix_to_virt(__end_of_early_ioremap_region) >> PMD_SHIFT)
|
|
!= FIXADDR_TOP >> PMD_SHIFT);
|
|
|
|
pmd = fixmap_pmd(FIXADDR_TOP);
|
|
pmd_populate_kernel(&init_mm, pmd, bm_pte);
|
|
|
|
pte_offset_fixmap = pte_offset_early_fixmap;
|
|
}
|
|
|
|
/*
|
|
* To avoid TLB flush broadcasts, this uses local_flush_tlb_kernel_range().
|
|
* As a result, this can only be called with preemption disabled, as under
|
|
* stop_machine().
|
|
*/
|
|
void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t prot)
|
|
{
|
|
unsigned long vaddr = __fix_to_virt(idx);
|
|
pte_t *pte = pte_offset_fixmap(pmd_off_k(vaddr), vaddr);
|
|
|
|
/* Make sure fixmap region does not exceed available allocation. */
|
|
BUILD_BUG_ON(FIXADDR_START + (__end_of_fixed_addresses * PAGE_SIZE) >
|
|
FIXADDR_END);
|
|
BUG_ON(idx >= __end_of_fixed_addresses);
|
|
|
|
/* We support only device mappings before pgprot_kernel is set. */
|
|
if (WARN_ON(pgprot_val(prot) != pgprot_val(FIXMAP_PAGE_IO) &&
|
|
pgprot_val(prot) && pgprot_val(pgprot_kernel) == 0))
|
|
return;
|
|
|
|
if (pgprot_val(prot))
|
|
set_pte_at(NULL, vaddr, pte,
|
|
pfn_pte(phys >> PAGE_SHIFT, prot));
|
|
else
|
|
pte_clear(NULL, vaddr, pte);
|
|
local_flush_tlb_kernel_range(vaddr, vaddr + PAGE_SIZE);
|
|
}
|
|
|
|
/*
|
|
* Adjust the PMD section entries according to the CPU in use.
|
|
*/
|
|
static void __init build_mem_type_table(void)
|
|
{
|
|
struct cachepolicy *cp;
|
|
unsigned int cr = get_cr();
|
|
pteval_t user_pgprot, kern_pgprot, vecs_pgprot;
|
|
int cpu_arch = cpu_architecture();
|
|
int i;
|
|
|
|
if (cpu_arch < CPU_ARCH_ARMv6) {
|
|
#if defined(CONFIG_CPU_DCACHE_DISABLE)
|
|
if (cachepolicy > CPOLICY_BUFFERED)
|
|
cachepolicy = CPOLICY_BUFFERED;
|
|
#elif defined(CONFIG_CPU_DCACHE_WRITETHROUGH)
|
|
if (cachepolicy > CPOLICY_WRITETHROUGH)
|
|
cachepolicy = CPOLICY_WRITETHROUGH;
|
|
#endif
|
|
}
|
|
if (cpu_arch < CPU_ARCH_ARMv5) {
|
|
if (cachepolicy >= CPOLICY_WRITEALLOC)
|
|
cachepolicy = CPOLICY_WRITEBACK;
|
|
ecc_mask = 0;
|
|
}
|
|
|
|
if (is_smp()) {
|
|
if (cachepolicy != CPOLICY_WRITEALLOC) {
|
|
pr_warn("Forcing write-allocate cache policy for SMP\n");
|
|
cachepolicy = CPOLICY_WRITEALLOC;
|
|
}
|
|
if (!(initial_pmd_value & PMD_SECT_S)) {
|
|
pr_warn("Forcing shared mappings for SMP\n");
|
|
initial_pmd_value |= PMD_SECT_S;
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Strip out features not present on earlier architectures.
|
|
* Pre-ARMv5 CPUs don't have TEX bits. Pre-ARMv6 CPUs or those
|
|
* without extended page tables don't have the 'Shared' bit.
|
|
*/
|
|
if (cpu_arch < CPU_ARCH_ARMv5)
|
|
for (i = 0; i < ARRAY_SIZE(mem_types); i++)
|
|
mem_types[i].prot_sect &= ~PMD_SECT_TEX(7);
|
|
if ((cpu_arch < CPU_ARCH_ARMv6 || !(cr & CR_XP)) && !cpu_is_xsc3())
|
|
for (i = 0; i < ARRAY_SIZE(mem_types); i++)
|
|
mem_types[i].prot_sect &= ~PMD_SECT_S;
|
|
|
|
/*
|
|
* ARMv5 and lower, bit 4 must be set for page tables (was: cache
|
|
* "update-able on write" bit on ARM610). However, Xscale and
|
|
* Xscale3 require this bit to be cleared.
|
|
*/
|
|
if (cpu_is_xscale_family()) {
|
|
for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
|
|
mem_types[i].prot_sect &= ~PMD_BIT4;
|
|
mem_types[i].prot_l1 &= ~PMD_BIT4;
|
|
}
|
|
} else if (cpu_arch < CPU_ARCH_ARMv6) {
|
|
for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
|
|
if (mem_types[i].prot_l1)
|
|
mem_types[i].prot_l1 |= PMD_BIT4;
|
|
if (mem_types[i].prot_sect)
|
|
mem_types[i].prot_sect |= PMD_BIT4;
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Mark the device areas according to the CPU/architecture.
|
|
*/
|
|
if (cpu_is_xsc3() || (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP))) {
|
|
if (!cpu_is_xsc3()) {
|
|
/*
|
|
* Mark device regions on ARMv6+ as execute-never
|
|
* to prevent speculative instruction fetches.
|
|
*/
|
|
mem_types[MT_DEVICE].prot_sect |= PMD_SECT_XN;
|
|
mem_types[MT_DEVICE_NONSHARED].prot_sect |= PMD_SECT_XN;
|
|
mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_XN;
|
|
mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_XN;
|
|
|
|
/* Also setup NX memory mapping */
|
|
mem_types[MT_MEMORY_RW].prot_sect |= PMD_SECT_XN;
|
|
}
|
|
if (cpu_arch >= CPU_ARCH_ARMv7 && (cr & CR_TRE)) {
|
|
/*
|
|
* For ARMv7 with TEX remapping,
|
|
* - shared device is SXCB=1100
|
|
* - nonshared device is SXCB=0100
|
|
* - write combine device mem is SXCB=0001
|
|
* (Uncached Normal memory)
|
|
*/
|
|
mem_types[MT_DEVICE].prot_sect |= PMD_SECT_TEX(1);
|
|
mem_types[MT_DEVICE_NONSHARED].prot_sect |= PMD_SECT_TEX(1);
|
|
mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_BUFFERABLE;
|
|
} else if (cpu_is_xsc3()) {
|
|
/*
|
|
* For Xscale3,
|
|
* - shared device is TEXCB=00101
|
|
* - nonshared device is TEXCB=01000
|
|
* - write combine device mem is TEXCB=00100
|
|
* (Inner/Outer Uncacheable in xsc3 parlance)
|
|
*/
|
|
mem_types[MT_DEVICE].prot_sect |= PMD_SECT_TEX(1) | PMD_SECT_BUFFERED;
|
|
mem_types[MT_DEVICE_NONSHARED].prot_sect |= PMD_SECT_TEX(2);
|
|
mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_TEX(1);
|
|
} else {
|
|
/*
|
|
* For ARMv6 and ARMv7 without TEX remapping,
|
|
* - shared device is TEXCB=00001
|
|
* - nonshared device is TEXCB=01000
|
|
* - write combine device mem is TEXCB=00100
|
|
* (Uncached Normal in ARMv6 parlance).
|
|
*/
|
|
mem_types[MT_DEVICE].prot_sect |= PMD_SECT_BUFFERED;
|
|
mem_types[MT_DEVICE_NONSHARED].prot_sect |= PMD_SECT_TEX(2);
|
|
mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_TEX(1);
|
|
}
|
|
} else {
|
|
/*
|
|
* On others, write combining is "Uncached/Buffered"
|
|
*/
|
|
mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_BUFFERABLE;
|
|
}
|
|
|
|
/*
|
|
* Now deal with the memory-type mappings
|
|
*/
|
|
cp = &cache_policies[cachepolicy];
|
|
vecs_pgprot = kern_pgprot = user_pgprot = cp->pte;
|
|
|
|
#ifndef CONFIG_ARM_LPAE
|
|
/*
|
|
* We don't use domains on ARMv6 (since this causes problems with
|
|
* v6/v7 kernels), so we must use a separate memory type for user
|
|
* r/o, kernel r/w to map the vectors page.
|
|
*/
|
|
if (cpu_arch == CPU_ARCH_ARMv6)
|
|
vecs_pgprot |= L_PTE_MT_VECTORS;
|
|
|
|
/*
|
|
* Check is it with support for the PXN bit
|
|
* in the Short-descriptor translation table format descriptors.
|
|
*/
|
|
if (cpu_arch == CPU_ARCH_ARMv7 &&
|
|
(read_cpuid_ext(CPUID_EXT_MMFR0) & 0xF) >= 4) {
|
|
user_pmd_table |= PMD_PXNTABLE;
|
|
}
|
|
#endif
|
|
|
|
/*
|
|
* ARMv6 and above have extended page tables.
|
|
*/
|
|
if (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP)) {
|
|
#ifndef CONFIG_ARM_LPAE
|
|
/*
|
|
* Mark cache clean areas and XIP ROM read only
|
|
* from SVC mode and no access from userspace.
|
|
*/
|
|
mem_types[MT_ROM].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
|
|
mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
|
|
mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
|
|
#endif
|
|
|
|
/*
|
|
* If the initial page tables were created with the S bit
|
|
* set, then we need to do the same here for the same
|
|
* reasons given in early_cachepolicy().
|
|
*/
|
|
if (initial_pmd_value & PMD_SECT_S) {
|
|
user_pgprot |= L_PTE_SHARED;
|
|
kern_pgprot |= L_PTE_SHARED;
|
|
vecs_pgprot |= L_PTE_SHARED;
|
|
mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_S;
|
|
mem_types[MT_DEVICE_WC].prot_pte |= L_PTE_SHARED;
|
|
mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S;
|
|
mem_types[MT_DEVICE_CACHED].prot_pte |= L_PTE_SHARED;
|
|
mem_types[MT_MEMORY_RWX].prot_sect |= PMD_SECT_S;
|
|
mem_types[MT_MEMORY_RWX].prot_pte |= L_PTE_SHARED;
|
|
mem_types[MT_MEMORY_RW].prot_sect |= PMD_SECT_S;
|
|
mem_types[MT_MEMORY_RW].prot_pte |= L_PTE_SHARED;
|
|
mem_types[MT_MEMORY_DMA_READY].prot_pte |= L_PTE_SHARED;
|
|
mem_types[MT_MEMORY_RWX_NONCACHED].prot_sect |= PMD_SECT_S;
|
|
mem_types[MT_MEMORY_RWX_NONCACHED].prot_pte |= L_PTE_SHARED;
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Non-cacheable Normal - intended for memory areas that must
|
|
* not cause dirty cache line writebacks when used
|
|
*/
|
|
if (cpu_arch >= CPU_ARCH_ARMv6) {
|
|
if (cpu_arch >= CPU_ARCH_ARMv7 && (cr & CR_TRE)) {
|
|
/* Non-cacheable Normal is XCB = 001 */
|
|
mem_types[MT_MEMORY_RWX_NONCACHED].prot_sect |=
|
|
PMD_SECT_BUFFERED;
|
|
} else {
|
|
/* For both ARMv6 and non-TEX-remapping ARMv7 */
|
|
mem_types[MT_MEMORY_RWX_NONCACHED].prot_sect |=
|
|
PMD_SECT_TEX(1);
|
|
}
|
|
} else {
|
|
mem_types[MT_MEMORY_RWX_NONCACHED].prot_sect |= PMD_SECT_BUFFERABLE;
|
|
}
|
|
|
|
#ifdef CONFIG_ARM_LPAE
|
|
/*
|
|
* Do not generate access flag faults for the kernel mappings.
|
|
*/
|
|
for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
|
|
mem_types[i].prot_pte |= PTE_EXT_AF;
|
|
if (mem_types[i].prot_sect)
|
|
mem_types[i].prot_sect |= PMD_SECT_AF;
|
|
}
|
|
kern_pgprot |= PTE_EXT_AF;
|
|
vecs_pgprot |= PTE_EXT_AF;
|
|
|
|
/*
|
|
* Set PXN for user mappings
|
|
*/
|
|
user_pgprot |= PTE_EXT_PXN;
|
|
#endif
|
|
|
|
for (i = 0; i < 16; i++) {
|
|
pteval_t v = pgprot_val(protection_map[i]);
|
|
protection_map[i] = __pgprot(v | user_pgprot);
|
|
}
|
|
|
|
mem_types[MT_LOW_VECTORS].prot_pte |= vecs_pgprot;
|
|
mem_types[MT_HIGH_VECTORS].prot_pte |= vecs_pgprot;
|
|
|
|
pgprot_user = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | user_pgprot);
|
|
pgprot_kernel = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG |
|
|
L_PTE_DIRTY | kern_pgprot);
|
|
|
|
mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask;
|
|
mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask;
|
|
mem_types[MT_MEMORY_RWX].prot_sect |= ecc_mask | cp->pmd;
|
|
mem_types[MT_MEMORY_RWX].prot_pte |= kern_pgprot;
|
|
mem_types[MT_MEMORY_RW].prot_sect |= ecc_mask | cp->pmd;
|
|
mem_types[MT_MEMORY_RW].prot_pte |= kern_pgprot;
|
|
mem_types[MT_MEMORY_DMA_READY].prot_pte |= kern_pgprot;
|
|
mem_types[MT_MEMORY_RWX_NONCACHED].prot_sect |= ecc_mask;
|
|
mem_types[MT_ROM].prot_sect |= cp->pmd;
|
|
|
|
switch (cp->pmd) {
|
|
case PMD_SECT_WT:
|
|
mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_WT;
|
|
break;
|
|
case PMD_SECT_WB:
|
|
case PMD_SECT_WBWA:
|
|
mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_WB;
|
|
break;
|
|
}
|
|
pr_info("Memory policy: %sData cache %s\n",
|
|
ecc_mask ? "ECC enabled, " : "", cp->policy);
|
|
|
|
for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
|
|
struct mem_type *t = &mem_types[i];
|
|
if (t->prot_l1)
|
|
t->prot_l1 |= PMD_DOMAIN(t->domain);
|
|
if (t->prot_sect)
|
|
t->prot_sect |= PMD_DOMAIN(t->domain);
|
|
}
|
|
}
|
|
|
|
#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
|
|
pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
|
|
unsigned long size, pgprot_t vma_prot)
|
|
{
|
|
if (!pfn_valid(pfn))
|
|
return pgprot_noncached(vma_prot);
|
|
else if (file->f_flags & O_SYNC)
|
|
return pgprot_writecombine(vma_prot);
|
|
return vma_prot;
|
|
}
|
|
EXPORT_SYMBOL(phys_mem_access_prot);
|
|
#endif
|
|
|
|
#define vectors_base() (vectors_high() ? 0xffff0000 : 0)
|
|
|
|
static void __init *early_alloc(unsigned long sz)
|
|
{
|
|
void *ptr = memblock_alloc(sz, sz);
|
|
|
|
if (!ptr)
|
|
panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
|
|
__func__, sz, sz);
|
|
|
|
return ptr;
|
|
}
|
|
|
|
static void *__init late_alloc(unsigned long sz)
|
|
{
|
|
void *ptr = (void *)__get_free_pages(GFP_PGTABLE_KERNEL, get_order(sz));
|
|
|
|
if (!ptr || !pgtable_pte_page_ctor(virt_to_page(ptr)))
|
|
BUG();
|
|
return ptr;
|
|
}
|
|
|
|
static pte_t * __init arm_pte_alloc(pmd_t *pmd, unsigned long addr,
|
|
unsigned long prot,
|
|
void *(*alloc)(unsigned long sz))
|
|
{
|
|
if (pmd_none(*pmd)) {
|
|
pte_t *pte = alloc(PTE_HWTABLE_OFF + PTE_HWTABLE_SIZE);
|
|
__pmd_populate(pmd, __pa(pte), prot);
|
|
}
|
|
BUG_ON(pmd_bad(*pmd));
|
|
return pte_offset_kernel(pmd, addr);
|
|
}
|
|
|
|
static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr,
|
|
unsigned long prot)
|
|
{
|
|
return arm_pte_alloc(pmd, addr, prot, early_alloc);
|
|
}
|
|
|
|
static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr,
|
|
unsigned long end, unsigned long pfn,
|
|
const struct mem_type *type,
|
|
void *(*alloc)(unsigned long sz),
|
|
bool ng)
|
|
{
|
|
pte_t *pte = arm_pte_alloc(pmd, addr, type->prot_l1, alloc);
|
|
do {
|
|
set_pte_ext(pte, pfn_pte(pfn, __pgprot(type->prot_pte)),
|
|
ng ? PTE_EXT_NG : 0);
|
|
pfn++;
|
|
} while (pte++, addr += PAGE_SIZE, addr != end);
|
|
}
|
|
|
|
static void __init __map_init_section(pmd_t *pmd, unsigned long addr,
|
|
unsigned long end, phys_addr_t phys,
|
|
const struct mem_type *type, bool ng)
|
|
{
|
|
pmd_t *p = pmd;
|
|
|
|
#ifndef CONFIG_ARM_LPAE
|
|
/*
|
|
* In classic MMU format, puds and pmds are folded in to
|
|
* the pgds. pmd_offset gives the PGD entry. PGDs refer to a
|
|
* group of L1 entries making up one logical pointer to
|
|
* an L2 table (2MB), where as PMDs refer to the individual
|
|
* L1 entries (1MB). Hence increment to get the correct
|
|
* offset for odd 1MB sections.
|
|
* (See arch/arm/include/asm/pgtable-2level.h)
|
|
*/
|
|
if (addr & SECTION_SIZE)
|
|
pmd++;
|
|
#endif
|
|
do {
|
|
*pmd = __pmd(phys | type->prot_sect | (ng ? PMD_SECT_nG : 0));
|
|
phys += SECTION_SIZE;
|
|
} while (pmd++, addr += SECTION_SIZE, addr != end);
|
|
|
|
flush_pmd_entry(p);
|
|
}
|
|
|
|
static void __init alloc_init_pmd(pud_t *pud, unsigned long addr,
|
|
unsigned long end, phys_addr_t phys,
|
|
const struct mem_type *type,
|
|
void *(*alloc)(unsigned long sz), bool ng)
|
|
{
|
|
pmd_t *pmd = pmd_offset(pud, addr);
|
|
unsigned long next;
|
|
|
|
do {
|
|
/*
|
|
* With LPAE, we must loop over to map
|
|
* all the pmds for the given range.
|
|
*/
|
|
next = pmd_addr_end(addr, end);
|
|
|
|
/*
|
|
* Try a section mapping - addr, next and phys must all be
|
|
* aligned to a section boundary.
|
|
*/
|
|
if (type->prot_sect &&
|
|
((addr | next | phys) & ~SECTION_MASK) == 0) {
|
|
__map_init_section(pmd, addr, next, phys, type, ng);
|
|
} else {
|
|
alloc_init_pte(pmd, addr, next,
|
|
__phys_to_pfn(phys), type, alloc, ng);
|
|
}
|
|
|
|
phys += next - addr;
|
|
|
|
} while (pmd++, addr = next, addr != end);
|
|
}
|
|
|
|
static void __init alloc_init_pud(p4d_t *p4d, unsigned long addr,
|
|
unsigned long end, phys_addr_t phys,
|
|
const struct mem_type *type,
|
|
void *(*alloc)(unsigned long sz), bool ng)
|
|
{
|
|
pud_t *pud = pud_offset(p4d, addr);
|
|
unsigned long next;
|
|
|
|
do {
|
|
next = pud_addr_end(addr, end);
|
|
alloc_init_pmd(pud, addr, next, phys, type, alloc, ng);
|
|
phys += next - addr;
|
|
} while (pud++, addr = next, addr != end);
|
|
}
|
|
|
|
static void __init alloc_init_p4d(pgd_t *pgd, unsigned long addr,
|
|
unsigned long end, phys_addr_t phys,
|
|
const struct mem_type *type,
|
|
void *(*alloc)(unsigned long sz), bool ng)
|
|
{
|
|
p4d_t *p4d = p4d_offset(pgd, addr);
|
|
unsigned long next;
|
|
|
|
do {
|
|
next = p4d_addr_end(addr, end);
|
|
alloc_init_pud(p4d, addr, next, phys, type, alloc, ng);
|
|
phys += next - addr;
|
|
} while (p4d++, addr = next, addr != end);
|
|
}
|
|
|
|
#ifndef CONFIG_ARM_LPAE
|
|
static void __init create_36bit_mapping(struct mm_struct *mm,
|
|
struct map_desc *md,
|
|
const struct mem_type *type,
|
|
bool ng)
|
|
{
|
|
unsigned long addr, length, end;
|
|
phys_addr_t phys;
|
|
pgd_t *pgd;
|
|
|
|
addr = md->virtual;
|
|
phys = __pfn_to_phys(md->pfn);
|
|
length = PAGE_ALIGN(md->length);
|
|
|
|
if (!(cpu_architecture() >= CPU_ARCH_ARMv6 || cpu_is_xsc3())) {
|
|
pr_err("MM: CPU does not support supersection mapping for 0x%08llx at 0x%08lx\n",
|
|
(long long)__pfn_to_phys((u64)md->pfn), addr);
|
|
return;
|
|
}
|
|
|
|
/* N.B. ARMv6 supersections are only defined to work with domain 0.
|
|
* Since domain assignments can in fact be arbitrary, the
|
|
* 'domain == 0' check below is required to insure that ARMv6
|
|
* supersections are only allocated for domain 0 regardless
|
|
* of the actual domain assignments in use.
|
|
*/
|
|
if (type->domain) {
|
|
pr_err("MM: invalid domain in supersection mapping for 0x%08llx at 0x%08lx\n",
|
|
(long long)__pfn_to_phys((u64)md->pfn), addr);
|
|
return;
|
|
}
|
|
|
|
if ((addr | length | __pfn_to_phys(md->pfn)) & ~SUPERSECTION_MASK) {
|
|
pr_err("MM: cannot create mapping for 0x%08llx at 0x%08lx invalid alignment\n",
|
|
(long long)__pfn_to_phys((u64)md->pfn), addr);
|
|
return;
|
|
}
|
|
|
|
/*
|
|
* Shift bits [35:32] of address into bits [23:20] of PMD
|
|
* (See ARMv6 spec).
|
|
*/
|
|
phys |= (((md->pfn >> (32 - PAGE_SHIFT)) & 0xF) << 20);
|
|
|
|
pgd = pgd_offset(mm, addr);
|
|
end = addr + length;
|
|
do {
|
|
p4d_t *p4d = p4d_offset(pgd, addr);
|
|
pud_t *pud = pud_offset(p4d, addr);
|
|
pmd_t *pmd = pmd_offset(pud, addr);
|
|
int i;
|
|
|
|
for (i = 0; i < 16; i++)
|
|
*pmd++ = __pmd(phys | type->prot_sect | PMD_SECT_SUPER |
|
|
(ng ? PMD_SECT_nG : 0));
|
|
|
|
addr += SUPERSECTION_SIZE;
|
|
phys += SUPERSECTION_SIZE;
|
|
pgd += SUPERSECTION_SIZE >> PGDIR_SHIFT;
|
|
} while (addr != end);
|
|
}
|
|
#endif /* !CONFIG_ARM_LPAE */
|
|
|
|
static void __init __create_mapping(struct mm_struct *mm, struct map_desc *md,
|
|
void *(*alloc)(unsigned long sz),
|
|
bool ng)
|
|
{
|
|
unsigned long addr, length, end;
|
|
phys_addr_t phys;
|
|
const struct mem_type *type;
|
|
pgd_t *pgd;
|
|
|
|
type = &mem_types[md->type];
|
|
|
|
#ifndef CONFIG_ARM_LPAE
|
|
/*
|
|
* Catch 36-bit addresses
|
|
*/
|
|
if (md->pfn >= 0x100000) {
|
|
create_36bit_mapping(mm, md, type, ng);
|
|
return;
|
|
}
|
|
#endif
|
|
|
|
addr = md->virtual & PAGE_MASK;
|
|
phys = __pfn_to_phys(md->pfn);
|
|
length = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK));
|
|
|
|
if (type->prot_l1 == 0 && ((addr | phys | length) & ~SECTION_MASK)) {
|
|
pr_warn("BUG: map for 0x%08llx at 0x%08lx can not be mapped using pages, ignoring.\n",
|
|
(long long)__pfn_to_phys(md->pfn), addr);
|
|
return;
|
|
}
|
|
|
|
pgd = pgd_offset(mm, addr);
|
|
end = addr + length;
|
|
do {
|
|
unsigned long next = pgd_addr_end(addr, end);
|
|
|
|
alloc_init_p4d(pgd, addr, next, phys, type, alloc, ng);
|
|
|
|
phys += next - addr;
|
|
addr = next;
|
|
} while (pgd++, addr != end);
|
|
}
|
|
|
|
/*
|
|
* Create the page directory entries and any necessary
|
|
* page tables for the mapping specified by `md'. We
|
|
* are able to cope here with varying sizes and address
|
|
* offsets, and we take full advantage of sections and
|
|
* supersections.
|
|
*/
|
|
static void __init create_mapping(struct map_desc *md)
|
|
{
|
|
if (md->virtual != vectors_base() && md->virtual < TASK_SIZE) {
|
|
pr_warn("BUG: not creating mapping for 0x%08llx at 0x%08lx in user region\n",
|
|
(long long)__pfn_to_phys((u64)md->pfn), md->virtual);
|
|
return;
|
|
}
|
|
|
|
if (md->type == MT_DEVICE &&
|
|
md->virtual >= PAGE_OFFSET && md->virtual < FIXADDR_START &&
|
|
(md->virtual < VMALLOC_START || md->virtual >= VMALLOC_END)) {
|
|
pr_warn("BUG: mapping for 0x%08llx at 0x%08lx out of vmalloc space\n",
|
|
(long long)__pfn_to_phys((u64)md->pfn), md->virtual);
|
|
}
|
|
|
|
__create_mapping(&init_mm, md, early_alloc, false);
|
|
}
|
|
|
|
void __init create_mapping_late(struct mm_struct *mm, struct map_desc *md,
|
|
bool ng)
|
|
{
|
|
#ifdef CONFIG_ARM_LPAE
|
|
p4d_t *p4d;
|
|
pud_t *pud;
|
|
|
|
p4d = p4d_alloc(mm, pgd_offset(mm, md->virtual), md->virtual);
|
|
if (WARN_ON(!p4d))
|
|
return;
|
|
pud = pud_alloc(mm, p4d, md->virtual);
|
|
if (WARN_ON(!pud))
|
|
return;
|
|
pmd_alloc(mm, pud, 0);
|
|
#endif
|
|
__create_mapping(mm, md, late_alloc, ng);
|
|
}
|
|
|
|
/*
|
|
* Create the architecture specific mappings
|
|
*/
|
|
void __init iotable_init(struct map_desc *io_desc, int nr)
|
|
{
|
|
struct map_desc *md;
|
|
struct vm_struct *vm;
|
|
struct static_vm *svm;
|
|
|
|
if (!nr)
|
|
return;
|
|
|
|
svm = memblock_alloc(sizeof(*svm) * nr, __alignof__(*svm));
|
|
if (!svm)
|
|
panic("%s: Failed to allocate %zu bytes align=0x%zx\n",
|
|
__func__, sizeof(*svm) * nr, __alignof__(*svm));
|
|
|
|
for (md = io_desc; nr; md++, nr--) {
|
|
create_mapping(md);
|
|
|
|
vm = &svm->vm;
|
|
vm->addr = (void *)(md->virtual & PAGE_MASK);
|
|
vm->size = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK));
|
|
vm->phys_addr = __pfn_to_phys(md->pfn);
|
|
vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING;
|
|
vm->flags |= VM_ARM_MTYPE(md->type);
|
|
vm->caller = iotable_init;
|
|
add_static_vm_early(svm++);
|
|
}
|
|
}
|
|
|
|
void __init vm_reserve_area_early(unsigned long addr, unsigned long size,
|
|
void *caller)
|
|
{
|
|
struct vm_struct *vm;
|
|
struct static_vm *svm;
|
|
|
|
svm = memblock_alloc(sizeof(*svm), __alignof__(*svm));
|
|
if (!svm)
|
|
panic("%s: Failed to allocate %zu bytes align=0x%zx\n",
|
|
__func__, sizeof(*svm), __alignof__(*svm));
|
|
|
|
vm = &svm->vm;
|
|
vm->addr = (void *)addr;
|
|
vm->size = size;
|
|
vm->flags = VM_IOREMAP | VM_ARM_EMPTY_MAPPING;
|
|
vm->caller = caller;
|
|
add_static_vm_early(svm);
|
|
}
|
|
|
|
#ifndef CONFIG_ARM_LPAE
|
|
|
|
/*
|
|
* The Linux PMD is made of two consecutive section entries covering 2MB
|
|
* (see definition in include/asm/pgtable-2level.h). However a call to
|
|
* create_mapping() may optimize static mappings by using individual
|
|
* 1MB section mappings. This leaves the actual PMD potentially half
|
|
* initialized if the top or bottom section entry isn't used, leaving it
|
|
* open to problems if a subsequent ioremap() or vmalloc() tries to use
|
|
* the virtual space left free by that unused section entry.
|
|
*
|
|
* Let's avoid the issue by inserting dummy vm entries covering the unused
|
|
* PMD halves once the static mappings are in place.
|
|
*/
|
|
|
|
static void __init pmd_empty_section_gap(unsigned long addr)
|
|
{
|
|
vm_reserve_area_early(addr, SECTION_SIZE, pmd_empty_section_gap);
|
|
}
|
|
|
|
static void __init fill_pmd_gaps(void)
|
|
{
|
|
struct static_vm *svm;
|
|
struct vm_struct *vm;
|
|
unsigned long addr, next = 0;
|
|
pmd_t *pmd;
|
|
|
|
list_for_each_entry(svm, &static_vmlist, list) {
|
|
vm = &svm->vm;
|
|
addr = (unsigned long)vm->addr;
|
|
if (addr < next)
|
|
continue;
|
|
|
|
/*
|
|
* Check if this vm starts on an odd section boundary.
|
|
* If so and the first section entry for this PMD is free
|
|
* then we block the corresponding virtual address.
|
|
*/
|
|
if ((addr & ~PMD_MASK) == SECTION_SIZE) {
|
|
pmd = pmd_off_k(addr);
|
|
if (pmd_none(*pmd))
|
|
pmd_empty_section_gap(addr & PMD_MASK);
|
|
}
|
|
|
|
/*
|
|
* Then check if this vm ends on an odd section boundary.
|
|
* If so and the second section entry for this PMD is empty
|
|
* then we block the corresponding virtual address.
|
|
*/
|
|
addr += vm->size;
|
|
if ((addr & ~PMD_MASK) == SECTION_SIZE) {
|
|
pmd = pmd_off_k(addr) + 1;
|
|
if (pmd_none(*pmd))
|
|
pmd_empty_section_gap(addr);
|
|
}
|
|
|
|
/* no need to look at any vm entry until we hit the next PMD */
|
|
next = (addr + PMD_SIZE - 1) & PMD_MASK;
|
|
}
|
|
}
|
|
|
|
#else
|
|
#define fill_pmd_gaps() do { } while (0)
|
|
#endif
|
|
|
|
#if defined(CONFIG_PCI) && !defined(CONFIG_NEED_MACH_IO_H)
|
|
static void __init pci_reserve_io(void)
|
|
{
|
|
struct static_vm *svm;
|
|
|
|
svm = find_static_vm_vaddr((void *)PCI_IO_VIRT_BASE);
|
|
if (svm)
|
|
return;
|
|
|
|
vm_reserve_area_early(PCI_IO_VIRT_BASE, SZ_2M, pci_reserve_io);
|
|
}
|
|
#else
|
|
#define pci_reserve_io() do { } while (0)
|
|
#endif
|
|
|
|
#ifdef CONFIG_DEBUG_LL
|
|
void __init debug_ll_io_init(void)
|
|
{
|
|
struct map_desc map;
|
|
|
|
debug_ll_addr(&map.pfn, &map.virtual);
|
|
if (!map.pfn || !map.virtual)
|
|
return;
|
|
map.pfn = __phys_to_pfn(map.pfn);
|
|
map.virtual &= PAGE_MASK;
|
|
map.length = PAGE_SIZE;
|
|
map.type = MT_DEVICE;
|
|
iotable_init(&map, 1);
|
|
}
|
|
#endif
|
|
|
|
static void * __initdata vmalloc_min =
|
|
(void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET);
|
|
|
|
/*
|
|
* vmalloc=size forces the vmalloc area to be exactly 'size'
|
|
* bytes. This can be used to increase (or decrease) the vmalloc
|
|
* area - the default is 240m.
|
|
*/
|
|
static int __init early_vmalloc(char *arg)
|
|
{
|
|
unsigned long vmalloc_reserve = memparse(arg, NULL);
|
|
|
|
if (vmalloc_reserve < SZ_16M) {
|
|
vmalloc_reserve = SZ_16M;
|
|
pr_warn("vmalloc area too small, limiting to %luMB\n",
|
|
vmalloc_reserve >> 20);
|
|
}
|
|
|
|
if (vmalloc_reserve > VMALLOC_END - (PAGE_OFFSET + SZ_32M)) {
|
|
vmalloc_reserve = VMALLOC_END - (PAGE_OFFSET + SZ_32M);
|
|
pr_warn("vmalloc area is too big, limiting to %luMB\n",
|
|
vmalloc_reserve >> 20);
|
|
}
|
|
|
|
vmalloc_min = (void *)(VMALLOC_END - vmalloc_reserve);
|
|
return 0;
|
|
}
|
|
early_param("vmalloc", early_vmalloc);
|
|
|
|
phys_addr_t arm_lowmem_limit __initdata = 0;
|
|
|
|
void __init adjust_lowmem_bounds(void)
|
|
{
|
|
phys_addr_t block_start, block_end, memblock_limit = 0;
|
|
u64 vmalloc_limit, i;
|
|
phys_addr_t lowmem_limit = 0;
|
|
|
|
/*
|
|
* Let's use our own (unoptimized) equivalent of __pa() that is
|
|
* not affected by wrap-arounds when sizeof(phys_addr_t) == 4.
|
|
* The result is used as the upper bound on physical memory address
|
|
* and may itself be outside the valid range for which phys_addr_t
|
|
* and therefore __pa() is defined.
|
|
*/
|
|
vmalloc_limit = (u64)(uintptr_t)vmalloc_min - PAGE_OFFSET + PHYS_OFFSET;
|
|
|
|
/*
|
|
* The first usable region must be PMD aligned. Mark its start
|
|
* as MEMBLOCK_NOMAP if it isn't
|
|
*/
|
|
for_each_mem_range(i, &block_start, &block_end) {
|
|
if (!IS_ALIGNED(block_start, PMD_SIZE)) {
|
|
phys_addr_t len;
|
|
|
|
len = round_up(block_start, PMD_SIZE) - block_start;
|
|
memblock_mark_nomap(block_start, len);
|
|
}
|
|
break;
|
|
}
|
|
|
|
for_each_mem_range(i, &block_start, &block_end) {
|
|
if (block_start < vmalloc_limit) {
|
|
if (block_end > lowmem_limit)
|
|
/*
|
|
* Compare as u64 to ensure vmalloc_limit does
|
|
* not get truncated. block_end should always
|
|
* fit in phys_addr_t so there should be no
|
|
* issue with assignment.
|
|
*/
|
|
lowmem_limit = min_t(u64,
|
|
vmalloc_limit,
|
|
block_end);
|
|
|
|
/*
|
|
* Find the first non-pmd-aligned page, and point
|
|
* memblock_limit at it. This relies on rounding the
|
|
* limit down to be pmd-aligned, which happens at the
|
|
* end of this function.
|
|
*
|
|
* With this algorithm, the start or end of almost any
|
|
* bank can be non-pmd-aligned. The only exception is
|
|
* that the start of the bank 0 must be section-
|
|
* aligned, since otherwise memory would need to be
|
|
* allocated when mapping the start of bank 0, which
|
|
* occurs before any free memory is mapped.
|
|
*/
|
|
if (!memblock_limit) {
|
|
if (!IS_ALIGNED(block_start, PMD_SIZE))
|
|
memblock_limit = block_start;
|
|
else if (!IS_ALIGNED(block_end, PMD_SIZE))
|
|
memblock_limit = lowmem_limit;
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
arm_lowmem_limit = lowmem_limit;
|
|
|
|
high_memory = __va(arm_lowmem_limit - 1) + 1;
|
|
|
|
if (!memblock_limit)
|
|
memblock_limit = arm_lowmem_limit;
|
|
|
|
/*
|
|
* Round the memblock limit down to a pmd size. This
|
|
* helps to ensure that we will allocate memory from the
|
|
* last full pmd, which should be mapped.
|
|
*/
|
|
memblock_limit = round_down(memblock_limit, PMD_SIZE);
|
|
|
|
if (!IS_ENABLED(CONFIG_HIGHMEM) || cache_is_vipt_aliasing()) {
|
|
if (memblock_end_of_DRAM() > arm_lowmem_limit) {
|
|
phys_addr_t end = memblock_end_of_DRAM();
|
|
|
|
pr_notice("Ignoring RAM at %pa-%pa\n",
|
|
&memblock_limit, &end);
|
|
pr_notice("Consider using a HIGHMEM enabled kernel.\n");
|
|
|
|
memblock_remove(memblock_limit, end - memblock_limit);
|
|
}
|
|
}
|
|
|
|
memblock_set_current_limit(memblock_limit);
|
|
}
|
|
|
|
static inline void prepare_page_table(void)
|
|
{
|
|
unsigned long addr;
|
|
phys_addr_t end;
|
|
|
|
/*
|
|
* Clear out all the mappings below the kernel image.
|
|
*/
|
|
for (addr = 0; addr < MODULES_VADDR; addr += PMD_SIZE)
|
|
pmd_clear(pmd_off_k(addr));
|
|
|
|
#ifdef CONFIG_XIP_KERNEL
|
|
/* The XIP kernel is mapped in the module area -- skip over it */
|
|
addr = ((unsigned long)_exiprom + PMD_SIZE - 1) & PMD_MASK;
|
|
#endif
|
|
for ( ; addr < PAGE_OFFSET; addr += PMD_SIZE)
|
|
pmd_clear(pmd_off_k(addr));
|
|
|
|
/*
|
|
* Find the end of the first block of lowmem.
|
|
*/
|
|
end = memblock.memory.regions[0].base + memblock.memory.regions[0].size;
|
|
if (end >= arm_lowmem_limit)
|
|
end = arm_lowmem_limit;
|
|
|
|
/*
|
|
* Clear out all the kernel space mappings, except for the first
|
|
* memory bank, up to the vmalloc region.
|
|
*/
|
|
for (addr = __phys_to_virt(end);
|
|
addr < VMALLOC_START; addr += PMD_SIZE)
|
|
pmd_clear(pmd_off_k(addr));
|
|
}
|
|
|
|
#ifdef CONFIG_ARM_LPAE
|
|
/* the first page is reserved for pgd */
|
|
#define SWAPPER_PG_DIR_SIZE (PAGE_SIZE + \
|
|
PTRS_PER_PGD * PTRS_PER_PMD * sizeof(pmd_t))
|
|
#else
|
|
#define SWAPPER_PG_DIR_SIZE (PTRS_PER_PGD * sizeof(pgd_t))
|
|
#endif
|
|
|
|
/*
|
|
* Reserve the special regions of memory
|
|
*/
|
|
void __init arm_mm_memblock_reserve(void)
|
|
{
|
|
/*
|
|
* Reserve the page tables. These are already in use,
|
|
* and can only be in node 0.
|
|
*/
|
|
memblock_reserve(__pa(swapper_pg_dir), SWAPPER_PG_DIR_SIZE);
|
|
|
|
#ifdef CONFIG_SA1111
|
|
/*
|
|
* Because of the SA1111 DMA bug, we want to preserve our
|
|
* precious DMA-able memory...
|
|
*/
|
|
memblock_reserve(PHYS_OFFSET, __pa(swapper_pg_dir) - PHYS_OFFSET);
|
|
#endif
|
|
}
|
|
|
|
/*
|
|
* Set up the device mappings. Since we clear out the page tables for all
|
|
* mappings above VMALLOC_START, except early fixmap, we might remove debug
|
|
* device mappings. This means earlycon can be used to debug this function
|
|
* Any other function or debugging method which may touch any device _will_
|
|
* crash the kernel.
|
|
*/
|
|
static void __init devicemaps_init(const struct machine_desc *mdesc)
|
|
{
|
|
struct map_desc map;
|
|
unsigned long addr;
|
|
void *vectors;
|
|
|
|
/*
|
|
* Allocate the vector page early.
|
|
*/
|
|
vectors = early_alloc(PAGE_SIZE * 2);
|
|
|
|
early_trap_init(vectors);
|
|
|
|
/*
|
|
* Clear page table except top pmd used by early fixmaps
|
|
*/
|
|
for (addr = VMALLOC_START; addr < (FIXADDR_TOP & PMD_MASK); addr += PMD_SIZE)
|
|
pmd_clear(pmd_off_k(addr));
|
|
|
|
if (__atags_pointer) {
|
|
/* create a read-only mapping of the device tree */
|
|
map.pfn = __phys_to_pfn(__atags_pointer & SECTION_MASK);
|
|
map.virtual = FDT_FIXED_BASE;
|
|
map.length = FDT_FIXED_SIZE;
|
|
map.type = MT_ROM;
|
|
create_mapping(&map);
|
|
}
|
|
|
|
/*
|
|
* Map the kernel if it is XIP.
|
|
* It is always first in the modulearea.
|
|
*/
|
|
#ifdef CONFIG_XIP_KERNEL
|
|
map.pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & SECTION_MASK);
|
|
map.virtual = MODULES_VADDR;
|
|
map.length = ((unsigned long)_exiprom - map.virtual + ~SECTION_MASK) & SECTION_MASK;
|
|
map.type = MT_ROM;
|
|
create_mapping(&map);
|
|
#endif
|
|
|
|
/*
|
|
* Map the cache flushing regions.
|
|
*/
|
|
#ifdef FLUSH_BASE
|
|
map.pfn = __phys_to_pfn(FLUSH_BASE_PHYS);
|
|
map.virtual = FLUSH_BASE;
|
|
map.length = SZ_1M;
|
|
map.type = MT_CACHECLEAN;
|
|
create_mapping(&map);
|
|
#endif
|
|
#ifdef FLUSH_BASE_MINICACHE
|
|
map.pfn = __phys_to_pfn(FLUSH_BASE_PHYS + SZ_1M);
|
|
map.virtual = FLUSH_BASE_MINICACHE;
|
|
map.length = SZ_1M;
|
|
map.type = MT_MINICLEAN;
|
|
create_mapping(&map);
|
|
#endif
|
|
|
|
/*
|
|
* Create a mapping for the machine vectors at the high-vectors
|
|
* location (0xffff0000). If we aren't using high-vectors, also
|
|
* create a mapping at the low-vectors virtual address.
|
|
*/
|
|
map.pfn = __phys_to_pfn(virt_to_phys(vectors));
|
|
map.virtual = 0xffff0000;
|
|
map.length = PAGE_SIZE;
|
|
#ifdef CONFIG_KUSER_HELPERS
|
|
map.type = MT_HIGH_VECTORS;
|
|
#else
|
|
map.type = MT_LOW_VECTORS;
|
|
#endif
|
|
create_mapping(&map);
|
|
|
|
if (!vectors_high()) {
|
|
map.virtual = 0;
|
|
map.length = PAGE_SIZE * 2;
|
|
map.type = MT_LOW_VECTORS;
|
|
create_mapping(&map);
|
|
}
|
|
|
|
/* Now create a kernel read-only mapping */
|
|
map.pfn += 1;
|
|
map.virtual = 0xffff0000 + PAGE_SIZE;
|
|
map.length = PAGE_SIZE;
|
|
map.type = MT_LOW_VECTORS;
|
|
create_mapping(&map);
|
|
|
|
/*
|
|
* Ask the machine support to map in the statically mapped devices.
|
|
*/
|
|
if (mdesc->map_io)
|
|
mdesc->map_io();
|
|
else
|
|
debug_ll_io_init();
|
|
fill_pmd_gaps();
|
|
|
|
/* Reserve fixed i/o space in VMALLOC region */
|
|
pci_reserve_io();
|
|
|
|
/*
|
|
* Finally flush the caches and tlb to ensure that we're in a
|
|
* consistent state wrt the writebuffer. This also ensures that
|
|
* any write-allocated cache lines in the vector page are written
|
|
* back. After this point, we can start to touch devices again.
|
|
*/
|
|
local_flush_tlb_all();
|
|
flush_cache_all();
|
|
|
|
/* Enable asynchronous aborts */
|
|
early_abt_enable();
|
|
}
|
|
|
|
static void __init kmap_init(void)
|
|
{
|
|
#ifdef CONFIG_HIGHMEM
|
|
pkmap_page_table = early_pte_alloc(pmd_off_k(PKMAP_BASE),
|
|
PKMAP_BASE, _PAGE_KERNEL_TABLE);
|
|
#endif
|
|
|
|
early_pte_alloc(pmd_off_k(FIXADDR_START), FIXADDR_START,
|
|
_PAGE_KERNEL_TABLE);
|
|
}
|
|
|
|
static void __init map_lowmem(void)
|
|
{
|
|
phys_addr_t kernel_x_start = round_down(__pa(KERNEL_START), SECTION_SIZE);
|
|
phys_addr_t kernel_x_end = round_up(__pa(__init_end), SECTION_SIZE);
|
|
phys_addr_t start, end;
|
|
u64 i;
|
|
|
|
/* Map all the lowmem memory banks. */
|
|
for_each_mem_range(i, &start, &end) {
|
|
struct map_desc map;
|
|
|
|
if (end > arm_lowmem_limit)
|
|
end = arm_lowmem_limit;
|
|
if (start >= end)
|
|
break;
|
|
|
|
if (end < kernel_x_start) {
|
|
map.pfn = __phys_to_pfn(start);
|
|
map.virtual = __phys_to_virt(start);
|
|
map.length = end - start;
|
|
map.type = MT_MEMORY_RWX;
|
|
|
|
create_mapping(&map);
|
|
} else if (start >= kernel_x_end) {
|
|
map.pfn = __phys_to_pfn(start);
|
|
map.virtual = __phys_to_virt(start);
|
|
map.length = end - start;
|
|
map.type = MT_MEMORY_RW;
|
|
|
|
create_mapping(&map);
|
|
} else {
|
|
/* This better cover the entire kernel */
|
|
if (start < kernel_x_start) {
|
|
map.pfn = __phys_to_pfn(start);
|
|
map.virtual = __phys_to_virt(start);
|
|
map.length = kernel_x_start - start;
|
|
map.type = MT_MEMORY_RW;
|
|
|
|
create_mapping(&map);
|
|
}
|
|
|
|
map.pfn = __phys_to_pfn(kernel_x_start);
|
|
map.virtual = __phys_to_virt(kernel_x_start);
|
|
map.length = kernel_x_end - kernel_x_start;
|
|
map.type = MT_MEMORY_RWX;
|
|
|
|
create_mapping(&map);
|
|
|
|
if (kernel_x_end < end) {
|
|
map.pfn = __phys_to_pfn(kernel_x_end);
|
|
map.virtual = __phys_to_virt(kernel_x_end);
|
|
map.length = end - kernel_x_end;
|
|
map.type = MT_MEMORY_RW;
|
|
|
|
create_mapping(&map);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#ifdef CONFIG_ARM_PV_FIXUP
|
|
typedef void pgtables_remap(long long offset, unsigned long pgd);
|
|
pgtables_remap lpae_pgtables_remap_asm;
|
|
|
|
/*
|
|
* early_paging_init() recreates boot time page table setup, allowing machines
|
|
* to switch over to a high (>4G) address space on LPAE systems
|
|
*/
|
|
static void __init early_paging_init(const struct machine_desc *mdesc)
|
|
{
|
|
pgtables_remap *lpae_pgtables_remap;
|
|
unsigned long pa_pgd;
|
|
unsigned int cr, ttbcr;
|
|
long long offset;
|
|
|
|
if (!mdesc->pv_fixup)
|
|
return;
|
|
|
|
offset = mdesc->pv_fixup();
|
|
if (offset == 0)
|
|
return;
|
|
|
|
/*
|
|
* Get the address of the remap function in the 1:1 identity
|
|
* mapping setup by the early page table assembly code. We
|
|
* must get this prior to the pv update. The following barrier
|
|
* ensures that this is complete before we fixup any P:V offsets.
|
|
*/
|
|
lpae_pgtables_remap = (pgtables_remap *)(unsigned long)__pa(lpae_pgtables_remap_asm);
|
|
pa_pgd = __pa(swapper_pg_dir);
|
|
barrier();
|
|
|
|
pr_info("Switching physical address space to 0x%08llx\n",
|
|
(u64)PHYS_OFFSET + offset);
|
|
|
|
/* Re-set the phys pfn offset, and the pv offset */
|
|
__pv_offset += offset;
|
|
__pv_phys_pfn_offset += PFN_DOWN(offset);
|
|
|
|
/* Run the patch stub to update the constants */
|
|
fixup_pv_table(&__pv_table_begin,
|
|
(&__pv_table_end - &__pv_table_begin) << 2);
|
|
|
|
/*
|
|
* We changing not only the virtual to physical mapping, but also
|
|
* the physical addresses used to access memory. We need to flush
|
|
* all levels of cache in the system with caching disabled to
|
|
* ensure that all data is written back, and nothing is prefetched
|
|
* into the caches. We also need to prevent the TLB walkers
|
|
* allocating into the caches too. Note that this is ARMv7 LPAE
|
|
* specific.
|
|
*/
|
|
cr = get_cr();
|
|
set_cr(cr & ~(CR_I | CR_C));
|
|
asm("mrc p15, 0, %0, c2, c0, 2" : "=r" (ttbcr));
|
|
asm volatile("mcr p15, 0, %0, c2, c0, 2"
|
|
: : "r" (ttbcr & ~(3 << 8 | 3 << 10)));
|
|
flush_cache_all();
|
|
|
|
/*
|
|
* Fixup the page tables - this must be in the idmap region as
|
|
* we need to disable the MMU to do this safely, and hence it
|
|
* needs to be assembly. It's fairly simple, as we're using the
|
|
* temporary tables setup by the initial assembly code.
|
|
*/
|
|
lpae_pgtables_remap(offset, pa_pgd);
|
|
|
|
/* Re-enable the caches and cacheable TLB walks */
|
|
asm volatile("mcr p15, 0, %0, c2, c0, 2" : : "r" (ttbcr));
|
|
set_cr(cr);
|
|
}
|
|
|
|
#else
|
|
|
|
static void __init early_paging_init(const struct machine_desc *mdesc)
|
|
{
|
|
long long offset;
|
|
|
|
if (!mdesc->pv_fixup)
|
|
return;
|
|
|
|
offset = mdesc->pv_fixup();
|
|
if (offset == 0)
|
|
return;
|
|
|
|
pr_crit("Physical address space modification is only to support Keystone2.\n");
|
|
pr_crit("Please enable ARM_LPAE and ARM_PATCH_PHYS_VIRT support to use this\n");
|
|
pr_crit("feature. Your kernel may crash now, have a good day.\n");
|
|
add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK);
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_FORCE_PAGES
|
|
/*
|
|
* remap a PMD into pages
|
|
* We split a single pmd here none of this two pmd nonsense
|
|
*/
|
|
static noinline void __init split_pmd(pmd_t *pmd, unsigned long addr,
|
|
unsigned long end, unsigned long pfn,
|
|
const struct mem_type *type)
|
|
{
|
|
pte_t *pte, *start_pte;
|
|
pmd_t *base_pmd;
|
|
|
|
base_pmd = pmd_offset(
|
|
pud_offset(pgd_offset(&init_mm, addr), addr), addr);
|
|
|
|
if (pmd_none(*base_pmd) || pmd_bad(*base_pmd)) {
|
|
start_pte = early_alloc(PTE_HWTABLE_OFF + PTE_HWTABLE_SIZE);
|
|
#ifndef CONFIG_ARM_LPAE
|
|
/*
|
|
* Following is needed when new pte is allocated for pmd[1]
|
|
* cases, which may happen when base (start) address falls
|
|
* under pmd[1].
|
|
*/
|
|
if (addr & SECTION_SIZE)
|
|
start_pte += pte_index(addr);
|
|
#endif
|
|
} else {
|
|
start_pte = pte_offset_kernel(base_pmd, addr);
|
|
}
|
|
|
|
pte = start_pte;
|
|
|
|
do {
|
|
set_pte_ext(pte, pfn_pte(pfn, type->prot_pte), 0);
|
|
pfn++;
|
|
} while (pte++, addr += PAGE_SIZE, addr != end);
|
|
|
|
*pmd = __pmd((__pa(start_pte) + PTE_HWTABLE_OFF) | type->prot_l1);
|
|
mb(); /* let pmd be programmed */
|
|
flush_pmd_entry(pmd);
|
|
flush_tlb_all();
|
|
}
|
|
|
|
/*
|
|
* It's significantly easier to remap as pages later after all memory is
|
|
* mapped. Everything is sections so all we have to do is split
|
|
*/
|
|
static void __init remap_pages(void)
|
|
{
|
|
struct memblock_region *reg;
|
|
|
|
for_each_memblock(memory, reg) {
|
|
phys_addr_t phys_start = reg->base;
|
|
phys_addr_t phys_end = reg->base + reg->size;
|
|
unsigned long addr = (unsigned long)__va(phys_start);
|
|
unsigned long end = (unsigned long)__va(phys_end);
|
|
pmd_t *pmd = NULL;
|
|
unsigned long next;
|
|
unsigned long pfn = __phys_to_pfn(phys_start);
|
|
bool fixup = false;
|
|
unsigned long saved_start = addr;
|
|
|
|
if (phys_start > arm_lowmem_limit)
|
|
break;
|
|
if (phys_end > arm_lowmem_limit)
|
|
end = (unsigned long)__va(arm_lowmem_limit);
|
|
if (phys_start >= phys_end)
|
|
break;
|
|
|
|
pmd = pmd_offset(
|
|
pud_offset(pgd_offset(&init_mm, addr), addr), addr);
|
|
|
|
#ifndef CONFIG_ARM_LPAE
|
|
if (addr & SECTION_SIZE) {
|
|
fixup = true;
|
|
pmd_empty_section_gap((addr - SECTION_SIZE) & PMD_MASK);
|
|
pmd++;
|
|
}
|
|
|
|
if (end & SECTION_SIZE)
|
|
pmd_empty_section_gap(end);
|
|
#endif
|
|
|
|
do {
|
|
next = addr + SECTION_SIZE;
|
|
|
|
if (pmd_none(*pmd) || pmd_bad(*pmd))
|
|
split_pmd(pmd, addr, next, pfn,
|
|
&mem_types[MT_MEMORY_RWX]);
|
|
pmd++;
|
|
pfn += SECTION_SIZE >> PAGE_SHIFT;
|
|
|
|
} while (addr = next, addr < end);
|
|
|
|
if (fixup) {
|
|
/*
|
|
* Put a faulting page table here to avoid detecting no
|
|
* pmd when accessing an odd section boundary. This
|
|
* needs to be faulting to help catch errors and avoid
|
|
* speculation
|
|
*/
|
|
pmd = pmd_off_k(saved_start);
|
|
pmd[0] = pmd[1] & ~1;
|
|
}
|
|
}
|
|
}
|
|
#else
|
|
static void __init remap_pages(void)
|
|
{
|
|
|
|
}
|
|
#endif
|
|
|
|
static void __init early_fixmap_shutdown(void)
|
|
{
|
|
int i;
|
|
unsigned long va = fix_to_virt(__end_of_permanent_fixed_addresses - 1);
|
|
|
|
pte_offset_fixmap = pte_offset_late_fixmap;
|
|
pmd_clear(fixmap_pmd(va));
|
|
local_flush_tlb_kernel_page(va);
|
|
|
|
for (i = 0; i < __end_of_permanent_fixed_addresses; i++) {
|
|
pte_t *pte;
|
|
struct map_desc map;
|
|
|
|
map.virtual = fix_to_virt(i);
|
|
pte = pte_offset_early_fixmap(pmd_off_k(map.virtual), map.virtual);
|
|
|
|
/* Only i/o device mappings are supported ATM */
|
|
if (pte_none(*pte) ||
|
|
(pte_val(*pte) & L_PTE_MT_MASK) != L_PTE_MT_DEV_SHARED)
|
|
continue;
|
|
|
|
map.pfn = pte_pfn(*pte);
|
|
map.type = MT_DEVICE;
|
|
map.length = PAGE_SIZE;
|
|
|
|
create_mapping(&map);
|
|
}
|
|
}
|
|
|
|
/*
|
|
* paging_init() sets up the page tables, initialises the zone memory
|
|
* maps, and sets up the zero page, bad page and bad page tables.
|
|
*/
|
|
void __init paging_init(const struct machine_desc *mdesc)
|
|
{
|
|
void *zero_page;
|
|
|
|
prepare_page_table();
|
|
map_lowmem();
|
|
memblock_set_current_limit(arm_lowmem_limit);
|
|
dma_contiguous_remap();
|
|
early_fixmap_shutdown();
|
|
remap_pages();
|
|
devicemaps_init(mdesc);
|
|
kmap_init();
|
|
tcm_init();
|
|
|
|
top_pmd = pmd_off_k(0xffff0000);
|
|
|
|
/* allocate the zero page. */
|
|
zero_page = early_alloc(PAGE_SIZE);
|
|
|
|
bootmem_init();
|
|
|
|
empty_zero_page = virt_to_page(zero_page);
|
|
__flush_dcache_page(NULL, empty_zero_page);
|
|
}
|
|
|
|
void __init early_mm_init(const struct machine_desc *mdesc)
|
|
{
|
|
build_mem_type_table();
|
|
early_paging_init(mdesc);
|
|
}
|
|
|
|
void set_pte_at(struct mm_struct *mm, unsigned long addr,
|
|
pte_t *ptep, pte_t pteval)
|
|
{
|
|
unsigned long ext = 0;
|
|
|
|
if (addr < TASK_SIZE && pte_valid_user(pteval)) {
|
|
if (!pte_special(pteval))
|
|
__sync_icache_dcache(pteval);
|
|
ext |= PTE_EXT_NG;
|
|
}
|
|
|
|
set_pte_ext(ptep, pteval, ext);
|
|
}
|