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; }