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 ...
|
a2b7c499 | 02-Mar-2016 |
Andrew Jones <drjones@redhat.com> |
x86: clean up exit use, use abort
Change all exit()'s for the purpose of aborts to abort()'s. This changes a handful of exit(-1)'s, which resulted in a 255 exit status (putting the status in signal
x86: clean up exit use, use abort
Change all exit()'s for the purpose of aborts to abort()'s. This changes a handful of exit(-1)'s, which resulted in a 255 exit status (putting the status in signal territory) to a 127 exit status (just below signal territory), as 127 is defined as the unittest abort. Yes, stdlib would use SIGABRT resulting in 134, but, well, we do what we can...
Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Radim KrÄmář <rkrcmar@redhat.com> Message-Id: <1456939982-13178-2-git-send-email-drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
6ed97c50 | 02-Mar-2016 |
Peter Feiner <pfeiner@google.com> |
lib: generic bitops.h
Factored out common bitops stuff, just like Linux's include/linux/bitops.h.
Signed-off-by: Peter Feiner <pfeiner@google.com> Message-Id: <1456938657-20850-3-git-send-email-pfe
lib: generic bitops.h
Factored out common bitops stuff, just like Linux's include/linux/bitops.h.
Signed-off-by: Peter Feiner <pfeiner@google.com> Message-Id: <1456938657-20850-3-git-send-email-pfeiner@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
0c4e631e | 22-Feb-2016 |
Peter Feiner <pfeiner@google.com> |
x86: vmx: fix definition of X86_CR4_VMXE
Was defined as 0x1 when it should have been 0x2000 (13th bit of CR4). See Intel manual 23.7. 0x1 is the VME 'Virtual-8086 Mode Extensions' bit, which the vmx
x86: vmx: fix definition of X86_CR4_VMXE
Was defined as 0x1 when it should have been 0x2000 (13th bit of CR4). See Intel manual 23.7. 0x1 is the VME 'Virtual-8086 Mode Extensions' bit, which the vmx tests don't exercise.
The correct bit was being set thanks to IA32_VMX_CR4_FIXED{0,1} MSRs forcing it.
I hacked the test setup to forcibly un-set the bit and observed the correct #UD VMXON behavior. Adding a test to verify the #UD behavior is follow-up work.
Signed-off-by: Peter Feiner <pfeiner@google.com> Message-Id: <1456184436-31168-1-git-send-email-pfeiner@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
456c55bc | 18-Jan-2016 |
Andrew Jones <drjones@redhat.com> |
x86: move x86/pci to the common lib
Also move pci_config_read into asm/pci.h
Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Radim KrÄmář <rkrcmar@redhat.com> Message-Id: <14531400
x86: move x86/pci to the common lib
Also move pci_config_read into asm/pci.h
Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Radim KrÄmář <rkrcmar@redhat.com> Message-Id: <1453140064-9040-7-git-send-email-drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
0c796038 | 18-Jan-2016 |
Andrew Jones <drjones@redhat.com> |
x86: pci.h: remove useless include
Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Radim KrÄmář <rkrcmar@redhat.com> Message-Id: <1453140064-9040-6-git-send-email-drjones@redhat.com
x86: pci.h: remove useless include
Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Radim KrÄmář <rkrcmar@redhat.com> Message-Id: <1453140064-9040-6-git-send-email-drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
f22a66a1 | 18-Jan-2016 |
Andrew Jones <drjones@redhat.com> |
x86: use common portio accessors from io.h
x86 code reinvents io*/out* in a few places. To prepare for a common pci driver use the common accessors from io.h in pci.c and vmexit.c. Now we use the co
x86: use common portio accessors from io.h
x86 code reinvents io*/out* in a few places. To prepare for a common pci driver use the common accessors from io.h in pci.c and vmexit.c. Now we use the correct order (value, port) for out* too.
Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Radim KrÄmář <rkrcmar@redhat.com> Message-Id: <1453140064-9040-5-git-send-email-drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
932ba2d2 | 12-Jan-2016 |
Paolo Bonzini <pbonzini@redhat.com> |
x86: simplify test_for_exception trigger functions
test_for_exception makes the unit tests simpler, but it requires the trigger function to be in on the joke: before, by calling set_exception_return
x86: simplify test_for_exception trigger functions
test_for_exception makes the unit tests simpler, but it requires the trigger function to be in on the joke: before, by calling set_exception_return; now, by calling set_exception_jmpbuf and handle_exception(NULL). The new setjmp-based implementation lets us move all of this into test_for_exception itself, so that the trigger_func can be very simple.
Suggested-by: David Matlack <dmatlack@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
03f37ef2 | 15-Dec-2015 |
Paolo Bonzini <pbonzini@redhat.com> |
x86: replace set_exception_return with longjmp-based implementation
set_exception_return forces exceptions handlers to return to a specific address instead of returning to the instruction address pu
x86: replace set_exception_return with longjmp-based implementation
set_exception_return forces exceptions handlers to return to a specific address instead of returning to the instruction address pushed by the CPU at the time of the exception. The unit tests apic.c and vmx.c use this functionality to recover from expected exceptions.
When using set_exception_return one would have to be careful not to modify the stack (such as by doing a function call) as triggering the exception will likely jump us past the instructions which undo the stack manipulation (such as a ret). This is unnecessarily brittle, and C already has a mechanism to do non-local returns---setjmp. Now that libcflat includes an implementation of setjmp, replace set_exception_return with a wrapper that takes care of restoring the processor flags as well.
Reported-by: David Matlack <dmatlack@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
9dde4243 | 15-Dec-2015 |
Paolo Bonzini <pbonzini@redhat.com> |
lib: add setjmp header and x86 implementation
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> |
98fb3357 | 08-Dec-2015 |
Andrey Smetanin <asmetanin@virtuozzo.com> |
x86/hyperv: Move Hyper-V generic code into hyperv.h/hyperv.c
This code will be used as shared between hyperv_synic and hyperv_stimer tests.
Signed-off-by: Andrey Smetanin <asmetanin@virtuozzo.com>
x86/hyperv: Move Hyper-V generic code into hyperv.h/hyperv.c
This code will be used as shared between hyperv_synic and hyperv_stimer tests.
Signed-off-by: Andrey Smetanin <asmetanin@virtuozzo.com> CC: Paolo Bonzini <pbonzini@redhat.com> CC: Marcelo Tosatti <mtosatti@redhat.com> CC: Roman Kagan <rkagan@virtuozzo.com> CC: Denis V. Lunev <den@openvz.org> CC: qemu-devel@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
1597d09d | 08-Dec-2015 |
Andrey Smetanin <asmetanin@virtuozzo.com> |
lib/x86: Make free_page() available to call
This will be used to release allocated pages by Hyper-V SynIC timers test.
Signed-off-by: Andrey Smetanin <asmetanin@virtuozzo.com> Reviewed-by: Roman Ka
lib/x86: Make free_page() available to call
This will be used to release allocated pages by Hyper-V SynIC timers test.
Signed-off-by: Andrey Smetanin <asmetanin@virtuozzo.com> Reviewed-by: Roman Kagan <rkagan@virtuozzo.com> CC: Paolo Bonzini <pbonzini@redhat.com> CC: Marcelo Tosatti <mtosatti@redhat.com> CC: Roman Kagan <rkagan@virtuozzo.com> CC: Denis V. Lunev <den@openvz.org> CC: qemu-devel@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
eab64501 | 02-Dec-2015 |
Paolo Bonzini <pbonzini@redhat.com> |
x86: use asm volatile for flags and segment register read/writes
The effects of a move from or to these registers is not entirely described by the asm's operands. Therefore, it may happen that the
x86: use asm volatile for flags and segment register read/writes
The effects of a move from or to these registers is not entirely described by the asm's operands. Therefore, it may happen that the compiler moves the asm around in ways that break tests.
In one case, the compiler marked read_ss() as pure and thus subjected it to common subexpression elimination:
u16 ss = read_ss();
// check for null segment load *mem = 0; asm volatile("mov %0, %%ss" : : "m"(*mem)); report("mov null, %%ss", read_ss() == 0);
This caused a spurious failure of the test.
Reported-by: Lucas Meneguel Rodrigues <lmr@scylladb.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
3da70799 | 16-Nov-2015 |
Huaitong Han <huaitong.han@intel.com> |
x86: pkeys: add test for PKEYS
Signed-off-by: Huaitong Han <huaitong.han@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> |
17fdf23e | 26-Oct-2015 |
Andrey Smetanin <asmetanin@virtuozzo.com> |
x86: hyperv_synic: Hyper-V SynIC test
Hyper-V SynIC is a Hyper-V synthetic interrupt controller.
The test runs on every vCPU and performs the following steps: * read from all Hyper-V SynIC MSR's *
x86: hyperv_synic: Hyper-V SynIC test
Hyper-V SynIC is a Hyper-V synthetic interrupt controller.
The test runs on every vCPU and performs the following steps: * read from all Hyper-V SynIC MSR's * setup Hyper-V SynIC evt/msg pages * setup SINT's routing * inject SINT's into destination vCPU by 'hyperv-synic-test-device' * wait for SINT's isr's completion * clear Hyper-V SynIC evt/msg pages and destroy SINT's routing
Signed-off-by: Andrey Smetanin <asmetanin@virtuozzo.com> Reviewed-by: Roman Kagan <rkagan@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Vitaly Kuznetsov <vkuznets@redhat.com> CC: "K. Y. Srinivasan" <kys@microsoft.com> CC: Gleb Natapov <gleb@kernel.org> CC: Paolo Bonzini <pbonzini@redhat.com> CC: Roman Kagan <rkagan@virtuozzo.com> CC: Denis V. Lunev <den@openvz.org> CC: qemu-devel@nongnu.org CC: virtualization@lists.linux-foundation.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
7488d290 | 12-Nov-2015 |
Paolo Bonzini <pbonzini@redhat.com> |
KVM: x86: a few more x86-specific functions
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> |
867f820d | 12-Nov-2015 |
Paolo Bonzini <pbonzini@redhat.com> |
x86: tsc: add test for RDTSCP
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> |
7c5f3ee9 | 10-Sep-2015 |
Paolo Bonzini <pbonzini@redhat.com> |
ioapic: test TMR behavior
Test that TMR works right even if the virtual-APIC page is modified by another processor. Either x2apic or xapic accesses are tested, depending on whether x2apic is availa
ioapic: test TMR behavior
Test that TMR works right even if the virtual-APIC page is modified by another processor. Either x2apic or xapic accesses are tested, depending on whether x2apic is available.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
74d51c58 | 26-Aug-2015 |
Levente Kurusa <lkurusa@redhat.com> |
x86: desc: fix typo
It should be 'exception' instead of 'excecption'.
Signed-off-by: Levente Kurusa <lkurusa@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> |
372e3528 | 21-Aug-2015 |
Paolo Bonzini <pbonzini@redhat.com> |
x86: add small library to find ACPI tables
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> |
0f187a08 | 13-May-2015 |
Steve Rutherford <srutherford@google.com> |
x86: Split APIC tests into IOAPIC/APIC tests
Split apart the APIC tests into constituent parts (IOAPIC and APIC tests).
Signed-off-by: Steve Rutherford <srutherford@google.com> Message-Id: <1431482
x86: Split APIC tests into IOAPIC/APIC tests
Split apart the APIC tests into constituent parts (IOAPIC and APIC tests).
Signed-off-by: Steve Rutherford <srutherford@google.com> Message-Id: <1431482143-28018-1-git-send-email-srutherford@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
d95bd8f6 | 13-Mar-2015 |
Radim Krčmář <rkrcmar@redhat.com> |
x86: fix build (macro R interpreted as raw string)
GCC 5.0.0 enables raw strings by default and they have higher priority than macros, thus R"[...]" is interpreted incorrectly:
lib/x86/isr.c:112:
x86: fix build (macro R interpreted as raw string)
GCC 5.0.0 enables raw strings by default and they have higher priority than macros, thus R"[...]" is interpreted incorrectly:
lib/x86/isr.c:112:30: error: invalid character ')' in raw string delimiter lib/x86/isr.c:112:8: error: stray ‘R’ in program lib/x86/isr.c:112:26: error: expected ‘:’ or ‘)’ before string constant "orl $0x200, (%%"R"sp)\n\t"
Fix it by putting a space between macro R and a string literal. (We already do that somewhere.)
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
show more ...
|
cc47ddc1 | 01-Feb-2015 |
Andrew Jones <drjones@redhat.com> |
x86: expose spin_lock/unlock to lib code
Move the spin_lock/unlock declarations to lib/x86/asm/spinlock.h, allowing lib code, e.g. lib/report.c, to use spinlocks.
Signed-off-by: Andrew Jones <drjon
x86: expose spin_lock/unlock to lib code
Move the spin_lock/unlock declarations to lib/x86/asm/spinlock.h, allowing lib code, e.g. lib/report.c, to use spinlocks.
Signed-off-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
show more ...
|
a0837ab6 | 20-Jan-2015 |
Radim Krčmář <rkrcmar@redhat.com> |
lib/x86: fix apic_id() under x2APIC
We used MMIO (xAPIC) for x2APIC. This is the same as using xAPIC in globally disabled mode, and APICv enforces this by returning 0 on APIC MMIO reads under x2API
lib/x86: fix apic_id() under x2APIC
We used MMIO (xAPIC) for x2APIC. This is the same as using xAPIC in globally disabled mode, and APICv enforces this by returning 0 on APIC MMIO reads under x2APIC.
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
49583468 | 28-Aug-2014 |
Eduardo Habkost <ehabkost@redhat.com> |
x86: Check level, xlevel before returning CPUID data
None of the existing code using cpuid checks level or xlevel before running it. Instead of changing all callers, make the cpuid() function check
x86: Check level, xlevel before returning CPUID data
None of the existing code using cpuid checks level or xlevel before running it. Instead of changing all callers, make the cpuid() function check if the requested leaf is available, before returning any data.
All existing callers of cpuid() and cpuid_indexed() are checks for the presence of feature bits, so it is safe to return all zeroes when the requested CPUID leaf is not available.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|