Commit graph

13 commits

Author SHA1 Message Date
Bernd Kuhls d5080edec9 package/kvm-unit-tests: add hash
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-06-11 14:29:29 +02:00
Thomas Petazzoni bdadcf593d kvm-unit-tests: fix build on x86-64 with specific gcc versions
kvm-unit-tests uses the following code on x86/x86-64:

static inline u64 scale_delta(u64 delta, u64 mul_frac)
{
        u64 product, unused;

        __asm__ (
                "mul %3"
                : "=d" (product), "=a" (unused) : "1" (delta), "rm" ((u64)mul_frac) );

        return product;
}

The "mul" instruction does not have a suffix that indicates the width of
the data being multiplied. When the data is passed in a register, there
is no need to specify the width, but with some gcc versions, the data is
passed as a memory reference, and therefore the assembler does not know
the width of the data to be multiplied. It causes the following build
failure:

x86/hyperv_clock.c: Assembler messages:
x86/hyperv_clock.c:21: Error: no instruction mnemonic suffix given and no register operands; can't size instruction

Since the data being multiplied is 64 bit, we explicitly specify the
instruction as being "mulq".

Fixes:

  http://autobuild.buildroot.net/results/a4a65d01f049db83a93de92660f228dd18532625/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-05-11 22:13:19 +02:00
Adam Duskett 6acd0a542e package/k*/Config.in: fix ordering of statements
The check-package script when ran gives warnings on ordering issues
on all of these Config files.  This patch cleans up all warnings
related to the ordering in the Config files for packages starting with
the letter k in the package directory.

The appropriate ordering is: type, default, depends on, select, help
See http://nightly.buildroot.org/#_config_files for more information.

Signed-off-by: Adam Duskett <Adamduskett@outlook.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-05-01 11:39:51 +02:00
Rahul Bedarkar 9254f02266 package: use SPDX short identifier for LGPLv2/LGPLv2+
We want to use SPDX identifier for license string as much as possible.
SPDX short identifier for LGPLv2/LGPLv2+ is LGPL-2.0/LGPL-2.0+.

This change is done using following command.
find . -name "*.mk" | xargs sed -ri '/LICENSE( )?[\+:]?=/s/LGPLv2(\+)?/LGPL-2.0\1/g'

Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-04-01 15:19:13 +02:00
Arnout Vandecappelle 592188e34b kvm-unit-tests: only enable for ARM on Cortex-A{7,12,15,17}
The library uses the hypervisor instruction HVC, which is only
available on ARMv7-A with Hypervisor extensions. This is limited to
Cortex-A{7,12,15,17}.

In addition the build unconditionally passes -marm so it also needs
ARM instructions to be available, but that is already implied by the
CPU selection.

Implicitly fixes
http://autobuild.buildroot.net/results/53d109fd9055fd20387bb857aced5f89cf3086fd
though it is still not clear why ld doesn't accept the -Ttext=...
option there.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
[Thomas: A12 and A17 also have the virtualization extensions.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-20 15:48:10 +01:00
Arnout Vandecappelle 4d907c71d4 kvm-unit-tests: pass the --processor configure argument
The configure script uses this to set the -mcpu option. If nothing is
passed, it defaults to -mcpu=cortex-a15 for arm, and -mcpu=cortex-a57
for aarch64, which may conflict with the actual architecture.

The --processor option is only really used for arm and aarch64, but it
doesn't hurt to also pass it for the other arches.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-20 15:46:54 +01:00
Thomas Petazzoni 0bb0443ee9 kvm-unit-tests: add patch to remove -Werror
Fixes:

  http://autobuild.buildroot.net/results/52c02c68be6c0b3e907f7ed645bd2d18476ec4f3/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-06 13:57:51 +01:00
Thomas Petazzoni 9f9903eaa6 kvm-unit-tests: really use KVM_UNIT_TESTS_ARCH and fix value on x86-64
The kvm-unit-tests package defines a KVM_UNIT_TESTS_ARCH variable, but
never used it. Due to this, on PowerPC64, we were passing an incorrect
value, causing a build failure.

In addition, once the KVM_UNIT_TESTS_ARCH is used, it appeared that
its value for x86_64 was incorrect, due a typo: it was x86_84 instead
of x86_64.

Fixes:

  http://autobuild.buildroot.net/results/16836c02f4d1ab5df6b2e21a4fcdbbf4a7542f22/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-06 13:39:26 +01:00
Thomas Petazzoni bde0250f06 kvm-unit-tests: add gcc version dependencies
On x86 (both i386 and x86_64), the kvm-unit-tests code uses
__builtin_reachable, which appeared in gcc 4.5. This commit adds the
relevant dependencies to kvm-unit-tests:

 - on i386, we need gcc 4.5 as the target compiler

 - on x86-64, we need gcc 4.5 as the host compiler, because we use the
   host compiler to build kvm-unit-tests for this architecture

Fixes:

  http://autobuild.buildroot.net/results/21340a7e6494e23adb2fe8dc6253ab220c380fec/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-26 21:13:54 +02:00
Cyril Bur 0f416f55c4 kvm-unit-tests: Bump version
This version bump includes several fixes for x86 and a significant fix
to powerpc transactional memory tests.

Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-26 12:33:48 +02:00
Cyril Bur e1b344070c kvm-unit-tests: Fix x86_64 to use host compiler
kvm-unit-tests requires a multilib compiler for x86_64 as it compiles
32bit boot code.

This patch uses the BR2_HOSTARCH_NEEDS_IA32_COMPILER option to enforce
this and avoids using TARGET_CROSS for x86_64 targets and uses the host
32bit (and 64bit) capable compiler.

Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
[Thomas: reword comment in .mk file.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-26 12:33:31 +02:00
Cyril Bur c0fa315d55 package/kvm-unit-tests: bump version
Most importantly this version includes a change to kvm-unit-tests which
means it will stop looking attempting to include host headers. This
change should fix build breakage on i386.

"ERROR: unsafe header/library path used in cross-compilation: '-I'
'/lib/modules/3.13.0-042stab111.12/build/include'"

The new version also includes more powerpc tests.

Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-09-25 23:20:11 +02:00
Cyril Bur ddcb1e4e92 package/kvm-unit-tests: new package
The unit tests are tiny guest operating systems that generally execute
only tens of lines of C and assembler test code in order to obtain its
PASS/FAIL result. Unit tests provide KVM and virt hardware functional
testing by targeting the features through minimal implementations of
their use per the hardware specification. The simplicity of unit tests
make them easy to verify they are correct, easy to maintain, and easy
to use in timing measurements. Unit tests are also often used for
quick and dirty bug reproducers. The reproducers may then be kept as
regression tests. It's strongly encouraged that patches implementing
new KVM features are submitted with accompanying unit tests.

Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
[Thomas:
 - order architecture dependencies in Config.in alphabetically.
 - rewrap Config.in help text, lines were too long
 - add an empty line between the package description and the upstream
   project URL in the Config.in help text
 - don't make KVM_UNIT_TESTS_ARCH default to $(ARCH). This was not
   correct for i386 for example. Instead, just handle the few
   architectures that the package supports.
 - remove useless double quotes in variable definitions.
 - remove --prefix="$(TARGET_DIR)" from CONF_OPTS. It was installing
   everything in /share/ and not /usr/share/, and setting the prefix to
   TARGET_DIR at configure time is not good. Instead, pass DESTDIR at
   installation time.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-09-19 14:14:37 +02:00