From patchwork Mon Sep 4 12:43:17 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: 1829578 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=SiHzq6iO; 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 4RfSyf5hRXz1yhH for ; Mon, 4 Sep 2023 22:44:58 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qd8wI-0002DE-E2; Mon, 04 Sep 2023 08:44:24 -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 1qd8w5-00024q-O3 for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:11 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qd8w2-0004ge-Ao for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:08 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-52a3ff5f0abso1860381a12.1 for ; Mon, 04 Sep 2023 05:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831443; x=1694436243; 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=uvgb1mY0EmO5+OIh91wyTfD/dyJ0WPXCogU6akizjwQ=; b=SiHzq6iOllrj4sisDqppUQIXfwq88s9s2I40fOvl+t4FtBDz6QP0rFa1YHjVlH/kYe Nc2ipq7f9gOXJA14jcyhhD5iFZLk/SgXsUh5tT+2w4vjxwlFS/rdL+QKi930Aeov6ycn AV/JJkwUCByV0U5T+E33cWI7C41eQJ+ws8ggb/ZqEu7H0KyLzuPMWZTOMR1O+yXUj0wY ds8KmTKSB3rYTVHrKhiBHbcIjyFDVIcnYJ7Nj/6fABjOVTpwOFzPhM8nslb3VKkaQMmZ v0zV/JrmPfMp2+dzHiZfVOsdaYzBaz90Rod4MIVE5TNZP7bex+UNpPCUGrwjaGxYOu4W Vy0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693831443; x=1694436243; 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=uvgb1mY0EmO5+OIh91wyTfD/dyJ0WPXCogU6akizjwQ=; b=kTK+v7rpF3wPXOohtGlsChPbmjGWRbUnt5NY6jR3x+AEneqi8OfFQ97rqwAbc9OuMt t9K06cYHJTZZM4RCtVxenimbUDFJIhvzjqG9EGr35B6H2mqDP9MCvlKR2Ycfi1vrk6Mq YDG8jBz6hAnghwITK6kt+Jczjb3B2pgV/126DUcDeBFLxUmk9hFx9EsgTED4xHdipwpH CfXaVKD6HaebB6EOcbkToWle4Ka7VOIUXKRK1a0UfRWWbv5l9GFeA0ADZu35SwALrVEQ yg9ohgZE+bWlaQSyHqm03y5NZKnqMI1eq9PRxXW+R2MhDT6pKHfxFVRj1b70N+iHBreW 9jGA== X-Gm-Message-State: AOJu0YyxTOW7jNyrP/k9+wY81s/dVubd7/zfQAxjKIzoKhfpQXHzRHXQ bNJ6ysy0tmIMlN6/NsHF+Fz17TVNeAN5SekwT0Q= X-Google-Smtp-Source: AGHT+IEKCW36+yHgpY2ZBNqNwkC4Vzs3gfJURNdlqSjhdC3qvST4PZ0o00mxq38nx3QQCXyG1+Hd8Q== X-Received: by 2002:aa7:d699:0:b0:525:6588:b624 with SMTP id d25-20020aa7d699000000b005256588b624mr6061172edr.37.1693831443293; Mon, 04 Sep 2023 05:44:03 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.227]) by smtp.gmail.com with ESMTPSA id b22-20020aa7d496000000b0051dd19d6d6esm5820773edr.73.2023.09.04.05.44.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Sep 2023 05:44:02 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Marcelo Tosatti , "Michael S. Tsirkin" , kvm@vger.kernel.org, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , Daniel Henrique Barboza Subject: [PATCH 06/13] target/i386: Remove unused KVM stubs Date: Mon, 4 Sep 2023 14:43:17 +0200 Message-ID: <20230904124325.79040-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230904124325.79040-1-philmd@linaro.org> References: <20230904124325.79040-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=philmd@linaro.org; helo=mail-ed1-x52b.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=ham 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 All these functions: - kvm_arch_get_supported_cpuid() - kvm_has_smm(() - kvm_hyperv_expand_features() - kvm_set_max_apic_id() are called after checking for kvm_enabled(), which is false when KVM is not built. Since the compiler elides these functions, their stubs are not used and can be removed. Inspired-by: Daniel Henrique Barboza Signed-off-by: Philippe Mathieu-Daudé --- target/i386/kvm/kvm-stub.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/target/i386/kvm/kvm-stub.c b/target/i386/kvm/kvm-stub.c index e052f1c7b0..f985d9a1d3 100644 --- a/target/i386/kvm/kvm-stub.c +++ b/target/i386/kvm/kvm-stub.c @@ -10,42 +10,16 @@ * */ #include "qemu/osdep.h" -#include "cpu.h" #include "kvm_i386.h" #ifndef __OPTIMIZE__ -bool kvm_has_smm(void) -{ - return 1; -} - bool kvm_enable_x2apic(void) { return false; } - -/* This function is only called inside conditionals which we - * rely on the compiler to optimize out when CONFIG_KVM is not - * defined. - */ -uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function, - uint32_t index, int reg) -{ - abort(); -} #endif bool kvm_hv_vpindex_settable(void) { return false; } - -bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp) -{ - abort(); -} - -void kvm_set_max_apic_id(uint32_t max_apic_id) -{ - return; -}