From patchwork Tue Oct 3 07:04:23 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: 13406929 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68F9BE7542D for ; Tue, 3 Oct 2023 07:04:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230461AbjJCHEq (ORCPT ); Tue, 3 Oct 2023 03:04:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230289AbjJCHEp (ORCPT ); Tue, 3 Oct 2023 03:04:45 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07CC183 for ; Tue, 3 Oct 2023 00:04:41 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-5031ccf004cso623949e87.2 for ; Tue, 03 Oct 2023 00:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696316679; x=1696921479; darn=vger.kernel.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=ck9fFBQ6PJmRxQ+9dHxfsblvqg5P8PS2Huy1TTlnqL4=; b=cWusvM89tihxVvoJeVAh62GKN9ZdzXdcn2U7bw1x9Io0j2A4moRrqY9vEgFTS1blru 1cn2KGVKasYjL5C8t8ORhX+rkOanboBkhr7ljxRdWeG+f0I8S7Kw0aMJfawOeVZ7PMoU q214I6Z8HkPrIhe+qrm1wRnbcA3m18WUAksvVUGZkcBnzBwsGYPxRLaXNVN/l+dapJHF r1XYJCf/PN1MkK0w5Dm3Mrs93KoyALi63XVBFfxf8KNrISzpr0lQ40RdE/dW7Y6JF3wc YhD8SJr1K4/jMWQZOZvX+6M0QjxYgWHdkzKEiOZg29YkxmnkwvligRWwaZhO84JhzSJU Murg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696316679; x=1696921479; 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=ck9fFBQ6PJmRxQ+9dHxfsblvqg5P8PS2Huy1TTlnqL4=; b=WVRWgO7DBL57ra21pr86YC1g8n5LlCOIPOR9lrwvYBKjmEVqrw0TaSSz+BOAt09cCJ cBE5g6Kk+pxYuBMmZzehyrgcgwLRddVaqXqxdKp+ZIMwuxrXNHTB5SsIUnP89yz+PJ28 Et574ULh6NJe5Gnn/3gqsmonoMMdMIcP5c9yI3N3vk9E8q+YVoqp/f3WBK09YMjI84QJ CfKY2H1DcWatAnO3nczymFX0/p5rACIUGcIF51ouG5CcjKDgGxeGhZCcHR/LSrDgrLb/ PZ5w1WNGHesjtupKuDIpkaa4erJx0Yr6bWdin/MkIC2QZ5FN9NzL99N56inNuMW+Bymq yOMg== X-Gm-Message-State: AOJu0YyWPEHV29PXYWR+Q5dFb4Q4TVv/7WluIdVYhDAOkqoeRCB6IgiA 1+t+34alTgHaG/K+gAFDyRcOkQ== X-Google-Smtp-Source: AGHT+IGryZXpTasDyIEnsH7yk7XUzG20teV6i2IANYrNa3Q4/4WtdfVUXfEaIbLjPIZ6q+as+mmEXw== X-Received: by 2002:ac2:4567:0:b0:503:383c:996d with SMTP id k7-20020ac24567000000b00503383c996dmr10962753lfm.12.1696316679009; Tue, 03 Oct 2023 00:04:39 -0700 (PDT) Received: from m1x-phil.lan (176-131-222-246.abo.bbox.fr. [176.131.222.246]) by smtp.gmail.com with ESMTPSA id a8-20020a5d4d48000000b00324ae863ac1sm828475wru.35.2023.10.03.00.04.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 03 Oct 2023 00:04:38 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , David Gibson , Paolo Bonzini , kvm@vger.kernel.org, Richard Henderson , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= , qemu-ppc@nongnu.org, Kevin Wolf , Daniel Henrique Barboza , Michael Tokarev , Greg Kurz , Nicholas Piggin , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/4] sysemu/kvm: Restrict kvmppc_get_radix_page_info() to ppc targets Date: Tue, 3 Oct 2023 09:04:23 +0200 Message-ID: <20231003070427.69621-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231003070427.69621-1-philmd@linaro.org> References: <20231003070427.69621-1-philmd@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org kvm_get_radix_page_info() is only defined for ppc targets (in target/ppc/kvm.c). The declaration is not useful in other targets, reduce its scope. Rename using the 'kvmppc_' prefix following other declarations from target/ppc/kvm_ppc.h. Suggested-by: Michael Tokarev Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza --- include/sysemu/kvm.h | 1 - target/ppc/kvm.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index ee9025f8e9..3bcd8f45be 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -551,7 +551,6 @@ int kvm_set_one_reg(CPUState *cs, uint64_t id, void *source); * Returns: 0 on success, or a negative errno on failure. */ int kvm_get_one_reg(CPUState *cs, uint64_t id, void *target); -struct ppc_radix_page_info *kvm_get_radix_page_info(void); int kvm_get_max_memslots(void); /* Notify resamplefd for EOI of specific interrupts. */ diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 51112bd367..19fe6d2d00 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -268,7 +268,7 @@ static void kvm_get_smmu_info(struct kvm_ppc_smmu_info *info, Error **errp) "KVM failed to provide the MMU features it supports"); } -struct ppc_radix_page_info *kvm_get_radix_page_info(void) +static struct ppc_radix_page_info *kvmppc_get_radix_page_info(void) { KVMState *s = KVM_STATE(current_accel()); struct ppc_radix_page_info *radix_page_info; @@ -2372,7 +2372,7 @@ static void kvmppc_host_cpu_class_init(ObjectClass *oc, void *data) } #if defined(TARGET_PPC64) - pcc->radix_page_info = kvm_get_radix_page_info(); + pcc->radix_page_info = kvmppc_get_radix_page_info(); if ((pcc->pvr & 0xffffff00) == CPU_POWERPC_POWER9_DD1) { /* From patchwork Tue Oct 3 07:04:24 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: 13406930 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0E07E7542D for ; Tue, 3 Oct 2023 07:04:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230335AbjJCHEw (ORCPT ); Tue, 3 Oct 2023 03:04:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbjJCHEu (ORCPT ); Tue, 3 Oct 2023 03:04:50 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55D2390 for ; Tue, 3 Oct 2023 00:04:47 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-406618d0991so5596065e9.2 for ; Tue, 03 Oct 2023 00:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696316686; x=1696921486; darn=vger.kernel.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=bgpXhinNPnFvZKdeMS+qc/3fubRg8oTbm/EUaTedB+8=; b=oUZo/vplvuB/UfvKmOz4RxA31p2aUCtn2ORjNULHo0XEh8bk1Q6sWrOyp3ejMXO08u M6zMiaceRjvZca19sB52FvXXE87E1DHXgcl5pQaTLjLfSo1a6pY87+snUPOyfH6TY7Wf JS0++yomf1qKwQMBONHUBVFWVH+3yfw6enwMsvBm4C9ch3srjX3pRTJEeGtHZa2oZYn5 iMv0OFzWkU+dnUCgPwUpG3znUuN6sWphLG/D6VBk5JbyH7+QrVTwuC5Bn3dUPQEl0BHa fXAXjLduhJXLqd52JjN6byY+5uQPjCcRttE4ZoEpGhczgX5Ax/2OzHmWQ8O5/zeWnbyF AXew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696316686; x=1696921486; 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=bgpXhinNPnFvZKdeMS+qc/3fubRg8oTbm/EUaTedB+8=; b=waHHFbNjh3z372ItnujAkN98KwaYg2lWx9Q3nSxV/r/bP2kb2Iduk5/OUlKotAsRu5 PbkzCDQhoksTz4Z5Hf7TCIIPeIjuLkaN+5w52oiiHxeRncfeAKhI3CAsqx9+duC0Aru7 Hjz4gCd4GO0iI2EoZVSJOGt9qUK+nceigspIurzR0AUR4x0BsnEwq1TLgt/fwWWvglz1 n6B1As8eBfp+SpJPqkPySwKu37UR7iO4A1qd/wXJ6mQTOOA7H/hDbZ/HAEeL6i5rKDji d80Gglu7ly2wzmWsU9px2pfoHeqsxUAdhDCDniEnye3TX3xSgt2Mqzp1XE5Rl13vxC8L wItg== X-Gm-Message-State: AOJu0Yx6ksT6+5ytiRvJYBDJNmnaRBlzYGLW4LFV9OMcLs+JPgkR8r9A OgA8FJFM78Mk+MqFMyK09ekL3g== X-Google-Smtp-Source: AGHT+IFbWPwhAeJVn1i9Pd2IS7QiJyQb6QTE0n/sRe1vRSJsLtP8IpfLi2Zi7CWQx7wnFWTnTIvUsw== X-Received: by 2002:a7b:ce89:0:b0:402:f07c:4b48 with SMTP id q9-20020a7bce89000000b00402f07c4b48mr10778116wmj.28.1696316685763; Tue, 03 Oct 2023 00:04:45 -0700 (PDT) Received: from m1x-phil.lan (176-131-222-246.abo.bbox.fr. [176.131.222.246]) by smtp.gmail.com with ESMTPSA id y18-20020a1c4b12000000b0040642a1df1csm548808wma.25.2023.10.03.00.04.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 03 Oct 2023 00:04:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , David Gibson , Paolo Bonzini , kvm@vger.kernel.org, Richard Henderson , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= , qemu-ppc@nongnu.org, Kevin Wolf , Daniel Henrique Barboza , Michael Tokarev , Greg Kurz , Nicholas Piggin , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/4] hw/ppc/e500: Restrict ppce500_init_mpic_kvm() to KVM Date: Tue, 3 Oct 2023 09:04:24 +0200 Message-ID: <20231003070427.69621-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231003070427.69621-1-philmd@linaro.org> References: <20231003070427.69621-1-philmd@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Inline and guard the single call to kvm_openpic_connect_vcpu() allows to remove kvm-stub.c. Reviewed-by: Michael Tokarev Signed-off-by: Philippe Mathieu-Daudé --- 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 4c2635039e..0bff3e39e5 100644 --- a/target/ppc/meson.build +++ b/target/ppc/meson.build @@ -30,7 +30,7 @@ gen = [ ] ppc_ss.add(when: 'CONFIG_TCG', if_true: gen) -ppc_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'), if_false: files('kvm-stub.c')) +ppc_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c')) ppc_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user_only_helper.c')) ppc_system_ss = ss.source_set() From patchwork Tue Oct 3 07:04: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: 13406931 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B7F1E7542D for ; Tue, 3 Oct 2023 07:04:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230462AbjJCHE6 (ORCPT ); Tue, 3 Oct 2023 03:04:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230323AbjJCHE5 (ORCPT ); Tue, 3 Oct 2023 03:04:57 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E38C590 for ; Tue, 3 Oct 2023 00:04:53 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-31f71b25a99so614742f8f.2 for ; Tue, 03 Oct 2023 00:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696316692; x=1696921492; darn=vger.kernel.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=sQzhyHwmNDSDi5pTVRLTrtcYFBIcSrpF9DmpQnEWx1k=; b=ZHmCl1vJfVDmxCrjCfeOs5OyW4vG1ypmWZzYeeaKM+vpAlMdYyalqmFbuqGve4OZPj zo14KBvVxM1LHEZaD7rIFBcsUDX0Urvf5b9pTEny0u3WZdOs4YwIw8VtSVoWyrJNG2x+ W04zHEsXtUNcq1413ssU26DulVzFJTH39dk1YJHURk7BgzuOB3KJHeDDsjes5ARTlbJx rvLRVVwJCm2JN4M4sRi5nVH4oTuCRJjTGiQmpHrLuBbt8GxyPoI/p7fdCS67bfXSRdnA w7lraoWml50ZQ4+6VsJsyQXEs8wg43lP2SO/AP2o/+xAo0Tjcz5QveqPgkuWuHV1CSB3 Xq6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696316692; x=1696921492; 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=sQzhyHwmNDSDi5pTVRLTrtcYFBIcSrpF9DmpQnEWx1k=; b=vzvVARelmRKosCHOBVrrVXCSMGr6uvOwYnsT4orsvxhtzfdcJOLJv7ygwQ5EbgvvtR u94tyGBQTPULBGsikX+auI1QEPzKSy7SrkfLkE0Xhxptet6iQLa3YOqeF6W4tz/GkuNc GIPT0w22Yrvugus2JfldiG/VSHuptummtUMBWbrhiwLUJRKAl1Up91kAxtl4zC5nw71M 6roPS8NNzBGbmUHh1bE5B9JoiMMsiONbYkSPQpLGGN9seyCvVfJNKE0LJtzOR/DUpjMU Tq0YE/8iqFCrDH+ZH1yfSFQJv9+SFnWacncC1aFuIJfuweL+4yrrlxa/NchkNMhqxAF3 OErw== X-Gm-Message-State: AOJu0YxxfmNlfAOEA3cj/0nx5iPAfdkU9C//DsWx4N7CV3PunR1m6fAX uG2A4YXeQvYsD2qydm//4CLlTA== X-Google-Smtp-Source: AGHT+IH5gi/VEas+l3NNvHvsWgSkQlY/4YqInldrRsPk6XIBCqPemE3++yzm1NzvbAR+ZF3pEplFwg== X-Received: by 2002:a5d:618c:0:b0:31f:eb6a:c824 with SMTP id j12-20020a5d618c000000b0031feb6ac824mr10944176wru.10.1696316692435; Tue, 03 Oct 2023 00:04:52 -0700 (PDT) Received: from m1x-phil.lan (176-131-222-246.abo.bbox.fr. [176.131.222.246]) by smtp.gmail.com with ESMTPSA id f5-20020a5d50c5000000b003200c918c81sm813270wrt.112.2023.10.03.00.04.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 03 Oct 2023 00:04:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , David Gibson , Paolo Bonzini , kvm@vger.kernel.org, Richard Henderson , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= , qemu-ppc@nongnu.org, Kevin Wolf , Daniel Henrique Barboza , Michael Tokarev , Greg Kurz , Nicholas Piggin , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 3/4] target/ppc: Restrict KVM objects to system emulation Date: Tue, 3 Oct 2023 09:04:25 +0200 Message-ID: <20231003070427.69621-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231003070427.69621-1-philmd@linaro.org> References: <20231003070427.69621-1-philmd@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org CONFIG_KVM is always FALSE on user emulation, so 'kvm.c' won't be added to ppc_ss[] source set; direcly use the system specific ppc_system_ss[] source set. Reviewed-by: Michael Tokarev Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/ppc/meson.build b/target/ppc/meson.build index 0bff3e39e5..44462f95cd 100644 --- a/target/ppc/meson.build +++ b/target/ppc/meson.build @@ -30,7 +30,6 @@ gen = [ ] ppc_ss.add(when: 'CONFIG_TCG', if_true: gen) -ppc_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c')) ppc_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user_only_helper.c')) ppc_system_ss = ss.source_set() @@ -46,6 +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')) ppc_system_ss.add(when: 'TARGET_PPC64', if_true: files( 'compat.c', From patchwork Tue Oct 3 07:04:26 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: 13406932 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01503E7542D for ; Tue, 3 Oct 2023 07:05:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230518AbjJCHFF (ORCPT ); Tue, 3 Oct 2023 03:05:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239159AbjJCHFD (ORCPT ); Tue, 3 Oct 2023 03:05:03 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BE69C9 for ; Tue, 3 Oct 2023 00:05:00 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3248aa5cf4eso622738f8f.1 for ; Tue, 03 Oct 2023 00:05:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696316699; x=1696921499; darn=vger.kernel.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=4dGNWXL4bt/YZVly7d1oK3PqrthsZjp41Sj7J9uNPxE=; b=FdxXa3K2TOM32wk7GV/mfDxBxfYPOKilYY36yNu+4OAQMK0nLnbFxlLQJxIDDaIIo2 scsK+d6DKDQwnESPVRgbH7uPMMVWElQ56Sfijm9XlCHQMCUIKDcc55JGF8C5gHbuGIfx wERNvhOkhkjv13Jw/5SzCf6IXbNMzSYXiM7ukDALG5fyTrGbxoW6+KkLfNUtzLcNqMvV qetCal3vfk4m9UfJZ4vy3DYGG1pbnalJwgUf9ZLntz2ZgHciOqYZ3sph7GzwSRFbWEif EP+Ih3rFvpVpJgygCUhSQU55zxO38Fjk7y3NeisXcf/ENiyH8gqhnx9e94dR3lOT9K8X sjPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696316699; x=1696921499; 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=4dGNWXL4bt/YZVly7d1oK3PqrthsZjp41Sj7J9uNPxE=; b=OPSDWUGHq0rtqMPhUhvN/2we9WJZrmIeCWZGdyYulGYmbq7ro+4sScqZY0xsltjnLp nKa/k96vxtq/58VrzTEXY3ihFj60HDLg/qymO4RrNrbglytc7PMLpe/iqoGKHorjYL7X AxbtyS7j9YtjEgLGQ9FubJEccVtyyv6VuveguiwGOn2vmPyo5n79/rcWmy5pfSdKlMDl kaLAY2yK/CRYRCF/DCFp/aRc3FCN5s/si9uI3aJNtGKjp8Cu7npP7+jPp2ekJSLdFJ4n 23VE9C8JrYGIbOP9Ar2y8IETwyyjsCyskKRD4pCW0rcBNsLukut4a+1vyDmJBT+kQgeE FzxA== X-Gm-Message-State: AOJu0YxBfJHqTOY+GXNa3Un5w6WRraLNejlg3W1K41ZnFaVAZWHOgwBf osx9hHGKWC6Ls89W6CoyZa0PeA== X-Google-Smtp-Source: AGHT+IEtMLpY0vDY8IiNQlnwRAuBYlQaQaB3YsnFQvO7ycOaQmgl/yRWmUy1V6VmkwiBs0q8c2c4lw== X-Received: by 2002:a5d:58c2:0:b0:321:f74d:ade6 with SMTP id o2-20020a5d58c2000000b00321f74dade6mr11933643wrf.40.1696316699144; Tue, 03 Oct 2023 00:04:59 -0700 (PDT) Received: from m1x-phil.lan (176-131-222-246.abo.bbox.fr. [176.131.222.246]) by smtp.gmail.com with ESMTPSA id d18-20020a056000115200b00326c952716esm818614wrx.61.2023.10.03.00.04.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 03 Oct 2023 00:04:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , David Gibson , Paolo Bonzini , kvm@vger.kernel.org, Richard Henderson , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= , qemu-ppc@nongnu.org, Kevin Wolf , Daniel Henrique Barboza , Michael Tokarev , Greg Kurz , Nicholas Piggin , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 4/4] target/ppc: Prohibit target specific KVM prototypes on user emulation Date: Tue, 3 Oct 2023 09:04:26 +0200 Message-ID: <20231003070427.69621-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231003070427.69621-1-philmd@linaro.org> References: <20231003070427.69621-1-philmd@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org None of these target-specific prototypes should be used by user emulation. Remove their declaration there, so we get a compile failure if ever used (instead of having to deal with linker and its possible optimizations, such dead code removal). Suggested-by: Kevin Wolf Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza --- target/ppc/kvm_ppc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h index 6a4dd9c560..1975fb5ee6 100644 --- a/target/ppc/kvm_ppc.h +++ b/target/ppc/kvm_ppc.h @@ -13,6 +13,10 @@ #include "exec/hwaddr.h" #include "cpu.h" +#ifdef CONFIG_USER_ONLY +#error Cannot include kvm_ppc.h from user emulation +#endif + #ifdef CONFIG_KVM uint32_t kvmppc_get_tbfreq(void);