@@ -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_REMOVE_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();
}