From patchwork Thu Sep 7 12:59:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 720602 Delivered-To: patch@linaro.org Received: by 2002:adf:eec5:0:b0:31d:da82:a3b4 with SMTP id a5csp220008wrp; Thu, 7 Sep 2023 06:03:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTjTwePs1drnsomZkDDP7A5chZx19PvlL5sEpNC6libViD3HEMiFHtuhnDRkzpqNd8oB8o X-Received: by 2002:a05:620a:29d5:b0:767:96e2:a9cb with SMTP id s21-20020a05620a29d500b0076796e2a9cbmr27937551qkp.38.1694091783777; Thu, 07 Sep 2023 06:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694091783; cv=none; d=google.com; s=arc-20160816; b=KM2EgiKp5otACaYfefytSVrcPLAc/TQNRVuf6T97sxaGjAkR5hZwfKrGDPY8zZKp8k DXbUk6cL5zwv69sa0ixlNJtPSRV/uG760zYfJb5fbiaG7amj/VbU+ccv3pRu1gz7DNR7 0Asht3sX6dcf4ULNpii6h3kX6MaK7jILosViZvWNCeUWwFkKK7JEhQYQd6ASaNPBHb1K bC+k4lUNlU3RBVLPVwzxwZRptvdcQ9WaU4ooSPIw6APwCAzhn7v6DEG3ntWZ1PZ5yOCE jN7Y2zK8NqTY/ZvtHAGGT9HVAyD1QzQwNixbOhNrtTPNMPii4xm8nNOXnnZ6Y42Kt9gJ eb9A== 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=oIq/O9qNMjpRAveEr93SV2nGg4KhrTDskMws53vhy7U=; fh=QFCe5Jk24fiK20qflZxwfoCL+eQZI/E3YbYpomTJI5Q=; b=eKFgnqk2EJU3NqU6G7zxDtfdPFZ4gHIV/FLG887OjB+6Utsz0ikqJcRqkZY5v1UTZG VX3s/O/M7jgoY0uYEJLKwD9qRfzTDBFyQFdKeypES9/KFT8dE0E3iFW45Dl/KmA0m99Q gsQSA5yiVxaqOyvg5UvqRMAzmab55bWbnDQKgW4l/kfRrEqqMKNxJ9Mb9P+6/KvpibT8 ZSZ/b4TkHrO2z3VCnJlbTbV5HaFPPd8TMTbToG06saCxZGdImTNzX0aBoDZLb1ScIpO/ IK/kX9SDTklephzSfhIVcn/oQGWpcKwbJJo+IRby3i4H2ujigBPytYrWdaP4CBpfdsGI SIoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=c3CQQ1dW; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id br31-20020a05620a461f00b0076f1a6b0551si11954856qkb.386.2023.09.07.06.03.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Sep 2023 06:03:03 -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=@redhat.com header.s=mimecast20190719 header.b=c3CQQ1dW; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeEea-0005pE-H6; Thu, 07 Sep 2023 09:02:36 -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 1qeEdw-0004WH-8b for qemu-devel@nongnu.org; Thu, 07 Sep 2023 09:02:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeEds-0007VP-Lv for qemu-devel@nongnu.org; Thu, 07 Sep 2023 09:01:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694091711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oIq/O9qNMjpRAveEr93SV2nGg4KhrTDskMws53vhy7U=; b=c3CQQ1dWLUmAR2Bd+ulPlyQxNA9YCgfOOTSNrsRct1Rq+W0ct9qdOHLsJxwo0V6pxUwvKM MKxc1KGkJS2kxGjLbHn7DX+uw0L6NakWGezSImKv4Uxcgxe8nME31MN/OZXnxZJLqTSIrX 97VBWnGqCEL4xPaJmCrhwKSk7BCnRgk= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-131-hJAO2njFM-yE4Va-O-Cnaw-1; Thu, 07 Sep 2023 09:01:48 -0400 X-MC-Unique: hJAO2njFM-yE4Va-O-Cnaw-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-31c5adb698aso574687f8f.2 for ; Thu, 07 Sep 2023 06:01:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694091707; x=1694696507; 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=oIq/O9qNMjpRAveEr93SV2nGg4KhrTDskMws53vhy7U=; b=LI2CQRGCOHmtZQHgmE31XTvzigY63YjcCq3IEPimB/XrCSPz3lrd/NhoT0HaPr/zqP 1FjlL4JJPRQUlkCzUtG3xy71YoTtBzEfrjLo+W5KFL+7x40d+spKvjQCEK6jQp7SEhXg q6uBXKiVeQLpCpYmA0AnaVbjolWes18N8UEqRdrBShbyPQ4ps+76Fv4oKLmPWcOBZS9h vlnunzz2w/T1BjsIHTWLMufizpwljgcZtG9QukEhs9aXtAcSIocLrq3fYx7w1CuvE63x 1FALEgBhzicEyFKta8HoxSvB88fL6F7egXfo6WxbR4uIIQAt8RMwj7N7PL32pUjq29Fi hcqQ== X-Gm-Message-State: AOJu0Yw3E7qh+IQgM4rDLCBsGYKONPARYmVqUQEYO/85SC0Z11RxXQvN Y8Hc6cOPcdVINqPajRu7zWFxiOwpmzQKJbq5wxdrHivpxIVcCARjqBGJ/pZdA/AbSDSeC8B726l AYHEDo7u6DZfdNn7KmA9UR776om/qB0cMGQpuO1Bpwhczu0oib0RQ6saKhjmAlq1WQZzQULWteD 0= X-Received: by 2002:adf:ce8c:0:b0:31a:d112:954e with SMTP id r12-20020adfce8c000000b0031ad112954emr4891376wrn.46.1694091707203; Thu, 07 Sep 2023 06:01:47 -0700 (PDT) X-Received: by 2002:adf:ce8c:0:b0:31a:d112:954e with SMTP id r12-20020adfce8c000000b0031ad112954emr4891356wrn.46.1694091706860; Thu, 07 Sep 2023 06:01:46 -0700 (PDT) Received: from [192.168.1.174] ([151.48.237.81]) by smtp.gmail.com with ESMTPSA id c1-20020a056000104100b003179b3fd837sm685464wrx.33.2023.09.07.06.01.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:01:46 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Daniel Henrique Barboza Subject: [PULL 44/51] target/i386: Allow elision of kvm_hv_vpindex_settable() Date: Thu, 7 Sep 2023 14:59:53 +0200 Message-ID: <20230907130004.500601-45-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230907130004.500601-1-pbonzini@redhat.com> References: <20230907130004.500601-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 From: Philippe Mathieu-Daudé 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é Message-ID: <20230904124325.79040-9-philmd@linaro.org> Signed-off-by: Paolo Bonzini --- 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 3e86cf3060f..f034df8bf62 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -421,7 +421,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 62cccebee4f..00000000000 --- 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 40fbde96cac..5d9174bbb5d 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(