From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA801C32750 for ; Fri, 2 Aug 2019 07:23:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9BFAD20657 for ; Fri, 2 Aug 2019 07:23:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389526AbfHBHXi (ORCPT ); Fri, 2 Aug 2019 03:23:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60016 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728404AbfHBHXi (ORCPT ); Fri, 2 Aug 2019 03:23:38 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E38C6F0CFF; Fri, 2 Aug 2019 07:23:37 +0000 (UTC) Received: from thuth.com (dhcp-200-228.str.redhat.com [10.33.200.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id ADAA960605; Fri, 2 Aug 2019 07:23:36 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , David Hildenbrand , Janosch Frank , Christian Borntraeger Subject: [kvm-unit-tests PULL 1/2] kvm-unit-tests: s390: add cpu model checks Date: Fri, 2 Aug 2019 09:23:28 +0200 Message-Id: <20190802072329.8276-2-thuth@redhat.com> In-Reply-To: <20190802072329.8276-1-thuth@redhat.com> References: <20190802072329.8276-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 02 Aug 2019 07:23:37 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Christian Borntraeger This adds a check for documented stfle dependencies. Signed-off-by: Christian Borntraeger Reviewed-by: Thomas Huth Reviewed-by: Janosch Frank [thuth: Added missing report_prefix_pop() at the end] Signed-off-by: Thomas Huth --- s390x/Makefile | 1 + s390x/cpumodel.c | 60 +++++++++++++++++++++++++++++++++++++++++++++ s390x/unittests.cfg | 3 +++ 3 files changed, 64 insertions(+) create mode 100644 s390x/cpumodel.c diff --git a/s390x/Makefile b/s390x/Makefile index 1f21ddb..574a9a2 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -11,6 +11,7 @@ tests += $(TEST_DIR)/cmm.elf tests += $(TEST_DIR)/vector.elf tests += $(TEST_DIR)/gs.elf tests += $(TEST_DIR)/iep.elf +tests += $(TEST_DIR)/cpumodel.elf tests_binary = $(patsubst %.elf,%.bin,$(tests)) all: directories test_cases test_cases_binary diff --git a/s390x/cpumodel.c b/s390x/cpumodel.c new file mode 100644 index 0000000..3811ee1 --- /dev/null +++ b/s390x/cpumodel.c @@ -0,0 +1,60 @@ +/* + * Test the known dependencies for facilities + * + * Copyright 2019 IBM Corp. + * + * Authors: + * Christian Borntraeger + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU Library General Public License version 2. + */ + +#include + +static int dep[][2] = { + /* from SA22-7832-11 4-98 facility indications */ + { 4, 3 }, + { 5, 3 }, + { 5, 4 }, + { 19, 18 }, + { 37, 42 }, + { 43, 42 }, + { 73, 49 }, + { 134, 129 }, + { 135, 129 }, + { 139, 25 }, + { 139, 28 }, + { 146, 76 }, + /* indirectly documented in description */ + { 78, 8 }, /* EDAT */ + /* new dependencies from gen15 */ + { 61, 45 }, + { 148, 129 }, + { 148, 135 }, + { 152, 129 }, + { 152, 134 }, + { 155, 76 }, + { 155, 77 }, +}; + +int main(void) +{ + int i; + + report_prefix_push("cpumodel"); + + report_prefix_push("dependency"); + for (i = 0; i < ARRAY_SIZE(dep); i++) { + if (test_facility(dep[i][0])) { + report("%d implies %d", test_facility(dep[i][1]), + dep[i][0], dep[i][1]); + } else { + report_skip("facility %d not present", dep[i][0]); + } + } + report_prefix_pop(); + + report_prefix_pop(); + return report_summary(); +} diff --git a/s390x/unittests.cfg b/s390x/unittests.cfg index 546b1f2..db58bad 100644 --- a/s390x/unittests.cfg +++ b/s390x/unittests.cfg @@ -61,3 +61,6 @@ file = gs.elf [iep] file = iep.elf + +[cpumodel] +file = cpumodel.elf -- 2.21.0