History log of /kvm-unit-tests/x86/vmx_tests.c (Results 101 – 125 of 325)
Revision Date Author Comments
# 2d9e3a37 30-Oct-2019 Bill Wendling <morbo@google.com>

x86: use inline asm to retrieve stack pointer

According to GCC's documentation, the only supported use for specifying
registers for local variables is "to specify registers for input and
output oper

x86: use inline asm to retrieve stack pointer

According to GCC's documentation, the only supported use for specifying
registers for local variables is "to specify registers for input and
output operands when calling Extended asm." Using it as a shortcut to
get the value in a register isn't guaranteed to work, and clang
complains that the variable is uninitialized.

Signed-off-by: Bill Wendling <morbo@google.com>
Message-Id: <20191030210419.213407-7-morbo@google.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...


# b49a1a6d 08-May-2020 Jim Mattson <jmattson@google.com>

x86: VMX: Add a VMX-preemption timer expiration test

When the VMX-preemption timer is activated, code executing in VMX
non-root operation should never be able to record a TSC value beyond
the deadli

x86: VMX: Add a VMX-preemption timer expiration test

When the VMX-preemption timer is activated, code executing in VMX
non-root operation should never be able to record a TSC value beyond
the deadline imposed by adding the scaled VMX-preemption timer value
to the first TSC value observed by the guest after VM-entry.

Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Peter Shier <pshier@google.com>
Message-Id: <20200508203938.88508-1-jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 8a06a5bb 05-May-2020 Cathy Avery <cavery@redhat.com>

KVM: VMX: add test for NMI delivery during HLT

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


# 149c2513 24-Apr-2020 Sean Christopherson <sean.j.christopherson@intel.com>

nVMX: Check EXIT_QUALIFICATION on VM-Enter failures due to bad guest state

Assert that vmcs.EXIT_QUALIFICATION contains the correct failure code on
failed VM-Enter due to invalid guest state. Hardc

nVMX: Check EXIT_QUALIFICATION on VM-Enter failures due to bad guest state

Assert that vmcs.EXIT_QUALIFICATION contains the correct failure code on
failed VM-Enter due to invalid guest state. Hardcode the expected code
to the default code, '0', rather than passing in the expected code to
minimize churn and boilerplate code, which works for all existing tests.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200424174025.1379-1-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 7af4533e 16-Apr-2020 Sean Christopherson <sean.j.christopherson@intel.com>

nVMX: Add testcase to cover VMWRITE to nonexistent CR3-target values

Enhance test_cr3_targets() to verify that attempting to write CR3-target
value fields beyond the reported number of supported tar

nVMX: Add testcase to cover VMWRITE to nonexistent CR3-target values

Enhance test_cr3_targets() to verify that attempting to write CR3-target
value fields beyond the reported number of supported targets fails.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200416162814.32065-1-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 47be871d 14-Apr-2020 Jim Mattson <jmattson@google.com>

x86: VMX: Add another corner-case VMX-preemption timer test

Ensure that the delivery of a "VMX-preemption timer expired" VM-exit
doesn't disrupt single-stepping in the guest. Note that passing this

x86: VMX: Add another corner-case VMX-preemption timer test

Ensure that the delivery of a "VMX-preemption timer expired" VM-exit
doesn't disrupt single-stepping in the guest. Note that passing this
test doesn't ensure correctness.

Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Oliver Upton <oupton@google.com>
Reviewed-by: Peter Shier <pshier@google.com>
Message-Id: <20200414001026.50051-2-jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# aa004fc0 14-Apr-2020 Jim Mattson <jmattson@google.com>

x86: nVMX: Add some corner-case VMX-preemption timer tests

Verify that both injected events and debug traps that result from
pending debug exceptions take precedence over a "VMX-preemption timer
exp

x86: nVMX: Add some corner-case VMX-preemption timer tests

Verify that both injected events and debug traps that result from
pending debug exceptions take precedence over a "VMX-preemption timer
expired" VM-exit resulting from a zero-valued VMX-preemption timer.

Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Oliver Upton <oupton@google.com>
Reviewed-by: Peter Shier <pshier@google.com>
Message-Id: <20200414001026.50051-1-jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 9870fcb6 14-Apr-2020 Oliver Upton <oupton@google.com>

