From patchwork Tue Sep 12 11:30:25 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: 721762 Delivered-To: patch@linaro.org Received: by 2002:adf:f64d:0:b0:31d:da82:a3b4 with SMTP id x13csp1587174wrp; Tue, 12 Sep 2023 04:37:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHEcXC5XML3baiHgDWCy8rF4HhctrR5ZWQQ0CT+KbXX9QISwqQDTUdDE50gEM6GS2pSPtTB X-Received: by 2002:a05:620a:1927:b0:769:89c8:4fae with SMTP id bj39-20020a05620a192700b0076989c84faemr14401346qkb.52.1694518668223; Tue, 12 Sep 2023 04:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694518668; cv=none; d=google.com; s=arc-20160816; b=Kxy5PeG3DZiadVyRP77gzFkXuERcAcYq5h0rLBXBB9PMXEk8/x0QI7l0xOGDQqWrlv OYLt2OtKu5Tj3sifGb8WhxETHurlkQ6yiqV45YUda3Oe7ZVU0mDUgmVApP2SHZ8OSsN5 hOQyn2eSq5/2yggQJN0rTiF6ZHVLdk73pCxQa1HccwDiIdgf5b4apbZdxxtbErXOS4w/ LiauS6uxuAu3LEGhtVo1ZhEP4WYTu3OIGeNrReAKqFBTTKRru1YCzuPo1pFNS3jhQVPy 2kkXgc+vzzDyF1GkCsD9ILUkLuRSN3OK9Z7+6Mcxj+XgV+KgEKFdnHnWHhD1jHc9RytR d7xg== 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=/aSlGFqA9ubhB7ZC5gHBqxQU1rcWLkqloVAzPG4iLCg=; fh=B+ZNRnZ/8434is8zCHEu5frYXYw5NWqaVMtn8Sm3cTI=; b=yyskL2DxftP3Q6utWzA4fWadvzitdRHMteSFQFYrIlJnLvgilnaYMi9ejTZoRRiUuN GdSl93LtFO9Ao6kLTGZhfkZShli7T/Az2LtD4uBjuCFjEuvRu7m1sxZjKIMAgKWNoVBM 8VTy13Kurvwe8K/tcehQBQ2Jd7znSTHlJ3VAwq8CEOhxKivXNk5Ogv+CN02KHkDv9tpu AhUSQGa902c/05qNlKHleYuIn709G9YeLItJp9N6hoFcl3W4vlI8X1xppA6ZjwMCzQbF 40SWw1gu9CTt+rBGv2i3XtqQKKLNMrvKA4/ntu1Blye9RXLPw3mRKLRQRPcckb8rxpxh JgYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="f/UwKA3k"; 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 ef14-20020a05620a808e00b0077076a46511si5833925qkb.255.2023.09.12.04.37.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Sep 2023 04:37:48 -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="f/UwKA3k"; 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 1qg1bf-0004N2-N8; Tue, 12 Sep 2023 07:30:59 -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 1qg1bc-0004M2-5J for qemu-devel@nongnu.org; Tue, 12 Sep 2023 07:30:57 -0400 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qg1bY-0000tS-2k for qemu-devel@nongnu.org; Tue, 12 Sep 2023 07:30:55 -0400 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-501cba1ec0aso9065609e87.2 for ; Tue, 12 Sep 2023 04:30:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694518250; x=1695123050; 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=/aSlGFqA9ubhB7ZC5gHBqxQU1rcWLkqloVAzPG4iLCg=; b=f/UwKA3kemM72cVDiT+KeUcY2sJtPXAtf4cxQvs+bb+0OesP4L9bz5LLF3uBYJRHbR ZsN46VjhkeOLep94WXvL9I2L7Fw895r/ZW7PyQFd3waeJuSqU8G6XzZcqEKDLyb/Z/vH CkWp2UH9JYWVMOXaqi+QRuBYI8jOkmMdHOVpimvR+u6k3xOVATVUrg1mlE/OrNgdeX0z MMxK+N7O6tffYhi4WBtHERZUdjLn/qrYifJIgxzhJ0uJJ/PIalBC0is556aY6PO5An9G cuUsSO3WFCbTpuVEWMm+W2+PCFZMhFGJu5l1XhUoTcyKmQ9twVNBsEJkhUi2hutNujNm UTuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694518250; x=1695123050; 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=/aSlGFqA9ubhB7ZC5gHBqxQU1rcWLkqloVAzPG4iLCg=; b=EhIbU7AcMrlVWPQe/D9/592UFHj9oBmVYlqldYoogNWHW2X04H3tT/lEsvfrlSRxHC D/zSnCeM+FLfkBi/VmILSxIpRFzn+eXJwewDY7DbWUgb65reDGeBFmcV8BddJ3sw9evJ xDj4L+Mj5Rv/GZmAlx4NhqXVI+IaBgKUA0Q0AU9t3tzJ8WItY36xlwe1IjTEFFExBF0c QGumTSwCTkeyX75tAoM+Q1+sYqfB1wUcuPLumKt3idAZwY6dc+ntEYz1Vi7AQ5ZGyM3G RnSAuiHDGmDn98bAN0aYjFqxs04DzejIlfCDwDyRKW4OM6HjpZdaYaCOMsBMRJe2F92A ZdQg== X-Gm-Message-State: AOJu0YyO6teqNO6r9KfYZVukDTSEK3cpNbPzlGCsC0BrNPAqTXMGMhRe 3ZWBVSw3WGWw8YkTvcrsKI/h+Cjd/3vSnB+7vq0= X-Received: by 2002:a05:6512:32d0:b0:4fb:7675:1ff9 with SMTP id f16-20020a05651232d000b004fb76751ff9mr11429892lfg.9.1694518250011; Tue, 12 Sep 2023 04:30:50 -0700 (PDT) Received: from m1x-phil.lan (cou50-h01-176-172-50-150.dsl.sta.abo.bbox.fr. [176.172.50.150]) by smtp.gmail.com with ESMTPSA id m16-20020aa7c490000000b005236410a16bsm5839285edq.35.2023.09.12.04.30.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 12 Sep 2023 04:30:49 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Nicholas Piggin , Daniel Henrique Barboza , Daniel Henrique Barboza , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, Paolo Bonzini , Kevin Wolf , David Gibson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Michael Tokarev , Greg Kurz , =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/4] hw/ppc/e500: Restrict ppce500_init_mpic_kvm() to KVM Date: Tue, 12 Sep 2023 13:30:25 +0200 Message-ID: <20230912113027.63941-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230912113027.63941-1-philmd@linaro.org> References: <20230912113027.63941-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=philmd@linaro.org; helo=mail-lf1-x12f.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 Inline and guard the single call to kvm_openpic_connect_vcpu() allows to remove kvm-stub.c. While it seems some code churn, it allows forbidding user emulation to include "kvm_ppc.h" in the next commit. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Michael Tokarev --- hw/ppc/e500.c | 4 ++++ target/ppc/kvm-stub.c | 19 ------------------- target/ppc/meson.build | 2 +- 3 files changed, 5 insertions(+), 20 deletions(-) delete mode 100644 target/ppc/kvm-stub.c diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index d5b6820d1d..d0e199fb2c 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -834,6 +834,7 @@ static DeviceState *ppce500_init_mpic_qemu(PPCE500MachineState *pms, static DeviceState *ppce500_init_mpic_kvm(const PPCE500MachineClass *pmc, IrqLines *irqs, Error **errp) { +#ifdef CONFIG_KVM DeviceState *dev; CPUState *cs; @@ -854,6 +855,9 @@ static DeviceState *ppce500_init_mpic_kvm(const PPCE500MachineClass *pmc, } return dev; +#else + g_assert_not_reached(); +#endif } static DeviceState *ppce500_init_mpic(PPCE500MachineState *pms, diff --git a/target/ppc/kvm-stub.c b/target/ppc/kvm-stub.c deleted file mode 100644 index b98e1d404f..0000000000 --- a/target/ppc/kvm-stub.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * QEMU KVM PPC specific function stubs - * - * Copyright Freescale Inc. 2013 - * - * Author: Alexander Graf - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - * - */ -#include "qemu/osdep.h" -#include "cpu.h" -#include "hw/ppc/openpic_kvm.h" - -int kvm_openpic_connect_vcpu(DeviceState *d, CPUState *cs) -{ - return -EINVAL; -} diff --git a/target/ppc/meson.build b/target/ppc/meson.build index bf1c9319fa..44462f95cd 100644 --- a/target/ppc/meson.build +++ b/target/ppc/meson.build @@ -45,7 +45,7 @@ ppc_system_ss.add(when: 'CONFIG_TCG', if_true: files( ), if_false: files( 'tcg-stub.c', )) -ppc_system_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'), if_false: files('kvm-stub.c')) +ppc_system_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c')) ppc_system_ss.add(when: 'TARGET_PPC64', if_true: files( 'compat.c',