aboutsummaryrefslogtreecommitdiff
path: root/arch/arm64
AgeCommit message (Collapse)AuthorFilesLines
2022-11-11KVM: arm64: Add per-cpu fixmap infrastructure at EL2Quentin Perret7-13/+128
Mapping pages in a guest page-table from within the pKVM hypervisor at EL2 may require cache maintenance to ensure that the initialised page contents is visible even to non-cacheable (e.g. MMU-off) accesses from the guest. In preparation for performing this maintenance at EL2, introduce a per-vCPU fixmap which allows the pKVM hypervisor to map guest pages temporarily into its stage-1 page-table for the purposes of cache maintenance and, in future, poisoning on the reclaim path. The use of a fixmap avoids the need for memory allocation or locking on the map() path. Tested-by: Vincent Donnefort <[email protected]> Signed-off-by: Quentin Perret <[email protected]> Co-developed-by: Will Deacon <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-11KVM: arm64: Instantiate pKVM hypervisor VM and vCPU structures from EL1Fuad Tabba6-6/+182
With the pKVM hypervisor at EL2 now offering hypercalls to the host for creating and destroying VM and vCPU structures, plumb these in to the existing arm64 KVM backend to ensure that the hypervisor data structures are allocated and initialised on first vCPU run for a pKVM guest. In the host, 'struct kvm_protected_vm' is introduced to hold the handle of the pKVM VM instance as well as to track references to the memory donated to the hypervisor so that it can be freed back to the host allocator following VM teardown. The stage-2 page-table, hypervisor VM and vCPU structures are allocated separately so as to avoid the need for a large physically-contiguous allocation in the host at run-time. Tested-by: Vincent Donnefort <[email protected]> Signed-off-by: Fuad Tabba <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-11KVM: arm64: Add infrastructure to create and track pKVM instances at EL2Fuad Tabba12-0/+531
Introduce a global table (and lock) to track pKVM instances at EL2, and provide hypercalls that can be used by the untrusted host to create and destroy pKVM VMs and their vCPUs. pKVM VM/vCPU state is directly accessible only by the trusted hypervisor (EL2). Each pKVM VM is directly associated with an untrusted host KVM instance, and is referenced by the host using an opaque handle. Future patches will provide hypercalls to allow the host to initialize/set/get pKVM VM/vCPU state using the opaque handle. Tested-by: Vincent Donnefort <[email protected]> Signed-off-by: Fuad Tabba <[email protected]> Co-developed-by: Will Deacon <[email protected]> Signed-off-by: Will Deacon <[email protected]> [maz: silence warning on unmap_donated_memory_noclear()] Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-11KVM: arm64: Rename 'host_kvm' to 'host_mmu'Will Deacon2-26/+26
In preparation for introducing VM and vCPU state at EL2, rename the existing 'struct host_kvm' and its singleton 'host_kvm' instance to 'host_mmu' so as to avoid confusion between the structure tracking the host stage-2 MMU state and the host instance of a 'struct kvm' for a protected guest. Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Tested-by: Vincent Donnefort <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-11KVM: arm64: Add hyp_spinlock_t static initializerFuad Tabba1-1/+9
Introduce a static initializer macro for 'hyp_spinlock_t' so that it is straightforward to instantiate global locks at EL2. This will be later utilised for locking the VM table in the hypervisor. Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Tested-by: Vincent Donnefort <[email protected]> Signed-off-by: Fuad Tabba <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-11KVM: arm64: Include asm/kvm_mmu.h in nvhe/mem_protect.hWill Deacon1-0/+1
nvhe/mem_protect.h refers to __load_stage2() in the definition of __load_host_stage2() but doesn't include the relevant header. Include asm/kvm_mmu.h in nvhe/mem_protect.h so that users of the latter don't have to do this themselves. Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Tested-by: Vincent Donnefort <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-11KVM: arm64: Add helpers to pin memory shared with the hypervisor at EL2Quentin Perret3-1/+57
Add helpers allowing the hypervisor to check whether a range of pages are currently shared by the host, and 'pin' them if so by blocking host unshare operations until the memory has been unpinned. This will allow the hypervisor to take references on host-provided data-structures (e.g. 'struct kvm') with the guarantee that these pages will remain in a stable state until the hypervisor decides to release them, for example during guest teardown. Tested-by: Vincent Donnefort <[email protected]> Signed-off-by: Quentin Perret <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-11KVM: arm64: Prevent the donation of no-map pagesQuentin Perret1-6/+16
Memory regions marked as "no-map" in the host device-tree routinely include TrustZone carev-outs and DMA pools. Although donating such pages to the hypervisor may not breach confidentiality, it could be used to corrupt its state in uncontrollable ways. To prevent this, let's block host-initiated memory transitions targeting "no-map" pages altogether in nVHE protected mode as there should be no valid reason to do this in current operation. Thankfully, the pKVM EL2 hypervisor has a full copy of the host's list of memblock regions, so we can easily check for the presence of the MEMBLOCK_NOMAP flag on a region containing pages being donated from the host. Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Tested-by: Vincent Donnefort <[email protected]> Signed-off-by: Quentin Perret <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-11KVM: arm64: Implement do_donate() helper for donating memoryWill Deacon2-0/+241
Transferring ownership information of a memory region from one component to another can be achieved using a "donate" operation, which results in the previous owner losing access to the underlying pages entirely and the new owner having exclusive access to the page. Implement a do_donate() helper, along the same lines as do_{un,}share, and provide this functionality for the host-{to,from}-hyp cases as this will later be used to donate/reclaim memory pages to store VM metadata at EL2. In a similar manner to the sharing transitions, permission checks are performed by the hypervisor to ensure that the component initiating the transition really is the owner of the page and also that the completer does not currently have a page mapped at the target address. Tested-by: Vincent Donnefort <[email protected]> Co-developed-by: Quentin Perret <[email protected]> Signed-off-by: Quentin Perret <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-11KVM: arm64: Unify identifiers used to distinguish host and hypervisorWill Deacon3-10/+6
The 'pkvm_component_id' enum type provides constants to refer to the host and the hypervisor, yet this information is duplicated by the 'pkvm_hyp_id' constant. Remove the definition of 'pkvm_hyp_id' and move the 'pkvm_component_id' type definition to 'mem_protect.h' so that it can be used outside of the memory protection code, for example when initialising the owner for hypervisor-owned pages. Reviewed-by: Oliver Upton <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Tested-by: Vincent Donnefort <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-11KVM: arm64: Fix-up hyp stage-1 refcounts for all pages mapped at EL2Quentin Perret1-19/+43
In order to allow unmapping arbitrary memory pages from the hypervisor stage-1 page-table, fix-up the initial refcount for pages that have been mapped before the 'vmemmap' array was up and running so that it accurately accounts for all existing hypervisor mappings. This is achieved by traversing the entire hypervisor stage-1 page-table during initialisation of EL2 and updating the corresponding 'struct hyp_page' for each valid mapping. Reviewed-by: Oliver Upton <[email protected]> Tested-by: Vincent Donnefort <[email protected]> Signed-off-by: Quentin Perret <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-11KVM: arm64: Back the hypervisor 'struct hyp_page' array for all memoryQuentin Perret6-40/+60
The EL2 'vmemmap' array in nVHE Protected mode is currently very sparse: only memory pages owned by the hypervisor itself have a matching 'struct hyp_page'. However, as the size of this struct has been reduced significantly since its introduction, it appears that we can now afford to back the vmemmap for all of memory. Having an easily accessible 'struct hyp_page' for every physical page in memory provides the hypervisor with a simple mechanism to store metadata (e.g. a refcount) that wouldn't otherwise fit in the very limited number of software bits available in the host stage-2 page-table entries. This will be used in subsequent patches when pinning host memory pages for use by the hypervisor at EL2. Tested-by: Vincent Donnefort <[email protected]> Signed-off-by: Quentin Perret <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-11KVM: arm64: Allow attaching of non-coalescable pages to a hyp poolQuentin Perret1-0/+6
All the contiguous pages used to initialize a 'struct hyp_pool' are considered coalescable, which means that the hyp page allocator will actively try to merge them with their buddies on the hyp_put_page() path. However, using hyp_put_page() on a page that is not part of the inital memory range given to a hyp_pool() is currently unsupported. In order to allow dynamically extending hyp pools at run-time, add a check to __hyp_attach_page() to allow inserting 'external' pages into the free-list of order 0. This will be necessary to allow lazy donation of pages from the host to the hypervisor when allocating guest stage-2 page-table pages at EL2. Tested-by: Vincent Donnefort <[email protected]> Signed-off-by: Quentin Perret <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-11KVM: arm64: Move hyp refcount manipulation helpers to common header fileQuentin Perret2-19/+22
We will soon need to manipulate 'struct hyp_page' refcounts from outside page_alloc.c, so move the helpers to a common header file to allow them to be reused easily. Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Oliver Upton <[email protected]> Tested-by: Vincent Donnefort <[email protected]> Signed-off-by: Quentin Perret <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-11KVM: arm64: Fix typo in commentZhiyuan Dai1-1/+1
Fix typo in comment (nVHE/VHE). Signed-off-by: Zhiyuan Dai <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-11arm64: defconfig: Enable HTE configDipen Patel1-0/+3
Enable HTE core and tegra HTE provider by default as built in module. Signed-off-by: Dipen Patel <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2022-11-11crypto: move gf128mul library into lib/cryptoArd Biesheuvel1-1/+1
The gf128mul library does not depend on the crypto API at all, so it can be moved into lib/crypto. This will allow us to use it in other library code in a subsequent patch without having to depend on CONFIG_CRYPTO. While at it, change the Kconfig symbol name to align with other crypto library implementations. However, the source file name is retained, as it is reflected in the module .ko filename, and changing this might break things for users. Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2022-11-11arm64: dts: mt7986: add i2c nodeFrank Wunderlich1-0/+14
Add i2c Node to mt7986 devicetree. Signed-off-by: Frank Wunderlich <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Matthias Brugger <[email protected]>
2022-11-11arm64: dts: mt7986: add crypto related device nodesSam Shih3-0/+23
This patch adds crypto engine support for MT7986. Signed-off-by: Vic Wu <[email protected]> Signed-off-by: Sam Shih <[email protected]> Signed-off-by: Frank Wunderlich <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Matthias Brugger <[email protected]>
2022-11-11arm64: dts: mt7986: harmonize device node orderSam Shih2-58/+58
This arrange device tree nodes in alphabetical order. Signed-off-by: Sam Shih <[email protected]> Signed-off-by: Frank Wunderlich <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Matthias Brugger <[email protected]>
2022-11-11arm64: dts: mt8195: Add pcie and pcie phy nodesTinghan Shen1-0/+150
Add pcie and pcie phy nodes for mt8195. Signed-off-by: Jianjun Wang <[email protected]> Signed-off-by: Tinghan Shen <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Matthias Brugger <[email protected]>
2022-11-11arm64: defconfig: Enable missing configs for mt8183-jacuzzi-juniperNícolas F. R. A. Prado1-0/+18
Enable missing configs in the arm64 defconfig to get all devices probing on the mt8183-kukui-jacuzzi-juniper machine. The devices enabled are: ATH10K SDIO wireless adapter, Elan touchscreen, cr50 TPM, MediaTek SPI controller, JPEG video decoder, ANX7625 DSI/DPI to DP bridge (used for the internal display), MT8183 sound cards, SCP co-processor, MediaTek Global Command Engine (controlled by CMDQ driver), MediaTek Smart Voltage Scaling (SVS) engine, CCI frequency and voltage scaling, AUXADC thermal sensors. All symbols are enabled as modules with the exception of SPI, which is enabled as builtin since on some platforms like mt8195-cherry, the ChromeOS Embedded Controller is connected through SPI and it is responsible for the regulators powering the MMC controller used for the SD card, and thus SPI support is required for booting. By enabling the support for all of this machine's devices on the defconfig we make it effortless to test the relevant hardware both by developers as well as CI systems like KernelCI. Signed-off-by: Nícolas F. R. A. Prado <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Tested-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Matthias Brugger <[email protected]>
2022-11-11arm64: dts: mediatek: mt7986: add support for RX Wireless Ethernet DispatchLorenzo Bianconi1-0/+65
Similar to TX Wireless Ethernet Dispatch, introduce RX Wireless Ethernet Dispatch to offload traffic received by the wlan interface to lan/wan one. Co-developed-by: Sujuan Chen <[email protected]> Signed-off-by: Sujuan Chen <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-11-11arm64: dts: imx8m{m,n}-venice-gw7902: add gpio pins for new board revisionTim Harvey2-8/+12
Add gpio pins present on new board revision: * LTE modem support (imx8mm-gw7902 only) - lte_pwr# - lte_rst - lte_int * M2 power enable - m2_pwr_en * off-board 4.0V supply - vdd_4p0_en Signed-off-by: Tim Harvey <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: dts: imx93-pinfunc: drop execution permissionPeng Fan1-0/+0
Drop the header file execution permission Signed-off-by: Peng Fan <[email protected]> Fixes: ec8b5b5058ea ("arm64: dts: freescale: Add i.MX93 dtsi support") Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: dts: imx8mm: Remove watchdog always-enabled property from eDM SBCMarek Vasut1-1/+0
There is no such always-enabled property supported by gpio-watchdog driver or described in its bindings, remove it. Signed-off-by: Marek Vasut <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: dts: imx8mm: imx8mn: imx8mp: imx8mq: Replace opp-xM with opp-x000000Marek Vasut20-58/+58
Fix the following dtbs_check warning on all of i.MX8M variants: " opp-table: Unevaluated properties are not allowed ('opp-25M', 'opp-100M', 'opp-750M' were unexpected) " Using the following command: " $ sed -i '/opp-[0-9]\+M/ s@M {@000000 {@' arch/arm64/boot/dts/freescale/imx8m* " The Documentation/devicetree/bindings/opp/opp-v2-base.yaml expects the OPP subnode names to be full frequency listings in Hz without unit suffixes. Only the i.MX8M DTs are affected per "git grep 'opp-[0-9]\+M'", so fix them. Signed-off-by: Marek Vasut <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: dts: imx8mn: Fix NAND controller size-cellsMarek Vasut1-1/+1
The NAND controller size-cells should be 0 per DT bindings. Fix the following warning produces by DT bindings check: " nand-controller@33002000: #size-cells:0:0: 0 was expected nand-controller@33002000: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected) " Fixes: 6c3debcbae47a ("arm64: dts: freescale: Add i.MX8MN dtsi support") Signed-off-by: Marek Vasut <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: dts: imx8mm: Fix NAND controller size-cellsMarek Vasut1-2/+2
The NAND controller size-cells should be 0 per DT bindings. Fix the following warning produces by DT bindings check: " nand-controller@33002000: #size-cells:0:0: 0 was expected nand-controller@33002000: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected) " Fix the missing space in node name too. Fixes: a05ea40eb384e ("arm64: dts: imx: Add i.mx8mm dtsi support") Signed-off-by: Marek Vasut <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: dts: imx8mm-data-modul: Rename /watchdog-gpio to plain /watchdogMarek Vasut1-1/+1
The DT bindings checker is confused by the -gpio node suffix, drop it to fix the following warning: " imx8mm-data-modul-edm-sbc.dtb: /: watchdog-gpio: {'pinctrl-names': ['default'], 'pinctrl-0': [[104]], 'compatible': ['linux,wdt-gpio'], 'always-enabled': True, 'gpios': [[45, 8, 0]], 'hw_algo': ['level'], 'hw_margin_ms': [[1500]], 'status': ['disabled']} is not of type 'array' " Signed-off-by: Marek Vasut <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: dts: verdin-imx8mp: dahlia: mark usb_2 permanently attachedMarcel Ziswiler1-0/+1
As both Dahlia and the Verdin Development Board have on-carrier permanently attached USB hubs mark Verdin USB_2 as such. Signed-off-by: Marcel Ziswiler <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: dts: verdin-imx8mp: add gpio usb-b connectorMarcel Ziswiler1-6/+14
Add GPIO USB-B connector (gpio-usb-b-connector) functionality using Verdin USB_1_ID. Signed-off-by: Marcel Ziswiler <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: dts: verdin-imx8mp: disable usb port power controlMarcel Ziswiler1-0/+5
Disable port power control on Verdin USB_1/2 as we use regular fixed-regulators with Verdin USB_1/2_EN as enable GPIOs. Signed-off-by: Marcel Ziswiler <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: dts: verdin-imx8mp: add usb_1 over-current detectionMarcel Ziswiler1-2/+12
Add Verdin USB_1 over-current detection functionality via Verdin USB_1_OC# (SODIMM 157) being active-low and removing its previous gpio_hog3 mapping. Signed-off-by: Marcel Ziswiler <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: dts: verdin-imx8mp: remove usb_2 over-current detection disablingMarcel Ziswiler1-1/+0
The disable-over-current property is only applicable for the ci-hdrc-usb2 and dwc2 drivers while the i.MX 8M Plus integrates dwc3 IP. Therefore remove this property which does not really serve any purpose here. Signed-off-by: Marcel Ziswiler <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: dts: verdin-imx8mp: improve pinctrl for vbus-suppliesMarcel Ziswiler1-2/+2
As we are using two fixed regulators for Verdin USB_1_EN (SODIMM 155) and Verdin USB_2_EN (SODIMM 185), those should be muxed as GPIOs rather than OTG_PWR. Signed-off-by: Marcel Ziswiler <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: dts: imx8mm-tqma8mqml-mba8mx: Fix USB DRAlexander Stein1-6/+26
Using extcon USB host mode works properly on DR interface, e.g. enabling/disabling VBUS. But USB device mode is not working. Fix this by switching to usb-role-switch instead. Fixes: dfcd1b6f7620 ("arm64: dts: freescale: add initial device tree for TQMa8MQML with i.MX8MM") Signed-off-by: Alexander Stein <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: defconfig: Add Renesas 9-series PCIe clock generatorAlexander Stein1-0/+1
MBa8MPxL (with TQMa8MPQL attached) needs this driver for PCIe reference clock generation. Add it do default config. Signed-off-by: Alexander Stein <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: dts: mba8mpxl: Add PWM fan supportAlexander Stein1-0/+76
This adds the support for optional PWM fan 422J/2HP. Signed-off-by: Alexander Stein <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: dts: tqma8mpql: add PCIe supportAlexander Stein1-1/+41
Add PCIe support on TQMa8MPxL module on MBa8MPxL mainboard. Signed-off-by: Alexander Stein <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: dts: imx8mp: Bind bluetooth UART on DH electronics i.MX8M Plus DHCOMMarek Vasut1-6/+25
The i.MX8MP DHCOM SoM does contain muRata 2AE WiFi+BT chip, bind the bluetooth to UART2 using btbcm and hci_bcm drivers. Use PLL3 to drive UART2 clock divided down to 64 MHz to obtain suitable block clock for exact 4 Mbdps, which is the maximum supported baud rate by the muRata 2AE BT UART. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-11arm64: dts: imx8mm/n-evk: enable wakeup-source for usb phyLi Jun2-0/+8
Enable usb phy to be wakeup source to support system wakeup from usb. Signed-off-by: Li Jun <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-11-10Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netJakub Kicinski21-86/+198
drivers/net/can/pch_can.c ae64438be192 ("can: dev: fix skb drop check") 1dd1b521be85 ("can: remove obsolete PCH CAN driver") https://lore.kernel.org/all/[email protected]/ Signed-off-by: Jakub Kicinski <[email protected]>
2022-11-10arm64: efi: Fix handling of misaligned runtime regions and drop warningArd Biesheuvel1-18/+34
Currently, when mapping the EFI runtime regions in the EFI page tables, we complain about misaligned regions in a rather noisy way, using WARN(). Not only does this produce a lot of irrelevant clutter in the log, it is factually incorrect, as misaligned runtime regions are actually allowed by the EFI spec as long as they don't require conflicting memory types within the same 64k page. So let's drop the warning, and tweak the code so that we - take both the start and end of the region into account when checking for misalignment - only revert to RWX mappings for non-code regions if misaligned code regions are also known to exist. Cc: <[email protected]> Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]>
2022-11-10KVM: arm64: Fix PAR_TO_HPFAR() to work independently of PA_BITS.Ryan Roberts1-1/+5
Kernel configs with PAGE_SIZE=64KB and PA_BITS=48 still advertise 52 bit IPA space on HW that implements LPA. This is by design (admitedly this is a very unlikely configuration in the real world). However on such a config, attempting to create a vm with the guest kernel placed above 48 bits in IPA space results in misbehaviour due to the hypervisor incorrectly interpretting a faulting IPA. Fix up PAR_TO_HPFAR() to always take 52 bits out of the PAR rather than masking to CONFIG_ARM64_PA_BITS. If the system has a smaller implemented PARange this should be safe because the bits are res0. A more robust approach would be to discover the IPA size in use by the page-table and mask based on that, to avoid relying on res0 reading back as zero. But this information is difficult to access safely from the code's location, so take the easy way out. Fixes: bc1d7de8c550 ("kvm: arm64: Add 52bit support for PAR to HPFAR conversoin") Signed-off-by: Ryan Roberts <[email protected]> [maz: commit message fixes] Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-10KVM: arm64: Fix kvm init failure when mode!=vhe and VA_BITS=52.Ryan Roberts2-18/+30
For nvhe and protected modes, the hyp stage 1 page-tables were previously configured to have the same number of VA bits as the kernel's idmap. However, for kernel configs with VA_BITS=52 and where the kernel is loaded in physical memory below 48 bits, the idmap VA bits is actually smaller than the kernel's normal stage 1 VA bits. This can lead to kernel addresses that can't be mapped into the hypervisor, leading to kvm initialization failure during boot: kvm [1]: IPA Size Limit: 48 bits kvm [1]: Cannot map world-switch code kvm [1]: error initializing Hyp mode: -34 Fix this by ensuring that the hyp stage 1 VA size is the maximum of what's used for the idmap and the regular kernel stage 1. At the same time, refactor the code so that the hyp VA bits is only calculated in one place. Prior to 7ba8f2b2d652, the idmap was always 52 bits for a 52 VA bits kernel and therefore the hyp stage1 was also always 52 bits. Fixes: 7ba8f2b2d652 ("arm64: mm: use a 48-bit ID map when possible on 52-bit VA builds") Signed-off-by: Ryan Roberts <[email protected]> [maz: commit message fixes] Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-10arm64: dts: renesas: spider-cpu: Switch from SCIF3 to HSCIF0Wolfram Sang1-15/+15
Every loader before Linux utilizes HSCIF0 with a speed of 1843200 bps. Make Linux behave the same. Signed-off-by: Wolfram Sang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
2022-11-10KVM: arm64: Handle stage-2 faults in parallelOliver Upton4-28/+13
The stage-2 map walker has been made parallel-aware, and as such can be called while only holding the read side of the MMU lock. Rip out the conditional locking in user_mem_abort() and instead grab the read lock. Continue to take the write lock from other callsites to kvm_pgtable_stage2_map(). Signed-off-by: Oliver Upton <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-10KVM: arm64: Make table->block changes parallel-awareOliver Upton1-12/+3
stage2_map_walker_try_leaf() and friends now handle stage-2 PTEs generically, and perform the correct flush when a table PTE is removed. Additionally, they've been made parallel-aware, using an atomic break to take ownership of the PTE. Stop clearing the PTE in the pre-order callback and instead let stage2_map_walker_try_leaf() deal with it. Signed-off-by: Oliver Upton <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-10KVM: arm64: Make leaf->leaf PTE changes parallel-awareOliver Upton1-14/+12
Convert stage2_map_walker_try_leaf() to use the new break-before-make helpers, thereby making the handler parallel-aware. As before, avoid the break-before-make if recreating the existing mapping. Additionally, retry execution if another vCPU thread is modifying the same PTE. Signed-off-by: Oliver Upton <[email protected]> Reviewed-by: Ben Gardon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]