x86: VMX: test MTF VM-exit event injection

SDM 26.6.2 describes how the VM-entry interruption-information field
may be configured to inject an MTF VM-exit upon VM-entry. Ensure that an
MTF VM-exit o

x86: VMX: test MTF VM-exit event injection

SDM 26.6.2 describes how the VM-entry interruption-information field
may be configured to inject an MTF VM-exit upon VM-entry. Ensure that an
MTF VM-exit occurs when the VM-entry interruption-information field is
configured appropriately by the host.

Signed-off-by: Oliver Upton <oupton@google.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Peter Shier<pshier@google.com>
Message-Id: <20200414214634.126508-2-oupton@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# ce27fa2c 21-Mar-2020 Nadav Amit <namit@vmware.com>

x86: vmx: skip atomic_switch_overflow_msrs_test on bare metal

The test atomic_switch_overflow_msrs_test is only expected to pass on
KVM. Skip the test when the debug device is not supported to avoid

x86: vmx: skip atomic_switch_overflow_msrs_test on bare metal

The test atomic_switch_overflow_msrs_test is only expected to pass on
KVM. Skip the test when the debug device is not supported to avoid
failures on bare-metal.

Cc: Marc Orr <marcorr@google.com>
Signed-off-by: Nadav Amit <namit@vmware.com>
Message-Id: <20200321050616.4272-1-namit@vmware.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# b19a7f78 21-Mar-2020 Nadav Amit <namit@vmware.com>

x86: vmx: Fix "EPT violation - paging structure" test

Running the tests with more than 4GB of memory results in the following
failure:

FAIL: EPT violation - paging structure

It appears that the

x86: vmx: Fix "EPT violation - paging structure" test

Running the tests with more than 4GB of memory results in the following
failure:

FAIL: EPT violation - paging structure

It appears that the test mistakenly used get_ept_pte() to retrieve the
guest PTE, but this function is intended for accessing EPT and not the
guest page tables. Use get_pte_level() instead of get_ept_pte().

Tested on bare-metal only.

Signed-off-by: Nadav Amit <namit@vmware.com>
Message-Id: <20200321050555.4212-1-namit@vmware.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# a2777607 17-Mar-2020 Krish Sadhukhan <krish.sadhukhan@oracle.com>

kvm-unit-test: nVMX: Test GUEST_BNDCFGS VM-Entry control on vmentry of nested guests

According to section "Checks on Guest Control Registers, Debug Registers,
and MSRs" in Intel SDM vol 3C, the foll

kvm-unit-test: nVMX: Test GUEST_BNDCFGS VM-Entry control on vmentry of nested guests

According to section "Checks on Guest Control Registers, Debug Registers,
and MSRs" in Intel SDM vol 3C, the following checks are performed on
vmentry of nested guests:

If the "load IA32_BNDCFGS" VM-entry control is 1, the following
checks are performed on the field for the IA32_BNDCFGS MSR:

— Bits reserved in the IA32_BNDCFGS MSR must be 0.
— The linear address in bits 63:12 must be canonical.

Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 1649ab71 12-Feb-2020 Nadav Amit <namit@vmware.com>

x86: vmx: Expect multiple error codes on HOST_EFER corruption

Extended HOST_EFER tests can fail with a different error code than the
expected one, since the host address size bit is checked against

x86: vmx: Expect multiple error codes on HOST_EFER corruption

Extended HOST_EFER tests can fail with a different error code than the
expected one, since the host address size bit is checked against
EFER.LMA. This causes kvm-unit-tests to fail on bare metal. According
to the SDM the errors are not ordered.

Expect either "invalid control" or "invalid host state" error-codes to
allow the tests to pass. The fix somewhat relaxes the tests, as there
are cases when only "invalid host state" is a valid instruction error,
but doing the fix in this manner prevents intrusive changes.

Fixes: a22d7b5534c2 ("x86: vmx_tests: extend HOST_EFER tests")
Signed-off-by: Nadav Amit <namit@vmware.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# ef5d77a0 12-Mar-2020 Sean Christopherson <sean.j.christopherson@intel.com>

nVMX: Pass exit reason enum to print_vmexit_info()

