History log of /kvm-unit-tests/x86/pcid.c (Results 1 – 21 of 21)
Revision Date Author Comments
# dca3f4c0 24-Feb-2025 Paolo Bonzini <pbonzini@redhat.com>

Merge tag 'kvm-x86-2025.02.21' of https://github.com/kvm-x86/kvm-unit-tests into HEAD

KVM-Unit-Tests x86 changes:

- Expand the per-CPU data+stack area to 12KiB per CPU to reduce the
probability

Merge tag 'kvm-x86-2025.02.21' of https://github.com/kvm-x86/kvm-unit-tests into HEAD

KVM-Unit-Tests x86 changes:

- Expand the per-CPU data+stack area to 12KiB per CPU to reduce the
probability of tests overflowing their stack and clobbering pre-CPU
data.

- Add testcases for LA57 canonical checks.

- Add testcases for LAM.

- Add a smoke test to make sure KVM doesn't bleed split-lock #AC/#DB into
the guest.

- Fix many warts and bugs in the PMU test, and prepare it for PMU version 5
and beyond.

- Many misc fixes and cleanups.

show more ...


# b88e90e6 15-Feb-2025 Maxim Levitsky <mlevitsk@redhat.com>

x86: Move struct invpcid_desc descriptor to processor.h

Move struct invpcid_desc descriptor to processor.h so that it can be used
in tests that are external to pcid.c.

Signed-off-by: Maxim Levitsky

x86: Move struct invpcid_desc descriptor to processor.h

Move struct invpcid_desc descriptor to processor.h so that it can be used
in tests that are external to pcid.c.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20240907005440.500075-4-mlevitsk@redhat.com
Link: https://lore.kernel.org/r/20250215013018.1210432-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>

show more ...


# cd5f2fb4 20-Sep-2023 Paolo Bonzini <pbonzini@redhat.com>

Merge tag 'kvm-x86-2023.09.01' of https://github.com/kvm-x86/kvm-unit-tests into HEAD

x86 fixes, cleanups, and new testcases, and a few generic changes

- Fix a bug in runtime.bash that caused it t

Merge tag 'kvm-x86-2023.09.01' of https://github.com/kvm-x86/kvm-unit-tests into HEAD

x86 fixes, cleanups, and new testcases, and a few generic changes

- Fix a bug in runtime.bash that caused it to mishandle "check" strings with
multiple entries, e.g. a test that depends on multiple module params
- Make the PMU tests depend on vPMU support being enabled in KVM
- Fix PMU's forced emulation test on CPUs with full-width writes
- Add a PMU testcase for measuring TSX transactional cycles
- Nested SVM testcase for virtual NMIs
- Move a pile of code to ASM_TRY() and "safe" helpers
- Set up the guest stack in the LBRV tests so that the tests don't fail if the
compiler decides to generate function calls in guest code
- Ignore the "mispredict" flag in nSVM's LBRV tests to fix false failures
- Clean up usage of helpers that disable interrupts, e.g. stop inserting
unnecessary nops
- Add helpers to dedup code for programming the APIC timer
- Fix a variety of bugs in nVMX testcases related to being a 64-bit host

show more ...


# 8eb97e8f 06-Apr-2023 Sean Christopherson <seanjc@google.com>

x86: Move invpcid_safe() to processor.h and convert to asm_safe()

Move invpcid_safe() to processor.h so that it can be used by other tests,
and convert it to use asm_safe() instead of open coding AS

x86: Move invpcid_safe() to processor.h and convert to asm_safe()

Move invpcid_safe() to processor.h so that it can be used by other tests,
and convert it to use asm_safe() instead of open coding ASM_TRY() usage.

Link: https://lore.kernel.org/r/20230406025117.738014-5-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>

show more ...


# 14b54ed7 26-Jul-2022 Paolo Bonzini <pbonzini@redhat.com>

Merge tag 'for_paolo' of https://github.com/sean-jc/kvm-unit-tests into HEAD

x86 fixes, cleanups, and new sub-tests:

- Bug fix for the VMX-preemption timer expiration test
- Refactor SVM tests

Merge tag 'for_paolo' of https://github.com/sean-jc/kvm-unit-tests into HEAD

x86 fixes, cleanups, and new sub-tests:

- Bug fix for the VMX-preemption timer expiration test
- Refactor SVM tests to split out NPT tests
- Add tests for MCE banks to MSR test
- Add SMP Support for x86 UEFI tests
- x86: nVMX: Add VMXON #UD test (and exception cleanup)
- PMU cleanup and related nVMX bug fixes

