Re: [kvm-unit-tests PATCH 3/4] s390x: uv-guest: remove duplicated checks

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

 



On 1/27/22 15:15, Steffen Eiden wrote:
Removing some tests which are done at other points in the code
implicitly.

In lib/s390x/uc.c#setup_uv(void) the rc of the qui result is verified
using asserts.
The whole test is fenced by lib/s390x/uc.c#os_is_guest(void) which
checks if SET and REMOVE SHARED is present.

Signed-off-by: Steffen Eiden <seiden@xxxxxxxxxxxxx>

Reviewed-by: Janosch Frank <frankja@xxxxxxxxxxxxx>

---
  s390x/uv-guest.c | 24 ++++++++----------------
  1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/s390x/uv-guest.c b/s390x/uv-guest.c
index 44ad2154..909b7256 100644
--- a/s390x/uv-guest.c
+++ b/s390x/uv-guest.c
@@ -2,7 +2,7 @@
  /*
   * Guest Ultravisor Call tests
   *
- * Copyright (c) 2020 IBM Corp
+ * Copyright (c) 2020, 2022 IBM Corp
   *
   * Authors:
   *  Janosch Frank <frankja@xxxxxxxxxxxxx>
@@ -69,23 +69,15 @@ static void test_query(void)
  	cc = uv_call(0, (u64)&uvcb);
  	report(cc == 1 && uvcb.header.rc == UVC_RC_INV_LEN, "length");
- uvcb.header.len = sizeof(uvcb);
-	cc = uv_call(0, (u64)&uvcb);
-	report((!cc && uvcb.header.rc == UVC_RC_EXECUTED) ||
-	       (cc == 1 && uvcb.header.rc == 0x100),
-		"successful query");
-
  	/*
-	 * These bits have been introduced with the very first
-	 * Ultravisor version and are expected to always be available
-	 * because they are basic building blocks.
+	 * BIT_UVC_CMD_QUI, BIT_UVC_CMD_SET_SHARED_ACCESS and
+	 * BIT_UVC_CMD_SET_SHARED_ACCESS are always present as they
+	 * have been introduced with the first Ultravisor version.
+	 * However, we only need to check for QUI as
+	 * SET/REMOVE SHARED are used to fence this test to be only
+	 * executed by protected guests.
  	 */
-	report(test_bit_inv(BIT_UVC_CMD_QUI, &uvcb.inst_calls_list[0]),
-	       "query indicated");
-	report(test_bit_inv(BIT_UVC_CMD_SET_SHARED_ACCESS, &uvcb.inst_calls_list[0]),
-	       "share indicated");
-	report(test_bit_inv(BIT_UVC_CMD_REMOVE_SHARED_ACCESS, &uvcb.inst_calls_list[0]),
-	       "unshare indicated");
+	report(uv_query_test_call(BIT_UVC_CMD_QUI), "query indicated");
  	report_prefix_pop();
  }




[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