From patchwork Mon Sep 4 12:43:12 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: 13373842 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 0D6A5C83F2C for ; Mon, 4 Sep 2023 12:43:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349705AbjIDMnk (ORCPT ); Mon, 4 Sep 2023 08:43:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230353AbjIDMnj (ORCPT ); Mon, 4 Sep 2023 08:43:39 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5598B103 for ; Mon, 4 Sep 2023 05:43:35 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2bce552508fso20991531fa.1 for ; Mon, 04 Sep 2023 05:43:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831413; x=1694436213; 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=aJCm9ielSGbSry5cbeI+YJvG0psfGNIv8B+tATNPjpc=; b=nj1OQgtkeNKYr6/QUD5koOwS/jZxJ8I/vxqgE/lq1IF2tlLEgLaGTKNIlt06i3S/YN jaAQ55qJIOI84EG0u1/dgZgc7ED+DUSP2WSUHHBIx2omckZcda6Kry94/ZI8akKlNcgJ rPg/3gGJsKRRxVckLPehLOiIvHUdCDxOq5udvw9iJ9QuozOztZll4nGQudfUMP78paW9 Y1Z5v4klZenzzbUvIEjJC3ta5DfbRRqW50t/t2o+6nOyjrdulwdUDYYZKDEvAYJqyQng w2pkYmMRHuTu4XPz1+Ex1P01Lp6BFG63l+yGWAMlgVTWQ/jzgmbKhzZ8of2vGmQHsu80 hCQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693831413; x=1694436213; 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=aJCm9ielSGbSry5cbeI+YJvG0psfGNIv8B+tATNPjpc=; b=e3YF/VxRAfr6VneKEe9Ec8xrvdkR0EHCIeA9XezoHW4i6NxW7+kAfeC9pzgEAUjRre ngJUM/E+sSeDWfU5OZCWHHmVBuWJWbXxe0QvYHmQHdb/FFnjz4mbqpNqLGoDxgCLWgwO NZg8s8ObPEwqoGqp1b35y7R5AQLlI8Yd56WkEMX9dfYlUIE5SRef4hEPOx3K/cVf3RZl 1mxo24xCkD8vHfc4RtfetAyOqvmIQXsNLfpK2+LxGPWNuReGu1ni29GJeWKB5EvQ4aZO AOyq9ic/IzCzpV/D11x8btyHQHT1zECuoVVIVxPOfclawqcmZuBcLoa3lSQQPL3BPkMb f6CA== X-Gm-Message-State: AOJu0YzvNomuTLNKhM9ZLrcNSiqshWwT0MWebuiRFMt74ai0eZGDtz6b gCdJy1BdV8/2PC544xbWRdORWA== X-Google-Smtp-Source: AGHT+IF1LC+yWQ0PhXvd9yzZgLb7+mH1K3LMUlqzrxxaMQCoDCfGxeabIkm0GVrCgphK+2vgyIMWHQ== X-Received: by 2002:a2e:9a8e:0:b0:2bc:b0ae:a9e5 with SMTP id p14-20020a2e9a8e000000b002bcb0aea9e5mr7458665lji.42.1693831413634; Mon, 04 Sep 2023 05:43:33 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.227]) by smtp.gmail.com with ESMTPSA id f3-20020a170906824300b009786c8249d6sm6163671ejx.175.2023.09.04.05.43.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Sep 2023 05:43:33 -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?= , Marcel Apfelbaum , Eduardo Habkost Subject: [PATCH 01/13] hw/i386/pc: Include missing 'sysemu/tcg.h' header Date: Mon, 4 Sep 2023 14:43:12 +0200 Message-ID: <20230904124325.79040-2-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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Since commit 6f529b7534 ("target/i386: move FERR handling to target/i386") pc_q35_init() calls tcg_enabled() which is declared in "sysemu/tcg.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/i386/pc_q35.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 37c4814bed..43413dd1ac 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -34,6 +34,7 @@ #include "hw/loader.h" #include "hw/i2c/smbus_eeprom.h" #include "hw/rtc/mc146818rtc.h" +#include "sysemu/tcg.h" #include "sysemu/kvm.h" #include "hw/kvm/clock.h" #include "hw/pci-host/q35.h" From patchwork Mon Sep 4 12:43:13 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: 13373843 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 26D66C83F2C for ; Mon, 4 Sep 2023 12:43:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352815AbjIDMnq (ORCPT ); Mon, 4 Sep 2023 08:43:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350864AbjIDMnp (ORCPT ); Mon, 4 Sep 2023 08:43:45 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66CB31AD for ; Mon, 4 Sep 2023 05:43:41 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2bd0a5a5abbso21118901fa.0 for ; Mon, 04 Sep 2023 05:43:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831419; x=1694436219; 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=r6Qgqbn+d1/I+gSK8St7x7NRj+2INTDRnnggirvl8K4=; b=ZVR2Ww3eE3oRf6MWKRXd1kjuoV/8o0ln/+3JCOYPkHRMa1dtfOdi5HqliAQIMz9bTQ h2BEEGEOFqa1W5AZc/UFAgYpWhskZ4WjmakqgTtpm/MjEzcGaOyYn2whZzVyYdGl7UAy bxIu+u2yJ/fNNt6p+sUlH1osSdb1l4I2lLwtZL4AyGBNNKSwxWgcEVHuGQ+F+/Dwmr87 BZbWYghx1RjnI/Nl0bMbfhmlHbq4WsNGjKGXoIVSqNfW7m7DCTHQbLJtnIF1uSabYl/n MZSbANaoC13g15t6ctFPuZtOSzxvfqKDZ3rLmNImbrlL81EG8dgKjWOGQouPTG2oaBOL Dl/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693831419; x=1694436219; 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=r6Qgqbn+d1/I+gSK8St7x7NRj+2INTDRnnggirvl8K4=; b=cf8mWUDeCTFecD7AJ4dhGDjzUzlmrcIgHbf2fbsmApoBPR45dgu4aRSiq/rcBCobEg Cbep807L3MKLf/tbyKKDTgbnBC0e1w92ebwNrwlcqgloi3+kwuDxnLqWbitYTJZjTKm+ LqW/10Xp3LVh2qCcE3W/YupqtPo5uA7MauvJc3KsD4CxeePXsiR5Vga+HnJrjGu8Svv2 C4K1dnXDoDrAoC8edTvhQt70GGWjSk2jMBJsYvaZL8rHKO1cFXv/AR3qt3xbd255nGhm nBEjYrYQaZuCgwtSTy+6Ocnctv/agT0Zq2MSuB1KNu/lvakc3DU7r35+miGWCZG+EgH3 UrMg== X-Gm-Message-State: AOJu0Ywp0zRaV5ttQ7sDpwwOjptkWQ97+wx/23HDmkqIj5EkOl5UChhz ezCz0Ke85PewRSxz3jUXmg5bUA== X-Google-Smtp-Source: AGHT+IHAvtxselt1b1hV5LdDZn5OMGkxc7bjsWnN+/jQkXccg9G0McaZkj4DLfPBkIFLocObukSlqg== X-Received: by 2002:a19:2d45:0:b0:4fd:f84f:83c1 with SMTP id t5-20020a192d45000000b004fdf84f83c1mr5836726lft.64.1693831419642; Mon, 04 Sep 2023 05:43:39 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.227]) by smtp.gmail.com with ESMTPSA id lg16-20020a170906f89000b009a0955a7ad0sm6087296ejb.128.2023.09.04.05.43.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Sep 2023 05:43:39 -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?= , Marcel Apfelbaum , Eduardo Habkost Subject: [PATCH 02/13] hw/i386/pc: Include missing 'cpu.h' header Date: Mon, 4 Sep 2023 14:43:13 +0200 Message-ID: <20230904124325.79040-3-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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Both pc_piix.c and pc_q35.c files use CPU_VERSION_LEGACY which is defined in "target/i386/cpu.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index ce1ac95274..f0df12f6fa 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -69,6 +69,7 @@ #include "hw/mem/nvdimm.h" #include "hw/i386/acpi-build.h" #include "kvm/kvm-cpu.h" +#include "target/i386/cpu.h" #define MAX_IDE_BUS 2 #define XEN_IOAPIC_NUM_PIRQS 128ULL diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 43413dd1ac..8ecc78c822 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -58,6 +58,7 @@ #include "hw/hyperv/vmbus-bridge.h" #include "hw/mem/nvdimm.h" #include "hw/i386/acpi-build.h" +#include "target/i386/cpu.h" /* ICH9 AHCI has 6 ports */ #define MAX_SATA_PORTS 6 From patchwork Mon Sep 4 12:43:14 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: 13373844 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 D7544C83F2C for ; Mon, 4 Sep 2023 12:43:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352847AbjIDMnx (ORCPT ); Mon, 4 Sep 2023 08:43:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350864AbjIDMnx (ORCPT ); Mon, 4 Sep 2023 08:43:53 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B6A2CDD for ; Mon, 4 Sep 2023 05:43:47 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-99bcfe28909so205850166b.3 for ; Mon, 04 Sep 2023 05:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831426; x=1694436226; 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=EAX70gb1DRp0U5HpIrsPRfVqNXXnjE75o2367gc+/Ss=; b=WZaxS/0OLLL9irzltuc0NlABLYaNHFpRDlv4HHODyIt+4XlO+Ckldldhp4siGJGON8 LTayCQ1PlaXfsleHEyGx9l63zqSzhXgyA2WcZIA1CJhglih1YmbUTpP7GCE/NBe+p5i5 IFEVetKPw8YuDRJhOXS+mom9wPWqpuos5n06xvjAX6g4ekvcMwHw70NOhMnLno6Ue7Tm vkxcx7HC3QLgpFsGIZ5zSECTir/Kus3HKHU4GOPiRceHVu9cRZ2GyLkKzQ38l4oYLdrP oARe6AoWf0lH4fvAcu1JN+YjkxopnIydS+OZ/qESn6mXTkRTETozRvNIq/mQ1Bg+1IkL 7W5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693831426; x=1694436226; 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=EAX70gb1DRp0U5HpIrsPRfVqNXXnjE75o2367gc+/Ss=; b=dYsuNcdeqReggtilkg5L1FOYzXJcjVLyh/XkoZgHo/ff7X7GbeLRBB9KBXb5zEofOu WBgAUM11EaIORRsZCi5ZrecZMp54dT0MTJpLExIq+0mwYBrfcWMjbrpQkRSzSFjvsZGy fAPy7rm06hFf+l+hBh/tckh8XvAzfqTfncW3Mq/YSj66h5V03yZuHuoB3hNTt7rtRGSq 8WbUYjiDOgTr3z16sOcZgrHISN98+1ZCCAQqy4nZAMLQ0NWsrYyLDU64RdglXkofYHxC xMuHQsidvdCZh1tla0TDBGlalCQwlppjdi8dI9t9++uTULCU/1vUn1u1C/oe0qWgp7Ge TR4Q== X-Gm-Message-State: AOJu0Yxns8zdxgcT41zVljeTTIxg2RbD5G0PVjzsRXrdyAvFSOdMURpK QwMdPeNYeIBl8qal9fonUPZsAQ== X-Google-Smtp-Source: AGHT+IFkSqJnsshKBauxCddr+GUPT4A6KXmj88c6crUPHo9OljUs8uCyfcujmDG6A70sYs/Xauvxnw== X-Received: by 2002:a17:906:30c1:b0:993:d5bd:a757 with SMTP id b1-20020a17090630c100b00993d5bda757mr7133775ejb.19.1693831425876; Mon, 04 Sep 2023 05:43:45 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.227]) by smtp.gmail.com with ESMTPSA id pv9-20020a170907208900b00993470682e5sm6063351ejb.32.2023.09.04.05.43.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Sep 2023 05:43:45 -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?= , Marcel Apfelbaum , Eduardo Habkost Subject: [PATCH 03/13] hw/i386/fw_cfg: Include missing 'cpu.h' header Date: Mon, 4 Sep 2023 14:43:14 +0200 Message-ID: <20230904124325.79040-4-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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org fw_cfg_build_feature_control() uses CPUID_EXT_VMX which is defined in "target/i386/cpu.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/i386/fw_cfg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c index 72a42f3c66..7362daa45a 100644 --- a/hw/i386/fw_cfg.c +++ b/hw/i386/fw_cfg.c @@ -24,6 +24,7 @@ #include "kvm/kvm_i386.h" #include "qapi/error.h" #include CONFIG_DEVICES +#include "target/i386/cpu.h" struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX}; From patchwork Mon Sep 4 12:43:15 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: 13373845 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 58CECC71153 for ; Mon, 4 Sep 2023 12:43:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352854AbjIDMn7 (ORCPT ); Mon, 4 Sep 2023 08:43:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350864AbjIDMn6 (ORCPT ); Mon, 4 Sep 2023 08:43:58 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECD78CD4 for ; Mon, 4 Sep 2023 05:43:52 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-52e297c7c39so1270571a12.2 for ; Mon, 04 Sep 2023 05:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831431; x=1694436231; 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=SdbPeRb3rqucMV4G8DmJatCRkQTtO6zKzLYWXw0g6yM=; b=NKVUbO/Qvv7VF4HCE9AkPGvIpqppN1Lb7pn6sLpr2I7a+BXSA9m/XgqdhlHYW47jSP 2/RAYazx1fnIjcW9raSDp/zcTtn3qmle3E3k4IWOUMfeEWZTpB7l0P6Cq1J4RMQMrKoH OZ5dyyBRDQNDDpg/js82OTR7XvvMk50wt4IqBrDbyPXz8KxxwL7SiWUjjQTx1z5dJRcq 6A8h389evNHpbTqctpCTnhz9AWSpygo7Fx+EmEYp2LyQD11jlTzvqsHCAtkC9HeZRsnW R0pkpdaopmOw+EZz/hY23gQ4PzYDjkiW28e4/o9GVr3l9BwCZJLx7o7TjImGFti6kTCJ Vs1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693831431; x=1694436231; 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=SdbPeRb3rqucMV4G8DmJatCRkQTtO6zKzLYWXw0g6yM=; b=bBuUsyWJFpMUOrGbXJphZr/dUvjgSrWia34tS8aqYdSM5j9A+bbFQPHqldl3KTBH3O uNZupYtkdWrPy8M2PgS0mk6I0zoH3uAJP5+GXwq0T4qU+Rx9FsVCTg5icz2sDaUYBSed iV12iTjSvyHHxk0cnVG4a8efw0m+BU89cmZHSfa/S5jP7Op+Bl2KNI48FG6sYbzdAsZ3 AaQpbtQrIBxQdSAQzNzjzr9PLBExK2x20vRdGx2eoqrwzar1caA3vA+KyBTE6s0Yu2Td CkCXHcAVnvfrsmNilQ3qZQ6rDaFbvLWbibO3PnrXJZEP7g6Urkn8z2aD06I1iPGr50xi LaUA== X-Gm-Message-State: AOJu0YyuLdN/nqTRlK1SxYr85lXo0z8Qr1uSyaeKC7tC5XErUo2qZ5VO wn1SR1fk8ZrDMe3ijVJxrHn7rg== X-Google-Smtp-Source: AGHT+IEsBFqUtTTs6WqvZHff9CgEl9Cr75zp000xY/akplngwM5ibOARO4pqK/3xRP1h2a6+OrAUVw== X-Received: by 2002:a17:906:cc5b:b0:99d:fd65:dbb2 with SMTP id mm27-20020a170906cc5b00b0099dfd65dbb2mr7528978ejb.33.1693831431480; Mon, 04 Sep 2023 05:43:51 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.227]) by smtp.gmail.com with ESMTPSA id y8-20020a170906914800b00992f2befcbcsm6120980ejw.180.2023.09.04.05.43.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Sep 2023 05:43:51 -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?= Subject: [PATCH 04/13] target/i386/helper: Restrict KVM declarations to system emulation Date: Mon, 4 Sep 2023 14:43:15 +0200 Message-ID: <20230904124325.79040-5-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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org User emulation doesn't need any KVM declarations. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/i386/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/helper.c b/target/i386/helper.c index 89aa696c6d..2070dd0dda 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -22,10 +22,10 @@ #include "cpu.h" #include "exec/exec-all.h" #include "sysemu/runstate.h" -#include "kvm/kvm_i386.h" #ifndef CONFIG_USER_ONLY #include "sysemu/hw_accel.h" #include "monitor/monitor.h" +#include "kvm/kvm_i386.h" #endif #include "qemu/log.h" #ifdef CONFIG_TCG From patchwork Mon Sep 4 12:43:16 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: 13373846 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 06B3AC71153 for ; Mon, 4 Sep 2023 12:44:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352868AbjIDMoE (ORCPT ); Mon, 4 Sep 2023 08:44:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239379AbjIDMoE (ORCPT ); Mon, 4 Sep 2023 08:44:04 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D7E8CCC for ; Mon, 4 Sep 2023 05:43:58 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2bd6611873aso20724951fa.1 for ; Mon, 04 Sep 2023 05:43:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831437; x=1694436237; 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=J86j5mSNtE6sux8EpFhfC+5G/8PZx0ftCeNpTFb29eU=; b=SA4Ljt8izFTEjOIyGfH3mYL4G0sv5r9YmpB2UHQpi77HaGm06BUPhZjt6UVls0K/5e +q/pX8JHMtCBS2z6Q1B8hIL0Cln9etUQW38YokmiwE+Id20qwRthk2SjqrAlgeSG7LLJ qTWOjzLt/21x1oocOdJ+CZS9Wciafl30IuU8rdPbnBF82HpJutWk/6ye/x0vYVAZYHZc UCf84DohWnbBnASYheTZLRZqkiNNAp53qCgLySVJ/sXhUSbKfq9Sj4+hy2bHeOo5gXhq w8ixz9mbCkwPZ258Lk5NG/HEnwv6d9CwAlNi7J05E/CKg9GI8lkDdmxeqvbEzxPUUGCi O9fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693831437; x=1694436237; 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=J86j5mSNtE6sux8EpFhfC+5G/8PZx0ftCeNpTFb29eU=; b=TEnW0LwvaMOHaP7A6BoIOy92IsIGTtPErAs7ee9VtYAvShqCTnYr0aTxpqDsgqYp+/ joSJVUS9GsWOacCH5fn9QprsFUnv4uoNlmKAQqtgqJrJZqCXtiwLJAW+AeKNKKTkAG2F 89DjKgWtKvi6fYWE9hwEyDMAQdwilsUyDYasIZVaT2hGQbirmGgmcJucho10h6kHkWZC ZwsyQ4o09IAam+PhRTaCxvcfFxXRGsuugJLUOwPufOY1rp3PADOAg3PsdAFckly4t5pN AkJ4T8ARPBOv6jkS8dtkcnLr3gqeBdUEtuCkjR0A/6udKyATW++NZBqSWj2+lc9uY9s2 Hj+g== X-Gm-Message-State: AOJu0Yw0tyJxIRvgC0DjJIhpNKfb7leTBRh6o08kbefUdRpnciaFuJWk 8f99ohQ6EjxgzXEJvO3FPbjUrQ== X-Google-Smtp-Source: AGHT+IHTKfewe5UyKQ+3sAtZlufz27CBCCuRSsD4I35Lg5dnHNAx7JD/gpJfXGmmCvEgfuCO6tDe+g== X-Received: by 2002:a19:ca4e:0:b0:4fb:9050:1d92 with SMTP id h14-20020a19ca4e000000b004fb90501d92mr5895100lfj.51.1693831437006; Mon, 04 Sep 2023 05:43:57 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.227]) by smtp.gmail.com with ESMTPSA id qc8-20020a170906d8a800b009944e955e19sm6102288ejb.30.2023.09.04.05.43.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Sep 2023 05:43:56 -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?= Subject: [PATCH 05/13] target/i386/cpu-sysemu: Inline kvm_apic_in_kernel() Date: Mon, 4 Sep 2023 14:43:16 +0200 Message-ID: <20230904124325.79040-6-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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org In order to have cpu-sysemu.c become accelerator-agnostic, inline kvm_apic_in_kernel() -- which is a simple wrapper to kvm_irqchip_in_kernel() -- and use the generic "sysemu/kvm.h" header. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/i386/kvm/kvm_i386.h | 2 -- target/i386/cpu-sysemu.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h index e24753abfe..470627b750 100644 --- a/target/i386/kvm/kvm_i386.h +++ b/target/i386/kvm/kvm_i386.h @@ -13,8 +13,6 @@ #include "sysemu/kvm.h" -#define kvm_apic_in_kernel() (kvm_irqchip_in_kernel()) - #ifdef CONFIG_KVM #define kvm_pit_in_kernel() \ diff --git a/target/i386/cpu-sysemu.c b/target/i386/cpu-sysemu.c index 28115edf44..2375e48178 100644 --- a/target/i386/cpu-sysemu.c +++ b/target/i386/cpu-sysemu.c @@ -19,9 +19,9 @@ #include "qemu/osdep.h" #include "cpu.h" +#include "sysemu/kvm.h" #include "sysemu/xen.h" #include "sysemu/whpx.h" -#include "kvm/kvm_i386.h" #include "qapi/error.h" #include "qapi/qapi-visit-run-state.h" #include "qapi/qmp/qdict.h" @@ -253,7 +253,7 @@ APICCommonClass *apic_get_class(Error **errp) /* TODO: in-kernel irqchip for hvf */ if (kvm_enabled()) { - if (!kvm_apic_in_kernel()) { + if (!kvm_irqchip_in_kernel()) { error_setg(errp, "KVM does not support userspace APIC"); return NULL; } 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: 13373847 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 6E56DC83F2C for ; Mon, 4 Sep 2023 12:44:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229510AbjIDMoK (ORCPT ); Mon, 4 Sep 2023 08:44:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238975AbjIDMoJ (ORCPT ); Mon, 4 Sep 2023 08:44:09 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A03ACDD for ; Mon, 4 Sep 2023 05:44:05 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-52bcb8b199aso1854425a12.3 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=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=uvgb1mY0EmO5+OIh91wyTfD/dyJ0WPXCogU6akizjwQ=; b=jlYMZFIkEus2toBx/LbjpMCmPsNi/F149iw0lpWJUPwmXfd/ZTG4pnpLrAcB/vcBPM iIoaIX3Br0LvtiSnR7KJm+1t2ky5TTz/vJox1pPzInq6fJUwb4CKVdlNkTEaAfZGt9KD dNrybxG9qGhWYrO0F1raRtyFo8g6VWm/6RSlp5cE/lEOVhr+f9ILvveCqEBk/dqz+Nbc fHOK49QBmIFVoumyb/nVgI8Zjso2rsEx0XAotPhpAEajJ3ctxxNk/HqMEiWgEwnKto3E cSq7QMSMYSVzS+2Jnw9hxecNkJLH3TPMPg49lBVq2wRKAmpbNgsxw/yh6C6gO5IGIxLU SU9w== 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=QUA/g6jS2pw8xMAJhg7iUp0SzocPoQSHXdcbKku2Jwo+V0Snr1FRQxcOMn4j9nZAmh aY8aOHlIhcousnjUl7sDbb+7I290e2fJKeNOpZJtsTMtm06rP5I+J/j67fkNoOwxsUOm 0Drn6BJU0QUDGeo0Xg3/D5yRt582IlPAwJ5XfvgmwJV5Mvv485uCdtzmhaQdNCrCiSqS rH1EESPVhAQarB+/AyIbpnus4TdKz5+iJ3FgY0mTy2GQjwTJsvL6wh4Gw8ap6hCbpr4K Gk77wyyrGjtb5BB7LCWIertp4446utGPRbyNifnLVwhilkceITx1G4A8fRW3Y7j8fJc1 JWKQ== X-Gm-Message-State: AOJu0YwEtXIa99psGODHu0lTWADhz6G6v7hzuVsnD0ssC037S8LegjyU UlS5QDNlGM7VwtYlJnJVXIpptw== 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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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; -} From patchwork Mon Sep 4 12:43:18 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: 13373848 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 D270AC71153 for ; Mon, 4 Sep 2023 12:44:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236147AbjIDMoV (ORCPT ); Mon, 4 Sep 2023 08:44:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352874AbjIDMoV (ORCPT ); Mon, 4 Sep 2023 08:44:21 -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 17C20CFB for ; Mon, 4 Sep 2023 05:44:11 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-9a5be3166a2so195183266b.1 for ; Mon, 04 Sep 2023 05:44:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831449; x=1694436249; 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=y1KRPJbXgs1nETBjJNmlr2PmeFCKIGRCFU9IErPdUTo=; b=v8OPqbdBSClRZU6+mP2XH7bhTZcQ9L3fiG2Ocq8VG6M7GM28+Y3fu7uZlazrXzoQ94 yNyJwDVoEUUKqre7zA1AO9CRq02WzTyHIPL0/02LvKMwRogQNWmZwM28n4ApitKZEq42 lLLhB/ydth8DSSu943RijAeczFCr1MU09Re+qJ+jp/SeBQoz/DL9Vu4uyK0PbI7zaPSC gOq24HE3CWR3YogWZhxUTSPSg13zwjONM2tVNEl6+AYXnKG1CSAD8mYrshepeNQlqKG5 1HVvrQyLmBP1uKIy+nXstccy+jQiSYnciopHX1SUZmdmI2bzaAVNru/GWUurKviZ+9X4 2VWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693831449; x=1694436249; 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=y1KRPJbXgs1nETBjJNmlr2PmeFCKIGRCFU9IErPdUTo=; b=Y7HCoAXxZ/51McEkef49KRNe2o90UUWgifJAlb5a0dBUsBndr0TQM9zDivUknNHFbK wbcyBraoV8DifVsgoFuSWUKWS517dwHRMZo6Bv0p+jmZ+Y8xEDx6+rQffNijVcAnvF8B 94Vi+2F6mGkIo33Dk4Lnl/r/1wpC6msbLWnBMMYASYyvUzV6syJ2FhV2B+iJsZGZ310D mpsAQNDs/jKQzn/WjZCbN9SAJb/bR4Rmij72bxcSCDH5iakcel0ZGzKdLoRJrFIVTdwi Fgnri8h1yLjQL1DmzAjri3Ps0cAuBGbz+1H+L3Ngdd2++SGuUEK+E6hE7IQnszes4aWf bYuQ== X-Gm-Message-State: AOJu0YxPc3ECTbAIWCkfksoHtzmdgS+DwQ2sxXcyKBCn0jtZCnv/X+vR 6Qr0+SIacYMxDxKXK9D9PUhEWA== X-Google-Smtp-Source: AGHT+IEWg2VEI4Vi7IulTZgNKdrHE2WZNrX8LJFTMhv1AYpEjEk8Q1zYIfhClVUZKE72XnRCdYjEhg== X-Received: by 2002:a17:907:2c75:b0:9a1:d29c:6aa9 with SMTP id ib21-20020a1709072c7500b009a1d29c6aa9mr5782355ejc.11.1693831449576; Mon, 04 Sep 2023 05:44:09 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.227]) by smtp.gmail.com with ESMTPSA id lt14-20020a170906fa8e00b00977eec7b7e8sm6153822ejb.68.2023.09.04.05.44.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Sep 2023 05:44:09 -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 , Peter Xu , Jason Wang , Eduardo Habkost , Marcel Apfelbaum Subject: [PATCH 07/13] target/i386: Allow elision of kvm_enable_x2apic() Date: Mon, 4 Sep 2023 14:43:18 +0200 Message-ID: <20230904124325.79040-8-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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Call kvm_enabled() before kvm_enable_x2apic() to let the compiler elide its call. Suggested-by: Daniel Henrique Barboza Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/intel_iommu.c | 2 +- hw/i386/x86.c | 2 +- target/i386/kvm/kvm-stub.c | 7 ------- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 3ca71df369..c9961ef752 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -4053,7 +4053,7 @@ static bool vtd_decide_config(IntelIOMMUState *s, Error **errp) error_setg(errp, "eim=on requires accel=kvm,kernel-irqchip=split"); return false; } - if (!kvm_enable_x2apic()) { + if (kvm_enabled() && !kvm_enable_x2apic()) { error_setg(errp, "eim=on requires support on the KVM side" "(X2APIC_API, first shipped in v4.7)"); return false; diff --git a/hw/i386/x86.c b/hw/i386/x86.c index a88a126123..d2920af792 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -136,7 +136,7 @@ void x86_cpus_init(X86MachineState *x86ms, int default_cpu_version) * With KVM's in-kernel lapic: only if X2APIC API is enabled. */ if (x86ms->apic_id_limit > 255 && !xen_enabled() && - (!kvm_irqchip_in_kernel() || !kvm_enable_x2apic())) { + kvm_enabled() && (!kvm_irqchip_in_kernel() || !kvm_enable_x2apic())) { error_report("current -smp configuration requires kernel " "irqchip and X2APIC API support."); exit(EXIT_FAILURE); diff --git a/target/i386/kvm/kvm-stub.c b/target/i386/kvm/kvm-stub.c index f985d9a1d3..62cccebee4 100644 --- a/target/i386/kvm/kvm-stub.c +++ b/target/i386/kvm/kvm-stub.c @@ -12,13 +12,6 @@ #include "qemu/osdep.h" #include "kvm_i386.h" -#ifndef __OPTIMIZE__ -bool kvm_enable_x2apic(void) -{ - return false; -} -#endif - bool kvm_hv_vpindex_settable(void) { return false; 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: 13373849 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 5B00FC71153 for ; Mon, 4 Sep 2023 12:44:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352874AbjIDMo1 (ORCPT ); Mon, 4 Sep 2023 08:44:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352862AbjIDMo0 (ORCPT ); Mon, 4 Sep 2023 08:44:26 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58EA1E6A for ; Mon, 4 Sep 2023 05:44:17 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-52c9f1bd05dso2063521a12.3 for ; Mon, 04 Sep 2023 05:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831456; x=1694436256; 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=yBy9B8/ychOxzyt4MqhLID6RA2iJpJf7s2rkxq992Dw=; b=t44XWowjpeyfurw0yOcHmsyLm/jX+WmVgbvxPAQLxdVXmD6VDmKTTJO1ft4wBn1M4E dqSmegvy1lRo/xXG+zBaoqs3WN0dyA0ys8q+ne15p90smxe4oZ+0cngFj5GnuUR1EuUd PFs4m3O5SjPiGLAoFRHvRrHMUzDD6PhDthYahUvUMhNGqE48Begg1KEj+fNJjU2nogB0 nDLhi2G3Gc0EBXESPbCrdW88l83UUvEYhc24k2ojhQXVq/fA+T3U0WBeqGFa6KmMmTce 18+fkzBcxkXY28drahp8Gv3BEb2Sz156s/H/TVGOqLUhKR3cxxL8W1DglyAppn3DpPGc n2sQ== 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=ObPC1wFAKDK36a+Y77UIj43P89HqYAOvWGsN9G6aE3dEC7hc1wvv11G0gum3GHV4IG JiAGMeW6lUJ/Zf3eovOPLC7SBPjq5NTBbwe4HNH0nUA/WeTCtt29hmoXFzbGkjOM0lXR /ol0V09wbbUECQGuKh7c2RG5Lp6WhVS6tqItFP1zCnzcmNtS6/WPqSVw2nM14TjBD7ac B6sykdttUXxevEsHZ1eIj5jIJeCNeMkIM92+1iDPSbTcBXV9mmWoSDyHmU+LaCr2Mpzp ZExo3ylmBPp/qdfuGCPz9xC3Aw2XW+p8gILjq00aAwTmtZvhh9razderziB2SHuujVw3 wZYg== X-Gm-Message-State: AOJu0YwYr+1l1x5biVZurwjba7DW6wwahatrG7ds5S4kDloLb5EucVOl Ff9r5F050izuLKTd3Vayuj6jgA== X-Google-Smtp-Source: AGHT+IG4z1vB/QZFvcTz4ZepoUXgBUZve8udAT7n1n0cJ/4FcFU6pkPiPnNOm13Rql1ddwKB2By5rQ== 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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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( From patchwork Mon Sep 4 12:43:20 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: 13373850 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 5E567C83F2C for ; Mon, 4 Sep 2023 12:44:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233976AbjIDMoc (ORCPT ); Mon, 4 Sep 2023 08:44:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352862AbjIDMoa (ORCPT ); Mon, 4 Sep 2023 08:44:30 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DAF0CDA for ; Mon, 4 Sep 2023 05:44:23 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2bd3f629c76so23138821fa.0 for ; Mon, 04 Sep 2023 05:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831461; x=1694436261; 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=EfDnH2zi19spDXT1YZEdk2e2zvrpSHkYzKDFanumPPE=; b=Z+49L87zQD41dah6ZjYJ5UUuYpU/3zWRYKDQySzNAu3hks/TZPHT6Lkj10HgcTZHjM DIm+wxwU4zAHljhBxkkecu9+JbIkzUOqVvh/5KgUDv4QKZZ7BsJ1A23vIZNheqY+/OTF nOOBJjVyumKHx12OWRlzh5lTRwiEAxpnYfqyMKn69jmC6fCrWVMuagwgNzGpP26nldJ1 lsjukjEwiXCwE7jzKK8dziZj+TI79oa2yduI+tHhAwbqaczWhShPca8Bb/DCgxitpWo8 HLx+DyLkBqPwuOLk5S6ZSyejBprkCL0aD8GnpIfekvLUpL+STtRCncSXiy9cDHknLeir leOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693831461; x=1694436261; 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=EfDnH2zi19spDXT1YZEdk2e2zvrpSHkYzKDFanumPPE=; b=KrjqOGtS+LsW3B3DPcFOGGlg3Ujpdug99Lsd8XSjwnQKU2u1xgDXnihPrqy2V0IfPv Gwt9jRCDIPeYpemYTH+ZU/1zJRn4golo7GfWDgZb1CjvYzG18S8O0DGJWZcNgHs/EP/Y FlnXs9BxUi4FLB2Lt3QUmcV92yL9Uo5ZwZRHpfvEnascNrRispfV3hjkVMnFKCc6ILM4 QFvrpV0+4A5d7kntx47g7r+uONRnAwhapJxZWDjlkmYqwyre1Z8oApf8OGy39hYs5wP+ bJIoc7RavTRmXbflImGRRVqYyudlYMYO/rVepFqeYSipYCy/llUUYZtZOl3ToR7AzU42 pPiA== X-Gm-Message-State: AOJu0YyFW0tdshOBBCl+dNdW/iEktSQPX6mtT8QT6TuYMFxy7VrRjQ+j C1acg0QPEF3ecI/ozV6tvHwFJw== X-Google-Smtp-Source: AGHT+IE976/wb9043fTOX1jLNvYiAsS+SMGWMVP8cKCaRkt7WlpkXdAiG5q4d7+oUS7QvOusWuayLw== X-Received: by 2002:a2e:a176:0:b0:2bc:c466:60e9 with SMTP id u22-20020a2ea176000000b002bcc46660e9mr6704259ljl.49.1693831461543; Mon, 04 Sep 2023 05:44:21 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.227]) by smtp.gmail.com with ESMTPSA id gu18-20020a170906f29200b0098f99048053sm6215400ejb.148.2023.09.04.05.44.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Sep 2023 05:44:21 -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?= Subject: [PATCH 09/13] target/i386: Restrict declarations specific to CONFIG_KVM Date: Mon, 4 Sep 2023 14:43:20 +0200 Message-ID: <20230904124325.79040-10-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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Keep the function accessed by target/i386/ and hw/i386/ exposed, restrict the ones accessed by target/i386/kvm/. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/kvm/kvm_i386.h | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h index 470627b750..ff309bad25 100644 --- a/target/i386/kvm/kvm_i386.h +++ b/target/i386/kvm/kvm_i386.h @@ -31,30 +31,35 @@ #endif /* CONFIG_KVM */ bool kvm_has_smm(void); -bool kvm_has_adjust_clock(void); -bool kvm_has_adjust_clock_stable(void); -bool kvm_has_exception_payload(void); -void kvm_synchronize_all_tsc(void); +bool kvm_enable_x2apic(void); +bool kvm_hv_vpindex_settable(void); + +bool kvm_enable_sgx_provisioning(KVMState *s); +bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp); + void kvm_arch_reset_vcpu(X86CPU *cs); void kvm_arch_after_reset_vcpu(X86CPU *cpu); void kvm_arch_do_init_vcpu(X86CPU *cs); +void kvm_set_max_apic_id(uint32_t max_apic_id); +void kvm_request_xsave_components(X86CPU *cpu, uint64_t mask); + +#ifdef CONFIG_KVM + +bool kvm_has_adjust_clock(void); +bool kvm_has_adjust_clock_stable(void); +bool kvm_has_exception_payload(void); +void kvm_synchronize_all_tsc(void); + void kvm_put_apicbase(X86CPU *cpu, uint64_t value); -bool kvm_enable_x2apic(void); bool kvm_has_x2apic_api(void); bool kvm_has_waitpkg(void); -bool kvm_hv_vpindex_settable(void); -bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp); - uint64_t kvm_swizzle_msi_ext_dest_id(uint64_t address); void kvm_update_msi_routes_all(void *private, bool global, uint32_t index, uint32_t mask); -bool kvm_enable_sgx_provisioning(KVMState *s); -void kvm_request_xsave_components(X86CPU *cpu, uint64_t mask); - typedef bool QEMURDMSRHandler(X86CPU *cpu, uint32_t msr, uint64_t *val); typedef bool QEMUWRMSRHandler(X86CPU *cpu, uint32_t msr, uint64_t val); typedef struct kvm_msr_handlers { @@ -66,6 +71,6 @@ typedef struct kvm_msr_handlers { bool kvm_filter_msr(KVMState *s, uint32_t msr, QEMURDMSRHandler *rdmsr, QEMUWRMSRHandler *wrmsr); -void kvm_set_max_apic_id(uint32_t max_apic_id); +#endif /* CONFIG_KVM */ #endif From patchwork Mon Sep 4 12:43:21 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: 13373852 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 26FA8CA0FF3 for ; Mon, 4 Sep 2023 12:44:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352961AbjIDMok (ORCPT ); Mon, 4 Sep 2023 08:44:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352918AbjIDMog (ORCPT ); Mon, 4 Sep 2023 08:44:36 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8070E54 for ; Mon, 4 Sep 2023 05:44:28 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2bcc4347d2dso20034221fa.0 for ; Mon, 04 Sep 2023 05:44:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831467; x=1694436267; 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=9c1++OFXiKHirX3uQNfDd/RXZK+lEL70eHdHIGvdol4=; b=DFUZ1+IwqePNniguFUpFfmPzV9Ew4KRunYOSRST7uGhjBYq4MrmYU+PNEIf9MX65cy 0N/0QfWJ33HcXav7Fwk0X1xcm3MFjEKxGAAKfBEoub1xcdYsfLXhSljoisl+icDQtOOo 3M3NJ0fCLcjgFgbRzyEaXC/Tp6rdolCR/T+9FosWkMNuhlKb6q97CCRxOXgnEsHtbmQi OClVmXBibYdP2uNw3+vKY31XTkCquLVl1yz/0aE2R5ibyXbOqn3+cg2WcH18hBQdG0wb uLJLUESMuJWtGohaeaDVXvsHuO1pPD9sMkZbu6tAOpOOYpiSjc6YBfctlyILccLMW8ra V53g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693831467; x=1694436267; 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=9c1++OFXiKHirX3uQNfDd/RXZK+lEL70eHdHIGvdol4=; b=X+mgfuOEYJC52K6DIq5/VVtXqmPAsGwvBnLKbi8IjdZxA0J5nWzDJf8e4eiCLDLHz8 Rv5iVpHrc+cOsusUXEgVy2sERb7Gi+2VESodaxDc0HIQZ4reB21xF/shmbzbrw6SorWf MV/5s1Ik/C15bN1srsBPmc+mLX8WCc/rgfFdvfx8Z9NAiXwTQlfEJa5/nQyYLPQF91Qv x3Ah8CV5VrZRkCnKnRZVYSR43r2YlFxQjx6SXszOGGAcSjBgzJminiscSoRUdeOMdsH+ myt2y9GXK9DbjzQYnpO03yXPbDFlMDJH4gDfkkPaSYeK9iGDvsU3Jp11aDjaESTnchJp pfhQ== X-Gm-Message-State: AOJu0YygcTCdXQT/75/qo1og4bRQCgJlB+3e3tyKlK4cHUQJ19K246Ym +kLSc5u8PD+hg49nvNTJIxMRoA== X-Google-Smtp-Source: AGHT+IEWA9agBIka4/UEdzmAwtfRA+imBetPWuYVWeGSiJIg5JmAaXx74MtNWsYTkyhrhZ9vNtQo1Q== X-Received: by 2002:a2e:908a:0:b0:2bc:fce1:54d3 with SMTP id l10-20020a2e908a000000b002bcfce154d3mr7414408ljg.41.1693831467132; Mon, 04 Sep 2023 05:44:27 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.227]) by smtp.gmail.com with ESMTPSA id f15-20020a1709067f8f00b009934855d8f1sm6127181ejr.34.2023.09.04.05.44.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Sep 2023 05:44:26 -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?= Subject: [PATCH 10/13] sysemu/kvm: Restrict kvm_arch_get_supported_cpuid/msr() to x86 targets Date: Mon, 4 Sep 2023 14:43:21 +0200 Message-ID: <20230904124325.79040-11-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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org kvm_arch_get_supported_cpuid() / kvm_arch_get_supported_msr_feature() are only defined for x86 targets (in target/i386/kvm/kvm.c). Their declarations are pointless on other targets. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/kvm.h | 5 ----- target/i386/kvm/kvm_i386.h | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index ebdca41052..a578961a5e 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -464,11 +464,6 @@ int kvm_vm_check_extension(KVMState *s, unsigned int extension); kvm_vcpu_ioctl(cpu, KVM_ENABLE_CAP, &cap); \ }) -uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function, - uint32_t index, int reg); -uint64_t kvm_arch_get_supported_msr_feature(KVMState *s, uint32_t index); - - void kvm_set_sigmask_len(KVMState *s, unsigned int sigmask_len); int kvm_physical_memory_addr_from_host(KVMState *s, void *ram_addr, diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h index ff309bad25..b78e2feb49 100644 --- a/target/i386/kvm/kvm_i386.h +++ b/target/i386/kvm/kvm_i386.h @@ -40,6 +40,9 @@ bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp); void kvm_arch_reset_vcpu(X86CPU *cs); void kvm_arch_after_reset_vcpu(X86CPU *cpu); void kvm_arch_do_init_vcpu(X86CPU *cs); +uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function, + uint32_t index, int reg); +uint64_t kvm_arch_get_supported_msr_feature(KVMState *s, uint32_t index); void kvm_set_max_apic_id(uint32_t max_apic_id); void kvm_request_xsave_components(X86CPU *cpu, uint64_t mask); From patchwork Mon Sep 4 12:43:22 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: 13373853 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 3C838C83F2C for ; Mon, 4 Sep 2023 12:44:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352919AbjIDMom (ORCPT ); Mon, 4 Sep 2023 08:44:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352927AbjIDMok (ORCPT ); Mon, 4 Sep 2023 08:44:40 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1903DCDB for ; Mon, 4 Sep 2023 05:44:34 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-99bed101b70so220981766b.3 for ; Mon, 04 Sep 2023 05:44:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831472; x=1694436272; 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=wQp1ZwukkzwgrEJecGe85e61/jQRSJ79TXphHOkDcps=; b=ETXABFbqLFylxzdk8+kA/bWtEGV9pHYb6jtzy4Lg9cCZgjkRWIcRxt343U9UcaO/HR PlAig5rvIerqDXmcphNsp2YOXDE5qltlaCdARfVv4ZQYDgpJ6lKo8dcDo3puB7k04Onk tMlWB9BupNgQO7oe+lO2SUXmvvwMeuoT88+4HQRv93e8qJg1GY10w555saFhJtRcl9hR 55DLX7d7V7YcynfSyGAiQSgZ9y4lYOrQrOSpe8XMamGd5RIXOJfy/NS0K+OZ7rwO4OWR jBDZiJBA1LAj1YR/eDDP61IBgGCriNIWF3IurVY8VKANwvBQcljG4P2VVSHKNcgSy42w t5Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693831472; x=1694436272; 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=wQp1ZwukkzwgrEJecGe85e61/jQRSJ79TXphHOkDcps=; b=jFrENGK5a31tYy6ArL8qJeJoKavPvFNGgODvt+Zu7AvkUXf82lKzfIHa11suYscjyb HP13jrPYIG/hg6ZfuneTiwDMyH5LNDt1kE4ySpiprviGy9BNaIG/Zu8NPx9KaZK2lXKt wCoIS9wbtlLRFejZ0d+lmk5yjKTZclrIeQ7FabskGwP+mMVj1IvgMvbHjtq8kkUiIihe kKGPf9rQghyTpWdHStj4rwW44pG/eJgtog8PH8PklZO/HwGIwy37zZ81R8EoKuvnzaS4 sK9/0CTEJYTQzVlx16+q25nMzZ8HIg8fzzEUOOPGRnVICdxTTeYznjYMwmzScjPEgyeL sH5Q== X-Gm-Message-State: AOJu0Yx+Bn8hzYHQtxXPWjBVpOHH8IeEKFbprUjD427LNgIByLGPh2G1 37/Gjfdi41VeHcI0ECywPJiKaw== X-Google-Smtp-Source: AGHT+IHuyIx4y8Ds8coh9sd7t5uoyGE2ek+jqkPzJtAFpTx/gIGSHZIy1qj15vmm5PPTTvaYTKuKSw== X-Received: by 2002:a17:907:2c64:b0:9a1:b43b:73a0 with SMTP id ib4-20020a1709072c6400b009a1b43b73a0mr8116583ejc.20.1693831472606; Mon, 04 Sep 2023 05:44:32 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.227]) by smtp.gmail.com with ESMTPSA id x24-20020a170906299800b0099cadcf13cesm6132052eje.66.2023.09.04.05.44.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Sep 2023 05:44:32 -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?= Subject: [PATCH 11/13] sysemu/kvm: Restrict kvm_get_apic_state() to x86 targets Date: Mon, 4 Sep 2023 14:43:22 +0200 Message-ID: <20230904124325.79040-12-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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org kvm_get_apic_state() is only defined for x86 targets (in hw/i386/kvm/apic.c). Its declaration is pointless on all other targets. Since we include "linux-headers/asm-x86/kvm.h", no need to forward-declare 'struct kvm_lapic_state'. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/kvm.h | 3 --- target/i386/kvm/kvm_i386.h | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index a578961a5e..4326b53f90 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -188,7 +188,6 @@ extern bool kvm_msi_use_devid; #endif /* CONFIG_KVM_IS_POSSIBLE */ struct kvm_run; -struct kvm_lapic_state; struct kvm_irq_routing_entry; typedef struct KVMCapabilityInfo { @@ -407,8 +406,6 @@ void kvm_irqchip_add_change_notifier(Notifier *n); void kvm_irqchip_remove_change_notifier(Notifier *n); void kvm_irqchip_change_notify(void); -void kvm_get_apic_state(DeviceState *d, struct kvm_lapic_state *kapic); - struct kvm_guest_debug; struct kvm_debug_exit_arch; diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h index b78e2feb49..d4a1239c68 100644 --- a/target/i386/kvm/kvm_i386.h +++ b/target/i386/kvm/kvm_i386.h @@ -54,6 +54,7 @@ bool kvm_has_adjust_clock_stable(void); bool kvm_has_exception_payload(void); void kvm_synchronize_all_tsc(void); +void kvm_get_apic_state(DeviceState *d, struct kvm_lapic_state *kapic); void kvm_put_apicbase(X86CPU *cpu, uint64_t value); bool kvm_has_x2apic_api(void); From patchwork Mon Sep 4 12:43: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: 13373854 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 55042C83F2C for ; Mon, 4 Sep 2023 12:44:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347313AbjIDMos (ORCPT ); Mon, 4 Sep 2023 08:44:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352920AbjIDMor (ORCPT ); Mon, 4 Sep 2023 08:44:47 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33646E42 for ; Mon, 4 Sep 2023 05:44:40 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-99bf3f59905so218083666b.3 for ; Mon, 04 Sep 2023 05:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831478; x=1694436278; 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=c18azMn+jtI1YAn3dB0AGJOCqMNVzX0REantB+5g0DU=; b=ySQ5g0lskI++33f4BGopafUSz5qwKzLDdgj3ibi91XFJaoBSFXLrvmqsNdslVKHdMi IhtMksW/W+MpJfOIu7WVC1CZzZW2K3W4CExqq63KNpk/9V61HkqHHTRYDHwDnOwwlDFs S7WPBpbDzqvTDohHdPD1yt/ggGrYg/BVWykegUjLbz29V/+j7oWl4F6APcfo7OjULHAF aRZ7HdshJp1gnRdj6dq7TNCQu+XPuK/lWLYCJ8+WtAv21I7cBz0PB/JhAUJiEV9zBFDH Xuyox9UBJ73rxjNvdMk3jk2vNPN8XpgjrEjCg1mztWZo3E1tzClk10SRD620CThfvShk +/Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693831478; x=1694436278; 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=c18azMn+jtI1YAn3dB0AGJOCqMNVzX0REantB+5g0DU=; b=a6gm/w4+L+AXQ1P20xfWgGesYuRMA5eYm5/cuJq3MCsAWKNcPnVdU2L3gXj5A8duuG 7MzFGF53LGQc+07BdGnxSNkW3v87+YxJS6O4/tWr8s1HkJ4A+AAl8T98xWy3HSDdA/hN JGKYnfSURrttUumcOPrsJb+VgDUycrHYuWD0pJQszolBi98bZw5BYbQyBnP83uOEjzGB ikCm3lBIstz1wAqMjipWeQy0JwcBJSt9fHXHXpiHU7gY2QYxL7NxN52rINhJyyQA0qZR b9yXiI6BsC5KQgoLVKxWCZTIiJxDcfPK6+/0+w8moIPMTKhZVRv9Az1704PQtlyvb11u sHwg== X-Gm-Message-State: AOJu0Yy2mrTYsB0mr1WcN6qTC+/Rmon+/+wS/wZu5aznjo2KXx5hVidx drJn+skE1Hhq9oLrLdaSAl7vEQ== X-Google-Smtp-Source: AGHT+IGkBWzlSRGBOELBpUf+dLc0WEpvu9JCETivRhredxbliVAZerUGcF4mTiM1Pqigg7YcHDOtcQ== X-Received: by 2002:a17:906:5a6e:b0:9a2:24f9:fabe with SMTP id my46-20020a1709065a6e00b009a224f9fabemr6871711ejc.66.1693831478762; Mon, 04 Sep 2023 05:44:38 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.227]) by smtp.gmail.com with ESMTPSA id hb26-20020a170906b89a00b0098cf565d98asm6058630ejb.22.2023.09.04.05.44.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Sep 2023 05:44:38 -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?= , Marcel Apfelbaum , Eduardo Habkost Subject: [PATCH 12/13] sysemu/kvm: Restrict kvm_has_pit_state2() to x86 targets Date: Mon, 4 Sep 2023 14:43:23 +0200 Message-ID: <20230904124325.79040-13-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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org kvm_has_pit_state2() is only defined for x86 targets (in target/i386/kvm/kvm.c). Its declaration is pointless on all other targets. Have it return a boolean. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/kvm.h | 1 - target/i386/kvm/kvm_i386.h | 1 + hw/i386/kvm/i8254.c | 1 + target/i386/kvm/kvm.c | 4 ++-- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 4326b53f90..147967422f 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -221,7 +221,6 @@ int kvm_has_vcpu_events(void); int kvm_has_robust_singlestep(void); int kvm_has_debugregs(void); int kvm_max_nested_state_length(void); -int kvm_has_pit_state2(void); int kvm_has_many_ioeventfds(void); int kvm_has_gsi_routing(void); int kvm_has_intx_set_mask(void); diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h index d4a1239c68..76e8f952e5 100644 --- a/target/i386/kvm/kvm_i386.h +++ b/target/i386/kvm/kvm_i386.h @@ -33,6 +33,7 @@ bool kvm_has_smm(void); bool kvm_enable_x2apic(void); bool kvm_hv_vpindex_settable(void); +bool kvm_has_pit_state2(void); bool kvm_enable_sgx_provisioning(KVMState *s); bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp); diff --git a/hw/i386/kvm/i8254.c b/hw/i386/kvm/i8254.c index 6a7383d877..a649b2b7ca 100644 --- a/hw/i386/kvm/i8254.c +++ b/hw/i386/kvm/i8254.c @@ -34,6 +34,7 @@ #include "hw/timer/i8254_internal.h" #include "hw/qdev-properties-system.h" #include "sysemu/kvm.h" +#include "target/i386/kvm/kvm_i386.h" #include "qom/object.h" #define KVM_PIT_REINJECT_BIT 0 diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 639a242ad8..e5cd7cc806 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -154,9 +154,9 @@ static KVMMSRHandlers msr_handlers[KVM_MSR_FILTER_MAX_RANGES]; static RateLimit bus_lock_ratelimit_ctrl; static int kvm_get_one_msr(X86CPU *cpu, int index, uint64_t *value); -int kvm_has_pit_state2(void) +bool kvm_has_pit_state2(void) { - return has_pit_state2; + return !!has_pit_state2; } bool kvm_has_smm(void) From patchwork Mon Sep 4 12:43: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: 13373855 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 23E17C71153 for ; Mon, 4 Sep 2023 12:44:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235835AbjIDMo6 (ORCPT ); Mon, 4 Sep 2023 08:44:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233610AbjIDMo6 (ORCPT ); Mon, 4 Sep 2023 08:44:58 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DDACCD7 for ; Mon, 4 Sep 2023 05:44:46 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-52a3ff5f0abso1861558a12.1 for ; Mon, 04 Sep 2023 05:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831485; x=1694436285; 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=QgUPYLmjXf0NM9VXdRKjm+MRqu9ErWeVIsJU5m+yYDU=; b=BAr++xpX006+SazRw+fzDmZRM9mSjW/zL4TZ+dkLqVcadP55q/stMuB8iZpN+2Lxix JZw1yczewe3D+NsShIAw4/GlUqYST/+fsY43mDfz6c2pOpk9EJiQPszBKlqRX9dGOvz6 plVOs/l6t+4XFCf4/Qfgy3aEHjxzvYpm+JW9pNUeBP3LvbtYmFKkjXfM7o3nr0yFqLJl XlwygUeqwyjzjAa50qiau5wW4K8fQcwIJqpk3ZGJtm+Zm27oepPa9Abh2U4JUe0zZrth UnXVVPp56XpJfOa60OJhKet41K+S8iHLo8aU0cgT2cPg+j4ZlxmPhbloIJL+niaJS9jL g+tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693831485; x=1694436285; 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=QgUPYLmjXf0NM9VXdRKjm+MRqu9ErWeVIsJU5m+yYDU=; b=CoHzyjowqZo5D7nuoHcH1FgobuROJayCaP4FqDgZF3bJtY6/1aNvM8MLKzqqkUAb3/ xfK7I1DpMQw0Kx0A9drFGhvdjqso9SsH6sqtIWVbsxVi2rZpv+gyDV3+hc9uXdnuDs2/ wKFr2TvcG+BmHWGmlisiY+COAstdpF12LTJ4VGXgP19BA/9nLgtmo2he9WPwKhUJeaeU I1U6DC8ztkwtEZq80Fdu6Z565tiFAWQvHYJ+/9VCX2a2yvShZXph1DS/y9wVy305lPuN MC9B4BBwqGM7shiIdCywyXqWmwllidPzHllhvEK5VowLc2SDCZQH/Vb3MU3d674rmtI9 WQrA== X-Gm-Message-State: AOJu0Yy6F0v8VXet+BC5NfL+Rhklns5OwrkWYRgRA3vsW/KFWSRocO/7 MnhGSGUC2aDcbioK420+GhCi6Q== X-Google-Smtp-Source: AGHT+IGpqxvPFHv+7iL7JBf8coc8ir/WyqX6mJSQUkJ8wn20F+l+BdUJBcSdl1rEC9tKrnU3giCDUw== X-Received: by 2002:aa7:c393:0:b0:525:570c:566b with SMTP id k19-20020aa7c393000000b00525570c566bmr6829285edq.22.1693831484850; Mon, 04 Sep 2023 05:44:44 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.227]) by smtp.gmail.com with ESMTPSA id d4-20020a50ea84000000b00521d2f7459fsm5753793edo.49.2023.09.04.05.44.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Sep 2023 05:44:44 -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?= , Marcel Apfelbaum , Eduardo Habkost Subject: [PATCH 13/13] sysemu/kvm: Restrict kvm_pc_setup_irq_routing() to x86 targets Date: Mon, 4 Sep 2023 14:43:24 +0200 Message-ID: <20230904124325.79040-14-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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org kvm_pc_setup_irq_routing() is only defined for x86 targets (in hw/i386/kvm/apic.c). Its declaration is pointless on all other targets. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/kvm.h | 1 - target/i386/kvm/kvm_i386.h | 2 ++ hw/i386/kvm/ioapic.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 147967422f..ee9025f8e9 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -514,7 +514,6 @@ int kvm_irqchip_add_irqfd_notifier(KVMState *s, EventNotifier *n, int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n, qemu_irq irq); void kvm_irqchip_set_qemuirq_gsi(KVMState *s, qemu_irq irq, int gsi); -void kvm_pc_setup_irq_routing(bool pci_enabled); void kvm_init_irq_routing(KVMState *s); bool kvm_kernel_irqchip_allowed(void); diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h index 76e8f952e5..55d4e68c34 100644 --- a/target/i386/kvm/kvm_i386.h +++ b/target/i386/kvm/kvm_i386.h @@ -78,4 +78,6 @@ bool kvm_filter_msr(KVMState *s, uint32_t msr, QEMURDMSRHandler *rdmsr, #endif /* CONFIG_KVM */ +void kvm_pc_setup_irq_routing(bool pci_enabled); + #endif diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c index cd5ea5d60b..409d0c8c76 100644 --- a/hw/i386/kvm/ioapic.c +++ b/hw/i386/kvm/ioapic.c @@ -16,6 +16,7 @@ #include "hw/intc/ioapic_internal.h" #include "hw/intc/kvm_irqcount.h" #include "sysemu/kvm.h" +#include "kvm/kvm_i386.h" /* PC Utility function */ void kvm_pc_setup_irq_routing(bool pci_enabled)