Re: [kvm-unit-tests PATCH v2 1/2] s390x: add a library for CMM-related functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 24/11/2022 14.44, Nico Boehr wrote:
Upcoming changes will add a test which is very similar to the existing
CMM migration test. To reduce code duplication, move the common function
to a library which can be re-used by both tests.

Signed-off-by: Nico Boehr <nrb@xxxxxxxxxxxxx>
---
  lib/s390x/cmm.c       | 90 +++++++++++++++++++++++++++++++++++++++++++
  lib/s390x/cmm.h       | 31 +++++++++++++++
  s390x/Makefile        |  1 +
  s390x/migration-cmm.c | 34 ++++------------
  4 files changed, 130 insertions(+), 26 deletions(-)
  create mode 100644 lib/s390x/cmm.c
  create mode 100644 lib/s390x/cmm.h

diff --git a/lib/s390x/cmm.c b/lib/s390x/cmm.c
new file mode 100644
index 000000000000..5da02fe628f9
--- /dev/null
+++ b/lib/s390x/cmm.c
@@ -0,0 +1,90 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * CMM test library
+ *
+ * Copyright IBM Corp. 2022
+ *
+ * Authors:
+ *  Nico Boehr <nrb@xxxxxxxxxxxxx>
+ */
+#include <libcflat.h>
+#include <bitops.h>
+#include "cmm.h"
+
+/*
+ * Maps ESSA actions to states the page is allowed to be in after the
+ * respective action was executed.
+ */
+const int allowed_essa_state_masks[4] = {

Could be declared as "static const int ...", I guess?

Apart from that nit:
Reviewed-by: Thomas Huth <thuth@xxxxxxxxxx>




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux