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: 1836302 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=kIaVVI4i; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Rq8pC5TsHz1ynX for ; Tue, 19 Sep 2023 02:07:47 +1000 (AEST) 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-Google-Smtp-Source: AGHT+IF1uzqoMGcGEAlyaETsh01GEqG5TP+8vhZBqOT31xYKgtT4aKTdO73/67eFYWfUVkYSZ8Rjqw== 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.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;