@@ -3403,6 +3403,52 @@ invalid, if invalid pages are written to (e.g. after the end of memory)
3403
3403
or if no page table is present for the addresses (e.g. when using
3404
3404
hugepages).
3405
3405
3406
+ 4.108 KVM_PPC_GET_CPU_CHAR
3407
+
3408
+ Capability: KVM_CAP_PPC_GET_CPU_CHAR
3409
+ Architectures: powerpc
3410
+ Type: vm ioctl
3411
+ Parameters: struct kvm_ppc_cpu_char (out)
3412
+ Returns: 0 on successful completion
3413
+ -EFAULT if struct kvm_ppc_cpu_char cannot be written
3414
+
3415
+ This ioctl gives userspace information about certain characteristics
3416
+ of the CPU relating to speculative execution of instructions and
3417
+ possible information leakage resulting from speculative execution (see
3418
+ CVE-2017-5715, CVE-2017-5753 and CVE-2017-5754). The information is
3419
+ returned in struct kvm_ppc_cpu_char, which looks like this:
3420
+
3421
+ struct kvm_ppc_cpu_char {
3422
+ __u64 character; /* characteristics of the CPU */
3423
+ __u64 behaviour; /* recommended software behaviour */
3424
+ __u64 character_mask; /* valid bits in character */
3425
+ __u64 behaviour_mask; /* valid bits in behaviour */
3426
+ };
3427
+
3428
+ For extensibility, the character_mask and behaviour_mask fields
3429
+ indicate which bits of character and behaviour have been filled in by
3430
+ the kernel. If the set of defined bits is extended in future then
3431
+ userspace will be able to tell whether it is running on a kernel that
3432
+ knows about the new bits.
3433
+
3434
+ The character field describes attributes of the CPU which can help
3435
+ with preventing inadvertent information disclosure - specifically,
3436
+ whether there is an instruction to flash-invalidate the L1 data cache
3437
+ (ori 30,30,0 or mtspr SPRN_TRIG2,rN), whether the L1 data cache is set
3438
+ to a mode where entries can only be used by the thread that created
3439
+ them, whether the bcctr[l] instruction prevents speculation, and
3440
+ whether a speculation barrier instruction (ori 31,31,0) is provided.
3441
+
3442
+ The behaviour field describes actions that software should take to
3443
+ prevent inadvertent information disclosure, and thus describes which
3444
+ vulnerabilities the hardware is subject to; specifically whether the
3445
+ L1 data cache should be flushed when returning to user mode from the
3446
+ kernel, and whether a speculation barrier should be placed between an
3447
+ array bounds check and the array access.
3448
+
3449
+ These fields use the same bit definitions as the new
3450
+ H_GET_CPU_CHARACTERISTICS hypercall.
3451
+
3406
3452
5. The kvm_run structure
3407
3453
------------------------
3408
3454
0 commit comments