- 19 Dec, 2016 18 commits
-
-
Andrew Jones authored
Reviewed-by:
Eric Auger <eric.auger@redhat.com> Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
Andrew Jones authored
Add some gicv2 support. This just adds init and enable functions, allowing unit tests to start messing with it. Reviewed-by:
Andre Przywara <andre.przywara@arm.com> Reviewed-by:
Eric Auger <eric.auger@redhat.com> Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
Andrew Jones authored
Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Eric Auger <eric.auger@redhat.com> Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
Andrew Jones authored
Allow a thread to wait some specified amount of time. Can specify in cycles, usecs, and msecs. Reviewed-by:
Andre Przywara <andre.przywara@arm.com> Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
Andrew Jones authored
By adding support for launching with gicv3 we can break the 8 vcpu limit. This patch adds support to smp code and also selects the vgic model corresponding to the host. The vgic model may also be manually selected by adding e.g. -machine gic-version=3 to extra_params. Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Andre Przywara <andre.przywara@arm.com> Reviewed-by:
Eric Auger <eric.auger@redhat.com> Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
Andrew Jones authored
In many tests one or more cpus wait for events from other cpus. However, with TCG, if the event triggering cpus then continue without first informing TCG it should schedule other cpus, then those other cpus may never get scheduled, and never see their events. This is because the TCG scheduler relies on either the currently running cpu to invoke an instruction that results in scheduling or for some I/O event to occur, and then to do scheduling while handling the I/O. kvm-unit-tests do not have external I/O events, so we must invoke a yielding instruction wherever needed. cpu_relax() is almost always a place it's needed. While this change is mostly for TCG, it's fine to do for KVM as well. The Linux kernel made the same change with 1baa82f4803 for armv8. As the yield instruction is also available on armv7, we make the change for both. Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
Andrew Jones authored
The TCG PMU is barely implemented for ARM and not at all implemented for AArch64. Let's not bother running the TCG-only tests yet. We'll likely move them to a new TCG-only unittests.cfg at some point before re-enabling them too. Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
Andrew Jones authored
The spec for ID_DFR0_EL1 says "In an AArch64-only implementation, this register is UNKNOWN." Indeed ThunderX just returns zero when that register is read. This means we can't rely on a non-zero value to determine if we can test the PMU. For AArch64 we need to read ID_AA64DFR0_EL1. This patch has the side effect of no longer running PMU tests on TCG for AArch64. That's actually another fix, though, as TCG chooses not to implement a PMU for AArch64 at this time. The only way it worked before was probing the wrong register and proceeding even though the version was 2, which is not a valid version for AArch64. When TCG eventually implements a PMU things should "just work". Reviewed-by:
Wei Huang <wei@redhat.com> Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
Calculate the numbers of cycles per instruction (CPI) implied by ARM PMU cycle counter values. The code includes a strict checking facility intended for the -icount option in TCG mode in the configuration file. Signed-off-by:
Christopher Covington <cov@codeaurora.org> Signed-off-by:
Wei Huang <wei@redhat.com> Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
Ensure that reads of the PMCCNTR_EL0 are monotonically increasing, even for the smallest delta of two subsequent reads. Signed-off-by:
Christopher Covington <cov@codeaurora.org> Signed-off-by:
Wei Huang <wei@redhat.com> Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
Beginning with a simple sanity check of the control register, add a unit test for the ARM Performance Monitors Unit (PMU). Signed-off-by:
Christopher Covington <cov@codeaurora.org> Signed-off-by:
Wei Huang <wei@redhat.com> Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
This patch adds two new macros to support read/write operations of ARMv7 and ARMv8 system registers. As part of the change, xstr() is revised to support variable arguments. With it, ARMv7 system register can be defined with __ACCESS_CP15() or __ACCESS_CP15_64() depending if it is 32-bit or 64-bit. get_mpidr() is re-written with new macros. Suggested-by:
Andrew Jones <drjones@redhat.com> Signed-off-by:
Wei Huang <wei@redhat.com> Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
To prepare for future support of ARMv8 system register, rename cp15.h file to sysreg.h, with _ASMARM_CP15_H_ renamed to _ASMARM_SYSREG_H_ in header file. Signed-off-by:
Wei Huang <wei@redhat.com> Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
As distro compilers move towards defaults for build hardening for things like ASLR we need to force -fno-pic. Failure to do can lead to weird relocation problems when we build our "lat" binaries. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
Failing to translate the PCI address obtained from the bar means something isn't right with the PCI setup. As this should never happen, assert when it does. Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Signed-off-by:
Alexander Gordeev <agordeev@redhat.com> [Added commit message] Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
Function pci_host_bridge_get_paddr() returns zero in case no mapping for a passed PCI address is found. All ones is a better choice, since zero may be a legitimate physical address. Suggested-by:
Andrew Jones <drjones@redhat.com> Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Signed-off-by:
Alexander Gordeev <agordeev@redhat.com> [squashed in INVALID_PHYS_ADDR use] Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
PCI I/O and Memory must be allocated to a device in a naturally aligned way. For example, if a device asks for 0xB0 of PCI I/O space then it must be aligned on an address that is a multiple of 0xB0 (http://www.tldp.org/LDP/tlk/dd/pci.html ) Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Reported-by:
Andrew Jones <drjones@redhat.com> Signed-off-by:
Alexander Gordeev <agordeev@redhat.com> Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
Size of a BAR is naturally aligned so there is no need to align it explicitly. Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Signed-off-by:
Alexander Gordeev <agordeev@redhat.com> Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
- 16 Dec, 2016 1 commit
-
-
Jim Mattson authored
Int3 (#BP) and INTO (#OF) are unusual, in that they are reported as "software exception" rather than "hardware exception" in the VM-exit interruption information field of the VMCS. Signed-off-by:
Jim Mattson <jmattson@google.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- 30 Nov, 2016 1 commit
-
-
Kyle Huey authored
This test checks that single stepping through CPUID and RDMSR works. Both instructions trigger VM exits and are emulated by the hypervisor. Signed-off-by:
Kyle Huey <khuey@kylehuey.com> [Fixed dr6 indices to check even dr6[5] and dr6[6].] Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
- 22 Nov, 2016 2 commits
-
-
Andrew Jones authored
Test writers sometimes want to output informational messages, but they don't want to use printf because they want the prefixes as well. Rather than creating "fake" tests that always pass, with report(fmt, true, ...), provide report_info(fmt, ...). This generates 'INFO: prefixes...: message' Signed-off-by:
Andrew Jones <drjones@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
Andrew Jones authored
Signed-off-by:
Andrew Jones <drjones@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
- 21 Nov, 2016 3 commits
-
-
Jim Mattson authored
This test disables and re-enables the local APIC and ensures that CPUID.1H:EDX.APIC[bit 9] mirrors IA32_APIC_BASE[11]. Signed-off-by:
Jim Mattson <jmattson@google.com> Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
Andrew Jones authored
Adding pci-test to arm allowed us to see that a virtio-net-pci device was getting added to our machine by default. Unit tests should configure the most minimal machines they can, only adding devices necessary for the tests. Let's add -nodefaults to all the run scripts. I tested all arches (powerpc and arm on tcg). There were no unexpected changes. Signed-off-by:
Andrew Jones <drjones@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com> [powerpc] Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
Andrew Jones authored
Add two changes to run_qemu. The first saves/restores terminal settings. This solves an annoying loss of terminal echo when QEMU aborts during a test run. The second ensures we see a message about the abort, because the "Aborted (core dumped)" message we should see gets eaten. We also add a message to run()'s failure cases in its exit code processing to handle signals in general. Note, the first change is necessary because QEMU modifies the terminal settings when using '-serial stdio', but calling abort() invokes exit without first calling qemu_chr_free(serial_hds[0]) to restore them. (Additionally we fixup the premature failure check to only capture the last line, like it says it's doing.) Reported-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Andrew Jones <drjones@redhat.com> [Redirected the abort message to stderr and moved it below `stty`.] Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
- 15 Nov, 2016 1 commit
-
-
Radim Krčmář authored
Not doing so hid stderr output when the test was stuck and subsequently killed with ^C. Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
-
- 08 Nov, 2016 13 commits
-
-
Alexander Gordeev authored
Suggested-by:
Andrew Jones <drjones@redhat.com> Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by:
Andrew Jones <drjones@redhat.com> Signed-off-by:
Alexander Gordeev <agordeev@redhat.com> Message-Id: <7d7e8f320a5de2f9201c3d21f88dc63520ea41aa.1478512824.git.agordeev@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alexander Gordeev authored
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by:
Andrew Jones <drjones@redhat.com> Signed-off-by:
Alexander Gordeev <agordeev@redhat.com> Message-Id: <aa209d81d593909bfaf89bb3a91ff7f33f8441a8.1478512824.git.agordeev@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alexander Gordeev authored
Unlike x86, other architectures using generic ECAM PCI host do not have a luxury of PCI bus initialized by a BIOS and ready to use at start. Thus, we need allocate and assign resources to all devices, much like an architecture's firmware would do. There is no any sort of resource management for memory and io spaces, since only ones-per-BAR allocations are expected and no deallocations at all. Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Suggested-by:
Andrew Jones <drjones@redhat.com> Signed-off-by:
Alexander Gordeev <agordeev@redhat.com> Message-Id: <6488b060e4cbbead5a5ec525a53d65773ceb5f87.1478512824.git.agordeev@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alexander Gordeev authored
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Suggested-by:
Andrew Jones <drjones@redhat.com> Reviewed-by:
Andrew Jones <drjones@redhat.com> Signed-off-by:
Alexander Gordeev <agordeev@redhat.com> Message-Id: <b261e0c3fbfafaa4c38793d4ae632a667f46fb16.1478512824.git.agordeev@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alexander Gordeev authored
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by:
Andrew Jones <drjones@redhat.com> Signed-off-by:
Alexander Gordeev <agordeev@redhat.com> Message-Id: <bbe2afcf1701fa8905d910e141c922e2b058073f.1478512824.git.agordeev@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alexander Gordeev authored
Because the counterpart to pci_bar_set_addr() setter is pci_bar_addr() getter, these names become inconsistent. Rename pci_bar_addr() to pci_bar_get_addr() also to make the resulting names conform to each other. Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by:
Andrew Jones <drjones@redhat.com> Signed-off-by:
Alexander Gordeev <agordeev@redhat.com> Message-Id: <ce732680ee4989d1b2b26361a2c02d24b8bef37b.1478512824.git.agordeev@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alexander Gordeev authored
This update makes pci_bar_addr() interface 64 bit BARs aware and introduces a concept of PCI address translation. An architecutre should implement pci_translate_addr() interface in order to provide mapping between PCI bus address and CPU physical address. Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by:
Andrew Jones <drjones@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Alexander Gordeev <agordeev@redhat.com> Message-Id: <11145b9c19a61b4f585b3fabf5b2c64299aa89ff.1478512824.git.agordeev@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alexander Gordeev authored
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by:
Andrew Jones <drjones@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Alexander Gordeev <agordeev@redhat.com> Message-Id: <1173859894ae623b5324ad04fc6417a4591ad450.1478512824.git.agordeev@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alexander Gordeev authored
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by:
Andrew Jones <drjones@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Alexander Gordeev <agordeev@redhat.com> Message-Id: <df1dee9ef0ff2740835e0690f84b849315ee7885.1478512824.git.agordeev@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alexander Gordeev authored
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by:
Andrew Jones <drjones@redhat.com> Signed-off-by:
Alexander Gordeev <agordeev@redhat.com> Message-Id: <24c5c29c3bbd3fed9091efa8586c90068037f168.1478512824.git.agordeev@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alexander Gordeev authored
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
Andrew Jones <drjones@redhat.com> Signed-off-by:
Alexander Gordeev <agordeev@redhat.com> Message-Id: <c13b07e15d2ffa2823894bc83be62de400f29e98.1478512824.git.agordeev@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alexander Gordeev authored
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by:
Andrew Jones <drjones@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Alexander Gordeev <agordeev@redhat.com> Message-Id: <6bb1283e3dfd4c3e8c4b1ebcdd4e08485bc4c507.1478512824.git.agordeev@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Andrew Jones authored
Signed-off-by:
Andrew Jones <drjones@redhat.com> Message-Id: <1477939540-28370-1-git-send-email-drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- 03 Nov, 2016 1 commit
-
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-