diff options
author | Jing Liu <jing2.liu@intel.com> | 2022-01-05 04:35:19 -0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-01-14 13:43:21 -0500 |
commit | 5ab2f45bba4894a0db4af8567da3efd6228dd010 (patch) | |
tree | a6f415abd8710146d741d2b497af3313d5a39ae4 /arch/x86/kernel/fpu | |
parent | 0781d60f658e25fbad3b6e4261f54eb1cd3dc302 (diff) | |
download | linux-5ab2f45bba4894a0db4af8567da3efd6228dd010.tar.bz2 |
kvm: x86: Enable dynamic xfeatures at KVM_SET_CPUID2
KVM can request fpstate expansion in two approaches:
1) When intercepting guest updates to XCR0 and XFD MSR;
2) Before vcpu runs (e.g. at KVM_SET_CPUID2);
The first option doesn't waste memory for legacy guest if it doesn't
support XFD. However doing so introduces more complexity and also
imposes an order requirement in the restoring path, i.e. XCR0/XFD
must be restored before XSTATE.
Given that the agreement is to do the static approach. This is
considered a better tradeoff though it does waste 8K memory for
legacy guest if its CPUID includes dynamically-enabled xfeatures.
Successful fpstate expansion requires userspace VMM to acquire
guest xstate permissions before calling KVM_SET_CPUID2.
Also take the chance to adjust the indent in kvm_set_cpuid().
Signed-off-by: Jing Liu <jing2.liu@intel.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Message-Id: <20220105123532.12586-9-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kernel/fpu')
0 files changed, 0 insertions, 0 deletions