diff options
author | Christoffer Dall <c.dall@virtualopensystems.com> | 2013-01-23 13:18:04 -0500 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2013-02-11 13:58:39 -0500 |
commit | 3401d54696f992edf036f00f46c8c399d1b75c2a (patch) | |
tree | bbb3bb02050b3b513e4b55839b553d793c1e63b9 /Documentation/virtual/kvm/api.txt | |
parent | a96ab03917dcf4c9477d03b31e8d74779bca1074 (diff) |
KVM: ARM: Introduce KVM_ARM_SET_DEVICE_ADDR ioctl
On ARM some bits are specific to the model being emulated for the guest and
user space needs a way to tell the kernel about those bits. An example is mmio
device base addresses, where KVM must know the base address for a given device
to properly emulate mmio accesses within a certain address range or directly
map a device with virtualiation extensions into the guest address space.
We make this API ARM-specific as we haven't yet reached a consensus for a
generic API for all KVM architectures that will allow us to do something like
this.
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'Documentation/virtual/kvm/api.txt')
-rw-r--r-- | Documentation/virtual/kvm/api.txt | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index c25439a58274..4505f869e450 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt | |||
@@ -2210,6 +2210,43 @@ This ioctl returns the guest registers that are supported for the | |||
2210 | KVM_GET_ONE_REG/KVM_SET_ONE_REG calls. | 2210 | KVM_GET_ONE_REG/KVM_SET_ONE_REG calls. |
2211 | 2211 | ||
2212 | 2212 | ||
2213 | 4.80 KVM_ARM_SET_DEVICE_ADDR | ||
2214 | |||
2215 | Capability: KVM_CAP_ARM_SET_DEVICE_ADDR | ||
2216 | Architectures: arm | ||
2217 | Type: vm ioctl | ||
2218 | Parameters: struct kvm_arm_device_address (in) | ||
2219 | Returns: 0 on success, -1 on error | ||
2220 | Errors: | ||
2221 | ENODEV: The device id is unknown | ||
2222 | ENXIO: Device not supported on current system | ||
2223 | EEXIST: Address already set | ||
2224 | E2BIG: Address outside guest physical address space | ||
2225 | |||
2226 | struct kvm_arm_device_addr { | ||
2227 | __u64 id; | ||
2228 | __u64 addr; | ||
2229 | }; | ||
2230 | |||
2231 | Specify a device address in the guest's physical address space where guests | ||
2232 | can access emulated or directly exposed devices, which the host kernel needs | ||
2233 | to know about. The id field is an architecture specific identifier for a | ||
2234 | specific device. | ||
2235 | |||
2236 | ARM divides the id field into two parts, a device id and an address type id | ||
2237 | specific to the individual device. | ||
2238 | |||
2239 | bits: | 63 ... 32 | 31 ... 16 | 15 ... 0 | | ||
2240 | field: | 0x00000000 | device id | addr type id | | ||
2241 | |||
2242 | ARM currently only require this when using the in-kernel GIC support for the | ||
2243 | hardware VGIC features, using KVM_ARM_DEVICE_VGIC_V2 as the device id. When | ||
2244 | setting the base address for the guest's mapping of the VGIC virtual CPU | ||
2245 | and distributor interface, the ioctl must be called after calling | ||
2246 | KVM_CREATE_IRQCHIP, but before calling KVM_RUN on any of the VCPUs. Calling | ||
2247 | this ioctl twice for any of the base addresses will return -EEXIST. | ||
2248 | |||
2249 | |||
2213 | 5. The kvm_run structure | 2250 | 5. The kvm_run structure |
2214 | ------------------------ | 2251 | ------------------------ |
2215 | 2252 | ||