show more ...


# 64c8b768 08-Jun-2022 Sean Christopherson <seanjc@google.com>

x86: Use "safe" helpers to implement unsafe CRs accessors

Use the "safe" helpers to read and write CR0, CR3, and CR4, so that an
unexpected fault results in a detailed message instead of an generic

x86: Use "safe" helpers to implement unsafe CRs accessors

Use the "safe" helpers to read and write CR0, CR3, and CR4, so that an
unexpected fault results in a detailed message instead of an generic
"unexpected fault" explosion.

Do not give RDMSR/WRMSR the same treatment. KUT's exception fixup uses
per-CPU data and thus needs a stable GS.base. Various tests modify
MSR_GS_BASE and routing them through the safe variants will cause
fireworks when trying to clear/read the exception vector with a garbage
GS.base.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20220608235238.3881916-5-seanjc@google.com

show more ...


# 4143fbfd 08-Jun-2022 Sean Christopherson <seanjc@google.com>

x86: Use "safe" terminology instead of "checking"

Rename all helpers that eat (and return) exceptions to use "safe" instead
of "checking". This aligns KUT with the kernel and KVM selftests.

Signed

x86: Use "safe" terminology instead of "checking"

Rename all helpers that eat (and return) exceptions to use "safe" instead
of "checking". This aligns KUT with the kernel and KVM selftests.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20220608235238.3881916-4-seanjc@google.com

show more ...


# fb0e760a 17-Jan-2022 Zhenzhong Duan <zhenzhong.duan@intel.com>

x86: Assign a canonical address before execute invpcid

Accidently we see pcid test failed as INVPCID_DESC[127:64] is
uninitialized before execute invpcid.

According to Intel spec: "#GP If INVPCID_T

x86: Assign a canonical address before execute invpcid

Accidently we see pcid test failed as INVPCID_DESC[127:64] is
uninitialized before execute invpcid.

According to Intel spec: "#GP If INVPCID_TYPE is 0 and the linear
address in INVPCID_DESC[127:64] is not canonical."

By zeroing the whole invpcid_desc structure, ensure the address
canonical and reserved bit zero in desc.

Also change invpcid_desc to be clearly 128bit in size no matter
in 64bit or 32bit mode to match the description in spec.

Fixes: b44d84dae10c ("Add PCID/INVPCID test")
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220117084618.442906-1-zhenzhong.duan@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 6e058ea6 12-Feb-2021 Sean Christopherson <seanjc@google.com>

x86: Add a testcase for !PCID && INVPCID

Add an "official" testcase for a guest with PCID disabled but INVPCID
enabled, which is supported by SVM and will soon be supported by VMX.

Signed-off-by: S

x86: Add a testcase for !PCID && INVPCID

Add an "official" testcase for a guest with PCID disabled but INVPCID
enabled, which is supported by SVM and will soon be supported by VMX.

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

show more ...


# 477ae7de 12-Feb-2021 Sean Christopherson <seanjc@google.com>

x86: Iterate over all INVPCID types in the enabled test

Verify that INVPCID works with all types, even those that take a PCID,
when CR4.PCIDE=0. So long as the target PCID=0, INVPCID is legal even

x86: Iterate over all INVPCID types in the enabled test

Verify that INVPCID works with all types, even those that take a PCID,
when CR4.PCIDE=0. So long as the target PCID=0, INVPCID is legal even
if CR4.PCIDE=0.

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

show more ...


# dfe94e75 12-Feb-2021 Sean Christopherson <seanjc@google.com>

x86: Remove PCID test that INVPCID isn't enabled without PCID

Drop the test that verifies INVPCID isn't enabled in the guest without
PCID also being enabled. SVM allows !PCID && INVPCID, and VMX wi

x86: Remove PCID test that INVPCID isn't enabled without PCID

Drop the test that verifies INVPCID isn't enabled in the guest without
PCID also being enabled. SVM allows !PCID && INVPCID, and VMX will soon
follow.

https://lkml.kernel.org/r/20210212003411.1102677-1-seanjc@google.com

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

show more ...


# 31e68df7 08-Jun-2020 Paolo Bonzini <pbonzini@redhat.com>

x86: always set up SMP

Currently setup_vm cannot assume that it can invoke IPIs, and therefore
only initializes CR0/CR3/CR4 on the CPU it runs on. In order to keep the
initialization code clean, le

x86: always set up SMP

Currently setup_vm cannot assume that it can invoke IPIs, and therefore
only initializes CR0/CR3/CR4 on the CPU it runs on. In order to keep the
initialization code clean, let's just call smp_init (and therefore
setup_idt) unconditionally.

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

