diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2022-01-05 04:35:28 -0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-01-14 13:44:40 -0500 |
commit | c60427dd50ba9b20063ccaed0e98d62e886d7a3b (patch) | |
tree | 5555b7cc1f8a3e5946015a0262d478f5566e59d0 /arch/x86/kernel/fpu | |
parent | 690a757d610e50c2c3acd2e4bc3992cfc63feff2 (diff) | |
download | linux-stable-c60427dd50ba9b20063ccaed0e98d62e886d7a3b.tar.gz linux-stable-c60427dd50ba9b20063ccaed0e98d62e886d7a3b.tar.bz2 linux-stable-c60427dd50ba9b20063ccaed0e98d62e886d7a3b.zip |
x86/fpu: Add uabi_size to guest_fpu
Userspace needs to inquire KVM about the buffer size to work
with the new KVM_SET_XSAVE and KVM_GET_XSAVE2. Add the size info
to guest_fpu for KVM to access.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Wei Wang <wei.w.wang@intel.com>
Signed-off-by: Jing Liu <jing2.liu@intel.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Message-Id: <20220105123532.12586-18-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kernel/fpu')
-rw-r--r-- | arch/x86/kernel/fpu/core.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/fpu/xstate.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c index 271fd5bc043b..de8e8c21f355 100644 --- a/arch/x86/kernel/fpu/core.c +++ b/arch/x86/kernel/fpu/core.c @@ -240,6 +240,7 @@ bool fpu_alloc_guest_fpstate(struct fpu_guest *gfpu) gfpu->fpstate = fpstate; gfpu->xfeatures = fpu_user_cfg.default_features; gfpu->perm = fpu_user_cfg.default_features; + gfpu->uabi_size = fpu_user_cfg.default_size; fpu_init_guest_permissions(gfpu); return true; diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c index 0c0b2323cdec..10fe072f1c92 100644 --- a/arch/x86/kernel/fpu/xstate.c +++ b/arch/x86/kernel/fpu/xstate.c @@ -1545,6 +1545,7 @@ static int fpstate_realloc(u64 xfeatures, unsigned int ksize, newfps->is_confidential = curfps->is_confidential; newfps->in_use = curfps->in_use; guest_fpu->xfeatures |= xfeatures; + guest_fpu->uabi_size = usize; } fpregs_lock(); |