From patchwork Wed Mar 2 19:42:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Upton X-Patchwork-Id: 12766641 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 65FE4C433EF for ; Wed, 2 Mar 2022 19:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=kho7Wjb8W/9QLxhox7OBGrdO9FLksDpHjVtXTpJHEgo=; b=XPSjdCzB++H9V40X1Z9Gv5PCce 4lp5q79jAPbVEUJMB2evQQvGeHJf/WhieBli1jAkXzSlv7OBg/r/RYts+1+Dgu61b9MNun4FLFFLi D3HDcBhuvhjIEpHqsTzxhOoCDnsbkeQePWMYUvysxyHXSlBXYwtOLC6WmUXDgvmVjFih5qLGOPdUm UnN7oyl5gcidRPiEYPGs3mk0NLspCpGQgmfYP4Juzyx2L9d7t0AEmCuSX2cCTZPqrt1mYbihXUJqF eMYqJ7fl+Bhc+bTDHenRkis9p7QVIC+n55o3HuiNi+njtE/pA0J9nC2hs1M4T13bDBTUuGlHbYf0N lbvfIAzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPUs6-0040kp-GX; Wed, 02 Mar 2022 19:42:50 +0000 Received: from mail-io1-xd49.google.com ([2607:f8b0:4864:20::d49]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPUrk-0040eQ-28 for linux-arm-kernel@lists.infradead.org; Wed, 02 Mar 2022 19:42:30 +0000 Received: by mail-io1-xd49.google.com with SMTP id f9-20020a5ec709000000b00640c72b204eso1862593iop.22 for ; Wed, 02 Mar 2022 11:42:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=nuZe9ZhOuay90wUI9CO/j9ARq8u5vmZVCVvA+iWxxmE=; b=WhOfmlhODiH8EfJkCYzZDvh9S8MEzq3NEt5PIdnwe58jLGyDMLHtOkts1KC8XJ038o j/4t+g46z/BLc53Na19dx4lP27UIBdz5Heo3P32MaMQSCouLqYQfoqvXmoWdij7K9e2V bVA5mIAope1CdFCU74zsogpQvnu1nDAD+jhsGevtsQMG1/i7xGOcJV3d6SOpOJH2l8sT o72QODfkdzmX+EQ/iCxRrEonxc0bUAPfWVY55V6TkIVC9obMPa9BEqNB3PfM/7+MgVoD /ZOdp8I+q+7NEpGG5srirZMRiZGcgX+P6j+1Nu+hv1jOA8gioOML6979XqQktx9v1pXY HiWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=nuZe9ZhOuay90wUI9CO/j9ARq8u5vmZVCVvA+iWxxmE=; b=Y4vDWRhNrAY5qUSVEZN45E7NfepMPyGkniMOwvIG9BPaa1CaS33ljXsFnOrY7SkqLY zAtwYf7Mu7EWT5iKx7KzWjU3VUZgSVykMItunXi10Rm8db+mF/liM+vmvZPga7hrxFEx IN8pJ6JkaGMZT0it1wKuIsem6CKZfbrRUoLRt03RRYMDx2Rg52f23mCkLLZMYY2EbiMF g+OHuo6fOUvLVEAG1DDkUrL5x9HzgcLj0WQjUAHLtZzhO0wkq0AHe5SNMkKg/cSz9Ciw J9ZzDNAJiNtU2DshrlEVCGu9q/IEAvFPXQt8PeF0nozTrgmPSZm0SrggvMaUCinLWEJY DTfw== X-Gm-Message-State: AOAM533otuXT3Vzb2ysFx2JUGokHosS965OVIZEBeWUOvkV//Zbps5mB ybVQc6oDUhVBWoem3n4Bwnmrv1rqN6E= X-Google-Smtp-Source: ABdhPJyk1rwN1bkv1E5VJ6CQ34W9eUiJzPPN/6foQ8rJCLe/p51ymVvi545lXjtIZn4D0kgCWY1tf6aFd6Y= X-Received: from oupton.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:404]) (user=oupton job=sendgmr) by 2002:a92:ce10:0:b0:2c2:8829:bd1f with SMTP id b16-20020a92ce10000000b002c28829bd1fmr27685914ilo.37.1646250146231; Wed, 02 Mar 2022 11:42:26 -0800 (PST) Date: Wed, 2 Mar 2022 19:42:20 +0000 In-Reply-To: <20220302194221.1774513-1-oupton@google.com> Message-Id: <20220302194221.1774513-2-oupton@google.com> Mime-Version: 1.0 References: <20220302194221.1774513-1-oupton@google.com> X-Mailer: git-send-email 2.35.1.574.g5d30c73bfb-goog Subject: [PATCH 1/2] Documentation: KVM: Update documentation to indicate KVM is arm64-only From: Oliver Upton To: kvmarm@lists.cs.columbia.edu Cc: kvm@vger.kernel.org, Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, Peter Shier , Ricardo Koller , Reiji Watanabe , Paolo Bonzini , Oliver Upton X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220302_114228_148682_BBF1CE38 X-CRM114-Status: GOOD ( 30.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org KVM support for 32-bit ARM hosts (KVM/arm) has been removed from the kernel since commit 541ad0150ca4 ("arm: Remove 32bit KVM host support"). There still exists some remnants of the old architecture in the KVM documentation. Remove all traces of 32-bit host support from the documentation. Note that AArch32 guests are still supported. Fixes: 541ad0150ca4 ("arm: Remove 32bit KVM host support") Suggested-by: Marc Zyngier Signed-off-by: Oliver Upton --- Documentation/virt/kvm/api.rst | 83 ++++++++++++------------- Documentation/virt/kvm/arm/hyp-abi.rst | 54 ++++++++-------- Documentation/virt/kvm/arm/ptp_kvm.rst | 4 +- Documentation/virt/kvm/devices/vcpu.rst | 2 +- 4 files changed, 70 insertions(+), 73 deletions(-) diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst index 9f3172376ec3..25423ee890e2 100644 --- a/Documentation/virt/kvm/api.rst +++ b/Documentation/virt/kvm/api.rst @@ -417,7 +417,7 @@ kvm_run' (see below). ----------------- :Capability: basic -:Architectures: all except ARM, arm64 +:Architectures: all except arm64 :Type: vcpu ioctl :Parameters: struct kvm_regs (out) :Returns: 0 on success, -1 on error @@ -450,7 +450,7 @@ Reads the general purpose registers from the vcpu. ----------------- :Capability: basic -:Architectures: all except ARM, arm64 +:Architectures: all except arm64 :Type: vcpu ioctl :Parameters: struct kvm_regs (in) :Returns: 0 on success, -1 on error @@ -824,7 +824,7 @@ Writes the floating point state to the vcpu. ----------------------- :Capability: KVM_CAP_IRQCHIP, KVM_CAP_S390_IRQCHIP (s390) -:Architectures: x86, ARM, arm64, s390 +:Architectures: x86, arm64, s390 :Type: vm ioctl :Parameters: none :Returns: 0 on success, -1 on error @@ -833,7 +833,7 @@ Creates an interrupt controller model in the kernel. On x86, creates a virtual ioapic, a virtual PIC (two PICs, nested), and sets up future vcpus to have a local APIC. IRQ routing for GSIs 0-15 is set to both PIC and IOAPIC; GSI 16-23 only go to the IOAPIC. -On ARM/arm64, a GICv2 is created. Any other GIC versions require the usage of +On arm64, a GICv2 is created. Any other GIC versions require the usage of KVM_CREATE_DEVICE, which also supports creating a GICv2. Using KVM_CREATE_DEVICE is preferred over KVM_CREATE_IRQCHIP for GICv2. On s390, a dummy irq routing table is created. @@ -846,7 +846,7 @@ before KVM_CREATE_IRQCHIP can be used. ----------------- :Capability: KVM_CAP_IRQCHIP -:Architectures: x86, arm, arm64 +:Architectures: x86, arm64 :Type: vm ioctl :Parameters: struct kvm_irq_level :Returns: 0 on success, -1 on error @@ -870,7 +870,7 @@ capability is present (or unless it is not using the in-kernel irqchip, of course). -ARM/arm64 can signal an interrupt either at the CPU level, or at the +arm64 can signal an interrupt either at the CPU level, or at the in-kernel irqchip (GIC), and for in-kernel irqchip can tell the GIC to use PPIs designated for specific cpus. The irq field is interpreted like this:: @@ -896,7 +896,7 @@ When KVM_CAP_ARM_IRQ_LINE_LAYOUT_2 is supported, the target vcpu is identified as (256 * vcpu2_index + vcpu_index). Otherwise, vcpu2_index must be zero. -Note that on arm/arm64, the KVM_CAP_IRQCHIP capability only conditions +Note that on arm64, the KVM_CAP_IRQCHIP capability only conditions injection of interrupts for the in-kernel irqchip. KVM_IRQ_LINE can always be used for a userspace interrupt controller. @@ -1087,7 +1087,7 @@ Other flags returned by ``KVM_GET_CLOCK`` are accepted but ignored. :Capability: KVM_CAP_VCPU_EVENTS :Extended by: KVM_CAP_INTR_SHADOW -:Architectures: x86, arm, arm64 +:Architectures: x86, arm64 :Type: vcpu ioctl :Parameters: struct kvm_vcpu_event (out) :Returns: 0 on success, -1 on error @@ -1146,8 +1146,8 @@ The following bits are defined in the flags field: fields contain a valid state. This bit will be set whenever KVM_CAP_EXCEPTION_PAYLOAD is enabled. -ARM/ARM64: -^^^^^^^^^^ +ARM64: +^^^^^^ If the guest accesses a device that is being emulated by the host kernel in such a way that a real device would generate a physical SError, KVM may make @@ -1206,7 +1206,7 @@ directly to the virtual CPU). :Capability: KVM_CAP_VCPU_EVENTS :Extended by: KVM_CAP_INTR_SHADOW -:Architectures: x86, arm, arm64 +:Architectures: x86, arm64 :Type: vcpu ioctl :Parameters: struct kvm_vcpu_event (in) :Returns: 0 on success, -1 on error @@ -1241,8 +1241,8 @@ can be set in the flags field to signal that the exception_has_payload, exception_payload, and exception.pending fields contain a valid state and shall be written into the VCPU. -ARM/ARM64: -^^^^^^^^^^ +ARM64: +^^^^^^ User space may need to inject several types of events to the guest. @@ -1449,7 +1449,7 @@ for vm-wide capabilities. --------------------- :Capability: KVM_CAP_MP_STATE -:Architectures: x86, s390, arm, arm64, riscv +:Architectures: x86, s390, arm64, riscv :Type: vcpu ioctl :Parameters: struct kvm_mp_state (out) :Returns: 0 on success; -1 on error @@ -1467,7 +1467,7 @@ Possible values are: ========================== =============================================== KVM_MP_STATE_RUNNABLE the vcpu is currently running - [x86,arm/arm64,riscv] + [x86,arm64,riscv] KVM_MP_STATE_UNINITIALIZED the vcpu is an application processor (AP) which has not yet received an INIT signal [x86] KVM_MP_STATE_INIT_RECEIVED the vcpu has received an INIT signal, and is @@ -1476,7 +1476,7 @@ Possible values are: is waiting for an interrupt [x86] KVM_MP_STATE_SIPI_RECEIVED the vcpu has just received a SIPI (vector accessible via KVM_GET_VCPU_EVENTS) [x86] - KVM_MP_STATE_STOPPED the vcpu is stopped [s390,arm/arm64,riscv] + KVM_MP_STATE_STOPPED the vcpu is stopped [s390,arm64,riscv] KVM_MP_STATE_CHECK_STOP the vcpu is in a special error state [s390] KVM_MP_STATE_OPERATING the vcpu is operating (running or halted) [s390] @@ -1488,7 +1488,7 @@ On x86, this ioctl is only useful after KVM_CREATE_IRQCHIP. Without an in-kernel irqchip, the multiprocessing state must be maintained by userspace on these architectures. -For arm/arm64/riscv: +For arm64/riscv: ^^^^^^^^^^^^^^^^^^^^ The only states that are valid are KVM_MP_STATE_STOPPED and @@ -1498,7 +1498,7 @@ KVM_MP_STATE_RUNNABLE which reflect if the vcpu is paused or not. --------------------- :Capability: KVM_CAP_MP_STATE -:Architectures: x86, s390, arm, arm64, riscv +:Architectures: x86, s390, arm64, riscv :Type: vcpu ioctl :Parameters: struct kvm_mp_state (in) :Returns: 0 on success; -1 on error @@ -1510,7 +1510,7 @@ On x86, this ioctl is only useful after KVM_CREATE_IRQCHIP. Without an in-kernel irqchip, the multiprocessing state must be maintained by userspace on these architectures. -For arm/arm64/riscv: +For arm64/riscv: ^^^^^^^^^^^^^^^^^^^^ The only states that are valid are KVM_MP_STATE_STOPPED and @@ -1780,14 +1780,14 @@ The flags bitmap is defined as:: ------------------------ :Capability: KVM_CAP_IRQ_ROUTING -:Architectures: x86 s390 arm arm64 +:Architectures: x86 s390 arm64 :Type: vm ioctl :Parameters: struct kvm_irq_routing (in) :Returns: 0 on success, -1 on error Sets the GSI routing table entries, overwriting any previously set entries. -On arm/arm64, GSI routing has the following limitation: +On arm64, GSI routing has the following limitation: - GSI routing does not apply to KVM_IRQ_LINE but only to KVM_IRQFD. @@ -2855,7 +2855,7 @@ after pausing the vcpu, but before it is resumed. ------------------- :Capability: KVM_CAP_SIGNAL_MSI -:Architectures: x86 arm arm64 +:Architectures: x86 arm64 :Type: vm ioctl :Parameters: struct kvm_msi (in) :Returns: >0 on delivery, 0 if guest blocked the MSI, and -1 on error @@ -3043,7 +3043,7 @@ into the hash PTE second double word). -------------- :Capability: KVM_CAP_IRQFD -:Architectures: x86 s390 arm arm64 +:Architectures: x86 s390 arm64 :Type: vm ioctl :Parameters: struct kvm_irqfd (in) :Returns: 0 on success, -1 on error @@ -3069,7 +3069,7 @@ Note that closing the resamplefd is not sufficient to disable the irqfd. The KVM_IRQFD_FLAG_RESAMPLE is only necessary on assignment and need not be specified with KVM_IRQFD_FLAG_DEASSIGN. -On arm/arm64, gsi routing being supported, the following can happen: +On arm64, gsi routing being supported, the following can happen: - in case no routing entry is associated to this gsi, injection fails - in case the gsi is associated to an irqchip routing entry, @@ -3325,7 +3325,7 @@ current state. "addr" is ignored. ---------------------- :Capability: basic -:Architectures: arm, arm64 +:Architectures: arm64 :Type: vcpu ioctl :Parameters: struct kvm_vcpu_init (in) :Returns: 0 on success; -1 on error @@ -3423,7 +3423,7 @@ Possible features: ----------------------------- :Capability: basic -:Architectures: arm, arm64 +:Architectures: arm64 :Type: vm ioctl :Parameters: struct kvm_vcpu_init (out) :Returns: 0 on success; -1 on error @@ -3452,7 +3452,7 @@ VCPU matching underlying host. --------------------- :Capability: basic -:Architectures: arm, arm64, mips +:Architectures: arm64, mips :Type: vcpu ioctl :Parameters: struct kvm_reg_list (in/out) :Returns: 0 on success; -1 on error @@ -3479,7 +3479,7 @@ KVM_GET_ONE_REG/KVM_SET_ONE_REG calls. ----------------------------------------- :Capability: KVM_CAP_ARM_SET_DEVICE_ADDR -:Architectures: arm, arm64 +:Architectures: arm64 :Type: vm ioctl :Parameters: struct kvm_arm_device_address (in) :Returns: 0 on success, -1 on error @@ -3506,13 +3506,13 @@ can access emulated or directly exposed devices, which the host kernel needs to know about. The id field is an architecture specific identifier for a specific device. -ARM/arm64 divides the id field into two parts, a device id and an +arm64 divides the id field into two parts, a device id and an address type id specific to the individual device:: bits: | 63 ... 32 | 31 ... 16 | 15 ... 0 | field: | 0x00000000 | device id | addr type id | -ARM/arm64 currently only require this when using the in-kernel GIC +arm64 currently only require this when using the in-kernel GIC support for the hardware VGIC features, using KVM_ARM_DEVICE_VGIC_V2 as the device id. When setting the base address for the guest's mapping of the VGIC virtual CPU and distributor interface, the ioctl @@ -4726,7 +4726,7 @@ to I/O ports. ------------------------------------ :Capability: KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 -:Architectures: x86, arm, arm64, mips +:Architectures: x86, arm64, mips :Type: vm ioctl :Parameters: struct kvm_clear_dirty_log (in) :Returns: 0 on success, -1 on error @@ -4838,7 +4838,7 @@ version has the following quirks: 4.119 KVM_ARM_VCPU_FINALIZE --------------------------- -:Architectures: arm, arm64 +:Architectures: arm64 :Type: vcpu ioctl :Parameters: int feature (in) :Returns: 0 on success, -1 on error @@ -5920,7 +5920,7 @@ should put the acknowledged interrupt vector into the 'epr' field. If exit_reason is KVM_EXIT_SYSTEM_EVENT then the vcpu has triggered a system-level event using some architecture specific mechanism (hypercall -or some special instruction). In case of ARM/ARM64, this is triggered using +or some special instruction). In case of ARM64, this is triggered using HVC instruction based PSCI call from the vcpu. The 'type' field describes the system-level event type. The 'flags' field describes architecture specific flags for the system-level event. @@ -6013,7 +6013,7 @@ in send_page or recv a buffer to recv_page). __u64 fault_ipa; } arm_nisv; -Used on arm and arm64 systems. If a guest accesses memory not in a memslot, +Used on arm64 systems. If a guest accesses memory not in a memslot, KVM will typically return to userspace and ask it to do MMIO emulation on its behalf. However, for certain classes of instructions, no instruction decode (direction, length of memory access) is provided, and fetching and decoding @@ -6030,11 +6030,10 @@ did not fall within an I/O window. Userspace implementations can query for KVM_CAP_ARM_NISV_TO_USER, and enable this capability at VM creation. Once this is done, these types of errors will instead return to userspace with KVM_EXIT_ARM_NISV, with the valid bits from -the HSR (arm) and ESR_EL2 (arm64) in the esr_iss field, and the faulting IPA -in the fault_ipa field. Userspace can either fix up the access if it's -actually an I/O access by decoding the instruction from guest memory (if it's -very brave) and continue executing the guest, or it can decide to suspend, -dump, or restart the guest. +the ESR_EL2 in the esr_iss field, and the faulting IPA in the fault_ipa field. +Userspace can either fix up the access if it's actually an I/O access by +decoding the instruction from guest memory (if it's very brave) and continue +executing the guest, or it can decide to suspend, dump, or restart the guest. Note that KVM does not skip the faulting instruction as it does for KVM_EXIT_MMIO, but userspace has to emulate any change to the processing state @@ -6741,7 +6740,7 @@ and injected exceptions. 7.18 KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 -:Architectures: x86, arm, arm64, mips +:Architectures: x86, arm64, mips :Parameters: args[0] whether feature should be enabled or not Valid flags are:: @@ -7138,7 +7137,7 @@ reserved. 8.9 KVM_CAP_ARM_USER_IRQ ------------------------ -:Architectures: arm, arm64 +:Architectures: arm64 This capability, if KVM_CHECK_EXTENSION indicates that it is available, means that if userspace creates a VM without an in-kernel interrupt controller, it @@ -7265,7 +7264,7 @@ HvFlushVirtualAddressList, HvFlushVirtualAddressListEx. 8.19 KVM_CAP_ARM_INJECT_SERROR_ESR ---------------------------------- -:Architectures: arm, arm64 +:Architectures: arm64 This capability indicates that userspace can specify (via the KVM_SET_VCPU_EVENTS ioctl) the syndrome value reported to the guest when it diff --git a/Documentation/virt/kvm/arm/hyp-abi.rst b/Documentation/virt/kvm/arm/hyp-abi.rst index 4d43fbc25195..516ea630d160 100644 --- a/Documentation/virt/kvm/arm/hyp-abi.rst +++ b/Documentation/virt/kvm/arm/hyp-abi.rst @@ -1,7 +1,7 @@ .. SPDX-License-Identifier: GPL-2.0 ======================================= -Internal ABI between the kernel and HYP +Internal ABI between the kernel and EL2 ======================================= This file documents the interaction between the Linux kernel and the @@ -13,65 +13,63 @@ used as a host. Note: KVM/arm has been removed from the kernel. The API described here is still valid though, as it allows the kernel to kexec when -booted at HYP. It can also be used by a hypervisor other than KVM +booted at EL2. It can also be used by a hypervisor other than KVM if necessary. -On arm and arm64 (without VHE), the kernel doesn't run in hypervisor +On arm64 without VHE, the kernel doesn't run in hypervisor mode, but still needs to interact with it, allowing a built-in hypervisor to be either installed or torn down. -In order to achieve this, the kernel must be booted at HYP (arm) or -EL2 (arm64), allowing it to install a set of stubs before dropping to -SVC/EL1. These stubs are accessible by using a 'hvc #0' instruction, -and only act on individual CPUs. +In order to achieve this, the kernel must be booted at EL2 (arm64), +allowing it to install a set of stubs before dropping to EL1. +These stubs are accessible by using a 'hvc #0' instruction, and only +act on individual CPUs. Unless specified otherwise, any built-in hypervisor must implement -these functions (see arch/arm{,64}/include/asm/virt.h): +these functions (see arch/arm64/include/asm/virt.h): * :: - r0/x0 = HVC_SET_VECTORS - r1/x1 = vectors + x0 = HVC_SET_VECTORS + x1 = vectors - Set HVBAR/VBAR_EL2 to 'vectors' to enable a hypervisor. 'vectors' + Set VBAR_EL2 to 'vectors' to enable a hypervisor. 'vectors' must be a physical address, and respect the alignment requirements of the architecture. Only implemented by the initial stubs, not by Linux hypervisors. * :: - r0/x0 = HVC_RESET_VECTORS + x0 = HVC_RESET_VECTORS - Turn HYP/EL2 MMU off, and reset HVBAR/VBAR_EL2 to the initials - stubs' exception vector value. This effectively disables an existing - hypervisor. + Turn EL2 MMU off, and reset VBAR_EL2 to the initials stubs' exception + vector value. This effectively disables an existing hypervisor. * :: - r0/x0 = HVC_SOFT_RESTART - r1/x1 = restart address - x2 = x0's value when entering the next payload (arm64) - x3 = x1's value when entering the next payload (arm64) - x4 = x2's value when entering the next payload (arm64) + x0 = HVC_SOFT_RESTART + x1 = restart address + x2 = x0's value when entering the next payload + x3 = x1's value when entering the next payload + x4 = x2's value when entering the next payload Mask all exceptions, disable the MMU, clear I+D bits, move the arguments - into place (arm64 only), and jump to the restart address while at HYP/EL2. - This hypercall is not expected to return to its caller. + into place, and jump to the restart address while at EL2. This hypercall + is not expected to return to its caller. * :: - x0 = HVC_VHE_RESTART (arm64 only) + x0 = HVC_VHE_RESTART Attempt to upgrade the kernel's exception level from EL1 to EL2 by enabling the VHE mode. This is conditioned by the CPU supporting VHE, the EL2 MMU being off, and VHE not being disabled by any other means (command line option, for example). -Any other value of r0/x0 triggers a hypervisor-specific handling, +Any other value of x0 triggers a hypervisor-specific handling, which is not documented here. -The return value of a stub hypercall is held by r0/x0, and is 0 on +The return value of a stub hypercall is held by x0, and is 0 on success, and HVC_STUB_ERR on error. A stub hypercall is allowed to -clobber any of the caller-saved registers (x0-x18 on arm64, r0-r3 and -ip on arm). It is thus recommended to use a function call to perform -the hypercall. +clobber any of the caller-saved registers (x0-x18 on arm64). It is +thus recommended to use a function call to perform the hypercall. diff --git a/Documentation/virt/kvm/arm/ptp_kvm.rst b/Documentation/virt/kvm/arm/ptp_kvm.rst index aecdc80ddcd8..5d47f7ecbf5a 100644 --- a/Documentation/virt/kvm/arm/ptp_kvm.rst +++ b/Documentation/virt/kvm/arm/ptp_kvm.rst @@ -1,7 +1,7 @@ .. SPDX-License-Identifier: GPL-2.0 -PTP_KVM support for arm/arm64 -============================= +PTP_KVM support for arm64 +========================= PTP_KVM is used for high precision time sync between host and guests. It relies on transferring the wall clock and counter value from the diff --git a/Documentation/virt/kvm/devices/vcpu.rst b/Documentation/virt/kvm/devices/vcpu.rst index 60a29972d3f1..92942440a9e7 100644 --- a/Documentation/virt/kvm/devices/vcpu.rst +++ b/Documentation/virt/kvm/devices/vcpu.rst @@ -108,7 +108,7 @@ using event 0x11 (CPU_CYCLES). 2. GROUP: KVM_ARM_VCPU_TIMER_CTRL ================================= -:Architectures: ARM, ARM64 +:Architectures: ARM64 2.1. ATTRIBUTES: KVM_ARM_VCPU_TIMER_IRQ_VTIMER, KVM_ARM_VCPU_TIMER_IRQ_PTIMER ----------------------------------------------------------------------------- From patchwork Wed Mar 2 19:42:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Upton X-Patchwork-Id: 12766640 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D1C5EC433F5 for ; Wed, 2 Mar 2022 19:43:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=m+B6tE3m2M2D9SG2KRaFzmzslgCoqZ8bs1cqWC34WBI=; b=sZ4TLVJrdUAQy1Z0EFPnOaT/Jp xz+D8U5gjtsUprwaMHfmJleRgIwoVH9uK89AOoKKZQLsgDhQ0OynEc8JkkR02UYRcgS7ADVw2OFi4 wrephrA6XPbYZmjpUNIPlpdawDQZEdlt4UZOKjfOHTwJ0dlROUfyvLBQUbuasxa4xT2SB7zHw2/nM oOGDIJdASiDUCqjl8Jri/S+EdOVfL6Iv1gbRP2A36umzHc3iG9e8R252E0H+cSZw2kHiqV2qGRug3 499gEVJZGsDwzWzuPzN0RP71S5y/gvdzvOSGaUnvwyEOAOw5CbViAj/y55/u4QMfajR6WFa79vbT+ GctPclBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPUrx-0040iN-2t; Wed, 02 Mar 2022 19:42:41 +0000 Received: from mail-il1-x149.google.com ([2607:f8b0:4864:20::149]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPUrk-0040ee-VD for linux-arm-kernel@lists.infradead.org; Wed, 02 Mar 2022 19:42:30 +0000 Received: by mail-il1-x149.google.com with SMTP id m17-20020a923f11000000b002c10e8f4c44so2040867ila.1 for ; Wed, 02 Mar 2022 11:42:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=PCKbeMGnbMeKELdpOCOC6blFVgcWYPGEsQUKnbyj5go=; b=G0al7m5j2pHc4CKpHFPbAvY1Su3hfl9KYNhpUHasUGXkhZjiwnSE+L077x7HJGzxhc cXxJ4JwUSVkKnpf8t/HmJRhM/x7wMALqVExeShd5thY955fKWd0ZT1UDe9XqFSzvPOO8 quu5C+hjVXWH6BPLfsrW7fsKuxo5LMd5VcUVYQ/a875oeBm6weKOwER47OXLQcfoom3E bvCqMHgoxfudytYMYZfl6faLp+vBLT32Hovs7p8zi5DP/ZWtvHNqV16WAWPYBIh3Z99M bsZpxeOWhQsHz0W9mZQX15ftuqL6gvEKdG4nUEodgpIE6yZgiKjw9azLE0aScrTir43i RNkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=PCKbeMGnbMeKELdpOCOC6blFVgcWYPGEsQUKnbyj5go=; b=QOtDwuo4aQBRwX4YyRVO5zznT7JBoozROLX6gQffx0uSUGsLBzlY+AatwJQFv912rv kdXtAibq4U8UF/RyjfQWGjhacKs98hNqoM2nd9uj9lmzBT2nMhxwPRX3GjRZOWEn9Paf 44ai2K4xVD7BQWLSv+6ICig9/0hBla9Al21T4XV10JUADtl2b35jthpCVIa0OSUTtfTP 8q1yu8+rqGlo8H3EpZa+GWeI7dFdxgEQieA+AO5g/8Wd9Y9z3PqLjnuyuL/hmQys+aOv dTQiZpNL2NrlmlbNKiNcSVyVQtpoe2/9gIy1d7wO6s96uQ9OQYrPUB/uOq3YKcTXWyR3 vU8g== X-Gm-Message-State: AOAM5314oZKGHGmvVfz5VS+UwdQl416SHlSmpDe+WegWmGF6GWdDlov2 1XqmcvM8Z9yiYS3CQb1o9P2NtX1SjNE= X-Google-Smtp-Source: ABdhPJzREjaDgmMlO/8NJ9+/tMKnX5excwPLRFEHZ26PVrArvstUOygEWptrPRZ3dGEPxnpxWkN+HOgNpHE= X-Received: from oupton.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:404]) (user=oupton job=sendgmr) by 2002:a02:a594:0:b0:314:365c:3a4f with SMTP id b20-20020a02a594000000b00314365c3a4fmr24710782jam.162.1646250147094; Wed, 02 Mar 2022 11:42:27 -0800 (PST) Date: Wed, 2 Mar 2022 19:42:21 +0000 In-Reply-To: <20220302194221.1774513-1-oupton@google.com> Message-Id: <20220302194221.1774513-3-oupton@google.com> Mime-Version: 1.0 References: <20220302194221.1774513-1-oupton@google.com> X-Mailer: git-send-email 2.35.1.574.g5d30c73bfb-goog Subject: [PATCH 2/2] Documentation: KVM: Move KVM/arm64 docs into aptly named directory From: Oliver Upton To: kvmarm@lists.cs.columbia.edu Cc: kvm@vger.kernel.org, Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, Peter Shier , Ricardo Koller , Reiji Watanabe , Paolo Bonzini , Oliver Upton X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220302_114229_028237_A55F147B X-CRM114-Status: GOOD ( 12.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org ARM64 is the only supported ARM archiecture for KVM now. Move all the documentation into a new directory, arm64, making the file structure consistent with this change. While we're at it, rename hyp-abi.rst to el2-abi.rst for the sake of consistency with the architecture as well. Signed-off-by: Oliver Upton --- .../virt/kvm/{arm/hyp-abi.rst => arm64/el2-abi.rst} | 0 Documentation/virt/kvm/{arm => arm64}/index.rst | 8 ++++---- Documentation/virt/kvm/{arm => arm64}/psci.rst | 0 Documentation/virt/kvm/{arm => arm64}/ptp_kvm.rst | 0 Documentation/virt/kvm/{arm => arm64}/pvtime.rst | 0 Documentation/virt/kvm/devices/vcpu.rst | 2 +- Documentation/virt/kvm/index.rst | 2 +- 7 files changed, 6 insertions(+), 6 deletions(-) rename Documentation/virt/kvm/{arm/hyp-abi.rst => arm64/el2-abi.rst} (100%) rename Documentation/virt/kvm/{arm => arm64}/index.rst (76%) rename Documentation/virt/kvm/{arm => arm64}/psci.rst (100%) rename Documentation/virt/kvm/{arm => arm64}/ptp_kvm.rst (100%) rename Documentation/virt/kvm/{arm => arm64}/pvtime.rst (100%) diff --git a/Documentation/virt/kvm/arm/hyp-abi.rst b/Documentation/virt/kvm/arm64/el2-abi.rst similarity index 100% rename from Documentation/virt/kvm/arm/hyp-abi.rst rename to Documentation/virt/kvm/arm64/el2-abi.rst diff --git a/Documentation/virt/kvm/arm/index.rst b/Documentation/virt/kvm/arm64/index.rst similarity index 76% rename from Documentation/virt/kvm/arm/index.rst rename to Documentation/virt/kvm/arm64/index.rst index 78a9b670aafe..b0110fcf5eb1 100644 --- a/Documentation/virt/kvm/arm/index.rst +++ b/Documentation/virt/kvm/arm64/index.rst @@ -1,13 +1,13 @@ .. SPDX-License-Identifier: GPL-2.0 -=== -ARM -=== +===== +ARM64 +===== .. toctree:: :maxdepth: 2 - hyp-abi + el2-abi psci pvtime ptp_kvm diff --git a/Documentation/virt/kvm/arm/psci.rst b/Documentation/virt/kvm/arm64/psci.rst similarity index 100% rename from Documentation/virt/kvm/arm/psci.rst rename to Documentation/virt/kvm/arm64/psci.rst diff --git a/Documentation/virt/kvm/arm/ptp_kvm.rst b/Documentation/virt/kvm/arm64/ptp_kvm.rst similarity index 100% rename from Documentation/virt/kvm/arm/ptp_kvm.rst rename to Documentation/virt/kvm/arm64/ptp_kvm.rst diff --git a/Documentation/virt/kvm/arm/pvtime.rst b/Documentation/virt/kvm/arm64/pvtime.rst similarity index 100% rename from Documentation/virt/kvm/arm/pvtime.rst rename to Documentation/virt/kvm/arm64/pvtime.rst diff --git a/Documentation/virt/kvm/devices/vcpu.rst b/Documentation/virt/kvm/devices/vcpu.rst index 92942440a9e7..ab9d81421488 100644 --- a/Documentation/virt/kvm/devices/vcpu.rst +++ b/Documentation/virt/kvm/devices/vcpu.rst @@ -159,7 +159,7 @@ Returns: Specifies the base address of the stolen time structure for this VCPU. The base address must be 64 byte aligned and exist within a valid guest memory -region. See Documentation/virt/kvm/arm/pvtime.rst for more information +region. See Documentation/virt/kvm/arm64/pvtime.rst for more information including the layout of the stolen time structure. 4. GROUP: KVM_VCPU_TSC_CTRL diff --git a/Documentation/virt/kvm/index.rst b/Documentation/virt/kvm/index.rst index b6833c7bb474..4bf7e0eef6a1 100644 --- a/Documentation/virt/kvm/index.rst +++ b/Documentation/virt/kvm/index.rst @@ -25,7 +25,7 @@ KVM review-checklist - arm/index + arm64/index devices/index