[...]
On 4/21/2023 9:46 PM, Yang Weijiang wrote:
Add handling for Control Protection (#CP) exceptions(vector 21).
The new vector is introduced for Intel's Control-Flow Enforcement
Technology (CET) relevant violation cases.
See Intel's SDM for details.
-static int exception_class(int vector)By definition, #CP is Contributory.
+static int exception_class(struct kvm_vcpu *vcpu, int vector)
{
switch (vector) {
case PF_VECTOR:
return EXCPT_PF;
+ case CP_VECTOR:
+ if (vcpu->arch.cr4_guest_rsvd_bits & X86_CR4_CET)
+ return EXCPT_BENIGN;
+ return EXCPT_CONTRIBUTORY;
Can you explain more about this change here which treats #CP as EXCPT_BENIGN when CET is not enabled in guest?
In current KVM code, there is suppose no #CP triggered in guest if CET is not enalbed in guest, right?
case DE_VECTOR:
case TS_VECTOR:
case NP_VECTOR: