From patchwork Tue Sep 12 11:30: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: 13381489 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 6C94ACA0EC3 for ; Tue, 12 Sep 2023 11:30:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234567AbjILLav (ORCPT ); Tue, 12 Sep 2023 07:30:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232345AbjILLam (ORCPT ); Tue, 12 Sep 2023 07:30:42 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C22F510D2 for ; Tue, 12 Sep 2023 04:30:38 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2bcb89b4767so90374381fa.3 for ; Tue, 12 Sep 2023 04:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694518236; x=1695123036; 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=21QMJ7GGkeglUQqOfSInY5x1p67Ji2fztTn3JUMzTjQ=; b=u1kCPa4UR0KdAj+q5r6ikP/fz6yMtAei4/3/fTBR8/YBlAqZFnVu+GTX1LEBUP6ORb gE7QMy5t3Fgl3HRxCEmvKQzdgy0eLfrtOkiLWH4dINk5SQr3UOWQlAOuKXqRvCkYWEBF IjfFM4r8J/g+gED+/dnZWDVEx0FkfHS7AzxWT6pbGet9SsjYuH5+8Dm5M7gl8Kd82tAO X9Hk2bAKX6g2vk33tUsotFWTUNL24vJiZRxcoKttT+VN/toD23fxMdmiILhdvNVMnttQ Tt2M4HCf2iXfqC0szs9ExcxAw279R4eXW1/h4cevk3WP2jJNi8hAaZYm7asocBW7k8GF zOOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694518236; x=1695123036; 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=21QMJ7GGkeglUQqOfSInY5x1p67Ji2fztTn3JUMzTjQ=; b=FQn+Z0ILShQanay2B/mJFR4ZwTX4xrHZkgZd6T8Dvve9wvBQFYmAUMt0q8p7daBb87 Rqt8UxO47H1k/ExoZ0DrVrhiq2QPeufGT5y4Z2nAM8IuX25frzHCKgi80ecdePZDezkX LVCoYi1DHmRZwn2jjfX3nLLYFrAO4LDdXsQeFTnn0jsIGtv8uMXL36pFK3JErYaxcD1X oHatKKDEGACW+RK0FQEOcypkZ0YMIT7g7gawRfdN/KqzXSmwSjn1DAQUsI+u3rgZ7fID vPnFb8KXzjA6vb2aRxB7PtdcENMdT1WshQIjJoC+l9Q7tffjGoQa4yAC/MfZyRl8Hrvi K83g== X-Gm-Message-State: AOJu0YwwQupjFGIw4mj4QpIdMBJkSO0A/NlZfIf4AWAFuPpzFNxrdF3p LmC4cXtfh2xnvRE47UJ9O09rHz5EWOPEe1S42o8= X-Google-Smtp-Source: AGHT+IGrmkxUF4fF6+bNXffo8F8gG9e/Ung4GKdfh9dcnF2dShXSPiBar0HZ/5nMx033pCom6oSwBw== X-Received: by 2002:a2e:7c1a:0:b0:2bc:c846:aa17 with SMTP id x26-20020a2e7c1a000000b002bcc846aa17mr10295292ljc.41.1694518236658; Tue, 12 Sep 2023 04:30:36 -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 l26-20020a1709061c5a00b009894b476310sm6628964ejg.163.2023.09.12.04.30.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 12 Sep 2023 04:30:36 -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 1/4] sysemu/kvm: Restrict kvmppc_get_radix_page_info() to ppc targets Date: Tue, 12 Sep 2023 13:30:23 +0200 Message-ID: <20230912113027.63941-2-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 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. Rename using the 'kvmppc_' prefix following other declarations from target/ppc/kvm_ppc.h. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/kvm.h | 1 - target/ppc/kvm_ppc.h | 2 ++ target/ppc/kvm.c | 4 ++-- 3 files changed, 4 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_ppc.h b/target/ppc/kvm_ppc.h index 6a4dd9c560..440e93f923 100644 --- a/target/ppc/kvm_ppc.h +++ b/target/ppc/kvm_ppc.h @@ -89,6 +89,8 @@ void kvmppc_set_reg_tb_offset(PowerPCCPU *cpu, int64_t tb_offset); int kvm_handle_nmi(PowerPCCPU *cpu, struct kvm_run *run); +struct ppc_radix_page_info *kvmppc_get_radix_page_info(void); + #define kvmppc_eieio() \ do { \ if (kvm_enabled()) { \ diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 51112bd367..a58708cdfc 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) +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 Sep 12 11:30: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: 13381491 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 F17C8CA0EC3 for ; Tue, 12 Sep 2023 11:31:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234610AbjILLbG (ORCPT ); Tue, 12 Sep 2023 07:31:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234523AbjILLas (ORCPT ); Tue, 12 Sep 2023 07:30:48 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9EF1B3 for ; Tue, 12 Sep 2023 04:30:44 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-99bcc0adab4so696977466b.2 for ; Tue, 12 Sep 2023 04:30:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694518243; x=1695123043; 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=EJDcYGi9xkj6QKbqo3iNcw77O78wB7Hq6Jj/+q8EmC0=; b=kjaji4rCE6gdEkZGoCGBCqgiIfXqS1Dw8HL4f2pjTqVT81j8MU7qvR2R30KSIH5u7x 6PGeEfempwwE1u2xCKL239Wns00SevrhouBT+20gd0YUwNSOdAPVO21xtmbyCpvXCJ5L ru2VdFEniuFTBctOvSO1kLIcEl9QZXaCAoi+yNRKvF2/6Vk6Ogh38VPdQMQYXKTQZxLd jBUpkC0McZZATlLb8zMDkA29g9zxRu4+evWG19EuQ474JVzQMAyKL1vLhpdYmtYOOXAE 7TJQHbq64rHROVHOxTjNywFWdOIpSDwqw309zuLIzySTZffk6UM5sLeW7KLbzST3Pcad /9pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694518243; x=1695123043; 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=EJDcYGi9xkj6QKbqo3iNcw77O78wB7Hq6Jj/+q8EmC0=; b=NBOlQQysplsaHtEdw01mlqJNezdof6f8f99X1BE6HpNXJt0GpNMZV7vladGSNqZ64f fVS1KASDqCLsDNC0dvuDfuuYcJBanzuJYKBmjAi1BTqypgykkFDIfbTRa5hCbSwR832w SmF0VUF3tUSzOFB7jb3oLICN6LfVwcelDc+FvhxlWS27BT8Yi8kNEWMsuL2hr9YQ98Vr mRju/IB3yx7b66ksA7RRL4KPrc9LM5dCMIiQkKOUKT50ze6yF2YO7u4QhYcMBlaqqoZG Vm7G2jzN0SLjb/rWiBQveHR/zLXUTF9/Cncsqcdp7Pbfm2G2XDSS+ZCuqxe3Xma07AQn 49RA== X-Gm-Message-State: AOJu0Yw61LPToSfnSiMWyG1oXxtnRoMosrbIc5y0uHY1oD5603suQSB+ uEWyoX203GyQmPLPfwP3t2Y31w== X-Google-Smtp-Source: AGHT+IFGR/hGUK+MotInaJDLHL5KTJ51jW0Vv1cuFdKWsf08M8zQ6ICYJzMY0WFbfe/ZeqQConVujA== X-Received: by 2002:a17:906:1da9:b0:9a1:d79a:418e with SMTP id u9-20020a1709061da900b009a1d79a418emr10080318ejh.40.1694518243093; Tue, 12 Sep 2023 04:30:43 -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 ld10-20020a1709079c0a00b009ad829ed144sm953504ejc.130.2023.09.12.04.30.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 12 Sep 2023 04:30:42 -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 2/4] target/ppc: Restrict KVM objects to system emulation Date: Tue, 12 Sep 2023 13:30:24 +0200 Message-ID: <20230912113027.63941-3-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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org kvm-stub.c only defines kvm_openpic_connect_vcpu(), which is clearly not used by user emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Michael Tokarev --- 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 4c2635039e..bf1c9319fa 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'), if_false: files('kvm-stub.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'), if_false: files('kvm-stub.c')) ppc_system_ss.add(when: 'TARGET_PPC64', if_true: files( 'compat.c', 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: 13381492 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 DBE1FCA0EC3 for ; Tue, 12 Sep 2023 11:31:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234744AbjILLbL (ORCPT ); Tue, 12 Sep 2023 07:31:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234655AbjILLa4 (ORCPT ); Tue, 12 Sep 2023 07:30:56 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C078610D3 for ; Tue, 12 Sep 2023 04:30:51 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-502a7e1bdc7so5241172e87.0 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=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=/aSlGFqA9ubhB7ZC5gHBqxQU1rcWLkqloVAzPG4iLCg=; b=pC1GrUw3qz9tlmlBu9Vv65ySX+buIXsDjSy2R0sJpIupaKqMn0HTIv37X65aUi8N7Q +3udc7gI4vGQH64B/Q1469q8uGyj7DNu+kmvhrsuK1T0qZiu9OE4rhLbUk41zCthV5wW 4ZgBiTzo9iByjiuVf1V3HdUPgi7hxTvPerpDmBj5QWkRYQkKB4yZk3w9F1yXYAEkDwhl nhJf0UEbzD95YJilMtKf1YORm2yEG6q9v6GCvIeYJ7kAYgyXqS3BIi21F9TYXKSzon10 LVf6v5R1oBG5xDOJorMA7UnLy3LCwI3Mo7m/VPmqLusPwYmfWwblNzvshE5W80R8aKc9 bGRw== 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=qzEkmdGkb7w2raby7YYeElFtCI1A9BkqvJff4I++athUFZ2XiYrstCGd2xj9YemseZ FELIRDnWFq5wiaoEHEpfDVYXv5pS1ME+lyHliWuN5AI3oiJB2TXtBav3sRA3sHQDPgN6 aWjRWewqABio1tNNUzHdhKlz8HlpyzzYzS6efU8sgt/XCpfWyGpIf64HzeFFqxk7+NSl ECpwxcFvzrAsJi28MNtCdFzcAuDguTmUY4ecUst93SuI4M9dXwq02XS4BVyk58k5rqL8 44t7qtGjgky0eg7A9XQwdQZAldvp91yzFu+iklp9wRqmg1dAacF1ZI0GE+GQFx/mupRt xc9w== X-Gm-Message-State: AOJu0Yw9hcY8CWqRoW19rgz2L4/lKh8thjrztfVHdUlNJwkxe0Vk3IC7 NkfIw4T8VGAoKun73YEtmaXgoQ== X-Google-Smtp-Source: AGHT+IH1nDDr93QicJYxAxgnTc7nY/JwU0DHitp5fHJtl0TRbIOcDKW6MuHF8lvcCHq4T8Tl9fsYHA== 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 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. 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', From patchwork Tue Sep 12 11:30: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: 13381493 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 2F1B5CA0EC3 for ; Tue, 12 Sep 2023 11:31:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234597AbjILLb7 (ORCPT ); Tue, 12 Sep 2023 07:31:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234666AbjILLbL (ORCPT ); Tue, 12 Sep 2023 07:31:11 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EB6E170F for ; Tue, 12 Sep 2023 04:30:58 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-52e297c7c39so6917478a12.2 for ; Tue, 12 Sep 2023 04:30:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694518256; x=1695123056; 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=Qjw2XAQ6HKVx9Z3EPaWrG+b3gjC37zBrk2Sv1nlYmYs=; b=LACDLyDuZD9accFoJk2Wd9oDKlSKUqCQiXqOTR9hLCUg3HronSHnf9kRt5WlaW9iFW YHCy6XniucIlok/0Yg0zvrI8sE464J6JROB7Z8wbDBAGbNoQ6v4Ucq+NOqZCq3+aC5rA 0lwOredqQggd7g2DS6Av9HA0v5WwqcPEQ/hDrCGcGIXhhuzZ6B5D29O3cGDZMUnwyzx7 aoEQJdcy7H1VI7fzQnvIiCs4tRti3zmTWwxm7L+RjBbSn67ytYvFdrHNJVZcIh3pFm4f O0MFZoPjST9UEMws/FkaxaI/+nsxHrgUKjQ/q5RytATt27QQXugtvX4saBDSogUPBsTT YoJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694518256; x=1695123056; 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=Qjw2XAQ6HKVx9Z3EPaWrG+b3gjC37zBrk2Sv1nlYmYs=; b=gk7XZ/HKec3AWNIvnjAVrPJcxiYMDhzMx1pfqd46bkv32xnI4iJLRkdr/69MVeVK3b oC9r5TK8nlhB0p3eZgoJz0L+MEoFst4uzk9RNTxf/CE5sPkyjAQpmn7AaqlKMjSpGRTf WstRvqymMvEa8H4PK/ruj8kDeKkLKOKpFktaLP3e48UGN/6YRAGQ6Y7/W55pRVYAuNzT lXJbjmdBhrosl6u1uP9JtULZVw2gB9HHBUEzru/nnwkqPtcOyNL/HA+S7gLlYlxoXsE6 iqganLNaL+99C+BsOP0SL1AGz2RxaySrNlcAV1no2GbyGBriIxlqlAzTd79Di7uIc6wI PvBQ== X-Gm-Message-State: AOJu0YwH7HOSD5As/tXR4AddDq/Pe6FOWErerVWAYyP8VNyL8W2NUM17 UPX/aW89C/9OYPMPjw5gM0ZKQw== X-Google-Smtp-Source: AGHT+IGiO5Y1ImU0e5NPiApxvVuGIaqglPuHqf13s/S2DHwx1SaXcvGhb+gpSsNwSY48HsTaLRHqKw== X-Received: by 2002:a17:906:10c:b0:9ad:805d:70da with SMTP id 12-20020a170906010c00b009ad805d70damr1647683eje.12.1694518256600; Tue, 12 Sep 2023 04:30:56 -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 o6-20020a17090637c600b00991e2b5a27dsm6698164ejc.37.2023.09.12.04.30.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 12 Sep 2023 04:30:56 -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 4/4] target/ppc: Prohibit target specific KVM prototypes on user emulation Date: Tue, 12 Sep 2023 13:30:26 +0200 Message-ID: <20230912113027.63941-5-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 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 440e93f923..ffda8054b2 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);