History log of /kvm-unit-tests/x86/taskswitch2.c (Results 1 – 23 of 23)
Revision Date Author Comments
# 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 ...


# 787f0aeb 22-Nov-2022 Maxim Levitsky <mlevitsk@redhat.com>

x86: replace irq_{enable|disable}() with sti()/cli()

This removes a layer of indirection which is strictly
speaking not needed since its x86 code anyway.

Signed-off-by: Maxim Levitsky <mlevitsk@red

x86: replace irq_{enable|disable}() with sti()/cli()

This removes a layer of indirection which is strictly
speaking not needed since its x86 code anyway.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Link: https://lore.kernel.org/r/20221122161152.293072-2-mlevitsk@redhat.com
[sean: move and reword IRQ shadow to be above and about safe_halt()]
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>


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


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


# e0e5509b 03-May-2019 Nadav Amit <nadav.amit@gmail.com>

x86: Incorporate timestamp in delay(), call it in io_delay()

There is no guarantee that a self-IPI would be delivered immediately.
In eventinj, io_delay() is called after self-IPI is generated but d

x86: Incorporate timestamp in delay(), call it in io_delay()

There is no guarantee that a self-IPI would be delivered immediately.
In eventinj, io_delay() is called after self-IPI is generated but does
nothing.

In general, there is mess in regard to delay() and io_delay(). There are
two definitions of delay() and they do not really look on the timestamp
counter and instead count invocations of "pause" (or even "nop"), which
might be different on different CPUs/setups, for example due to
different pause-loop-exiting configurations.

To address these issues change io_delay() to really do a delay, based on
timestamp counter, and move common functions into delay.[hc].