show more ...


# a299895b 06-Dec-2019 Thomas Huth <thuth@redhat.com>

Switch the order of the parameters in report() and report_xfail()

Commit c09c54c66b1df ("lib: use an argument which doesn't require
default argument promotion") fixed a warning that occurs with Clan

Switch the order of the parameters in report() and report_xfail()

Commit c09c54c66b1df ("lib: use an argument which doesn't require
default argument promotion") fixed a warning that occurs with Clang,
but introduced a regression: If the "pass" parameter is a value
which has only set the condition bits in the upper 32 bits of a
64 bit value, the condition is now false since the value is truncated
to "unsigned int" so that the upper bits are simply discarded.

We fixed it by reverting the commit, but that of course also means
trouble with Clang again. We can not use "bool" if it is the last
parameter before the variable argument list. The proper fix is to
swap the parameters around and make the format string the last
parameter.

This patch (except the changes in lib/libcflat.h and lib/report.c
and some rebase conflicts along the way) has basically been created
with following coccinelle script (with some additional manual tweaking
of long and disabled lines afterwards):

@@
expression fmt;
expression pass;
expression list args;
@@
report(
-fmt, pass
+pass, fmt
, args);

@@
expression fmt;
expression pass;
expression list args;
@@
report_xfail(
-fmt, xfail, pass
+xfail, pass, fmt
, args);

Tested-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20191206113102.14914-1-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# badc98ca 30-Jul-2019 Krish Sadhukhan <krish.sadhukhan@oracle.com>

kvm-unit-test: x86: Replace cpuid/cpuid_indexed calls with this_cpu_has()

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

kvm-unit-test: x86: Replace cpuid/cpuid_indexed calls with this_cpu_has()

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 ...


# 40f559bc 28-Jun-2019 Krish Sadhukhan <krish.sadhukhan@oracle.com>

x86: Remove duplicate definitions of write_cr4_checking() and put it in library

..so that it can be re-used.

Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: Karl Heubaum <

x86: Remove duplicate definitions of write_cr4_checking() and put it in library

..so that it can be re-used.

Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com>
[Add 32-bit version of ASM_TRY. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# db4898e8 27-Jun-2018 Thomas Huth <thuth@redhat.com>

Mark many test functions as static

... so we can compile these files with -Wmissing-prototypes, too.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1530086528-21665-5-git-send-email-thu

Mark many test functions as static

... so we can compile these files with -Wmissing-prototypes, too.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1530086528-21665-5-git-send-email-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# a1a39c97 05-Aug-2014 Paolo Bonzini <pbonzini@redhat.com>

x86: pcid: fix clearing of CR0.PG

The test was trying to set CR0.PG, not clear it (and it was
already set, even).

Reported-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Paolo Bonzi

x86: pcid: fix clearing of CR0.PG

The test was trying to set CR0.PG, not clear it (and it was
already set, even).

Reported-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# b6a0ff03 02-Apr-2014 Paolo Bonzini <pbonzini@redhat.com>

x86: move CR0 and CR4 constants to processor.h

Move them together with the inline function that read/write the
control registers.

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


# f3cdd159 04-Jan-2014 Jan Kiszka <jan.kiszka@siemens.com>

Provide common report and report_summary services

This both reduces code duplication and standardizes the output format a
bit more.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by:

Provide common report and report_summary services

This both reduces code duplication and standardizes the output format a
bit more.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 6c8ef44f 01-Sep-2012 Mao, Junjie <junjie.mao@intel.com>

Restore cr3 after tests on PCID

The INVPCID enabling test assumes cr3[11:0] is 0. But at present PCID enabling
test sets cr3[11:0] to 1 for its own purpose and doesn't restore the register,
which le

Restore cr3 after tests on PCID

The INVPCID enabling test assumes cr3[11:0] is 0. But at present PCID enabling
test sets cr3[11:0] to 1 for its own purpose and doesn't restore the register,
which leads to a failure when INVPCID test tries to enable PCIDE.

This patch restores cr3 after PCID enabling test is done so that PCIDE can be
enabled normally in later tests.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>

show more ...


# b44d84da 18-May-2012 Mao, Junjie <junjie.mao@intel.com>

Add PCID/INVPCID test

Add unit test for basic functionality of PCID/INVPCID feature exposing in kvm.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat

Add PCID/INVPCID test

Add unit test for basic functionality of PCID/INVPCID feature exposing in kvm.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

show more ...