History log of /kvm-unit-tests/x86/vmx_tests.c (Results 51 – 75 of 325)
Revision Date Author Comments
# 00073e2c 29-Jun-2022 Jim Mattson <jmattson@google.com>

x86: VMX: Fix the VMX-preemption timer expiration test

When the VMX-preemption timer fires between the test for
"vmx_get_test_stage() == 0" and the subsequent rdtsc instruction, the
final VM-entry t

x86: VMX: Fix the VMX-preemption timer expiration test

When the VMX-preemption timer fires between the test for
"vmx_get_test_stage() == 0" and the subsequent rdtsc instruction, the
final VM-entry to finish the guest will inadvertently update
vmx_preemption_timer_expiry_finish.

Move the code to finish the guest until after the calculations
involving vmx_preemption_timer_expiry_finish are done, so that it
doesn't matter if vmx_preemption_timer_expiry_finish is clobbered.

Signed-off-by: Jim Mattson <jmattson@google.com>
Fixes: b49a1a6d4e23 ("x86: VMX: Add a VMX-preemption timer expiration test")
Link: https://lore.kernel.org/r/20220629025634.666085-1-jmattson@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>

show more ...


# 912c0d72 30-May-2022 Thomas Huth <thuth@redhat.com>

x86: Fix typos

Correct typos which were discovered with the "codespell" utility.

Message-Id: <20220530064831.8828-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


# f1dcfd54 20-Jan-2022 Sean Christopherson <seanjc@google.com>

x86: Overhaul definitions for DR6 and DR7 bits

Clean up the mess that is debugreg.h to follow the nomenclature used by
the SDM and the kernel (as best as possible). Use the "new" defines in
various

x86: Overhaul definitions for DR6 and DR7 bits

Clean up the mess that is debugreg.h to follow the nomenclature used by
the SDM and the kernel (as best as possible). Use the "new" defines in
various tests. Opportunistically add a define for VMX's extra flag in
vmcs.GUEST_PENDING_DBG_EXCEPTIONS that is set if any DR0-3 trap matched
and was enabled.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220120002923.668708-6-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# b546af30 25-Jan-2022 Aaron Lewis <aaronlewis@google.com>

x86: Add test coverage for nested_vmx_reflect_vmexit() testing

Add a framework and test cases to ensure exceptions that occur in L2 are
forwarded to the correct place by nested_vmx_reflect_vmexit().

x86: Add test coverage for nested_vmx_reflect_vmexit() testing

Add a framework and test cases to ensure exceptions that occur in L2 are
forwarded to the correct place by nested_vmx_reflect_vmexit().

Add testing for exceptions: #GP, #UD, #DE, #DB, #BP, and #AC.

Signed-off-by: Aaron Lewis <aaronlewis@google.com>
Message-Id: <20220125203127.1161838-5-aaronlewis@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 00640ddb 25-Nov-2021 Sean Christopherson <seanjc@google.com>

x86/access: nVMX: Add "access" test variants to invalidate via (INV)VPID

Add three variants of the #PF interception access test to handle TLB
invalidations by relying on VPID rules. Intercept the a

x86/access: nVMX: Add "access" test variants to invalidate via (INV)VPID

Add three variants of the #PF interception access test to handle TLB
invalidations by relying on VPID rules. Intercept the access test's
INVLPG and perform invalidation by:

1. Implicity flush on VM-Enter by disabling VPID
2. Explicitly perform INVVPID on the target address
3. Implicitly "flush" by moving to a new VPID

Case #3 exposes a bug where KVM fails to update unsync SPTEs when using
shadow paging and L1 changes the VPID it uses for L2, i.e. vmcs12->vpid.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211125012857.508243-40-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 682cc79c 25-Nov-2021 Sean Christopherson <seanjc@google.com>

nVMX: Add helper to check if VPID is supported

Add a helper to check for VPID support to deduplicate code, now and in
the future.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id:

nVMX: Add helper to check if VPID is supported

Add a helper to check for VPID support to deduplicate code, now and in
the future.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211125012857.508243-39-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 6250b38e 25-Nov-2021 Sean Christopherson <seanjc@google.com>

nVMX: Rename awful "ctrl" booleans to "is_ctrl_valid"

Rename ctrl to is_ctrl_valid in several tests. The variables are bools
that, *** drum roll ***, track if a control setting is valid.

Signed-of

nVMX: Rename awful "ctrl" booleans to "is_ctrl_valid"

Rename ctrl to is_ctrl_valid in several tests. The variables are bools
that, *** drum roll ***, track if a control setting is valid.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211125012857.508243-38-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 4fe1b677 25-Nov-2021 Sean Christopherson <seanjc@google.com>

