x86/fpu: Initialize guest fpstate and FPU pseudo container from guest defaults
authorChao Gao <chao.gao@intel.com>
Thu, 22 May 2025 15:10:06 +0000 (08:10 -0700)
committerDave Hansen <dave.hansen@linux.intel.com>
Tue, 24 Jun 2025 20:46:32 +0000 (13:46 -0700)
commit509e880b779592aafb41b3b23de3df7e4e2e2fcf
tree8b5d9b2b3b4662dd6a69d4cbb37e3081809bc6e5
parent7c2c89364d9219f3a31a9a930476de5c154f13bd
x86/fpu: Initialize guest fpstate and FPU pseudo container from guest defaults

fpu_alloc_guest_fpstate() currently uses host defaults to initialize guest
fpstate and pseudo containers. Guest defaults were introduced to
differentiate the features and sizes of host and guest FPUs. Switch to
using guest defaults instead.

Adjust __fpstate_reset() to handle different defaults for host and guest
FPUs. And to distinguish between the types of FPUs, move the initialization
of indicators (is_guest and is_valloc) before the reset.

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-4-chao.gao%40intel.com
arch/x86/kernel/fpu/core.c