[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [kvm-unit-tests PATCH v10 5/7] arm/locking-tests: add comprehensive
From: |
Andrew Jones |
Subject: |
Re: [kvm-unit-tests PATCH v10 5/7] arm/locking-tests: add comprehensive locking test |
Date: |
Tue, 21 Mar 2023 16:05:41 +0100 |
On Tue, Mar 07, 2023 at 11:28:43AM +0000, Alex Bennée wrote:
> This test has been written mainly to stress multi-threaded TCG behaviour
> but will demonstrate failure by default on real hardware. The test takes
> the following parameters:
>
> - "lock" use GCC's locking semantics
> - "atomic" use GCC's __atomic primitives
> - "wfelock" use WaitForEvent sleep
> - "excl" use load/store exclusive semantics
>
> Also two more options allow the test to be tweaked
>
> - "noshuffle" disables the memory shuffling
> - "count=%ld" set your own per-CPU increment count
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Message-Id: <20211118184650.661575-8-alex.bennee@linaro.org>
>
> ---
> v9
> - move back to unittests.cfg, drop accel=tcg
> - s/printf/report_info
> v10
> - dropped spare extra line in shuffle_memory
> ---
> arm/Makefile.common | 2 +-
> arm/locking-test.c | 321 ++++++++++++++++++++++++++++++++++++++++++++
> arm/spinlock-test.c | 87 ------------
> arm/unittests.cfg | 30 +++++
> 4 files changed, 352 insertions(+), 88 deletions(-)
> create mode 100644 arm/locking-test.c
> delete mode 100644 arm/spinlock-test.c
>
> diff --git a/arm/Makefile.common b/arm/Makefile.common
> index 2c4aad38..3089e3bf 100644
> --- a/arm/Makefile.common
> +++ b/arm/Makefile.common
> @@ -5,7 +5,6 @@
> #
>
> tests-common = $(TEST_DIR)/selftest.flat
> -tests-common += $(TEST_DIR)/spinlock-test.flat
> tests-common += $(TEST_DIR)/pci-test.flat
> tests-common += $(TEST_DIR)/pmu.flat
> tests-common += $(TEST_DIR)/gic.flat
> @@ -13,6 +12,7 @@ tests-common += $(TEST_DIR)/psci.flat
> tests-common += $(TEST_DIR)/sieve.flat
> tests-common += $(TEST_DIR)/pl031.flat
> tests-common += $(TEST_DIR)/tlbflush-code.flat
> +tests-common += $(TEST_DIR)/locking-test.flat
>
> tests-all = $(tests-common) $(tests)
> all: directories $(tests-all)
> diff --git a/arm/locking-test.c b/arm/locking-test.c
> new file mode 100644
> index 00000000..a49c2fd1
> --- /dev/null
> +++ b/arm/locking-test.c
> @@ -0,0 +1,321 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Locking Test
> + *
> + * This test allows us to stress the various atomic primitives of a VM
> + * guest. A number of methods are available that use various patterns
> + * to implement a lock.
> + *
> + * Copyright (C) 2017 Linaro
> + * Author: Alex Bennée <alex.bennee@linaro.org>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <libcflat.h>
> +#include <asm/smp.h>
> +#include <asm/cpumask.h>
> +#include <asm/barrier.h>
> +#include <asm/mmu.h>
> +
> +#include <prng.h>
> +
> +#define MAX_CPUS 8
> +
> +/* Test definition structure
> + *
> + * A simple structure that describes the test name, expected pass and
> + * increment function.
> + */
nit: This and many comment blocks below are missing their opening wings.
Thanks,
drew
- Re: [kvm-unit-tests PATCH v10 2/7] add .gitpublish metadata, (continued)
- [kvm-unit-tests PATCH v10 4/7] arm/tlbflush-code: TLB flush during code execution, Alex Bennée, 2023/03/07
- [kvm-unit-tests PATCH v10 3/7] lib: add isaac prng library from CCAN, Alex Bennée, 2023/03/07
- [kvm-unit-tests PATCH v10 1/7] Makefile: add GNU global tags support, Alex Bennée, 2023/03/07
- [kvm-unit-tests PATCH v10 6/7] arm/barrier-litmus-tests: add simple mp and sal litmus tests, Alex Bennée, 2023/03/07
- [kvm-unit-tests PATCH v10 7/7] arm/tcg-test: some basic TCG exercising tests, Alex Bennée, 2023/03/07
- [kvm-unit-tests PATCH v10 5/7] arm/locking-tests: add comprehensive locking test, Alex Bennée, 2023/03/07
- Re: [kvm-unit-tests PATCH v10 5/7] arm/locking-tests: add comprehensive locking test,
Andrew Jones <=
- Re: [kvm-unit-tests PATCH v10 0/7] MTTCG sanity tests for ARM, Andrew Jones, 2023/03/21