Re: [PATCH v3 10/21] KVM:x86: Add #CP support in guest exception classification

From: Yang, Weijiang
Date: Fri Jun 16 2023 - 02:57:10 EST



On 6/16/2023 7:58 AM, Sean Christopherson wrote:
On Thu, Jun 08, 2023, Weijiang Yang wrote:
On 6/6/2023 5:08 PM, Chao Gao wrote:
On Thu, May 11, 2023 at 12:08:46AM -0400, 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.

Although #CP belongs contributory exception class, but the actual
effect is conditional on CET being exposed to guest. If CET is not
available to guest, #CP falls back to non-contributory and doesn't
have an error code.
This sounds weird. is this the hardware behavior? If yes, could you
point us to where this behavior is documented?
It's not SDM documented behavior.
The #CP behavior needs to be documented. Please pester whoever you need to in
order to make that happen.

Do you mean documentation for #CP as an generic exception or the behavior in KVM as

this patch shows?