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: 719966 Delivered-To: patch@linaro.org Received: by 2002:adf:d08b:0:b0:31d:da82:a3b4 with SMTP id y11csp1578023wrh; Mon, 4 Sep 2023 05:44:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXm9ugdzXGDdO6oTW8PVOsQMxXzrZPOay/wtmq15wT+LhRK62xr+DkxDTxc/OIBns9QQZY X-Received: by 2002:a05:620a:44d1:b0:76c:d207:8471 with SMTP id y17-20020a05620a44d100b0076cd2078471mr12567922qkp.24.1693831453282; Mon, 04 Sep 2023 05:44:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693831453; cv=none; d=google.com; s=arc-20160816; b=0jcNupf0nGWTxe6Uu6+ne6yBbdcnUDquH/144etfZi6F/lCG9R3EvP/V3vWSI1bwIx Nq71uHbAyvffjiNIC7FgSyhQ8z1RaEv4yyeC88Yq2RxwVENIklGGe4GaEtzi9ln1n/pH ubW3nz7mgIlj23eekgRtghiBoEbCr+BqSaTC4YtKLD6GzysxUne/MB4wN2IiTgNdc8Fu rL2bz8faJucMW5D6qtLssHHkt5EsxM2tbVu8rOZioQF2t7dQZeVp923KplG/gOHUYvjV QJJhcdIYsi/zVNKlcG61qwvUBshFLdN0zGuVGU9pLy3il/LHhv82nWKmOERMCT2Gc3iF 8PGQ== 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=aJCm9ielSGbSry5cbeI+YJvG0psfGNIv8B+tATNPjpc=; fh=QjoLg5b8k+IWyR93Cyvr6VbRWLHQiDY7q1G3ZGcZnSU=; b=N8JKIDH06mn/G72v1B3xYHy5iZfMjBp73KpwRB8/qimxyGypURv2rR2AYSYudjMYev LUdfZsmcQU744wBTJbw6wbszbqp3gN+Q+0aOS/9yBfQCZBbzBPoVgVfgKGg1MzaMPubZ 4xyNEb+s8RAa+OsDNDVV6Pz0ljl5Aklvpj/cjLcqJKFXImwLBFmi/7WJvY7bBSACbLt4 dXH69Cc3HRTmAA17xw+Ggr06ijNzFNeFByQe2keio4n/gorEKTmnyrRGAUw4ExTpqjOp cWibbHCZXnaMB2cpCBtQfy4XV8PgWhf8ijOgMRxPYtOxreA9ILPMliHDrgmJagKkz3vE 0UGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BcpVQzQe; 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 l20-20020a05620a211400b0076ef3f7cecfsi6353434qkl.177.2023.09.04.05.44.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Sep 2023 05:44:13 -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=BcpVQzQe; 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 1qd8vb-0001FK-9T; Mon, 04 Sep 2023 08:43:39 -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 1qd8va-0001DE-0Q for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:43:38 -0400 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qd8vX-0004cX-MC for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:43:37 -0400 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2bd0a5a5abbso21117381fa.0 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=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=aJCm9ielSGbSry5cbeI+YJvG0psfGNIv8B+tATNPjpc=; b=BcpVQzQeY+8d9RsVWQiy1VBVzzeyR6OkhEIrMeEOU50iOKjXNpTeu0Shm22GtCumGl ZuvosTK7Ee7SGSGto43LCoN56sGb2UPaD4adMMqEr9DF9FZ7U+E3SHDpsgWYHQHQ/tnt LecuXfyOLMSVwcpyZzStKgW08UlGrlR0csHcxwCrDLpN/diVfZTesC3WGjPvm4HxAety LZm80i39s9ltEn1EHbkXoeO2ZwIIAT1pwfYkFe0Ik38Mzkl9b5BmdAE1PxSSBLPiA/FW V3gJ1lyuuBeeq9X9Hl0fM/czRoZKH5urRfIed+//OR7+BN+OzXiYtyYOefdyXA6dRJd6 bXDQ== 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=AmWMUVmWcCEApM0Ld56uU8tlj6fGobhXj9Ji3M9I52euraRgTS70kvQci1L6Wn2T7O jdth3NfaVYZulLr/FxLoLTAv2wF/wAZUz2qngGrTv6KMdYFWLNKT/6nv4CCMbEw1NUEC 2BtiU4ymvhA/QDSjECL5i/M6/75tavC03dyYQikMKHS73Zt2g6GI4km+Pu0aylLWQd1h tv32eHLGyNF37ykV6VRMSvabtMgnI30rsrfn3KGJk5elKlxR8eC1hi+T4vkKAb0zBrvU EntoXMY6hEk+YuSxIzZyNDQr+u0NUdCKn/A2Wj9qcUZRM4sHltm+KOnPSP8Gk9gRBMa4 nX0A== X-Gm-Message-State: AOJu0Yxd8j9GfWLfwobvHOxe1qKef1PLJrEVPolQnaIc1GlKcOoQ4lfi NPnzN40T/v5W6VyWmaMJQX8WjMVKoSwOz5IfNbQ= 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 Received-SPF: pass client-ip=2a00:1450:4864:20::235; envelope-from=philmd@linaro.org; helo=mail-lj1-x235.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 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: 719969 Delivered-To: patch@linaro.org Received: by 2002:adf:d08b:0:b0:31d:da82:a3b4 with SMTP id y11csp1578219wrh; Mon, 4 Sep 2023 05:44:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEC+WfskciEaBj/SnHO7nUxOLJle08hAvCoeR69Wq2oO3OP9jpJTn8qLqFOkdbztQrZ7JCN X-Received: by 2002:a05:6102:e53:b0:44d:48bf:591c with SMTP id p19-20020a0561020e5300b0044d48bf591cmr8484136vst.30.1693831477844; Mon, 04 Sep 2023 05:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693831477; cv=none; d=google.com; s=arc-20160816; b=FMxk5jMlaPi5yK4+8ym5VOublkl6Tt7XuAXewNGwTgV145s+AvvP7g0oJjT4qg+JVM OHhxj7oMshquSoiC5zpQd25srnmsuha9D9Aov2YFkRo8MzMRipt6i4aIN5MVGNDyFQjE gtX4qSuGAwCYMBv4ruCk09KK/zcOP8JqURQ/diUMibb5TqUtjfcYnRys2z3AoRjYqh7D kgNNYs2fvC8PHhMyMYHYZvx/92OcTImrZlt/iL0oJGriveb/bEtxk5kti3q6jvbB3D1r 2bMr2AZlvXAjMM7xAP8pQsx/F43W71ngCgB1zMGbEMQeKCKNEDNw1EZr5YDlUAh8PQRR 1zMw== 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=r6Qgqbn+d1/I+gSK8St7x7NRj+2INTDRnnggirvl8K4=; fh=QjoLg5b8k+IWyR93Cyvr6VbRWLHQiDY7q1G3ZGcZnSU=; b=Y8hOIa3lHTy9o2bB8+WO5ratJvuw8LY8BWQOgZY3P5vZ6jqImOaJ0ErsZNLREIVkoS tRX6s8k7GTll7FtA6MIDwTNN+NnTPAEVeeX8L05eVWwGNJNAWGBh5Op/axRADssCXZRb z+gdNaSQGD8wrXv+1IpyYtPDTHSiW/qY9Ca3jZPHlaMdnn3HEr45QruyLPXkOshWrjLo +uFARsFGtNdVfT7jWajWz2oMKQoO4n6E24VIk341DnsPzq7WqKOAvJztBuNMj5PG+T2h DCMG4evwP7ughzEqvxaqnh8HWA+k6WXv9LeE+9dwO+j8ZEWTBXSjcYYjb1jM1ij/cNYT H/Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rjLbOf8d; 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 c20-20020a0ce154000000b0063f726c14f3si6285739qvl.306.2023.09.04.05.44.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Sep 2023 05:44:37 -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=rjLbOf8d; 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 1qd8vi-0001VM-0T; Mon, 04 Sep 2023 08:43:46 -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 1qd8vf-0001OA-Oy for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:43:43 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qd8vd-0004d0-F4 for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:43:43 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-5009d4a4897so2355452e87.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=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=r6Qgqbn+d1/I+gSK8St7x7NRj+2INTDRnnggirvl8K4=; b=rjLbOf8dipYWQBszPzvkRe9wBVCtjJcGqNeF1e0ziUpFlwPgQzhdgaRXTVRXx/344E Wl9L4sCrHZJOElaMy7nvXQSECAkCpnDOB1qCZazq5NLZ4SWzR1ki2js3l5CL6RuF779K W3VXoaug2UxuQsPEtGjiWrgx907U8GEAFYw3HvU5YyBW4nmfVEYOFDrrZvgDpCqg6+vY mzSol6+/RhNfxsVCMDX0qkqqd2Fkxs9P0RjSDlP1/a09yUrwkx8TwlE/62Q1FDbeRlCn PbFQ1mEhwBybpSKVqSPcL4y5wWArn2MO4r+5vL0qX498fEMHTeKHei/KI8lJxj9cP6Hm w8lg== 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=YevuE4XXR5NUUc5x+jn5UclUkMSuEgmnc7C+nrDNGWxq+dv11fWh3iRyHB3Z5UiI92 +0WEDMqGf2QYYlW9gtVK/ORn9b7KsqLo0Kn9sEb0DJvy57U54aJjiZOVBWVaBDwLhEhT b1kxeiZllHKOR2IOrO5Yr57NLSZdaJsjBXaEXtYA1w1yHrPKixR5i8cUETaP0yUbteMC 46eTrsdSZrPIl0O4hzVzr2KS675BzrRU1LHZjLz1W5MK/sRR6AtePqfLPz3bMagz2XNG Y6yGUzG9vrMZgDttPx7PaKVOcRYqYmms4VeSJgmdFS6pJm85sQpW3xOeXV2V4opDRlql m+Hg== X-Gm-Message-State: AOJu0YwxBXRhuu2FYkS9k+5cI8NVKAC0F9ChjrpC+Z/HwSMvzBoejLO/ HQIIybcV7gTSRwYJkp3wJSx/g73hh/alOwKhNQY= 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 Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=philmd@linaro.org; helo=mail-lf1-x133.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 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: 719968 Delivered-To: patch@linaro.org Received: by 2002:adf:d08b:0:b0:31d:da82:a3b4 with SMTP id y11csp1578199wrh; Mon, 4 Sep 2023 05:44:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkpebwrn6w5G4eiG5HoaoEawY84UQYz1+VWfGBdEgCZri7qgxu/7WJ/onTb3BX8PIrBImd X-Received: by 2002:ac8:5a05:0:b0:412:514:2615 with SMTP id n5-20020ac85a05000000b0041205142615mr13217527qta.51.1693831475998; Mon, 04 Sep 2023 05:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693831475; cv=none; d=google.com; s=arc-20160816; b=ogk3urAQAq5TDvzIwHTRA3TYrln9ATHfq7aCjBLa1EnwuLXfhIQEcgxCezhi3UAf3/ 7TKVgtXNNX4WiOssClHfiKtXVMwGgLMI1W1AfBDePCun8tX6VcWFGoVs85wWir8UK4sb GBcdB7wzQmd6PZZNXuVZe/po5d0rPVqVFxbcYwXY4PviC7OglQkaiP0QwICN8J6t9ynl Q7y39bwBFTfqKCnBuoJlH/+cylK1vj/4vGLkhhB8GmDiJLB/+Rex/MqRbtoEJpAnQ9+5 NleqvH/0Vo1SHBMwryz4NyU4O7s543iNXK0ly233gFRGhLFJBQsZ0TrY85soSbQ61jz4 qnJg== 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=EAX70gb1DRp0U5HpIrsPRfVqNXXnjE75o2367gc+/Ss=; fh=QjoLg5b8k+IWyR93Cyvr6VbRWLHQiDY7q1G3ZGcZnSU=; b=A0r5gnCh5572elkmsPrcmmAG5k69OrUjjttZvQ2Arg0A+Z/FWiNrtWFLLNLe6ZUCMH jJoxSu25joiO/in9COyjJGWiGfIyGsFjIFzKdx8ZO8BLcfaia5lKmCLaKSiV4oldBbG7 FJWJcwhHaZXoQT+NfqxMyvppS9dPckpnUIZAz1+YcG/0zEQ+aFkwmSGECS+UKpknF+66 0sQ3Pm4cG9hV/1LhENF37gEVPTUve+7grn9y28QdWDHvkRn/I0DIfZ0AbTpke0R+4fsB VOuAHl7bfsqlti7sgcBRlJNUFJyeOK0H7UCQtA/QyWI9y2idyfNg96UU+86HB9TqWfUc YL+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="qes/yffy"; 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 q13-20020a05622a030d00b0040537f483b6si6366071qtw.655.2023.09.04.05.44.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Sep 2023 05:44:35 -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="qes/yffy"; 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 1qd8vo-0001dR-1j; Mon, 04 Sep 2023 08:43:52 -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 1qd8vm-0001W6-1r for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:43:50 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qd8vj-0004db-Rz for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:43:49 -0400 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-98377c5d53eso207589566b.0 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=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=EAX70gb1DRp0U5HpIrsPRfVqNXXnjE75o2367gc+/Ss=; b=qes/yffyt7CA99mz2FaV9THd3U2bxKjGOZFjOTZTHb//avor3vmPF1K75fo7hDlGYc /1SddMKmEUk1919Q2ZSghDBEbQUA3fsY2IxCIMHhwdEhzOoi7HO0bEi0U+XbSNcVmqje EDy+LdP/6QF7QoBOzbuY3+9CITYN4T/O9F4uZs8cApnGgjsn2MMV0mxL2pNVTrBxW7oc 28+aNuvbsWNiZU6pT/ssQ9pGR6q73YRxbeIhlGmTpJw67y0mG/KA0DoZshTQ8wYyhIDu xEFJw/ghqrxYgpp/Z6uT7hcqlBmvg+f+W5RYxRlTzNPanNFiVaZMZrRliq6C8PwZdjUa CWIA== 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=KD/txOuyURBmGv+t6QHN4+rTwEyJ7OnvCaFMQfxVOMR1/Bcu7jYhEGdSa0R12wNvil 5EOmhJYBMUN6fr9g5DW2lPqMDWPVRSvoqHx4hbKvo0n6nSOKuNO1MSwQV7iXCXeSws71 2hzpSRcSC1tA5jMFL3rWTsYcs99lPm54X5trTA0QFQWIBmlFqY32AyyBjFmcEgYe5lQy MdBwtfG0uBNMN012/O4/uCzZA6LUiC0PoGiZB8IYbVLurbvO3h5g+vZBB14rko64osI6 /Tg3Tl4ya52795Gi1+UgJGFNeD04CeEbdMG1lu0vpaOqD2so9oU/Fo3/z3jq32oRTDKf tSQQ== X-Gm-Message-State: AOJu0YypSiohchJkULY0xNuZAQeLzropmLmfWrHiEsSk22CO4ygrboYk /jtZOnp9eKEEp4yN5Exwo39ID3/GVcD4zmvh8dg= 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 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=philmd@linaro.org; helo=mail-ej1-x629.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 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: 719967 Delivered-To: patch@linaro.org Received: by 2002:adf:d08b:0:b0:31d:da82:a3b4 with SMTP id y11csp1578099wrh; Mon, 4 Sep 2023 05:44:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGgnmrSNxd9zHE4VUNFLOQ0D41zZvZVVn67Ljdh10BoL3W1E31Nl5SBWEA+cL6OULObSXlb X-Received: by 2002:a05:622a:4:b0:406:98be:bda2 with SMTP id x4-20020a05622a000400b0040698bebda2mr9562839qtw.59.1693831460960; Mon, 04 Sep 2023 05:44:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693831460; cv=none; d=google.com; s=arc-20160816; b=IltzONk7t80zYf+K3Xzdpi8j8xcoyVtaxOH4oNhism3pkQO0oU/5xqfXkug8byH0cB R/HBZgIj4vkfwb+0TCvC4myVuFvJY8tL6tltMvX03wQ9KiRC8kCffseNf4Rqg8s7tSRc E8O0LMtiYOHtnAt4CvNAkDFI9v1bvMgZ7/U99+h0GeJt5cemXTl/pUUTNvqlbj1PecSW aBP2CCVnjjvPxi/oKNErek0AHtcNnMpq6OdMR8J98lFO4Hw5rs7DAowZumfvuFoyX31b rUvfUQF8B1hPvMBO1VU0zCANtBvoYcZFqkMl9yxslsQCOmnM4uytJX5FBVn5f0lbRuRR wQRQ== 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=SdbPeRb3rqucMV4G8DmJatCRkQTtO6zKzLYWXw0g6yM=; fh=hcJ1er+KUFM3dFc6zTqY9RJhp4OGnpzxJ3DQBJGTxZ4=; b=MZMAHORlpknNmXIIaynyAQx41ODhNCrJvxobetYMnfEOakobBsX+eLDAoCyryeR3+h +0VqH5fQE0WsZFlsM2VPuLHUDr101CxuZN4y/6kJ2VhLwGoY0l4jcKDbxUtPKOxNiEeb t7W0wxGo/YTE5TDVTQ6yPiow0HRtR1LoUFhs/ikY35TiwT7N0t8dEFZVYtTKqs1sHTxB onh52kuEssQJXx18Sdg/HrDbeE8DdvFOfVCN0M5aEOSHisENnJNP5fRLe+jybos4UXQ3 MoAl2EYBoTGVmUQT+eacSeLiMOhhl36m4xH6iODYu6g/JI5WR/XdNrqk5e/oedfmGCkZ rzcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dWfNtNbk; 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 d20-20020a05622a05d400b0040eb18dbe18si6432738qtb.410.2023.09.04.05.44.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Sep 2023 05:44:20 -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=dWfNtNbk; 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 1qd8vt-0001lP-S1; Mon, 04 Sep 2023 08:43:57 -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 1qd8vs-0001i0-Bn for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:43:56 -0400 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qd8vp-0004eM-43 for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:43:56 -0400 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-9936b3d0286so220810266b.0 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=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=SdbPeRb3rqucMV4G8DmJatCRkQTtO6zKzLYWXw0g6yM=; b=dWfNtNbki2/Zlt/y2OdYsxFGajq1Ih3AqV2bzLc2IHjHjEXl5U7M0naJEkts/MtRoj KADVM2tNtm/tvQXx+riLrju6AOakWTAlJdm3v5LBrkXSTsajYxNJSFeZ7bluGVDzzq0U /GVoj96gjvaukMRuvcsrEY0gy0xhTdIhauYj3HAYXT5L0MqLBQUZamgkD2WKl+T3hs2W 08UZ2V06y8fDIAYev+UkTobenjHR60q9KFJFmjdm+ci3El5a1JaPGiAn+9Hf8fIjfprk yYAx4JWmO4y1aIwkeWuHaYCckINHHW9uNDkN5v3vlUZCgiGv6BLie09lSyU3IUO7Z4Rg IVHg== 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=C0EF3qlEC+BECjxs+YOrzgGq/+++d+Yw5ntBXD+bCSvAQDE749I+zyYhuGN8/980Nk sNUO2HnLSW/znFvs/nqpJK52LHMnFhNomiWSE7saEbF4xI4g+JpTW21wuxhF6If9Ozhd eBB7/FQ1/zrF3JW6Ov6gyOsHdEM0VLoo3fA1zcOR3Hq2PRvrHcZNzzjT+UBgmel1Eib3 kJK6M9xdgnhMx9hMAlNwi5oSszEjCVVQhSBukOCvGtZLETTQiK6tKssMbVeGGcPh/gnO KlLDh3osAiVPUIXRmk1feeBfexpJjBuYYqOOyA/d21Q6pAeW9roMo7Y8JtMChmw/u3ym 17fQ== X-Gm-Message-State: AOJu0YzbQVTRpJqI3Rbf0Q/6Mgm+jnvlfSoNAuaA14mAZ8oyFdA7Js7H yrwlTxJKdh8LrkgKd6scg/KDFP9xHX8xXYS0oRY= 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 Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=philmd@linaro.org; helo=mail-ej1-x631.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 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: 719970 Delivered-To: patch@linaro.org Received: by 2002:adf:d08b:0:b0:31d:da82:a3b4 with SMTP id y11csp1578243wrh; Mon, 4 Sep 2023 05:44:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFAPjJKrceb4dcB/zJ3kj0e1XT2+xUpeapBtLseBcWUWRM982zXF2DgOY5PdP6X2tzW6lPz X-Received: by 2002:a05:6102:3bcb:b0:44d:5c17:d067 with SMTP id a11-20020a0561023bcb00b0044d5c17d067mr8999161vsv.8.1693831481025; Mon, 04 Sep 2023 05:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693831481; cv=none; d=google.com; s=arc-20160816; b=IVQLfn17CIkmV01F1L7G+/Zl5G2xBfMfEbkzStjddIMVSoSYv1njRUlLBmf3krkjiO mHPDt/SQ84Nz4FAbVZYYOn+f/WftWk++awLMc4Sq9Wga09aR7iizgTYGN2gI+2DBnZpy 1IltGeZnk/MqBSjOHsgG/qHTf32MhOedzfopBX4Tu88WxnP3UYi7q6snJvTSIQLuSwaq yvDviXq7BK6IXHtT1ckuqPlNgq2xaxMZ5fI4mYA6UDAErlfDaDn6q0h16mXmBJEAK0YE wlMSk5XSLj66q3I7iOab69rRkshYaRPS0exE0Kjv2EYG5+7SypbkL/3ernguA6V32b77 dFCQ== 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=J86j5mSNtE6sux8EpFhfC+5G/8PZx0ftCeNpTFb29eU=; fh=hcJ1er+KUFM3dFc6zTqY9RJhp4OGnpzxJ3DQBJGTxZ4=; b=cublE0sJwNzI2xJexZQquK8lUUBQMI9s7ZTYJrlCSmX2Sf4zCBwNf102k5Gz5oy5lN NMvbG3FVdxD/4nqLVUVOunoZ2XSVPJfsSc3X7jWd+ank/Er8q9lnj4/btIuHQcdm+83m 5AFQEpfdb6dreDbJLWmazktgbskFQvkAHxyDpvlPXDblB57d/xuKM8c5ZnDmnoXix6ut AMhsGPa0kiXhnKxaDZyj9hNJ9exn/mqI4+r6ILu9sS4tvzq7O+BXFiK3/2THF96vYqJB opwSd/RGSRgNAsTLwBEttjgqkhgtV3nvn1t/I/U7CBYYfbTr/Ihd4aj5YQiHbdG2Lm1/ NLUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rugoFjQY; 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 i1-20020a0cf381000000b006471113a98dsi6278735qvk.441.2023.09.04.05.44.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Sep 2023 05:44:41 -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=rugoFjQY; 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 1qd8w0-0001uk-TG; Mon, 04 Sep 2023 08:44:04 -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 1qd8vz-0001pc-Ex for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:03 -0400 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qd8vx-0004fj-1q for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:03 -0400 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2bd6611873aso20725161fa.1 for ; Mon, 04 Sep 2023 05:43:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831437; x=1694436237; 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=J86j5mSNtE6sux8EpFhfC+5G/8PZx0ftCeNpTFb29eU=; b=rugoFjQY5QZTWmWx26g58vw+nqGgLXLA8xgvMQ4aeIwkgPrVrkMilAr1KJS1ytKHpB GK2tLEienrThJgUVPi2krz8sjY1GnSaAcwCX9PgMXcGEs0gBSaF3aMP6PR82R0H474ro 8ALHjsLUVvQM4TvAd5+lmFWW4/ap4eAl5/Dk1glbToIMD3VQ0Ks/7aBfWD2ssWwHoi1t iW0kOqFrFnTJIdJSXfn+0A+sJGP6DAqhOeK2xnHNH0SNWQUrNJp+LSoi6ZclcgXqV0Xx T0rFu9CJWiKTMZiH8LJGBLdxgljGFE7AOYgPXyqBwqNRsCY6097Iu8UoMcuIAtO6Qc5W U5ZA== 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=EjUVAvbCNi8tXCYRwk8NAaEoq05Xmt2zusZMA8hJXWO0iW6ujTRvmWpsQfIb9ZhG2c lqPCaXyqTgeRTH548QRDIMJmRkdW5Tp0PQ3WjcMuPtSb35wGYqww943Z6u9bAef0LX+N Fx+oj1X3I7sOWTkMZX77hOjzYNHFc9yrV19kKa2BUZs/R05e5+oLVwyOvEufOLd8ylZx iatyVTBq79hig3X/1PSTI8bbfUzrMEN8oTAvIXJo/SY8Of2ARmyYXiPKxCv1EZOUx/w4 3lZwXsACJhAU+qfLZll1w8pqunvtLBeRW15ETb8vbUjS9TTPWphz5Yf45fQIstUCWm51 nEXA== X-Gm-Message-State: AOJu0YxVYnYhM77+aSUvanoyhJOvP0ZAUAqSt79+2FBYtaekMb3ywh+j VpiwDsFYeB5jaSGtw7wmTN5HmOZgw9zj26Iq+EQ= 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 Received-SPF: pass client-ip=2a00:1450:4864:20::229; envelope-from=philmd@linaro.org; helo=mail-lj1-x229.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 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: 719971 Delivered-To: patch@linaro.org Received: by 2002:adf:d08b:0:b0:31d:da82:a3b4 with SMTP id y11csp1578360wrh; Mon, 4 Sep 2023 05:44:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFMz3Gy+5Jss3sLQnzmm0ws21qs2X8LNck1vLw6/gid1aII0vgYULOhCwHseUsTRaY7JbaM X-Received: by 2002:a05:620a:1a0e:b0:76c:b3cb:a9e5 with SMTP id bk14-20020a05620a1a0e00b0076cb3cba9e5mr12232014qkb.51.1693831497670; Mon, 04 Sep 2023 05:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693831497; cv=none; d=google.com; s=arc-20160816; b=v7EjfNzOueWKb4tpW47IBhLZvsA93TJJOQIcxOSe70MH3/wE0vygj+pHCzraSG4xVs Eqt7MBHZ2pgdOUVRQyyxg+r8eac5yWq70tlcPw8VIA2d2+MBZvbLpzUxyo8upIRSsAOy p08s8ZSNq2avHYtDiGvG7YGMs4b0nyqY42Q6GxXTDXw3xIPD+f3yt2vkpCstqJGuuBqo rmhd7kEpKtejPAxp5g4fONdxIL8h0l4aRAvtcQljVVkDUrvjm8Aiw5KwfJH7uKDLpLMn FY+Hfy0wya891L6dlQYsVs13GTYUlKFDud7KjZjFivrqnSNOJy1ffgL4O9DKovb9qCsB iYhQ== 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=uvgb1mY0EmO5+OIh91wyTfD/dyJ0WPXCogU6akizjwQ=; fh=7vtw0BZXa69LoAYaBsAv8Sj1in4httC6aOM0U6eRjv0=; b=vMpwjKm7saaB4DxVlmUGMkqcCBgomSyIix8BupUxcDUSjt2R+msevfmD60IjEeC7oX hnub712WOq/a/thahml0/1Ng7luXeADmwS+BAKmQv+6tWeFaYNJT1YxtbXx9uyU0fwaQ uckpfb1xUcqqcO22yhPxtLAY1BhZs6tDrJoIJCGGVIPe/IUpThxlr+4AbBbws9DmI2Lu c8YZ6ZRPyjHRMnw1PSGyzlDY5n/RC1acGow3RODwOi9eM2mBxLIXA2zls8YJAEw7kN1U s8BOZd68SSfNHPNT0PWUeg41Oa7Ya0M858IlR892B7cTCSKKebNjdHqVqwLV7T8rg3l6 UKNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SiHzq6iO; 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 s1-20020a05620a0bc100b0076cc8d130easi6464518qki.620.2023.09.04.05.44.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Sep 2023 05:44:57 -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=SiHzq6iO; 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 1qd8wI-0002DE-E2; Mon, 04 Sep 2023 08:44:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qd8w5-00024q-O3 for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:11 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qd8w2-0004ge-Ao for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:08 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-52a3ff5f0abso1860381a12.1 for ; Mon, 04 Sep 2023 05:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831443; x=1694436243; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uvgb1mY0EmO5+OIh91wyTfD/dyJ0WPXCogU6akizjwQ=; b=SiHzq6iOllrj4sisDqppUQIXfwq88s9s2I40fOvl+t4FtBDz6QP0rFa1YHjVlH/kYe Nc2ipq7f9gOXJA14jcyhhD5iFZLk/SgXsUh5tT+2w4vjxwlFS/rdL+QKi930Aeov6ycn AV/JJkwUCByV0U5T+E33cWI7C41eQJ+ws8ggb/ZqEu7H0KyLzuPMWZTOMR1O+yXUj0wY ds8KmTKSB3rYTVHrKhiBHbcIjyFDVIcnYJ7Nj/6fABjOVTpwOFzPhM8nslb3VKkaQMmZ v0zV/JrmPfMp2+dzHiZfVOsdaYzBaz90Rod4MIVE5TNZP7bex+UNpPCUGrwjaGxYOu4W Vy0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693831443; x=1694436243; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uvgb1mY0EmO5+OIh91wyTfD/dyJ0WPXCogU6akizjwQ=; b=kTK+v7rpF3wPXOohtGlsChPbmjGWRbUnt5NY6jR3x+AEneqi8OfFQ97rqwAbc9OuMt t9K06cYHJTZZM4RCtVxenimbUDFJIhvzjqG9EGr35B6H2mqDP9MCvlKR2Ycfi1vrk6Mq YDG8jBz6hAnghwITK6kt+Jczjb3B2pgV/126DUcDeBFLxUmk9hFx9EsgTED4xHdipwpH CfXaVKD6HaebB6EOcbkToWle4Ka7VOIUXKRK1a0UfRWWbv5l9GFeA0ADZu35SwALrVEQ yg9ohgZE+bWlaQSyHqm03y5NZKnqMI1eq9PRxXW+R2MhDT6pKHfxFVRj1b70N+iHBreW 9jGA== X-Gm-Message-State: AOJu0YyxTOW7jNyrP/k9+wY81s/dVubd7/zfQAxjKIzoKhfpQXHzRHXQ bNJ6ysy0tmIMlN6/NsHF+Fz17TVNeAN5SekwT0Q= X-Received: by 2002:aa7:d699:0:b0:525:6588:b624 with SMTP id d25-20020aa7d699000000b005256588b624mr6061172edr.37.1693831443293; Mon, 04 Sep 2023 05:44:03 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.227]) by smtp.gmail.com with ESMTPSA id b22-20020aa7d496000000b0051dd19d6d6esm5820773edr.73.2023.09.04.05.44.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Sep 2023 05:44:02 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Marcelo Tosatti , "Michael S. Tsirkin" , kvm@vger.kernel.org, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , Daniel Henrique Barboza Subject: [PATCH 06/13] target/i386: Remove unused KVM stubs Date: Mon, 4 Sep 2023 14:43:17 +0200 Message-ID: <20230904124325.79040-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230904124325.79040-1-philmd@linaro.org> References: <20230904124325.79040-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=philmd@linaro.org; helo=mail-ed1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org All these functions: - kvm_arch_get_supported_cpuid() - kvm_has_smm(() - kvm_hyperv_expand_features() - kvm_set_max_apic_id() are called after checking for kvm_enabled(), which is false when KVM is not built. Since the compiler elides these functions, their stubs are not used and can be removed. Inspired-by: Daniel Henrique Barboza Signed-off-by: Philippe Mathieu-Daudé --- target/i386/kvm/kvm-stub.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/target/i386/kvm/kvm-stub.c b/target/i386/kvm/kvm-stub.c index e052f1c7b0..f985d9a1d3 100644 --- a/target/i386/kvm/kvm-stub.c +++ b/target/i386/kvm/kvm-stub.c @@ -10,42 +10,16 @@ * */ #include "qemu/osdep.h" -#include "cpu.h" #include "kvm_i386.h" #ifndef __OPTIMIZE__ -bool kvm_has_smm(void) -{ - return 1; -} - bool kvm_enable_x2apic(void) { return false; } - -/* This function is only called inside conditionals which we - * rely on the compiler to optimize out when CONFIG_KVM is not - * defined. - */ -uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function, - uint32_t index, int reg) -{ - abort(); -} #endif bool kvm_hv_vpindex_settable(void) { return false; } - -bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp) -{ - abort(); -} - -void kvm_set_max_apic_id(uint32_t max_apic_id) -{ - return; -} 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: 719974 Delivered-To: patch@linaro.org Received: by 2002:adf:d08b:0:b0:31d:da82:a3b4 with SMTP id y11csp1578437wrh; Mon, 4 Sep 2023 05:45:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGmtO7vkArWIZjZNgWkFJwInonic83V11aEv7Wi+WY34zEqDYvbwh1CZuRZwN0T1fnYStBP X-Received: by 2002:a0c:8d47:0:b0:64f:59b8:cfd9 with SMTP id s7-20020a0c8d47000000b0064f59b8cfd9mr8510688qvb.18.1693831509012; Mon, 04 Sep 2023 05:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693831509; cv=none; d=google.com; s=arc-20160816; b=L7B6FLuhExq3cd1lfs2h+b/vPpj4/+uJMNg1KAHhOL4QbCGcu2GD5mFIUL1qEHnTw4 TBsCJPk5TOKHn4DeFKObd/41KvjMgtgTCi+zUE3X6C7NNNJUtnR+udEirIg6usNHvZFI ZPF6f1kw9g+9+tzsg3lVvEASVB2Pe1lt2QVQKP6koZTrKFgDAkdPQygEFojKs3VSfmwv WsEHYU4OkJH3yM1dT7P4CuepUX2LnbWgma4LOeG5JX1Hsw6m9juVsfprRcfcYJkNtN9L /sO2QfGxPrFBgc91KU9JKVv1O3Hn5P0bhfUZ2wqjNBXkJwCPppZy/XudqYnJKrwcHiTL iscQ== 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=y1KRPJbXgs1nETBjJNmlr2PmeFCKIGRCFU9IErPdUTo=; fh=m4TnS6IVM8RAyKGmHewnHpn5Ht3JgQEDd8raoB7tRKE=; b=LVGIAuOHLpf1BiH/bK0cfYOXNrrZFmqin+DPT79QNqEsa1D9afv/r1KANXE1hShZ85 1lKu+q/jXEqFEYsf7N9ProCO/bOmwUWfEiCeNxkLx6Bj8RMTkDMdtDVqPXR4AT0SZh+7 cBpso2LLW9mCCqwJbKJwzS6wysP2cqIjzY1V42aorp1pGKKSIh4aH9Vm0lgMT7v2UV2V 8A46yWtJz4Fopcq+1ME3JX9a/1X55IvncjcX0RyRmixTPstJfwqdXsdXEu0GEqvz0c6Q yjKDfd8UAdqZaB4LEAEh7KLb5xj9So09M6lRMfWAYP/DxeYifZFSD+lNp4syGZaA2xLC u2Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="PF/J7Sp+"; 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 s5-20020a0ce305000000b0064f4654d83bsi6219628qvl.419.2023.09.04.05.45.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Sep 2023 05:45:08 -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="PF/J7Sp+"; 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 1qd8wj-0002hP-VD; Mon, 04 Sep 2023 08:44:50 -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 1qd8wB-0002BD-0D for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:16 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qd8w7-0004hR-2k for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:14 -0400 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5230a22cfd1so1969801a12.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=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=y1KRPJbXgs1nETBjJNmlr2PmeFCKIGRCFU9IErPdUTo=; b=PF/J7Sp+O9zlBr9zE9ws5fv2ICxnWGaVkVK+5CH0ZN3Dz551s2G4Su/82pgQcOoqlF jXM+303olIGV7R5bJTswxSGiMRmVt7eOq0VjJg12BtZqzpXYMfjO9TuUwwpBo0+WOK+P miNO8RNuV9pVkzmekniU8u2rIp/Rq7EMeCPad4+3O7yijGg+Dnh4KzQR1g1tFcyOMpFF faiPsq0Jafc3rL/zDfcj4I8EhDrn5jlbbpbjgfS3bq9kyYmtNEJWvVraeyEWpIVhMNij T2emOpYmWRy4BmP8nerdTBXFv7n/N/1j5kT1RKqgMohMJAENk1MSXKYkMZA7NAvyQ/lU 4AmA== 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=Y2kq631CNe/YnQmoUOuNffltpYTVsHj+ZxLdcyGlFCQywTmxLmWRhoJNAYg2eJWJSa VGwt3l2Hirw4dXwTKf6lI0RgJGl6uV2WFZLKDVVnbYaQ/5Kp6XBSg1F4dK3L+789Gtp0 +jRTlXAXbYQyEcC1iTL0p3VO2juXkrCeOyYF8OzXDHMq+j8nCrFJplavVPJkkuNRgX3v fnUaP3ePPOmyCm7S8/eWgi3iXcPj7Gu5Mui3RTyUAtqkC6yd6HiG5z/ITkb3AXhgF06z saogign4G653iqsUtpCxnxGctI+Of9pXXY1yo2RgAouvyDphayLcK1Fv5kHMUfjSBbSq Z9XQ== X-Gm-Message-State: AOJu0YxQejGMflLUhvS0OlbJSzvOWI5UjEmrdtloc81Fw26berowpv9o B34x8qzWU5zQGg4dyYSRv9SY5MCkN3yGcEhKioo= 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 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=philmd@linaro.org; helo=mail-ed1-x532.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_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: 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( 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: 719975 Delivered-To: patch@linaro.org Received: by 2002:adf:d08b:0:b0:31d:da82:a3b4 with SMTP id y11csp1578821wrh; Mon, 4 Sep 2023 05:46:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGRJISTtXJo9lIGdmfDjre3x8x+h7M3pphBguHljlz1pyhD50v7Q+I54bFLhx1s0ybtZHe X-Received: by 2002:a05:620a:953:b0:76f:10ab:7c64 with SMTP id w19-20020a05620a095300b0076f10ab7c64mr10775528qkw.28.1693831561478; Mon, 04 Sep 2023 05:46:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693831561; cv=none; d=google.com; s=arc-20160816; b=Gkv2fh7Z3de2pb0+wEwjKSplDUzvg68r17T8uhTlcZknho8m9EVSIdbhVI0Kk2sr2v MF0SNfhRckKBXZll9oJZ5J3AsTmfVqgudHfhRANTI9pptZteFKkp1LQ1vXjzdSVCllcT OAQTikoFumHKkKZA3NWbFHj+zt1VE9fz/Np6untjVcB2JxHMqy1AM8hR1UJFomgbtNIu zwGOQqzcSIXnc+yJ24qEmDHmJja1kg8LOo1PE8N95uovBfp2I8p1G84k2V3ZL7F4cNSU fyegwaEWeuMkyvKfKPHOk+c3WNosJrh5kAYWliEYDqrChtb7k3CyseNitoKJvgbKl6D5 fE8A== 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=EfDnH2zi19spDXT1YZEdk2e2zvrpSHkYzKDFanumPPE=; fh=hcJ1er+KUFM3dFc6zTqY9RJhp4OGnpzxJ3DQBJGTxZ4=; b=FzMxRNzvMt2D1P1RBxsGMmfwrEDQultodw4Jg0P9xUOYYjP5FX/lVOg0GoT+zEbvjf yjv5Pe6Yi4FpwFz3Rj2/6zcKVCaIE9U8Hn9gWAdBipnxZiDrfFr6FspzNLiYS4hLvQfU vHWRBpGSC13umFoUOdlcwciQyNwR4ZbeuYbbbpm90X7PnfUKgAaRKrQX1ONXPB9Bw8uH qj1jMR5agjsSZsEWs2g2IC3gJs32Du6BrmI9H3UC76aUggIppie+Zq75miH9CV7+yKkm k4T2H61f5/mzBjXkV5HfLmAtvYgm+hUBNsIBrKap7ZnWzRsPBswAc8GHdUB+lHFGIQ1s P8rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OFetcV02; 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 y12-20020a05620a25cc00b0076ef2df1595si6429053qko.578.2023.09.04.05.46.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Sep 2023 05:46:01 -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=OFetcV02; 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-0003IW-Tn; 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 1qd8wM-0002Ui-NC for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:34 -0400 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qd8wJ-0004kN-GI for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:25 -0400 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2bbbda48904so22935531fa.2 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=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=EfDnH2zi19spDXT1YZEdk2e2zvrpSHkYzKDFanumPPE=; b=OFetcV02ajE+PqlKu5fqrE509BbUwXTdtoYOnacoN56eVwIUD8S9s/eAzrY+iwiYkE j/MLAyUjbv9KoKG9HAyA5Cnh6EimPxQJVuHvp/g69foed4PfuRYzfBTNHrr0DEkiUy/I 6VaJH1sL747WCUNBjzHcJU9iqApHFI3PHqRxCRN65+11KR/WAmgdEMyaO7q/fNoZvNLi sNAAZjNfA10HzA0hpUgTT/pQnkdYWo/rtZN2nbupMG4DRQB5pgEtyRPCxH5gdJLA7VvS UcJaMlTLSZyzBX/7R9lSAQ9El5fS1Ntu0kXH0BuCd5lMNSIxZ+Gc38PYyAKiONduYAIk zN5w== 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=J4pYeDN9hgR3ct6tpmEBMG0Hj7KusIWtsP4ASm+gcnOHuK5y3j9e5e1hV06Rw7PSaN Ah8Hdu3fJTjDS+CF6X+efWQlvhtZ12ZG5m9Ug8nqmBiTkk3KdO0Yr2hDR9YwDC0/j5Gt EuGEL5lErkPNshR5D/B+PnOCmMQhIMzq0Moh2h3V8rI8a9panOluymp7CCDnQb2I6M4G WcLepNDkyT5xFpWi4BajUfBvfzXSw8WM0lNEQ3Kcn/HW73FUfY0wTjmMy5c/loo5x/q0 nKNbadkp+HpcugrA3m06JOPNen7tuNxvjRqpn9vyqtbmbJApC/uWRC/hF2hxmUXVvuET wuww== X-Gm-Message-State: AOJu0YzMOZhQYYfdLXniYUNE0go+RRqYiMGWwQxpQwmh7pmF1eL8zfQ8 oQCiAO6S2v2w9pUcUYWDT++epzEwRq+pMZe/06U= 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 Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=philmd@linaro.org; helo=mail-lj1-x232.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 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: 719977 Delivered-To: patch@linaro.org Received: by 2002:adf:d08b:0:b0:31d:da82:a3b4 with SMTP id y11csp1578906wrh; Mon, 4 Sep 2023 05:46:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEtldZek/+1UE8l7Rlo2jgYw9qv8cW7BcEZFoSadNz8XKlJZb6AKGDMWqdavNNPn0WDsJXW X-Received: by 2002:a1f:4a02:0:b0:48d:eaa:45c4 with SMTP id x2-20020a1f4a02000000b0048d0eaa45c4mr6413281vka.7.1693831571417; Mon, 04 Sep 2023 05:46:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693831571; cv=none; d=google.com; s=arc-20160816; b=nXZxxuiyoKXDk//depGhoumUIBLoISLGDUOcemXuX2jzVAz/CzWFw+xE/+MZJYtj6x 2NBeEB//YgFxqKkO1bAlhkaDq9z2Nuw/3/2iVeJZTL+3U00ueWuHKKwN9P/W601w1Oh4 prlakosDBQJvriNSYRd/hAxN1a7Beg3yTxg3efV2VAyVAFYNzh9vMbmrO3YRXx8ZHZeP 46d0yNK3dVI2sVcOlqPj1rdF7abPrq0+UHcwNIojmJsFGQXREY8AgXAhCn1Ls4Vo3n1P 7aVos3LOYnDalLwwia/UgIusRuuDBDUZdq8wyT6UlcL8oC6sTKONyg5Z5d1tWeD89T+3 YnlQ== 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=9c1++OFXiKHirX3uQNfDd/RXZK+lEL70eHdHIGvdol4=; fh=hcJ1er+KUFM3dFc6zTqY9RJhp4OGnpzxJ3DQBJGTxZ4=; b=pfWg5WpXDCjbmlAyQCfgL48Qmv9+4c2GsZf1YBVzRMRZYUOMf3Af0O09yYuwkhFY23 4k4c9o5gw2eWP7DYm1F4uSpudd1aSjMT/prHwV9p+IzqkdW25ofyD5xadTpqdMCXpyeN 9/dJbO5HzOLGlT24YwFj2hpYg62RgdFYayHstWVJX32Ov7sLVnGZf2UqL0MRDVGz52zE jtYdct2sN7xBmpLMc9NmtUfv0Kc3Qp9XoSEhnaDr8Eo7hqrJl2xFK/iqr7O5CU9oiNEc zwIM5Xx71mBi07c1JUAZcMI0uUI2/BeItZcVwTF/8mf1a5UhF+ejKYHh2PPAFTNkSpi1 ++Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="fWk/Zq3c"; 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 qc6-20020a05620a654600b0076db4dfa8a9si6223742qkn.44.2023.09.04.05.46.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Sep 2023 05:46:11 -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="fWk/Zq3c"; 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 1qd8wq-0003kf-HE; Mon, 04 Sep 2023 08:44:56 -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 1qd8wS-0002Y9-VJ for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:36 -0400 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qd8wP-0004ks-4H for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:31 -0400 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2bcc4347d2dso20034271fa.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=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=9c1++OFXiKHirX3uQNfDd/RXZK+lEL70eHdHIGvdol4=; b=fWk/Zq3ceQ7UglWsyYHnFamB0IOzavOkRrA4EjYZGAHdfTPMrV7c9E4sDCqPH/+HWI M3cu+rqvJ4zrVI7Oiwu8ho8g9L8KlJhXSqNSicL+ooarZ+bGE/UoKYJ+wrVFegscKE6I 6gk6/+FzHoqjZakkgi/yWhtUKHy7zj5035b4Js21fQBkXZdb2cpWIyx8I4YtJW2ROjA2 Ic55XjrlPML0gTzqavSGxFDNHi37d8b+WVnD2XwlvRYJhrM7YS4h7YNdSspBeP73EBWN pGWpT2+i9UJnxqHBR+lsodFOh7ns4pzbhdMCCOmLvoag/ELIEl5PUEsTtb1hHrjYKq/4 sr/A== 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=Ap1VDdxCwjAcAbJzVwksu1wRDndEtaRw7SEFNcW0fggNMIk8itraMgQ7b8MCpxczwK VpZWE4JvvaEAnswY21covSlxtx+XumcvMoKDbHO9znWq53eivf9C2Uj/0Iv5mk5umIwC MakJPu7a4sn0Th5Z/TFmQva674V97w1BBIPgbYo1NSHFF/LqQE34ZQVEKptqdqnm/oI5 RKDnJkYCIvr2vcvGku53xPAXC0m4WOtovxWax+0w7phHLeUMBDd3xNRaMlRWK8iV4QSr ZmCTZ/zLadXhRTnZElCV5WKR90PzzQ90vLP/tVLa2WEUFj04U2Un2F+Dk00C5I4dwHdt 3gLg== X-Gm-Message-State: AOJu0Yyhbn1skzyRVMA+I3BDgpQhE714IwBR3ZVQkhV9YxNGaMchIFQ1 PcG6TQ5MRr0lTJIyMVXqOYtrzrcrC7lHll0YqjM= 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 Received-SPF: pass client-ip=2a00:1450:4864:20::22d; envelope-from=philmd@linaro.org; helo=mail-lj1-x22d.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 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: 719972 Delivered-To: patch@linaro.org Received: by 2002:adf:d08b:0:b0:31d:da82:a3b4 with SMTP id y11csp1578427wrh; Mon, 4 Sep 2023 05:45:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkYB1Wlh57OUz4DIRAgOFQ/XCSDU1yUR4RfyNr79kN/M2cvjGJQkSbhsXO/HhWWU2JsezV X-Received: by 2002:a05:622a:1c3:b0:413:5df3:9347 with SMTP id t3-20020a05622a01c300b004135df39347mr11907556qtw.36.1693831507485; Mon, 04 Sep 2023 05:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693831507; cv=none; d=google.com; s=arc-20160816; b=k6BkOTu3brHP6IRF/Lc5YIuSqZ4Y/b2VP0A+pmmgumUBV52qSjv3frSNHSdry78v5X IUYJjNU6eZZD9E5KsjdpU90uDVaCEllN04f0IH5eBoZDwiSlwMWVy8qK1NHQEOWpNXNP Wtrl6Vd+dM0gahaXGwxbMoqncZfPUWmp/VJruepSHSZ0CSkU3TFYAT9b96GjItvjah+u UJAx4OASzFt3rjy0+MFM9HlXyWe5/01pRCQkYt49k3lAXmpN317eMHhJAyrHC34q6405 FSLNRZfepfrGtPIm1cQBpYC4s4W0wgbrJq1eIyOC/y5sBKL0gSWpv7YkTFXfSOH9U6CE cG5A== 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=wQp1ZwukkzwgrEJecGe85e61/jQRSJ79TXphHOkDcps=; fh=hcJ1er+KUFM3dFc6zTqY9RJhp4OGnpzxJ3DQBJGTxZ4=; b=IVyJ+1Cy++IqnyE/fd5mLZBN26l+biwCl/Hhprf40B0IoEIX0E9sd+hqJjJqoJ/Oir E3SlkwpSykmVtcH3SuxNDqXThyvp+PqsUcx5N5RJKwBlQrOe/UFPJZOrrOxeBUnuVQ64 tORj6kBF4i+KM26THlh7tpkb3B/1D78l5vNOgQMPKdqVrBicaj2ZN0efihAiFyZ5nMtA 02ACA1YlDiZmm9dIzgOA28KfwRuauPmhDEqEDHnl1CLUzfBYUyN9V3FhWRUJRezNnzYW fhGh4ZrpD2SVolhvJ/oYZEHkRAkCfq3VCrSEIL29DRdvFu6tSjV1/1NdZoNttxpSRWDr zfEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kdM4fmih; 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 b22-20020ac87fd6000000b00403c2e9e72bsi6495271qtk.106.2023.09.04.05.45.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Sep 2023 05:45:07 -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=kdM4fmih; 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 1qd8wp-0003Yb-Au; Mon, 04 Sep 2023 08:44:55 -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 1qd8wY-0002hM-Kk for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:43 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qd8wU-0004q1-8N for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:36 -0400 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-99c3c8adb27so221339266b.1 for ; Mon, 04 Sep 2023 05:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831472; x=1694436272; 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=wQp1ZwukkzwgrEJecGe85e61/jQRSJ79TXphHOkDcps=; b=kdM4fmih7f7PIXry0I6KDgO3ccjLjcYsaaIES5rX5783shZBjvqesxw6xJJnZgToju q4HT2kWEXWU2NkDVHMBTN6S7aSMEUp7nUyMm7PPZt/eO628pvWP0MGNOqFCzDLarFH0N 30orC0f7UPti1MDYHXPRMm+h7D2MVcRbOO3R98xuOluEj4oPWNpQj0xo4A8TLpOplaWh 5iDQ+ZYrSUVxwYwXAHeLz3B44pJJMNwJ53L6J3+IWRv1e2cZit99YG1EjQW7CD8tCSoD YXyBjHn5Z2bUd/zqviSboydn79io3X+yZ0ywiBpS9Qmw0GH+G3i806e6YU3mujR0Okbl vhaw== 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=L7om7tDGaHDZ1UqelNfMJaUQqv/T4Dy8g+pu1bz9U9To0lDuLXNzHHbhuq/MiKRljZ Biec5woowqJ8QZr5Jjzjgh61hISHIQqaKgdfkCoO17zA2af/52cGSiguBv/mrJzOZ68D sXR8QD8IiHRRntf8x8weuXik890jLqH3sztBToKr1iR/gCP6Xsh4Ej40AoKQHTh+lUYW E78cdLPdBotHh5EJV8obwMqsMteqeYK/wz8R8y2ZadvZgEIyO0b6bJdh2pgRrQ0RJWww 7x60ux0T7SaniIIRegNcUVJwmrNpBTy8o8cYV5qpPlCqhdrleaYNDAJ6aU1WBRyA+VuY R7qg== X-Gm-Message-State: AOJu0YzqO5MYqg0uD+MUCU+b1iuANmNIAWoFwjWpQGNpBrK0sp2o+PKr gO7qEJmmNoD/B9SZ1TzEAr4pV3bQJNbVdPC+T8E= 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 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=philmd@linaro.org; helo=mail-ej1-x629.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 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: 719973 Delivered-To: patch@linaro.org Received: by 2002:adf:d08b:0:b0:31d:da82:a3b4 with SMTP id y11csp1578430wrh; Mon, 4 Sep 2023 05:45:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFOYwPp2jhV/NFLGioLFLoonf+bFA9gzlz1Rr7fkHG/HBUdcvQKOfY1XnrDIl7/lq8l9d0z X-Received: by 2002:a0c:b21e:0:b0:647:2def:6a8 with SMTP id x30-20020a0cb21e000000b006472def06a8mr9502108qvd.45.1693831507754; Mon, 04 Sep 2023 05:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693831507; cv=none; d=google.com; s=arc-20160816; b=LvTGfoO6jqLs3ZkHVE40wlxsmCw6LyFjvRjZplleHbPVPBXRR1SsIBkj54hCrhymjM zGhS+vtBpUIGxplbJ72DrPZzQ8IgYnVSmCc4rmCSKG5GEieW+9l5GY+6yiwcYkUJ8PiF 5taWlHBfFrsZrtthkWxHt2c7cvdDgkrnT579akKg74oa5xT6m1HTFX8lTYIUB5/DxuUc Xcns3+nS0GXTazVW9mfCraXEDji5A7Xq+HtQeVDcWAaVfKyUroSqEnleq2yOIM/oCZQ6 1YyD7k82u0MIoPkL6BiDpF/HRQ0icqxUTdHXFZGdlhjD3jFE5wTzJZNKpWa80uxNhSfg C49g== 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=c18azMn+jtI1YAn3dB0AGJOCqMNVzX0REantB+5g0DU=; fh=QjoLg5b8k+IWyR93Cyvr6VbRWLHQiDY7q1G3ZGcZnSU=; b=KMbaFE5PggJlEAb70nY7J8mfrsKhha05up2otxJc9lWyb32wlvaTLl+spSxnFk3xZM PdUI7dkPf4+EAQQRonH9OkIhSMSDlZHgm7NRDrZDdaM6G5JVd9zn8s5daqWvdDJ2kh76 2WHCtHfrB24xdqauZdtbxWiBtDhOu065UtKant+DtDmW/TfOTcNjU3ABOSP4/5F13xji 2b+O5dxyDMi1/lxTwwINBicKlN7lVrcREaOaBX5nOqzTy+Lew/1SnaQ+MFd2xx5MDESU PGegqBWAs332EKSi9mUdNe7l3J6QHA0SjWlAHHgLjnIIy+nPDy/wbrzbHyrIxMvk6ECQ +UnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WlkJXLjD; 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 v15-20020a0ce1cf000000b0064f5729799asi6453742qvl.382.2023.09.04.05.45.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Sep 2023 05:45:07 -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=WlkJXLjD; 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 1qd8wr-0003v8-QF; Mon, 04 Sep 2023 08:44:57 -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 1qd8wi-0002sR-2D for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:49 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qd8wc-0004sh-6r for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:47 -0400 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-9a6190af24aso219547166b.0 for ; Mon, 04 Sep 2023 05:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831478; x=1694436278; 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=c18azMn+jtI1YAn3dB0AGJOCqMNVzX0REantB+5g0DU=; b=WlkJXLjDr5p81463F//uUUFzTs4M3arxxHO3pd0X7GwKzvVMD4KAs/HnnrqHH9CKnl hZ96fLDTUuzcWAggBeM8QdCRAT18r1mkHgiKDITDMGv3wgoKS3DC7d5qfKsbTw9Oe7Pb XYleYjG3CudJ9aU+1h0xdBtz7ya1ZqSb1/01zyRdSWfZcQu1kc0dhei2zfdINxEAmGnx vOM6p7Is+nJ1h/8c83AZtF9N3BZqbh19qsxMqn4PmHe6s4g9psg2tGvGQ5Q2ZkMKqab1 tRDsnOv4yaDzZPgDFjRUGFybk9o6HiJ9h19xHdHV+5tEFwde751i5w82b0/liA7sJl53 nolA== 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=gd+JXPHhHuqyqQegIRpH23sOIJNaNcAuMObZzKVH4V4MvlLOYe6zUDvpAGZ0c/IJUL 3IceZWcX+w4Pcpr9JEBiTDa3Lx6AVrc51k4L2NKVvvXAO21h2RzKDMJsYYOpSs9bja4m 6u+alArqNZy1m8xEuZZRa/alFgYG24y5OD0FqMb1hWw1QTpmeGQ23WvZT8Cq08UTbqIC NpVQO2IGlQL8u4B5QAQnuYo5UN1RxofSwEKwczPPLR5rXMgw71YHLqz9L1f0ENBfOhR7 70JDLUwLn8h/wshHy/bfNzuIDuN1VJs/7K4foCnhzyfOHsyC0dy663ITdYXltwFZPaE1 hVfQ== X-Gm-Message-State: AOJu0YxKVPLwM+rbS4Q63slFggnAfN48ZeYP68i3ZHIcEGoYHdEe3BDK k1BIoDDGHnXl289INoVnPCq94I3vvneNMdVTQWo= 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 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=philmd@linaro.org; helo=mail-ej1-x629.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 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: 719976 Delivered-To: patch@linaro.org Received: by 2002:adf:d08b:0:b0:31d:da82:a3b4 with SMTP id y11csp1578902wrh; Mon, 4 Sep 2023 05:46:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG0gAwM6bIbJKxrihkdNTFcS5EWX7eXZhu2oFRQG7Y39vtDpPjtxjj5bwKN5L+1DTMby7+M X-Received: by 2002:a05:622a:246:b0:403:e745:2622 with SMTP id c6-20020a05622a024600b00403e7452622mr12403465qtx.19.1693831571049; Mon, 04 Sep 2023 05:46:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693831571; cv=none; d=google.com; s=arc-20160816; b=1KCv4h3a+Iz/4SIxjj+2Yg9pqt6Khli1pCD4V7KiAP9CLGQKAmHAEgWkRryLhlWKS9 b63mR11AQ4ECx2fB7L60G7pgnugfVt4LrABD2oQgZOsOCsslg7ux5m/6bBCAWjiDxl9m VHwYuTVxyPwc1hjmMXxuPHxJLJb461rfrM2kWIN7FMt9IYrV02iXMsvUNJ6JYbqYFTiN KBLIeppIk4z1BuwrXvh3Yt5SS38Ldr4G7jgp2VNB4vsKsLn9kx1V2uuFRtIQXI3WFKJ3 SzLIy9KlHbCF1oCG5ySYXuThPvbhHgvyUN9VPy8BAP4x7iOS+HVpEYv1z7nRAZzMXm2Y 7D7A== 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=QgUPYLmjXf0NM9VXdRKjm+MRqu9ErWeVIsJU5m+yYDU=; fh=QjoLg5b8k+IWyR93Cyvr6VbRWLHQiDY7q1G3ZGcZnSU=; b=eRaML2VrIHdkzHFG2SNKU7iZvQec76qnNdtk9QUzesXdI7i7mkjs1ekRO+Vi75fgWP 60wvHNW5iOlXEWwflZKJpvoep1s8doR/PV8LO8NPHAbFbxWCbbTiFnW/V7yrdsN5i3bd 3SOBTAZB6cdIc3E8GKN44cK1xW8KXOrtzpzv8aI7ZmCsLvJqRavigaJhoAmLY1uS/HIC 022bEJDuXa1c1skjgJgPA72riRmjaKjhGzJZ3LGkxGvYEeSwZwOMzcNCJAxLdHD0kdW4 rN1CU0YXFylTFZFTG3rmZNtm196J2+TG34coFclJkinlCdBhS4AJ0lgtxxM4bqGgAUej rkwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ElGuqkKP; 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 v22-20020a05622a145600b00411f8c5cea7si6434120qtx.135.2023.09.04.05.46.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Sep 2023 05:46:11 -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=ElGuqkKP; 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 1qd8wo-0003RI-LL; Mon, 04 Sep 2023 08:44:54 -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 1qd8wk-0002tk-6U for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:52 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qd8wg-0004tB-GN for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:49 -0400 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-52a23227567so1871459a12.0 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=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=QgUPYLmjXf0NM9VXdRKjm+MRqu9ErWeVIsJU5m+yYDU=; b=ElGuqkKPb4tccOJZzDdzhDceFkTKIqylpNDmc649b6nbMf1REbF1Efa0VFpwrGWSM3 2xKl0K+rIs/6CovWnoWd8DSYsfZ5odFhQ9ORInIdwJwk+P3jUmMJNv332kKBVjNcav0+ nl3UPRkchznUU2UQhb/mgadNEJB2hkwv355uNDCh696UmxOgHL0iurJHI7N6r14OPCW5 +qJx/03q9RA0C+9rJ6CB8ODB6WR36FavEUtPE5P+9s3lzPjqfkTa8ZBCBIeGeD9Jb0hY 87L4ZRMryQ76hoLnfEWbQPxdA+9IkPdDdzhsUM0oZtIizjvAg1zORD2B17oUnblvQbqk UWVw== 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=BNoqDKPhINO0+DGoX242DIdUOAXWBKy4kK6DiQqqp6W4vCiov4jR/dGy18S6pHEYmY Ktp8E6A9c0reBjvgHGj3AjxmlWsPurczQUFsjiEZqOdZnzUedaasKLkgfvYTnAeUEkcb nM2sAQKriW8lanu4Lpditd0xX0HT7BKC/94aEgnr3h2Nk7nYSi8I0LSNc/JJqY8Dnv0B uebFUURL7MquKrYTPqFDA3Y/Lii5Mq2CMjkI5KygkXFWqm/IzitDlaOCc3NNT/jtJxNn WeFHLg2NXfLlqW70V/nFplxWD+Io/mJnHe8W2EOgT9CDnLKIpTWzUYLMcyVw7/fhRr8H yLHg== X-Gm-Message-State: AOJu0YwzzXM8s3DTKJprruRtFmPKHEWCD9OIBSB6kF+5jPybxuq8/sK/ s9DjIiZD06XI0U1XOhbWK28pQHojtse1OoWF8xc= 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 Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=philmd@linaro.org; helo=mail-ed1-x52c.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 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)