Skip to contentSkip to conversation

KVM: X86: deprecate obsolete KVM_GET_CPUID2 ioctl

PATCH linmiaohe 1 participant 1 message Feb 28, 2020 KVM

lore
Share & tools
lore

linmiaohe

author
#0 lore raw
Quoted 12 lines · Vitaly Kuznetsov

Review

Quoted 7 lines · linmiaohe

From: Miaohe Lin <[email protected]>

(quoted diff) +1 -3
-		if (copy_to_user(cpuid_arg, &cpuid, sizeof(cpuid)))
-			goto out;
-		r = 0;
+		r = -EINVAL;
 		break;
 	}

Braces are not really needed not but all other cases in the switch have it so let's leave them here too.

That's what I think too. :)

Quoted 5 lines

Review

Quoted 3 lines
(quoted diff) +1 -0
 	case KVM_GET_MSRS: {
+/* KVM_GET_CPUID2 is deprecated, should not be used. */

"should not be used" pre-patch, post-patch we can say "Can only be used as a reliable source of -EINVAL" :-)

That's right.

Quoted 8 lines

#define KVM_GET_CPUID2 _IOWR(KVMIO, 0x91, struct kvm_cpuid2)
/* Available with KVM_CAP_VAPIC */
#define KVM_TPR_ACCESS_REPORTING _IOWR(KVMIO, 0x92, struct
kvm_tpr_access_ctl)

Surprisingly (or not), KVM_GET_CPUID2 is not even described in Documentation/virt/kvm/api.txt.

Maybe KVM_GET_CPUID2 is defined for integrity only.

Quoted 3 lines

Many thanks for your review!