From patchwork Mon Sep 18 16:02:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 724169 Delivered-To: patch@linaro.org Received: by 2002:adf:f0d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1775002wro; Mon, 18 Sep 2023 09:07:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEN/8N81nAXoysmCLHrqX2Iazv0YYlicbtU09nhNV9BHnE07DBXUgI+qA201kS6nmg00Fan X-Received: by 2002:a05:622a:1a86:b0:412:14a8:24c8 with SMTP id s6-20020a05622a1a8600b0041214a824c8mr12238283qtc.8.1695053266596; Mon, 18 Sep 2023 09:07:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695053266; cv=none; d=google.com; s=arc-20160816; b=HIyeVBy8BFwjBV09JUNzAh+hEQSUt8vWbZlHE6Ad25TCsuChzvB3jicXucH32ziXJt WPZZM/lXurYaLSYtIPT8W3KR6TCjTY/LMzcqBZdx8m6HznmOaZHLO/KLf6RbUh/4fcDs vLJFxfBLh1USGxxncLrlLY0/iBK8ZyLHZBn8PaDk9fZUNJE+JsUZnlI085dgQ65RLFQe WGT1546MEndHafWWV7aDragq4tnFosyJjUo7pM1lPIOsusvQoACsGeAS0JggWg967Qlb vlSlQQUdJJuEbBzRq4W7jtKceRGBPRbg7IyWqArBReareuTaoIuuf0rM4YBttc9Xs+4q o3ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=y7slh/pNTWelLfh1FzXsOutH1+zxCT/FLHdOf8nTB6I=; fh=AIYNAcrfQPdTp+tiOBYg2bCy2NfWRbXD73JV9SLWbpM=; b=MoDZINbvnNIAq8Bzy4fARjbE+4HoQCBjb5TZbpK0OIFYI9GFgqo0tytscld9ncwWEs 9jiJKFmUExMdB9yqExxi8GillXyy/gIpDLTKqgUt6vKn+fi0B468rKXJd2z1sAeKEGlF 6rVV93c3Fh7bn4DacoROkQMXrCunZ0mja8ncV1Ln+9kwrkA8/J50DBR6znOpgzRzo8YC 85M2KriGq2hl20RO5J8AM7EL73fhyEticX6I2a4Onm6BCUnS5VQVUndMFcxgYppQxS/z fgsy3IaWxKaCBtRvc9xKPt5apKRCLdGCYvLJyHWGog9fl3u76Rjm233FlzotmocBXP0i NV2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kIaVVI4i; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v14-20020a05622a130e00b00417bfe9e70dsi359110qtk.592.2023.09.18.09.07.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Sep 2023 09:07:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kIaVVI4i; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiGkW-000261-U2; Mon, 18 Sep 2023 12:05:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qiGjx-0001c0-RB for qemu-devel@nongnu.org; Mon, 18 Sep 2023 12:04:50 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qiGjv-0004Rp-3z for qemu-devel@nongnu.org; Mon, 18 Sep 2023 12:04:49 -0400 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5230a22cfd1so5883197a12.1 for ; Mon, 18 Sep 2023 09:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695053085; x=1695657885; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=y7slh/pNTWelLfh1FzXsOutH1+zxCT/FLHdOf8nTB6I=; b=kIaVVI4i6Ci1jWg3hOfeFjm7XJ1cO63lBFsvfE3UQtDL798H136yi6kUxNHRxl0to+ I+1wRNLqHLnSdK6q2zZ4/Q4/XkstVT/EJYsyO4xPV3GtFYB2AiTv9LzWLKr6aEXGOJGY GOOy3L6ePYOSiyg8sYGbR1ooasQBcD7CvSqltkbQTRlJEAuc+eOOgxLzvGe5vXzAqP2G qY7bDIRjOGThX6EkFAYRdy/6VjoUPVuklCQBAOZHQXbk9dcC3eLVKF6zUf+IsxFYUjxh 7PzyhgFYYYvUk1ciJIFmCQLtsFEQl3KG4ICes7sRhesxh7ZfL7qwf1X+BZdUOJnPbivl nRbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695053085; x=1695657885; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y7slh/pNTWelLfh1FzXsOutH1+zxCT/FLHdOf8nTB6I=; b=JMEqPlnNGhuVj8qwSw9Fuih1g6aGyaB/XSZAoNaCegU63v/hpRDQK1g6PZkWDy131s cxEfWlp6yA2MdeOIfQbmw+OsPTGhUtYT1ZnQEarF7BqWs7ciQ1uSVmlEvmWJGCJ8KuKv dciYju1cbVRonIDQPyIecR4UEWUXrEhCo6iuMj2rTatRuNpeFIgl2jte2BoeTxn+uMy+ vWQ1SmTBjvQmENqatuZio3O8CfvHYJpObOY61Lgsg/kmrjZgHapduWmHFYXK2kJcgBVQ 2ZpMwHWjCNzV3W8iHh1eO+2ppPA0v0ZLzMrqouUeW2FukOb982peocPLi7PmRc8hCHzX 0l2A== X-Gm-Message-State: AOJu0YwR+j24AClXqmjLnAONKXi80PKWoxnBITGZXZDW+p4abNz69JfZ 8lOUhoWtwPXi9TxScq9aYr8JmRTYeMftHiSFjqO1AJIw X-Received: by 2002:a17:907:75f1:b0:9a5:cc73:a2a5 with SMTP id jz17-20020a17090775f100b009a5cc73a2a5mr6784701ejc.1.1695053085243; Mon, 18 Sep 2023 09:04:45 -0700 (PDT) Received: from localhost.localdomain (static-212-193-78-212.thenetworkfactory.nl. [212.78.193.212]) by smtp.gmail.com with ESMTPSA id lt10-20020a170906fa8a00b009737b8d47b6sm6568567ejb.203.2023.09.18.09.04.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 18 Sep 2023 09:04:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Paolo Bonzini , Max Filippov , David Hildenbrand , Peter Xu , Anton Johansson , Peter Maydell , kvm@vger.kernel.org, Marek Vasut , David Gibson , Brian Cain , Yoshinori Sato , "Edgar E . Iglesias" , Claudio Fontana , Daniel Henrique Barboza , Artyom Tarasenko , Marcelo Tosatti , qemu-ppc@nongnu.org, Liu Zhiwei , Aurelien Jarno , Ilya Leoshkevich , Daniel Henrique Barboza , Bastian Koppelmann , =?utf-8?q?C=C3=A9dric_?= =?utf-8?q?Le_Goater?= , Alistair Francis , Alessandro Di Federico , Song Gao , Marcel Apfelbaum , Chris Wulff , "Michael S. Tsirkin" , Alistair Francis , Fabiano Rosas , qemu-s390x@nongnu.org, Yanan Wang , Luc Michel , Weiwei Li , Bin Meng , Stafford Horne , Xiaojuan Yang , "Daniel P . Berrange" , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, Jiaxun Yang , Richard Henderson , Aleksandar Rikalo , Bernhard Beschow , Mark Cave-Ayland , qemu-riscv@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Nicholas Piggin , Greg Kurz , Michael Rolnik , Eduardo Habkost , Markus Armbruster , Palmer Dabbelt Subject: [PATCH 20/22] target/s390x: Use s390_realize_cpu_model() as verify_accel_features() Date: Mon, 18 Sep 2023 18:02:53 +0200 Message-ID: <20230918160257.30127-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230918160257.30127-1-philmd@linaro.org> References: <20230918160257.30127-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=philmd@linaro.org; helo=mail-ed1-x52f.google.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, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org s390_realize_cpu_model() checks if CPU model and definitions are compatible with the KVM / TCG accelerators, before realizing the vCPU. Use it directly as CPUClass::verify_accel_features() handler (called from cpu_exec_realizefn()). Signed-off-by: Philippe Mathieu-Daudé --- target/s390x/cpu.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 1a44a6d2b2..983dbfe563 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -231,11 +231,6 @@ static void s390_cpu_realizefn(DeviceState *dev, Error **errp) S390CPUClass *scc = S390_CPU_GET_CLASS(dev); Error *err = NULL; - /* the model has to be realized before qemu_init_vcpu() due to kvm */ - if (!s390_realize_cpu_model(cs, &err)) { - goto out; - } - cpu_exec_realizefn(cs, &err); if (err != NULL) { goto out; @@ -329,6 +324,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) scc->reset = s390_cpu_reset; cc->class_by_name = s390_cpu_class_by_name, + cc->verify_accel_features = s390_realize_cpu_model; cc->has_work = s390_cpu_has_work; cc->dump_state = s390_cpu_dump_state; cc->query_cpu_fast = s390_query_cpu_fast;