Take the exit reason as a parameter when printing VM-Exit info instead
of rereading it from the VMCS. Opportunistically clean up the related
print

nVMX: Pass exit reason enum to print_vmexit_info()

Take the exit reason as a parameter when printing VM-Exit info instead
of rereading it from the VMCS. Opportunistically clean up the related
printing.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# e0e2af90 12-Mar-2020 Sean Christopherson <sean.j.christopherson@intel.com>

nVMX: Pass exit reason union to v1 exit handlers

Pass the recently introduce "union exit_reason" to the v1 exit handlers
and use it in lieu of a manual VMREAD of the exit reason.

Opportunistically

nVMX: Pass exit reason union to v1 exit handlers

Pass the recently introduce "union exit_reason" to the v1 exit handlers
and use it in lieu of a manual VMREAD of the exit reason.

Opportunistically fix a variety of warts in the handlers, e.g. grabbing
only bits 7:0 of the exit reason. Modify the "Unknown exit reason"
prints to display the exit reason in hex format to make a failed
VM-Entry more recognizable.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# fdd5a394 12-Mar-2020 Sean Christopherson <sean.j.christopherson@intel.com>

nVMX: Expose __enter_guest() and consolidate guest state test code

Expose __enter_guest() outside of vmx.c and use it in a new wrapper for
testing guest state. Handling both success and failure pat

nVMX: Expose __enter_guest() and consolidate guest state test code

Expose __enter_guest() outside of vmx.c and use it in a new wrapper for
testing guest state. Handling both success and failure paths in a
common helper eliminates a lot of boilerplate code in the tests
themselves.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 11a6e3d5 12-Mar-2020 Sean Christopherson <sean.j.christopherson@intel.com>

nVMX: Consolidate non-canonical code in test_canonical()

Refactor test_canonical() to provide a single flow for the non-canonical
path. Practically speaking, its extremely unlikely the field being

nVMX: Consolidate non-canonical code in test_canonical()

Refactor test_canonical() to provide a single flow for the non-canonical
path. Practically speaking, its extremely unlikely the field being
tested already has a non-canonical address, and even less likely that
it's anything other than NONCANONICAL. I.e. the added complexity
doesn't come with added coverage.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 0e0ea94b 12-Mar-2020 Sean Christopherson <sean.j.christopherson@intel.com>

nVMX: Refactor VM-Entry "failure" struct into "result"

Rename "struct vmentry_failure" to "struct vmentry_result" and add the
full VM-Exit reason to the result. Implement exit_reason as a union so

nVMX: Refactor VM-Entry "failure" struct into "result"

Rename "struct vmentry_failure" to "struct vmentry_result" and add the
full VM-Exit reason to the result. Implement exit_reason as a union so
that tests can easily pull out the parts of interest, e.g. basic exit
reason, whether VM-Entry failed, etc...

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# dc54cb48 28-Feb-2020 Paolo Bonzini <pbonzini@redhat.com>

x86: VMX: the "noclone" attribute is not needed

Don't use the "noclone" attribute as it's not needed.
Also, clang does not support it.

Reported-by: Bill Wendling <morbo@google.com>
Signed-off-by: P

x86: VMX: the "noclone" attribute is not needed

Don't use the "noclone" attribute as it's not needed.
Also, clang does not support it.

Reported-by: Bill Wendling <morbo@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 46cc038c 07-Feb-2020 Oliver Upton <oupton@google.com>

x86: VMX: Add tests for monitor trap flag

Test to verify that MTF VM-exits into host are synthesized when the
'monitor trap flag' processor-based VM-execution control is set under
various conditions

x86: VMX: Add tests for monitor trap flag

Test to verify that MTF VM-exits into host are synthesized when the
'monitor trap flag' processor-based VM-execution control is set under
various conditions.

Expect an MTF VM-exit if instruction execution produces no events other
than MTF. Should instruction execution produce a concurrent debug-trap
and MTF event, expect an MTF VM-exit with the 'pending debug exceptions'
VMCS field set. Expect an MTF VM-exit to follow event delivery should
instruction execution generate a higher-priority event, such as a
general-protection fault. Lastly, expect an MTF VM-exit to follow
delivery of a debug-trap software exception (INT1/INT3/INTO/INT n).