nVMX: Get rid of horribly named "ctrl" boolean in test_ept_eptp()

Eliminate a now-pointless and horribly name boolean in the EPT test.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message

nVMX: Get rid of horribly named "ctrl" boolean in test_ept_eptp()

Eliminate a now-pointless and horribly name boolean in the EPT test.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211125012857.508243-37-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 48aad93d 25-Nov-2021 Sean Christopherson <seanjc@google.com>

nVMX: Add helper to check if a memtype is supported for EPT structures

Add a helper to check if a given memtype can be used for EPT structures,
and use the helper to clean up the EPT test code. An

nVMX: Add helper to check if a memtype is supported for EPT structures

Add a helper to check if a given memtype can be used for EPT structures,
and use the helper to clean up the EPT test code. An informational
message is lost along the way, but that's not necessarily a bad thing.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211125012857.508243-36-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# f58beb1c 25-Nov-2021 Sean Christopherson <seanjc@google.com>

nVMX: Add helpers to check for 4/5-level EPT support

Add helpers to check for 4-level and 5-level EPT support. Yet another
baby step toward removing unnecessary RDMSRs...

Signed-off-by: Sean Chris

nVMX: Add helpers to check for 4/5-level EPT support

Add helpers to check for 4-level and 5-level EPT support. Yet another
baby step toward removing unnecessary RDMSRs...

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211125012857.508243-34-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 57ad374a 25-Nov-2021 Sean Christopherson <seanjc@google.com>

nVMX: Use helper to check for EPT A/D support

Use the existing helper to check for EPT A/D support instead of rereading
the capabilities MSR and open-coding the check.

Signed-off-by: Sean Christoph

nVMX: Use helper to check for EPT A/D support

Use the existing helper to check for EPT A/D support instead of rereading
the capabilities MSR and open-coding the check.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211125012857.508243-33-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 3529e54a 25-Nov-2021 Sean Christopherson <seanjc@google.com>

nVMX: Add helper to get first supported INVVPID type

Deduplicate some clever/interesting code for retrieving the first
supported INVVPID type, and opportunistically avoid RDMSR on every test.

Signe

nVMX: Add helper to get first supported INVVPID type

Deduplicate some clever/interesting code for retrieving the first
supported INVVPID type, and opportunistically avoid RDMSR on every test.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211125012857.508243-32-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# b5fe3e3f 25-Nov-2021 Sean Christopherson <seanjc@google.com>

nVMX: Add helper to check if INVVPID is supported

Add a helper to check for basic INVVPID, it will gain more users in the
future.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id:

nVMX: Add helper to check if INVVPID is supported

Add a helper to check for basic INVVPID, it will gain more users in the
future.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211125012857.508243-31-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# f19da7cc 25-Nov-2021 Sean Christopherson <seanjc@google.com>

nVMX: Add helper to check if INVVPID type is supported

Add a helper to deduplicate code, now and in the future, and to avoid a
RDMSR every time a VPID test wants to do a basic functionality check.

nVMX: Add helper to check if INVVPID type is supported

Add a helper to deduplicate code, now and in the future, and to avoid a
RDMSR every time a VPID test wants to do a basic functionality check.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211125012857.508243-30-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 3b6c56b3 25-Nov-2021 Sean Christopherson <seanjc@google.com>

nVMX: Remove "v1" version of INVVPID test

Yank out the old INVVPID and drop the version info from the new test,
which is a complete superset. That, and the old test was apparently
trying to win an

nVMX: Remove "v1" version of INVVPID test

Yank out the old INVVPID and drop the version info from the new test,
which is a complete superset. That, and the old test was apparently
trying to win an obfuscated C contest.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211125012857.508243-29-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 2a11f328 25-Nov-2021 Sean Christopherson <seanjc@google.com>

nVMX: Drop less-than-useless ept_sync() wrapper

Drop ept_sync(), it's nothing more than a wrapper to invept() with
open-coded "assertions" that the desired flavor of INVEPT is supported.

Signed-off

nVMX: Drop less-than-useless ept_sync() wrapper

Drop ept_sync(), it's nothing more than a wrapper to invept() with
open-coded "assertions" that the desired flavor of INVEPT is supported.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211125012857.508243-26-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 22d36c30 25-Nov-2021 Sean Christopherson <seanjc@google.com>

nVMX: Assert success in unchecked INVEPT/INVVPID helpers

Assert if INVEPT or INVVPID fails instead of silently ignoring potential
problems and hoping they'll show up later.

Signed-off-by: Sean Chri

nVMX: Assert success in unchecked INVEPT/INVVPID helpers

Assert if INVEPT or INVVPID fails instead of silently ignoring potential
problems and hoping they'll show up later.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211125012857.508243-25-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# ca530a10 25-Nov-2021 Sean Christopherson <seanjc@google.com>

