Skip to content

Commit 5fbff26

Browse files
ChangSeokBaehansendc
authored andcommitted
Documentation/x86: Explain the state component permission for guests
Commit 980fe2f ("x86/fpu: Extend fpu_xstate_prctl() with guest permissions") extends a couple of arch_prctl(2) options for VCPU threads. Add description for them. Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Yang Zhong <yang.zhong@intel.com> Reviewed-by: Tony Luck <tony.luck@intel.com> Link: https://lore.kernel.org/all/20230121001900.14900-5-chang.seok.bae%40intel.com
1 parent 7f9daaf commit 5fbff26

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Documentation/x86/xstate.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,32 @@ entry if the feature is in its initial configuration. This differs from
143143
non-dynamic features which are always written regardless of their
144144
configuration. Signal handlers can examine the XSAVE buffer's XSTATE_BV
145145
field to determine if a features was written.
146+
147+
Dynamic features for virtual machines
148+
-------------------------------------
149+
150+
The permission for the guest state component needs to be managed separately
151+
from the host, as they are exclusive to each other. A coupled of options
152+
are extended to control the guest permission:
153+
154+
-ARCH_GET_XCOMP_GUEST_PERM
155+
156+
arch_prctl(ARCH_GET_XCOMP_GUEST_PERM, &features);
157+
158+
ARCH_GET_XCOMP_GUEST_PERM is a variant of ARCH_GET_XCOMP_PERM. So it
159+
provides the same semantics and functionality but for the guest
160+
components.
161+
162+
-ARCH_REQ_XCOMP_GUEST_PERM
163+
164+
arch_prctl(ARCH_REQ_XCOMP_GUEST_PERM, feature_nr);
165+
166+
ARCH_REQ_XCOMP_GUEST_PERM is a variant of ARCH_REQ_XCOMP_PERM. It has the
167+
same semantics for the guest permission. While providing a similar
168+
functionality, this comes with a constraint. Permission is frozen when the
169+
first VCPU is created. Any attempt to change permission after that point
170+
is going to be rejected. So, the permission has to be requested before the
171+
first VCPU creation.
172+
173+
Note that some VMMs may have already established a set of supported state
174+
components. These options are not presumed to support any particular VMM.

0 commit comments

Comments
 (0)