Signed-off-by: Oliver Upton <oupton@google.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# f156755f 12-Feb-2020 Paolo Bonzini <pbonzini@redhat.com>

vmx: tweak XFAILS for #DB test

These were already fixed by KVM_CAP_EXCEPTION_PAYLOAD, but they were failing
on old QEMUs that did not support it. The recent KVM patch "KVM: x86: Deliver
exception p

vmx: tweak XFAILS for #DB test

These were already fixed by KVM_CAP_EXCEPTION_PAYLOAD, but they were failing
on old QEMUs that did not support it. The recent KVM patch "KVM: x86: Deliver
exception payload on KVM_GET_VCPU_EVENTS" however fixed them even there, so
it is about time to flip the arguments to check_db_exit and avoid ugly XPASS
results with newer versions of QEMU.

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

show more ...


# 163824c8 22-Jan-2020 Oliver Upton <oupton@google.com>

x86: VMX: Check precondition for RDTSC test

The RDTSC VM-exit test requires the 'use TSC offsetting' processor-based
VM-execution control be allowed on the host. Check this precondition
before runni

x86: VMX: Check precondition for RDTSC test

The RDTSC VM-exit test requires the 'use TSC offsetting' processor-based
VM-execution control be allowed on the host. Check this precondition
before running the test rather than asserting it later on to avoid
erroneous failures on a host without TSC offsetting.

Cc: Aaron Lewis <aaronlewis@google.com>
Signed-off-by: Oliver Upton <oupton@google.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# df84ca0a 28-Nov-2019 Oliver Upton <oupton@google.com>

x86: VMX: Check EPT AD bits when enabled in ept_access_paddr()

Modify the test helper, ept_access_paddr(), to test the correctness
of the L1's EPT AD bits when enabled. After a successful guest acce

x86: VMX: Check EPT AD bits when enabled in ept_access_paddr()

Modify the test helper, ept_access_paddr(), to test the correctness
of the L1's EPT AD bits when enabled. After a successful guest access,
assert that the accessed bit (bit 8) has been set on all EPT entries
which were used in the translation of the guest-physical address.

Since ept_access_paddr() tests an EPT mapping that backs a guest paging
structure, processor accesses are treated as writes and the dirty bit
(bit 9) is set accordingly. Assert that the dirty bit is set on the leaf
EPT entry.

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

show more ...


# e5fb3067 16-Jan-2020 Krish Sadhukhan <krish.sadhukhan@oracle.com>

kvm-unit-test: nVMX: Test GUEST_DR7 on vmentry of nested guests

According to section "Checks on Guest Control Registers, Debug Registers, and
and MSRs" in Intel SDM vol 3C, the following checks are

kvm-unit-test: nVMX: Test GUEST_DR7 on vmentry of nested guests

According to section "Checks on Guest Control Registers, Debug Registers, and
and MSRs" in Intel SDM vol 3C, the following checks are performed on vmentry
of nested guests:

If the "load debug controls" VM-entry control is 1,

- bits 63:32 in the DR7 field must be 0.

Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com>
Co-developed-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# a0fec1ea 06-Dec-2019 Krish Sadhukhan <krish.sadhukhan@oracle.com>

kvm-unit-test: nVMX: Test GUEST_SYSENTER_ESP and GUEST_SYSENTER_EIP on vmentry of nested guests

According to section "Checks on Guest Control Registers, Debug Registers, and
and MSRs" in Intel SDM v

kvm-unit-test: nVMX: Test GUEST_SYSENTER_ESP and GUEST_SYSENTER_EIP on vmentry of nested guests

According to section "Checks on Guest Control Registers, Debug Registers, and
and MSRs" in Intel SDM vol 3C, the following checks are performed on vmentry
of nested guests:

"The IA32_SYSENTER_ESP field and the IA32_SYSENTER_EIP field must each
contain a canonical address."

Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 87112cae 06-Dec-2019 Krish Sadhukhan <krish.sadhukhan@oracle.com>

kvm-unit-test: nVMX: Remove test_sysenter_field() and use test_canonical() instead

..as the latter already does what the former does.

Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
R

kvm-unit-test: nVMX: Remove test_sysenter_field() and use test_canonical() instead

..as the latter already does what the former does.

Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


12345678910>>...13