mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-16 17:23:55 +08:00
KVM: arm64: selftests: get-reg-list: Remove get-reg-list-sve
Now that we can easily run the test for multiple vcpu configs, let's merge get-reg-list and get-reg-list-sve into just get-reg-list. We also add a final change to make it more possible to run multiple tests, which is to fork the test, rather than directly run it. That allows a test to fail, but subsequent tests can still run. Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Ricardo Koller <ricarkol@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20210531103344.29325-5-drjones@redhat.com
This commit is contained in:
parent
f3032fcc9c
commit
32edd22908
1
tools/testing/selftests/kvm/.gitignore
vendored
1
tools/testing/selftests/kvm/.gitignore
vendored
@ -1,6 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
/aarch64/get-reg-list
|
||||
/aarch64/get-reg-list-sve
|
||||
/aarch64/vgic_init
|
||||
/s390x/memop
|
||||
/s390x/resets
|
||||
|
@ -79,7 +79,6 @@ TEST_GEN_PROGS_x86_64 += set_memory_region_test
|
||||
TEST_GEN_PROGS_x86_64 += steal_time
|
||||
|
||||
TEST_GEN_PROGS_aarch64 += aarch64/get-reg-list
|
||||
TEST_GEN_PROGS_aarch64 += aarch64/get-reg-list-sve
|
||||
TEST_GEN_PROGS_aarch64 += aarch64/vgic_init
|
||||
TEST_GEN_PROGS_aarch64 += demand_paging_test
|
||||
TEST_GEN_PROGS_aarch64 += dirty_log_test
|
||||
|
@ -1,3 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#define REG_LIST_SVE
|
||||
#include "get-reg-list.c"
|
@ -27,16 +27,13 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include "kvm_util.h"
|
||||
#include "test_util.h"
|
||||
#include "processor.h"
|
||||
|
||||
#ifdef REG_LIST_SVE
|
||||
#define reg_list_sve() (true)
|
||||
#else
|
||||
#define reg_list_sve() (false)
|
||||
#endif
|
||||
|
||||
static struct kvm_reg_list *reg_list;
|
||||
static __u64 *blessed_reg, blessed_n;
|
||||
|
||||
@ -588,7 +585,8 @@ static struct vcpu_config *parse_config(const char *config)
|
||||
int main(int ac, char **av)
|
||||
{
|
||||
struct vcpu_config *c, *sel = NULL;
|
||||
int i;
|
||||
int i, ret = 0;
|
||||
pid_t pid;
|
||||
|
||||
for (i = 1; i < ac; ++i) {
|
||||
if (strcmp(av[i], "--core-reg-fixup") == 0)
|
||||
@ -617,10 +615,22 @@ int main(int ac, char **av)
|
||||
c = vcpu_configs[i];
|
||||
if (sel && c != sel)
|
||||
continue;
|
||||
run_test(c);
|
||||
|
||||
pid = fork();
|
||||
|
||||
if (!pid) {
|
||||
run_test(c);
|
||||
exit(0);
|
||||
} else {
|
||||
int wstatus;
|
||||
pid_t wpid = wait(&wstatus);
|
||||
TEST_ASSERT(wpid == pid && WIFEXITED(wstatus), "wait: Unexpected return");
|
||||
if (WEXITSTATUS(wstatus) && WEXITSTATUS(wstatus) != KSFT_SKIP)
|
||||
ret = KSFT_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1026,6 +1036,7 @@ static struct vcpu_config sve_config = {
|
||||
};
|
||||
|
||||
static struct vcpu_config *vcpu_configs[] = {
|
||||
reg_list_sve() ? &sve_config : &vregs_config,
|
||||
&vregs_config,
|
||||
&sve_config,
|
||||
};
|
||||
static int vcpu_configs_n = ARRAY_SIZE(vcpu_configs);
|
||||
|
Loading…
Reference in New Issue
Block a user