nVMX: Skip EPT tests if INVEPT(SINGLE_CONTEXT) is unsupported

EPT can technically be supported without INVEPT(SINGLE_CONTEXT), skip the
EPT tests if SINGLE_CONTEXT isn't supported as it's heavily us

nVMX: Skip EPT tests if INVEPT(SINGLE_CONTEXT) is unsupported

EPT can technically be supported without INVEPT(SINGLE_CONTEXT), skip the
EPT tests if SINGLE_CONTEXT isn't supported as it's heavily used (without
the result being checked, yay).

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211125012857.508243-22-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# c50c1950 10-Nov-2021 Aaron Lewis <aaronlewis@google.com>

x86: Add tests that run ac_test_run() in an L2 guest

Add tests vmx_pf_exception_test and vmx_pf_exception_test_reduced_maxphyaddr
to vmx_tests.c.

The purpose of these tests are to test the reflecti

x86: Add tests that run ac_test_run() in an L2 guest

Add tests vmx_pf_exception_test and vmx_pf_exception_test_reduced_maxphyaddr
to vmx_tests.c.

The purpose of these tests are to test the reflection logic in KVM to
ensure exceptions are being routed to were they are intended to go. For
example, it will test that we are not accidentally reflecting exceptions
into L1 when L1 isn't expecting them. Commit 18712c13709d ("KVM: nVMX:
Use vmx_need_pf_intercept() when deciding if L0 wants a #PF") fixed an
issue related to this which went undetected because there was no testing
in place. This adds testing to ensure there is coverage for such
issues.

Signed-off-by: Aaron Lewis <aaronlewis@google.com>
Message-Id: <20211110212001.3745914-15-aaronlewis@google.com>
[Add timeout of 5 minutes. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# f7599ce5 15-Oct-2021 Jim Mattson <jmattson@google.com>

x86: Add a regression test for L1 LDTR persistence bug

Add a regression test for Linux commit afc8de0118be ("KVM: nVMX: Set
LDTR to its architecturally defined value on nested VM-Exit"). L1's
LDTR s

x86: Add a regression test for L1 LDTR persistence bug

Add a regression test for Linux commit afc8de0118be ("KVM: nVMX: Set
LDTR to its architecturally defined value on nested VM-Exit"). L1's
LDTR should be 0 after an emulated VM-exit from L2.

Signed-off-by: Jim Mattson <jmattson@google.com>
Message-Id: <20211015195530.301237-4-jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 91abf0b9 10-Nov-2021 Paolo Bonzini <pbonzini@redhat.com>

Merge branch 'gdt-idt-cleanup' into master


# 5ed10141 21-Oct-2021 Paolo Bonzini <pbonzini@redhat.com>

x86: unify name of 32-bit and 64-bit GDT

There's no need to distinguish gdt32 and gdt64, since the same C functions
operate on both and selector numbers are mostly unified between 32-
and 64-bit ver

x86: unify name of 32-bit and 64-bit GDT

There's no need to distinguish gdt32 and gdt64, since the same C functions
operate on both and selector numbers are mostly unified between 32-
and 64-bit versions.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# a3001422 19-Oct-2021 Oliver Upton <oupton@google.com>

x86: Consistently use safe_halt() in place of inline assembly

The safe_halt() library function simply performs an 'sti; hlt'
instruction sequence. There are several places where bare inline
assembly

x86: Consistently use safe_halt() in place of inline assembly

The safe_halt() library function simply performs an 'sti; hlt'
instruction sequence. There are several places where bare inline
assembly was used instead of this helper. Replace all open-coded
implementations with the helper.

No functional change intended.

Signed-off-by: Oliver Upton <oupton@google.com>
Message-Id: <20211019225351.970397-1-oupton@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 5c3582f0 05-Oct-2021 Janis Schoetterl-Glausch <scgl@linux.ibm.com>

Use report_pass(...) instead of report(1/true, ...)

Whitespace is kept consistent with the rest of the file.

Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Reviewed-by: Thomas Huth <t

Use report_pass(...) instead of report(1/true, ...)

Whitespace is kept consistent with the rest of the file.

Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20211005090921.1816373-6-scgl@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...


# 198dfd0e 05-Oct-2021 Janis Schoetterl-Glausch <scgl@linux.ibm.com>

Use report_fail(...) instead of report(0/false, ...)

Whitespace is kept consistent with the rest of the file.

Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Reviewed-by: Thomas Huth <

Use report_fail(...) instead of report(0/false, ...)

Whitespace is kept consistent with the rest of the file.

Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-Id: <20211005090921.1816373-5-scgl@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...


12345678910>>...13