From patchwork Mon Sep 4 12:43:19 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: 719978 Delivered-To: patch@linaro.org Received: by 2002:adf:d08b:0:b0:31d:da82:a3b4 with SMTP id y11csp1579350wrh; Mon, 4 Sep 2023 05:47:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGF5HeT25C3ubwkd6D4TGmzXVi+XlPBhUE/AmL/mkK/Hp6etMuMtC3U5wO18nYd+i8ha6MF X-Received: by 2002:a05:6214:3284:b0:64a:2b04:c10d with SMTP id mu4-20020a056214328400b0064a2b04c10dmr9236209qvb.25.1693831639377; Mon, 04 Sep 2023 05:47:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693831639; cv=none; d=google.com; s=arc-20160816; b=UKt4kBNeBuvwIy5NOL1PRNUVXUzT0eOPTA9mDfLjmDP0/lKXJTLFG2OfBUlzmmpf2n 6Y4eiP/qwx0o6lQZIJLZdxRC641PCvMmn1LY35llB66KM/efGAk72LWlD2h419CDcAEy DbevFxZci0kHIsEIGqx6pl091CUvy7+s8VPsvBzqmQXBpxGPWV7dmi2Eu0iblmtiNpv8 2nrxpLpFuEAv2EptkbpdlD3yd8xLXLvsdxv8N/O7KbguMUuaklGEFVlXGTlAj9pDa0Ds s2VbBDsXMCY8nhCmUV7ej3VlzXYQIudbeI8oNVM88ZvfjCnUdTVqwP7+ElINyWjvuATl Bz9Q== 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=yBy9B8/ychOxzyt4MqhLID6RA2iJpJf7s2rkxq992Dw=; fh=WMBZgFXqrDuncQg2GknPKBm0oqht+FEOghevSTbSsKg=; b=dirSdcdLaPfQ4/20Gaxg9XduNr6qYSIRev0H93BHL+/BkCdGEVxrnQ9gM2zu7y2oLS boKw9fN+jVECKOyfUVP/KO7M1cDFcMQBKH8eVOYR32FmOiGJELA6nbZ4pnohJtIe7mIH O8Hhuod0ceO4SVduCiu8RbNus2rSrGfS+ZPy2uroFtBczat75locB3dSpIRl50rV0Xgq nSzN+yjAb/tNXCMMQ98K+G7kRytBhO2V1d+CKXA0obydafvVhaamM1gpAcmXXGlBsOEz 6NPEzxt1b0XzlBCUCquWRfKH7R6+2fggwsD5xE2zl0EENwBzsN8tL0hfkLGQZoZe8AMw xwJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="n9Zlk/Jx"; 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 n7-20020a0ce487000000b0065571e04307si1935904qvl.198.2023.09.04.05.47.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Sep 2023 05:47:19 -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="n9Zlk/Jx"; 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 1qd8wn-00039Z-4O; Mon, 04 Sep 2023 08:44:53 -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 1qd8wJ-0002Sz-Ck for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:26 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qd8wG-0004jm-IJ for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:22 -0400 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-52c74a2e8edso2066318a12.1 for ; Mon, 04 Sep 2023 05:44:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831456; x=1694436256; 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=yBy9B8/ychOxzyt4MqhLID6RA2iJpJf7s2rkxq992Dw=; b=n9Zlk/JxQSQeyjWxZ0k1QN5K7D6XrWm2b3o4NH4540tb1b1p0D0S5lYxkMpbLlu9Ln H1SMqdDqu1dukMczUMpMWbkZR9uLMO22/ML7KlBxJGIjFhjVo+3vvMTW25/x6glgdtL8 DcCs4wrq2XcUnM1Vnmj3a3qetfkln48Nd2uGWEREv6dXMQWYimxt6FQRPd8xpZhUtVqV +qFZBWGqzwdsdp73e6c3BUkDkiIWOpM6yg7C6b7EPGv2Rju8VRpNBLbAh+YkSY3S82J3 TI5/VlF8z8afAfVniWqi9K78LYIeDB6vztQGZbgfMs+SLyMbfHAuCtWrSRz21BTbiMGQ peHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693831456; x=1694436256; 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=yBy9B8/ychOxzyt4MqhLID6RA2iJpJf7s2rkxq992Dw=; b=KJcYLMlNtTAsTPezXPBq/J2nSdUHU3zjyf4Uh6g41gl+pxRSycscXOLr6uzmzjOfMK Dp+saZBAHoazXh2e6ALF6grcrZ8kPyAcMJ50qkdz1+rbzfZc0XcxZlsUhMVqta4+8Zrq UziNftkcSpdebalYuZVI6tVjyPiXl9bsSaeKjQHWKVkEtEFVtlReRQx7InX6WCif7FYI bnamYcw09jt/bJ+Wbyya3kGsAtv/V0IiuDJj8leycm/3vNHVIj4SL19CBKzFyPhwR8ce XLCF54Ror4fMMbJan/AZ2r4JoF1+Fdx6XWLcta93+WvjsnaNVexLE1w73VSkmNxOuz7t 0KNA== X-Gm-Message-State: AOJu0Yye3qeKDkc4nVQA1CZ0UquyxwvSrHB1LVtQY+dPysUdLBDJG7Ah nLR5kUvDDAizd/TwotveToCx/obHXo6xMvuR09k= X-Received: by 2002:aa7:d3d2:0:b0:523:2dd6:62bf with SMTP id o18-20020aa7d3d2000000b005232dd662bfmr8674466edr.34.1693831455850; Mon, 04 Sep 2023 05:44:15 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.227]) by smtp.gmail.com with ESMTPSA id m7-20020aa7c2c7000000b00523a43f9b1dsm5777597edp.22.2023.09.04.05.44.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Sep 2023 05:44:15 -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 , Marcel Apfelbaum , Eduardo Habkost Subject: [PATCH 08/13] target/i386: Allow elision of kvm_hv_vpindex_settable() Date: Mon, 4 Sep 2023 14:43:19 +0200 Message-ID: <20230904124325.79040-9-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::52a; envelope-from=philmd@linaro.org; helo=mail-ed1-x52a.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Call kvm_enabled() before kvm_hv_vpindex_settable() to let the compiler elide its call. kvm-stub.c is now empty, remove it. Suggested-by: Daniel Henrique Barboza Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/x86.c | 2 +- target/i386/kvm/kvm-stub.c | 18 ------------------ target/i386/kvm/meson.build | 2 -- 3 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 target/i386/kvm/kvm-stub.c diff --git a/hw/i386/x86.c b/hw/i386/x86.c index d2920af792..ecf16ef402 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -424,7 +424,7 @@ void x86_cpu_pre_plug(HotplugHandler *hotplug_dev, cpu->thread_id = topo_ids.smt_id; if (hyperv_feat_enabled(cpu, HYPERV_FEAT_VPINDEX) && - !kvm_hv_vpindex_settable()) { + kvm_enabled() && !kvm_hv_vpindex_settable()) { error_setg(errp, "kernel doesn't allow setting HyperV VP_INDEX"); return; } diff --git a/target/i386/kvm/kvm-stub.c b/target/i386/kvm/kvm-stub.c deleted file mode 100644 index 62cccebee4..0000000000 --- a/target/i386/kvm/kvm-stub.c +++ /dev/null @@ -1,18 +0,0 @@ -/* - * QEMU KVM x86 specific function stubs - * - * Copyright Linaro Limited 2012 - * - * Author: Peter Maydell - * - * 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 "kvm_i386.h" - -bool kvm_hv_vpindex_settable(void) -{ - return false; -} diff --git a/target/i386/kvm/meson.build b/target/i386/kvm/meson.build index 40fbde96ca..5d9174bbb5 100644 --- a/target/i386/kvm/meson.build +++ b/target/i386/kvm/meson.build @@ -1,5 +1,3 @@ -i386_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) - i386_softmmu_kvm_ss = ss.source_set() i386_softmmu_kvm_ss.add(files(