From: Jan Beulich <jbeulich@suse.com>
To: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
Cc: andrew.cooper3@citrix.com, roger@xenproject.org,
jason.andryuk@amd.com, teddy.astie@vates.tech,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4] x86/nSVM: Check injected event consistency
Date: Mon, 21 Sep 2026 18:01:17 +0200 [thread overview]
Message-ID: <f81efd12-4eab-4147-9e83-8d082a8ce163@suse.com> (raw)
In-Reply-To: <20260921155103.3243475-1-abdelkareem.abdelsaamad@citrix.com>
On 21.09.2026 17:50, Abdelkareem Abdelsaamad wrote:
> On 07.09.2026 08:50, Jan Beulich wrote:
>> On 06.09.2026 15:11, Abdelkareem Abdelsaamad wrote:
>>> On 26.08.2026 15:33, Jan Beulich wrote:
>>>> On 23.08.2026 18:11, Abdelkareem Abdelsaamad wrote:
>>>>> + case X86_EXC_OF:
>>>>> + case X86_EXC_BR:
>>>>> + return !(vmcb_get_efer(vmcb) & EFER_LMA) || !vmcb->cs.l;
>>>>> +
>>>>> + case X86_EXC_VC:
>>>>> + return vmcb_get_sev_es(vmcb);
>>>>> +
>>>>> + case X86_EXC_CP:
>>>>> + return vmcb_get_cr4(vmcb) & X86_CR4_CET;
>>>>
>>>> ... e.g. here. That is, if a CR4 (or other) check is needed here, but not
>>>> for #XM (or #SX), that's surely worth (briefly) commenting upon. The more
>>>> that, afaics, none of this is spelled out in the PM.
>>> In my testing, the hardware behavior differs across the generations support for
>>> the Control-flow Enforcement Technology (CET):
>>> - Naples (No hardware support): Injecting the event when the feature is
>>> completely unsupported by the CPU results in VMEXIT_INVALID. The VMCB's CR4
>>> bit is not set as it is expected.
>>> - Genoa (Hardware support exists): If the CPU supports the feature but the
>>> guest has not enabled it in CR4 (not opted-in), injecting the event
>>> results in a triple fault. I am accordingly checking for the CPU feature and
>>> report it as invalid.
>>
>> A guest triple fault, I assume?
> Yes, that is correct. I meant a guest triple fault.
>> I'm not entirely convinced this is a sufficient
>> indication of injection being permitted, even though I agree it very much looks
>> so. Then again, like above, I'm also unconvinced this is actually intended
>> behavior. Guests unaware of a feature (and hence not enabling it) should never
>> observe exceptions related to only that feature.
> The testing, I performed shows the following behavior across the CPU
> generations:
> - On CPUU generations that support the feature (e.g., Genoa supporting
> Control-flow Enforcement Technology / CET), the injection results in
> a guest triple fault. If the the guest did not opt-in for the CET feature.
> No VMEXIT_INVALID results by the injection.
> - On older hardware generations that completely lack the feature (e.g., Naples),
> the injection immediately results in a VMEXIT_INVALID.
>
> The current hardware behavior seems to depend on whether the underlying
> physical CPU understands the feature, rather than whether the guest has opted
> into it via CR4. The patch expands this to consider the injection will result
> in VMEXIT_INVALID if the guest did not opt into the feature.
>
> Are you suggesting to reather explicitly check the CPU model/generation instead
> of checking X86_CR4_CET? For example, allowing the injection on Genoa platforms
> regardless of whether the guest has enabled the CET capability? I am concerned
> that handling this via CPU model checks might introduce architectural edge
> cases and/or add maintenance complication—what are your thoughts on that
> approach?
No, I'm not suggesting to go by CPU model. That would be wrong in certain
migration scenarios, afaict.
Jan
next prev parent reply other threads:[~2026-09-21 16:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <v4-586da975-bd71-4305-a17e-cd5ba35995a4@suse.com>
2026-09-21 15:50 ` Re: [PATCH v4] x86/nSVM: Check injected event consistency Abdelkareem Abdelsaamad
2026-09-21 16:01 ` Jan Beulich [this message]
2026-08-23 16:11 Abdelkareem Abdelsaamad
2026-08-26 13:33 ` Jan Beulich
2026-09-06 13:11 ` Abdelkareem Abdelsaamad
2026-09-06 13:22 ` Abdelkareem Abdelsaamad
2026-09-07 6:36 ` Jan Beulich
2026-09-21 17:07 ` Abdelkareem Abdelsaamad
2026-09-22 6:17 ` Jan Beulich
2026-09-07 6:50 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f81efd12-4eab-4147-9e83-8d082a8ce163@suse.com \
--to=jbeulich@suse.com \
--cc=abdelkareem.abdelsaamad@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jason.andryuk@amd.com \
--cc=roger@xenproject.org \
--cc=teddy.astie@vates.tech \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.