Skip to content

Commit 6656cda

Browse files
jingzhangosoupton
authored andcommitted
KVM: arm64: Document KVM_ARM_GET_REG_WRITABLE_MASKS
Add some basic documentation on how to get feature ID register writable masks from userspace. Signed-off-by: Jing Zhang <[email protected]> Reviewed-by: Cornelia Huck <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent 3f9cd0c commit 6656cda

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

Documentation/virt/kvm/api.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6070,6 +6070,54 @@ writes to the CNTVCT_EL0 and CNTPCT_EL0 registers using the SET_ONE_REG
60706070
interface. No error will be returned, but the resulting offset will not be
60716071
applied.
60726072

6073+
4.139 KVM_ARM_GET_REG_WRITABLE_MASKS
6074+
-------------------------------------------
6075+
6076+
:Capability: KVM_CAP_ARM_SUPPORTED_REG_MASK_RANGES
6077+
:Architectures: arm64
6078+
:Type: vm ioctl
6079+
:Parameters: struct reg_mask_range (in/out)
6080+
:Returns: 0 on success, < 0 on error
6081+
6082+
6083+
::
6084+
6085+
#define KVM_ARM_FEATURE_ID_RANGE 0
6086+
#define KVM_ARM_FEATURE_ID_RANGE_SIZE (3 * 8 * 8)
6087+
6088+
struct reg_mask_range {
6089+
__u64 addr; /* Pointer to mask array */
6090+
__u32 range; /* Requested range */
6091+
__u32 reserved[13];
6092+
};
6093+
6094+
This ioctl copies the writable masks for a selected range of registers to
6095+
userspace.
6096+
6097+
The ``addr`` field is a pointer to the destination array where KVM copies
6098+
the writable masks.
6099+
6100+
The ``range`` field indicates the requested range of registers.
6101+
``KVM_CHECK_EXTENSION`` for the ``KVM_CAP_ARM_SUPPORTED_REG_MASK_RANGES``
6102+
capability returns the supported ranges, expressed as a set of flags. Each
6103+
flag's bit index represents a possible value for the ``range`` field.
6104+
All other values are reserved for future use and KVM may return an error.
6105+
6106+
The ``reserved[13]`` array is reserved for future use and should be 0, or
6107+
KVM may return an error.
6108+
6109+
KVM_ARM_FEATURE_ID_RANGE (0)
6110+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6111+
6112+
The Feature ID range is defined as the AArch64 System register space with
6113+
op0==3, op1=={0, 1, 3}, CRn==0, CRm=={0-7}, op2=={0-7}.
6114+
6115+
The mask returned array pointed to by ``addr`` is indexed by the macro
6116+
``ARM64_FEATURE_ID_RANGE_IDX(op0, op1, crn, crm, op2)``, allowing userspace
6117+
to know what fields can be changed for the system register described by
6118+
``op0, op1, crn, crm, op2``. KVM rejects ID register values that describe a
6119+
superset of the features supported by the system.
6120+
60736121
5. The kvm_run structure
60746122
========================
60756123

0 commit comments

Comments
 (0)