diff options
author | Chao Gao <chao.gao@intel.com> | 2025-05-22 08:10:05 -0700 |
---|---|---|
committer | Dave Hansen <dave.hansen@linux.intel.com> | 2025-06-24 13:46:32 -0700 |
commit | 7c2c89364d9219f3a31a9a930476de5c154f13bd (patch) | |
tree | 0deccf59bfaa4a6613962555efdf6ffa2d50c8cc /rust/helpers/helpers.c | |
parent | 7bc4ed75f2d664c5a96d1f0874c41431a84c62b2 (diff) |
x86/fpu: Initialize guest FPU permissions from guest defaults
Currently, fpu->guest_perm is copied from fpu->perm, which is derived from
fpu_kernel_cfg.default_features.
Guest defaults were introduced to differentiate the features and sizes of
host and guest FPUs. Copying guest FPU permissions from the host will lead
to inconsistencies between the guest default features and permissions.
Initialize guest FPU permissions from guest defaults instead of host
defaults. This ensures that any changes to guest default features are
automatically reflected in guest permissions, which in turn guarantees
that fpstate_realloc() allocates a correctly sized XSAVE buffer for guest
FPUs.
Suggested-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: Chao Gao <chao.gao@intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Reviewed-by: John Allen <john.allen@amd.com>
Link: https://lore.kernel.org/all/20250522151031.426788-3-chao.gao%40intel.com
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions