From nobody Fri Sep 26 13:48:20 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608368887; cv=none; d=zohomail.com; s=zohoarc; b=nNoy7vvdJ8rYnpBQvaOkHEznALOdin9H1xh74zLsimorM8s6AOnMla0n2Dfx2Vmp4OkrT2C2bG/tyBymOAXDYJMluBdMKOEAaANSRxnOVTSrGVrui7+k/NLsaMlZkTWt6+jE47pMcoordRpvY4gCV8/YFYOYC0wthq5kTrop+7M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608368887; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Hg8d2PDhOVHoGWCzkruxDDDN0Z3PROZY3JZC6uFkyvQ=; b=JfVKFmlWYW0JEGEzDyK/Ln0huxXhKBVbEoIMN5Ing5SAeovqeOnaOOlQZHcc0EWb9MNfci47jJ3OViG6drrgu2nLcLRR2pISCfdmX7C46/hlCFtcBpNPM3pcLMJF3RISVhxfWW2z8K08B6wMZ7iqjfl8Gk4Nl+JFyOp3QdmX0bk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1608368887064438.75063893594915; Sat, 19 Dec 2020 01:08:07 -0800 (PST) Received: from localhost ([::1]:59250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqYDd-00079K-Lu for importer@patchew.org; Sat, 19 Dec 2020 04:08:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqYCP-0006MS-0K for qemu-devel@nongnu.org; Sat, 19 Dec 2020 04:06:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:36202) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqYCM-0004DL-4A for qemu-devel@nongnu.org; Sat, 19 Dec 2020 04:06:48 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-290-my_gCrUCOr2LAvibHpBUFA-1; Sat, 19 Dec 2020 04:06:42 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0C245801817 for ; Sat, 19 Dec 2020 09:06:42 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA763380; Sat, 19 Dec 2020 09:06:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608368804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Hg8d2PDhOVHoGWCzkruxDDDN0Z3PROZY3JZC6uFkyvQ=; b=G92N5vrHmPeTDv0BRGTyrLVu67urSykiPT549vR2w/NpLJ7rtaD1iOwD1QSfk4XoKKdsyD 1ih126OFzt2Z8mt2RrfAZMPK5edPcofxgQ07ftd1gFJTfqdFi+5im1nxjgoyApr5YWkBJ/ EODFXlOq84OZNxJuu/3tI+JCmxT1Skk= X-MC-Unique: my_gCrUCOr2LAvibHpBUFA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 2/2] whpx: move internal definitions to whpx-internal.h Date: Sat, 19 Dec 2020 04:06:37 -0500 Message-Id: <20201219090637.1700900-3-pbonzini@redhat.com> In-Reply-To: <20201219090637.1700900-1-pbonzini@redhat.com> References: <20201219090637.1700900-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcandre.lureau@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Only leave the external interface in sysemu/whpx.h. whpx_apic_in_platform is moved to a .c file because it needs whpx_state. Reported-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/sysemu/whpx.h | 22 +--------------------- target/i386/whpx/whpx-all.c | 4 ++++ target/i386/whpx/whpx-internal.h | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/include/sysemu/whpx.h b/include/sysemu/whpx.h index 9346fd92e9..8ca1c1c4ac 100644 --- a/include/sysemu/whpx.h +++ b/include/sysemu/whpx.h @@ -15,28 +15,8 @@ =20 #ifdef CONFIG_WHPX =20 -#include "whp-dispatch.h" - -struct whpx_state { - uint64_t mem_quota; - WHV_PARTITION_HANDLE partition; - bool kernel_irqchip_allowed; - bool kernel_irqchip_required; - bool apic_in_platform; -}; - -struct whpx_lapic_state { - struct { - uint32_t data; - uint32_t padding[3]; - } fields[256]; -}; - -extern struct whpx_state whpx_global; int whpx_enabled(void); - -void whpx_apic_get(DeviceState *s); -#define whpx_apic_in_platform() (whpx_global.apic_in_platform) +bool whpx_apic_in_platform(void); =20 #else /* CONFIG_WHPX */ =20 diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 12f79e2cd6..985ceba8f8 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -1866,6 +1866,10 @@ int whpx_enabled(void) return whpx_allowed; } =20 +bool whpx_apic_in_platform(void) { + return whpx_global.apic_in_platform; +} + static void whpx_accel_class_init(ObjectClass *oc, void *data) { AccelClass *ac =3D ACCEL_CLASS(oc); diff --git a/target/i386/whpx/whpx-internal.h b/target/i386/whpx/whpx-inter= nal.h index e0a9ea1dce..8cfaaef141 100644 --- a/target/i386/whpx/whpx-internal.h +++ b/target/i386/whpx/whpx-internal.h @@ -5,6 +5,24 @@ #include #include =20 +struct whpx_state { + uint64_t mem_quota; + WHV_PARTITION_HANDLE partition; + bool kernel_irqchip_allowed; + bool kernel_irqchip_required; + bool apic_in_platform; +}; + +struct whpx_lapic_state { + struct { + uint32_t data; + uint32_t padding[3]; + } fields[256]; +}; + +extern struct whpx_state whpx_global; +void whpx_apic_get(DeviceState *s); + #define WHV_E_UNKNOWN_CAPABILITY 0x80370300L =20 #define LIST_WINHVPLATFORM_FUNCTIONS(X) \ --=20 2.26.2