Cc: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Signed-off-by: Nadav Amit <nadav.amit@gmail.com>
[Drop the taskswitch2.c io_delay too - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 06846df5 28-Sep-2018 Thomas Huth <thuth@redhat.com>

x86: Add missing prototypes and mark more local functions as static

To be able to compile with -Wmissing-prototypes, we also need prototypes
for functions that are called from assembler code. We put

x86: Add missing prototypes and mark more local functions as static

To be able to compile with -Wmissing-prototypes, we also need prototypes
for functions that are called from assembler code. We put the prototypes
into the .c files and not into header files here, since these functions
are not called from other .c files.
While we're at it, also mark some more functions as static in these
files which are only used locally.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1538123582-17442-3-git-send-email-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 5aca024e 22-Oct-2017 Paolo Bonzini <pbonzini@redhat.com>

lib: move page allocator here from x86

This is another step in porting the x86 (v)malloc implementation to
other architectures.

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


# efd8e5aa 22-Oct-2017 Paolo Bonzini <pbonzini@redhat.com>

lib: start moving vmalloc to generic code

For now, vmalloc provides a primitive that allocates contiguous virtual
address. Together with a page allocator that allocates single
physical memory pages

lib: start moving vmalloc to generic code

For now, vmalloc provides a primitive that allocates contiguous virtual
address. Together with a page allocator that allocates single
physical memory pages, it will provide an implementation of
alloc_ops for when an MMU is enabled.

Before doing that, however, we need to move the page allocator and
give lib/alloc.c's malloc feature parity with lib/x86/vm.c's vmalloc.

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

show more ...


# d10d16e1 06-Jun-2016 Alexander Gordeev <agordeev@redhat.com>

x86: Cleanup PT_*_MASK flags

Cc: Andrew Jones <drjones@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Reviewed-by: Andre

x86: Cleanup PT_*_MASK flags

Cc: Andrew Jones <drjones@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# b006d7eb 03-Mar-2016 Andrew Jones <drjones@redhat.com>

x86: fix printf format warnings

Signed-off-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1457008388-12749-5-git-send-email-drjones@redhat.com>
[Fix c

x86: fix printf format warnings

Signed-off-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1457008388-12749-5-git-send-email-drjones@redhat.com>
[Fix conflicts with "x86: clean up exit use, use abort". - Paolo
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Conflicts:

lib/x86/desc.c

show more ...


# 1034d60a 07-Dec-2014 Nadav Amit <namit@cs.technion.ac.il>

x86: test_conforming_switch misses es initialization

test_conforming_switch in the taskswitch2 tests, miss es initialization.
Fix it.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-

x86: test_conforming_switch misses es initialization

test_conforming_switch in the taskswitch2 tests, miss es initialization.
Fix it.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# aa5d8048 19-Aug-2014 Paolo Bonzini <pbonzini@redhat.com>

x86: taskswitch2: add debugging output to the conforming CS test

In order to use the serial console, set the IOPL to 3.

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


# 67af69b7 19-Aug-2014 Paolo Bonzini <pbonzini@redhat.com>

x86: taskswitch2: do not polute IDT for lcall/ljmp tests

Setting the EIP value in the TSS is enough, since the GDT entry is
set up already by setup_tss32.

Signed-off-by: Paolo Bonzini <pbonzini@red

x86: taskswitch2: do not polute IDT for lcall/ljmp tests

Setting the EIP value in the TSS is enough, since the GDT entry is
set up already by setup_tss32.

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

show more ...


# 3cdcf179 19-Aug-2014 Nadav Amit <namit@cs.technion.ac.il>

x86: Test task-switch with cs.rpl != cs.dpl

Commit 5045b46803 added a check that cs.dpl equals cs.rpl during task-switch.
This is a wrong check, and this patch introduces a test in which cs.dpl !=
c

x86: Test task-switch with cs.rpl != cs.dpl

Commit 5045b46803 added a check that cs.dpl equals cs.rpl during task-switch.
This is a wrong check, and this patch introduces a test in which cs.dpl !=
cs.rpl. To do so, it configures tss.cs to be conforming with rpl=3 and dpl=0.
Since the cpl after calling is 3, it does not make any prints in the callee.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


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

x86: desc: reuse cstart.S GDT and TSS

There is no particular reason to use a specific TSS in tests that
use task-switching. In fact, in many cases the tests just want
a separate interrupt stack and

x86: desc: reuse cstart.S GDT and TSS

There is no particular reason to use a specific TSS in tests that
use task-switching. In fact, in many cases the tests just want
a separate interrupt stack and could run on 64-bit just as well
if the task-switching is abstracted.

As a first step, remove duplicate protected mode setup from desc.c's
users. Just leave some spare selectors in cstart.S's GDT before
the CPUs' main TSS. Then reuse CPU 0's TSS as TSS_MAIN.

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

show more ...


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

x86: desc: change set_gdt_entry argument to selector

This interface, already used in taskswitch.c, is a bit easier to use.

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


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

libcflat: move stringification trick to a common place

Rename "str" to "xxstr" to avoid a conflict with lib/x86/processor.h.

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


# b01c8823 12-Apr-2013 Kevin Wolf <kwolf@redhat.com>

x86/taskswitch2: Task switches into/out of VM86

This adds a test case that jumps into VM86 by iret-ing to a TSS and back
to Protected Mode using a task gate in the IDT.

Signed-off-by: Kevin Wolf <k

x86/taskswitch2: Task switches into/out of VM86

This adds a test case that jumps into VM86 by iret-ing to a TSS and back
to Protected Mode using a task gate in the IDT.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>

show more ...


# ce71ddc7 11-Jan-2011 Gleb Natapov <gleb@redhat.com>

Test that error code is pushed on exception's task stack.

If exception with error code is handled by task gate, error code should
be pushed to new task stack.

Signed-off-by: Gleb Natapov <gleb@redh

Test that error code is pushed on exception's task stack.

If exception with error code is handled by task gate, error code should
be pushed to new task stack.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

show more ...


# d21b4f12 22-Dec-2010 Gleb Natapov <gleb@redhat.com>

Add another task switch test

It has more test cases then existing one. These test cases were written
when I worked on fixing task switch emulation code. Most of them check
for previously existing i

Add another task switch test

It has more test cases then existing one. These test cases were written
when I worked on fixing task switch emulation code. Most of them check
for previously existing issue.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>

show more ...