From nobody Thu Nov 28 10:37:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1693831497; cv=none; d=zohomail.com; s=zohoarc; b=kov4m2LTlBLWg5ivIpi8zngwAHFcQitZB5l6HOLLAOZLynivl9fFgpNbniiNbou731+VC13aTwqDazMgMy3DW4XWlibWzQ3mGxIZ+oMpzWtJV4774n84tEwMWpHT+HhncsKeKmHXLq3C6RXSFK42HQ9LdRtYARDEw3pXE+YwJGc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693831497; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uvgb1mY0EmO5+OIh91wyTfD/dyJ0WPXCogU6akizjwQ=; b=HTSIx1Qc47ua6bC/oFMCbzrLrXkVXn837OM+cyai/v4Gu4TM23xyM7IMDnvj8mhR8mWy8qNLnO8jH/Y4MfoFXMwIsuJNqHxZUD+I0l8bZM5+U3Nbl6ADrefU04EtUO9x93jPOJ0Tpm3vBL13cRo6KPE3hN3icmmV2d5392p8nZU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693831497747598.2498792977425; Mon, 4 Sep 2023 05:44:57 -0700 (PDT) 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) 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) 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) From: =?UTF-8?q?Philippe=20Mathieu-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?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1693831499400100002 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=C3=A9 --- 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" =20 #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 =20 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; -} --=20 2.41.0