From patchwork Mon May 24 02:52:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Cho X-Patchwork-Id: 12275349 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT 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 413E2C47082 for ; Mon, 24 May 2021 02:55:44 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C0FB261159 for ; Mon, 24 May 2021 02:55:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C0FB261159 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ll0ko-0000oJ-Q6 for qemu-devel@archiver.kernel.org; Sun, 23 May 2021 22:55:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ll0il-00067X-Q3 for qemu-devel@nongnu.org; Sun, 23 May 2021 22:53:35 -0400 Received: from de-smtp-delivery-102.mimecast.com ([194.104.111.102]:48589) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ll0ih-0003Es-SM for qemu-devel@nongnu.org; Sun, 23 May 2021 22:53:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1621824810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lWYfYaBeLKoTPKygg7GlP3YGrQYWI9Ileyh4z480xTM=; b=Ia2U1EEuQEP91K5+GnCzhiMtr/8SBBskLGzi5d4sDcCF8P0kimPSZjTkHJbK2bGQB8cAs3 QejsHUfb8UUy0w0pGTEqsVIvr7WywfQrN4v/6F8WiQBeXCY2AWgF2Hm2/TDbj3l4Zj/Lgr XH4WmUhRokKDm0m02jKmNQ6Qli6niSU= Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2105.outbound.protection.outlook.com [104.47.18.105]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-14-SGA1OXu4NIqe0k57o-wRKA-1; Mon, 24 May 2021 04:53:29 +0200 X-MC-Unique: SGA1OXu4NIqe0k57o-wRKA-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D0MDwp9nxTWWJPeT3yhU5X0BIHbN8MPiLJf0ohd3nYV5tgFhHWlGMBeQJihO6nGvkgbCT/2Spv1aEAQi3AcRKkswD63VltgdwVIjg4Q8CN9sJrcYEvd6CBo+pAzc5nJq87Kz/fgURMdTEMsd0LTGFZ9xb6i1r0FkfpBXUoOHpXt1tkRS9YQ9PteiWtxp5M5E2LjoxZMK4SntSBKUCuT9Lryq3ti/jl17W1U0JVkk/R0UsBMrb+UzD+Ut6Jy4Sdn5rPUyRJiWvjj3oaildFuH4Ba/GNTZIQ/wh72RP3bZ9un0hm3COYS6W40XHvuctE6XLbbQyLy13SxY39fwz2EcAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Nq0qpyMJJ69Q/fNyz77BCzdupii77fc+pM9vLjT7r5k=; b=mhylBJbD29rIEUyCY+BaaVv2jBELFrG9D82ZfYBwWiaFzQ0BJWzeDtH8g1Ju3+0EjKD4r5iKGzVYsP8YrmSKrhWRF3/FXCnLGjJUwA04QvPMzDiB1hjvXTrMFGYxZDos1ewQjMlO+48MjxRijgjiccuaqNTJCxXFuFNRS/g5oXxdnZ46JAHoCsHBa3Dmr4SFM6wUbUjyMYIy04EarK0xvbM0otoPv+tGO33OJRZKEawPPGsyH206C0OILrGAXqmjk2dk/7Pnkyk1JnZqbNeUW73LCqtBczqpSJTsbzucPDkeUxFAX/0YkE6QHQSeJpQ0TNe51Adyk0HQqy8v7rpkSA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=suse.com; Received: from VI1PR0402MB3744.eurprd04.prod.outlook.com (2603:10a6:803:16::25) by VI1PR04MB4126.eurprd04.prod.outlook.com (2603:10a6:803:47::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23; Mon, 24 May 2021 02:53:28 +0000 Received: from VI1PR0402MB3744.eurprd04.prod.outlook.com ([fe80::b446:f4ea:d07c:ef5f]) by VI1PR0402MB3744.eurprd04.prod.outlook.com ([fe80::b446:f4ea:d07c:ef5f%7]) with mapi id 15.20.4150.027; Mon, 24 May 2021 02:53:28 +0000 From: "Cho, Yu-Chen" To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org CC: cohuck@redhat.com, thuth@redhat.com, richard.henderson@linaro.org, cfontana@suse.de, david@redhat.com, pasic@linux.ibm.com, borntraeger@de.ibm.com, pbonzini@redhat.com, acho@suse.com Subject: [RFC v4 04/14] hw/s390x: tod: make explicit checks for accelerators when initializing Date: Mon, 24 May 2021 10:52:46 +0800 Message-ID: <20210524025256.22252-4-acho@suse.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524025256.22252-1-acho@suse.com> References: <20210524025256.22252-1-acho@suse.com> X-Originating-IP: [114.24.18.39] X-ClientProxiedBy: HK2PR04CA0057.apcprd04.prod.outlook.com (2603:1096:202:14::25) To VI1PR0402MB3744.eurprd04.prod.outlook.com (2603:10a6:803:16::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (114.24.18.39) by HK2PR04CA0057.apcprd04.prod.outlook.com (2603:1096:202:14::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Mon, 24 May 2021 02:53:24 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f1cc6865-95c6-4a9c-024f-08d91e5f1b57 X-MS-TrafficTypeDiagnostic: VI1PR04MB4126: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 10PuO+dOUFnj2kNU4PtBUU9+Q3Rq/441XcqHX/SuQ0i7boxsGIdx47qAJQ8IINZM+mGBdqByxe+nDj6ID4Il5m5h7YXyvQ7Q2dv7e4MSoFNsvAjcWr2K1UxWHK7rWg5AuzOnX90MMb5gGcGnG365ZsLA4Qc0ihi5SUJsQIz4CG/Y7XeQRw0fhrzGtrU4TzojCCGq/2m1IhFdmSD5fhUdaeIzkiRRYEqkHCJAYyumIxjb2QTz6+1c1dhlTAbRMEqsteOHIFEqNPcguJA+7AWOlFteO7p1f6UwrtR8O9A6HyvQkwKuT0cLITjY0VaHs/eVUfZb1xlrFZQ42EzL9RJxTjxJqHt34Z3JK1kwirivA1iNqlxXT10R5vw25u0uIk9OxmzO0St2NlCkVIgnXDZgisZEjuIQ8U/MuauXOn0fYxOSye+pS5wm52gYB6YSSiJATCNooO8z+gVfXNuFgqsXBdb5TVLXhsvKVi9VnWgWZDnokSFYwXN/bO5g+6KYZJP1oKWtFrtgXTeRKHWZHNhWy9aYcAIBptmL7x5aEkeAL5UrWQ48x5V5y2vyH0BLKEn7qVTLQedMLiEWrf8gNSt+RiX9GdBW8o0BoMkcc2te2rddHZHq30RdSeB6ii1xwCD5iJ5RxvTt5e56Xu9g6fPaOsr40ic5gtsTfZjD8tjDzCPK0bp72Xk97DfRBJ0rpTYG X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0402MB3744.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(376002)(39860400002)(136003)(366004)(346002)(16526019)(6506007)(1076003)(2906002)(956004)(26005)(6512007)(7416002)(6666004)(4326008)(107886003)(66556008)(5660300002)(6486002)(2616005)(83380400001)(186003)(38100700002)(316002)(36756003)(66476007)(478600001)(52116002)(8936002)(66946007)(8676002)(38350700002)(86362001)(69590400013); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: tNQ6XFgNzLq4fsDfqPhoKv55JWnmD8XCBwn2PV2/ohYq4krMzqf4vB8V3ppGRHPKlp8f4JslTLyp30VvwgxTT2205a8ghh5NR4G4YF0O21FFPjJ1B7oiPv0Wd19Xv/hFmJ7Er4jxQyM4j4by1adpezw0/nJ95RzezSr3YCtnZThdYxnqu3/0YU/pLFqbzrmV+rzhctcgSUyo8ognBoPbSBHH7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uduLHfTN4JAvmoEXCZaMyIw1vrTkX7pAk8a/pOIWYsk1 X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: f1cc6865-95c6-4a9c-024f-08d91e5f1b57 X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB3744.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2021 02:53:28.2557 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +JqANtw7BlcG/Te2LBg7usz2c+7QDvOoQYXqsbe0fS1bXXQbur2h2JxS3CII42Db X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4126 Received-SPF: pass client-ip=194.104.111.102; envelope-from=acho@suse.com; helo=de-smtp-delivery-102.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" replace general "else" with specific checks for each possible accelerator. Handle qtest as a NOP, and error out for an unknown accelerator used in combination with tod. Signed-off-by: Claudio Fontana Reviewed-by: David Hildenbrand Reviewed-by: Cornelia Huck Signed-off-by: Cho, Yu-Chen --- hw/s390x/tod.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/s390x/tod.c b/hw/s390x/tod.c index 3c2979175e..fd5a36bf24 100644 --- a/hw/s390x/tod.c +++ b/hw/s390x/tod.c @@ -14,6 +14,8 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "sysemu/kvm.h" +#include "sysemu/tcg.h" +#include "sysemu/qtest.h" #include "migration/qemu-file-types.h" #include "migration/register.h" @@ -23,8 +25,13 @@ void s390_init_tod(void) if (kvm_enabled()) { obj = object_new(TYPE_KVM_S390_TOD); - } else { + } else if (tcg_enabled()) { obj = object_new(TYPE_QEMU_S390_TOD); + } else if (qtest_enabled()) { + return; + } else { + error_report("current accelerator not handled in s390_init_tod!"); + abort(); } object_property_add_child(qdev_get_machine(), TYPE_S390_TOD, obj); object_unref(obj);