Skip to content
  1. Feb 24, 2022
  2. Feb 22, 2022
  3. Feb 18, 2022
  4. Feb 15, 2022
  5. Feb 14, 2022
  6. Feb 11, 2022
  7. Feb 10, 2022
    • Oliver Upton's avatar
      KVM: VMX: Use local pointer to vcpu_vmx in vmx_vcpu_after_set_cpuid() · 48ebd0cf
      Oliver Upton authored
      
      
      There is a local that contains a pointer to vcpu_vmx already. Just use
      that instead to get at the structure directly instead of doing pointer
      arithmetic.
      
      No functional change intended.
      
      Signed-off-by: default avatarOliver Upton <oupton@google.com>
      Message-Id: <20220204204705.3538240-8-oupton@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      48ebd0cf
    • Vitaly Kuznetsov's avatar
      KVM: selftests: nSVM: Add enlightened MSR-Bitmap selftest · e67bd7df
      Vitaly Kuznetsov authored
      
      
      Introduce a new test for Hyper-V nSVM extensions (Hyper-V on KVM) and add
      a test for enlightened MSR-Bitmap feature:
      
      - Intercept access to MSR_FS_BASE in L1 and check that this works
        with enlightened MSR-Bitmap disabled.
      - Enabled enlightened MSR-Bitmap and check that the intercept still works
        as expected.
      - Intercept access to MSR_GS_BASE but don't clear the corresponding bit
        from clean fields mask, KVM is supposed to skip updating MSR-Bitmap02 and
        thus the consequent access to the MSR from L2 will not get intercepted.
      - Finally, clear the corresponding bit from clean fields mask and check
        that access to MSR_GS_BASE is now intercepted.
      
      The test works with the assumption, that access to MSR_FS_BASE/MSR_GS_BASE
      is not intercepted for L1. If this ever becomes not true the test will
      fail as nested_svm_exit_handled_msr() always checks L1's MSR-Bitmap for
      L2 irrespective of clean fields. The behavior is correct as enlightened
      MSR-Bitmap feature is just an optimization, KVM is not obliged to ignore
      updates when the corresponding bit in clean fields stays clear.
      
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20220203104620.277031-7-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      e67bd7df
    • Vitaly Kuznetsov's avatar
      KVM: selftests: nSVM: Update 'struct vmcb_control_area' definition · 29f557d5
      Vitaly Kuznetsov authored
      
      
      There's a copy of 'struct vmcb_control_area' definition in KVM selftests,
      update it to allow testing of the newly introduced features.
      
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20220203104620.277031-6-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      29f557d5
    • Vitaly Kuznetsov's avatar
      KVM: selftests: nSVM: Set up MSR-Bitmap for SVM guests · 0b815117
      Vitaly Kuznetsov authored
      
      
      Similar to VMX, allocate memory for MSR-Bitmap and fill in 'msrpm_base_pa'
      in VMCB. To use it, tests will need to set INTERCEPT_MSR_PROT interception
      along with the required bits in the MSR-Bitmap.
      
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20220203104620.277031-5-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      0b815117
    • Vitaly Kuznetsov's avatar
      KVM: selftests: nVMX: Add enlightened MSR-Bitmap selftest · 70e477d9
      Vitaly Kuznetsov authored
      
      
      Introduce a test for enlightened MSR-Bitmap feature (Hyper-V on KVM):
      - Intercept access to MSR_FS_BASE in L1 and check that this works
       with enlightened MSR-Bitmap disabled.
      - Enabled enlightened MSR-Bitmap and check that the intercept still works
      as expected.
      - Intercept access to MSR_GS_BASE but don't clear the corresponding bit
      from 'hv_clean_fields', KVM is supposed to skip updating MSR-Bitmap02 and
      thus the consequent access to the MSR from L2 will not get intercepted.
      - Finally, clear the corresponding bit from 'hv_clean_fields' and check
      that access to MSR_GS_BASE is now intercepted.
      
      The test works with the assumption, that access to MSR_FS_BASE/MSR_GS_BASE
      is not intercepted for L1. If this ever becomes not true the test will
      fail as nested_vmx_exit_handled_msr() always checks L1's MSR-Bitmap for
      L2 irrespective of 'hv_clean_fields'. The behavior is correct as
      enlightened MSR-Bitmap feature is just an optimization, KVM is not obliged
      to ignore updates when the corresponding bit in 'hv_clean_fields' stays
      clear.
      
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20220203104620.277031-4-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      70e477d9
Loading