Message ID | 20240207172646.3981-1-xin3.li@intel.com |
---|---|
Headers | show |
Series | Enable FRED with KVM VMX | expand |
On Wed, 2024-02-07 at 09:26 -0800, Xin Li wrote: > This patch set enables the Intel flexible return and event delivery > (FRED) architecture with KVM VMX to allow guests to utilize FRED. > We tested this FRED KVM patch set on a 7th Intel(R) Core(TM) CPU and the Intel Simics® Simulator with the following four configurations: The first config is the baseline on bare metal. The second config is the baseline on Intel Simics® Simulator. The third config enables host FRED, but disables guest FRED. The last config enables both host and guest FRED. Following are the Kselftest results on KVM guests. +---------------------------------------------+-------+-------+-------+-------+ | Config | Pass | Fail | Skip | Hang | +---------------------------------------------+-------+-------+-------+-------+ |the 7th Intel(R) Core(TM) CPU | | | | | | L0: 6.8.0-rc3+ w/ FRED native/KVM patch set| 1775 | 526 | 332 | 6 | | L1: 6.8.0-rc3+ | | | | | +---------------------------------------------+-------+-------+-------+-------+ |Intel Simics® Simulator w/o FRED model | | | | | | L0: 6.8.0-rc3+ w/ FRED native/KVM patch set| 1770 | 526 | 331 | 12 | | L1: 6.8.0-rc3+ w/ FRED native/KVM patch set| | | | | +---------------------------------------------+-------+-------+-------+-------+ |Intel Simics® Simulator w/ FRED model | | | | | | L0: 6.8.0-rc3+ w/ FRED native/KVM patch set| 1770 | 526 | 331 | 12 | | L1: 6.8.0-rc3+ w/ FRED native/KVM patch set| | | | | | but FRED disabled | | | | | +---------------------------------------------+-------+-------+-------+-------+ |Intel Simics® Simulator w/ FRED model | | | | | | L0: 6.8.0-rc3+ w/ FRED native/KVM patch set| 1769 | 528 | 330 | 12 | | L1: 6.8.0-rc3+ w/ FRED native/KVM patch set| | | | | +---------------------------------------------+-------+-------+-------+-------+ First of all we don't see any major issue. One major differences come from perf tests. Another variances are from timer tests due to Intel Simics® emulator's slowness. The tests "x86:sysret_rip_64" and "x86:sigreturn_32" fail on the last config, because they are not valid tests for FRED: https://lore.kernel.org/lkml/20230220030959.119222-1-ammarfaizi2@gnuweeb.org/T/#u https://lore.kernel.org/lkml/20230706052231.2183-1-xin3.li@intel.com/ NB: Some tests pass on Intel Simics® emulator, but not bare metal. If needed, we can share the data. We conducted local live migration tests with LKGS/FRED/WRMSRNS enabled/disabled on Intel Simics® Simulator, and see no problems. We also tested KVM Kselftest on a nested FRED KVM guest, 48 out of 83 cases passed and the rest cases failed due to the slowness of Intel Simics® emulator. Detailed report upon request.
> This patch set enables the Intel flexible return and event delivery > (FRED) architecture with KVM VMX to allow guests to utilize FRED. > <snip> > > Intel VMX architecture is extended to run FRED guests, and the major changes > are: > > 1) New VMCS fields for FRED context management, which includes two new > event data VMCS fields, eight new guest FRED context VMCS fields and eight new > host FRED context VMCS fields. > > 2) VMX nested-exception support for proper virtualization of stack levels > introduced with FRED architecture. > <snip> > > Patch 1-2 are cleanups to VMX basic and misc MSRs, which were sent out earlier > as a preparation for FRED changes: > https://lore.kernel.org/kvm/20240206182032.1596-1-xin3.li@intel.com/T/#u Obviously I will drop the 2 clean patches in the next iteration. > Patch 3-15 add FRED support to VMX. > Patch 16-21 add FRED support to nested VMX. > Patch 22 exposes FRED and its baseline features to KVM guests. > Patch 23-25 add FRED selftests. Please help to review and comment on the FRED KVM/VMX patches. Thanks! Xin
On Wed, Mar 27, 2024, Shan Kang wrote: > On Wed, 2024-02-07 at 09:26 -0800, Xin Li wrote: > > This patch set enables the Intel flexible return and event delivery > > (FRED) architecture with KVM VMX to allow guests to utilize FRED. > > > We tested this FRED KVM patch set on a 7th Intel(R) Core(TM) CPU and the Intel > Simics® Simulator with the following four configurations: That likely provides coverage for the happy cases, but I doubt it provides negative testing, e.g. for VM-Enter consistency checks. KVM-Unit-Tests are currently the best choice for concistency checks (unfortunately). And given the insanity of event re-injection, KVM selftests needs a dedicated test for that, and another for the interactions with nVMX, e.g. a la svm_nested_soft_inject_test.c. I haven't looked too closely at the selftest that's already provided, but my suspicion is that we'll want multiple tests, or alternatively one test that uses KVM_ONE_VCPU_TEST_SUITE().
> On Wed, Mar 27, 2024, Shan Kang wrote: > > On Wed, 2024-02-07 at 09:26 -0800, Xin Li wrote: > > > This patch set enables the Intel flexible return and event delivery > > > (FRED) architecture with KVM VMX to allow guests to utilize FRED. > > > > > We tested this FRED KVM patch set on a 7th Intel(R) Core(TM) CPU and > > the Intel Simics® Simulator with the following four configurations: > > That likely provides coverage for the happy cases, but I doubt it provides negative > testing, e.g. for VM-Enter consistency checks. KVM-Unit-Tests are currently the > best choice for concistency checks (unfortunately). > > And given the insanity of event re-injection, KVM selftests needs a dedicated test > for that, and another for the interactions with nVMX, e.g. a la > svm_nested_soft_inject_test.c. > > I haven't looked too closely at the selftest that's already provided, but my > suspicion is that we'll want multiple tests, or alternatively one test that uses > KVM_ONE_VCPU_TEST_SUITE(). What about posting the FRED selftests in another new patch set? Thanks! Xin