From nobody Sat May 4 00:24:54 2024 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=1608368894; cv=none; d=zohomail.com; s=zohoarc; b=U346Dk8FQPsNO3klAoNdPC/PLSWZDom/AthYv5rixiflUQA+ba3eBDRrDAd30HliozBnadQRX+q7BgTCSWvIZbIrApNAkUQXsLLfR35i01MWjIa5uj3CO/cb2vffF3b31V9BlDQ6T3AF/UztroLOx6v7yEBsODKxoFyAGkmYQJE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608368894; 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=5Bn86rgS2bnYH+W/Es2Qe8V7zT5naA/7VpIKLdZoXLI=; b=aachhrA2VrxkYQjiGJD+vNhQutcZUl2lr8g9Q9cTOHZTebZAqTQfxFZbRzBTOvNzeozJBfdKz1WoeUx6YxfSJL4GNXbRbXIJ3AjCfvzIc5Wb1RK5b0I1MkdPki80LftoDstfa1V2AirjHwdGTbZTrJmHDs0F1I/KlcsGSdBEPl4= 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 1608368894098617.1830730935454; Sat, 19 Dec 2020 01:08:14 -0800 (PST) Received: from localhost ([::1]:59486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqYDl-0007FC-0d for importer@patchew.org; Sat, 19 Dec 2020 04:08:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqYCP-0006Md-Af 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]:21025) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqYCM-0004DJ-J3 for qemu-devel@nongnu.org; Sat, 19 Dec 2020 04:06:49 -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-176-zPme71pYOZu8SD9w6z_HfQ-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 A0571107ACE6 for ; Sat, 19 Dec 2020 09:06:41 +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 589E32BCC3; 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=5Bn86rgS2bnYH+W/Es2Qe8V7zT5naA/7VpIKLdZoXLI=; b=DxJz4c35yIBvOsDRjPmpEba4s1g5Bajd6YE+8gKJPF54cybTgwEC33OHCT98W+WiHUrPhJ AWfJGVvT+Sfb3fO4mt8dkEVbBCf3jsWJMaFp+Tk4VSevhhfzs0nkYWfVPC4r4I2Y+mXUn5 th0rfzGngPISPK+fI1p20XbT+KhYQI8= X-MC-Unique: zPme71pYOZu8SD9w6z_HfQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 1/2] whpx: rename whp-dispatch to whpx-internal.h Date: Sat, 19 Dec 2020 04:06:36 -0500 Message-Id: <20201219090637.1700900-2-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-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) Content-Type: text/plain; charset="utf-8" Rename the file in preparation for moving more implementation-internal definitions to it. The build is still broken though. Signed-off-by: Paolo Bonzini Reviewed-by: Marc-Andr=C3=A9 Lureau --- target/i386/whpx/whpx-all.c | 5 +---- target/i386/whpx/whpx-apic.c | 2 +- target/i386/whpx/whpx-cpus.c | 4 +--- target/i386/whpx/{whp-dispatch.h =3D> whpx-internal.h} | 6 +++--- 4 files changed, 6 insertions(+), 11 deletions(-) rename target/i386/whpx/{whp-dispatch.h =3D> whpx-internal.h} (98%) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 3b824fc9d7..12f79e2cd6 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -26,13 +26,10 @@ #include "qapi/qapi-types-common.h" #include "qapi/qapi-visit-common.h" #include "migration/blocker.h" -#include "whp-dispatch.h" #include =20 #include "whpx-cpus.h" - -#include -#include +#include "whpx-internal.h" =20 #define HYPERV_APIC_BUS_FREQUENCY (200000000ULL) =20 diff --git a/target/i386/whpx/whpx-apic.c b/target/i386/whpx/whpx-apic.c index b127a3cb8a..1d330bf749 100644 --- a/target/i386/whpx/whpx-apic.c +++ b/target/i386/whpx/whpx-apic.c @@ -18,7 +18,7 @@ #include "hw/pci/msi.h" #include "sysemu/hw_accel.h" #include "sysemu/whpx.h" -#include "whp-dispatch.h" +#include "whpx-internal.h" =20 static void whpx_put_apic_state(APICCommonState *s, struct whpx_lapic_state *kapic) diff --git a/target/i386/whpx/whpx-cpus.c b/target/i386/whpx/whpx-cpus.c index d9bd5a2d36..f7e69881a3 100644 --- a/target/i386/whpx/whpx-cpus.c +++ b/target/i386/whpx/whpx-cpus.c @@ -15,11 +15,9 @@ #include "qemu/guest-random.h" =20 #include "sysemu/whpx.h" +#include "whpx-internal.h" #include "whpx-cpus.h" =20 -#include -#include - static void *whpx_cpu_thread_fn(void *arg) { CPUState *cpu =3D arg; diff --git a/target/i386/whpx/whp-dispatch.h b/target/i386/whpx/whpx-intern= al.h similarity index 98% rename from target/i386/whpx/whp-dispatch.h rename to target/i386/whpx/whpx-internal.h index cef5d848bd..e0a9ea1dce 100644 --- a/target/i386/whpx/whp-dispatch.h +++ b/target/i386/whpx/whpx-internal.h @@ -1,5 +1,5 @@ -#ifndef WHP_DISPATCH_H -#define WHP_DISPATCH_H +#ifndef WHP_INTERNAL_H +#define WHP_INTERNAL_H =20 #include #include @@ -72,4 +72,4 @@ typedef enum WHPFunctionList { WINHV_PLATFORM_FNS_SUPPLEMENTAL } WHPFunctionList; =20 -#endif /* WHP_DISPATCH_H */ +#endif /* WHP_INTERNAL_H */ --=20 2.26.2 From nobody Sat May 4 00:24:54 2024 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