Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8D443CFA76A for ; Fri, 21 Nov 2025 10:05:17 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vMNzq-0004sy-4r; Fri, 21 Nov 2025 05:04:07 -0500 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 1vMNzQ-0004fA-BZ for qemu-devel@nongnu.org; Fri, 21 Nov 2025 05:03:41 -0500 Received: from p-east3-cluster3-host8-snip4-4.eps.apple.com ([57.103.86.77] helo=outbound.qs.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vMNzE-0007tK-GY for qemu-devel@nongnu.org; Fri, 21 Nov 2025 05:03:38 -0500 Received: from outbound.qs.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-east-2d-100-percent-4 (Postfix) with ESMTPS id 8051C1800124; Fri, 21 Nov 2025 10:02:55 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; bh=jLqXoGrEPi7v9+7vHj1kBJ+bh5oPPLtWhi+tTvECrR8=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:x-icloud-hme; b=FJI92PWup5AtPPhA+ZTUzEAwhkfehybvt+6GTzsSq5hpJD/GCmufoYclUm9mHVAOqyjcKQk6bIkJbxgL3Qiv9uDODcPLjhxxDj3UhYSJvMerCEYo/Ne3CvmQiPfbYUXdlyfxedMiIgBueWsCqSfb9vN27hKVRxDC+EDqDOwrzJYdFed45jYf9S3BldB8QiGZhT66x8yBa3MGETM6pX/xs6F6LgBxU4MFYLzMzfQNdeeLZSjV5q4Ave8v+PMjpvFMxpHO+HXVBioE0HTYHJ6F2q8x312F1ZmsYXD7Wky3BIht1H5fE4QDmENqshVBDOOP47Www2ZNMwxtb6VFUDofGQ== mail-alias-created-date: 1752046281608 Received: from localhost.localdomain (unknown [17.57.155.37]) by p00-icloudmta-asmtp-us-east-2d-100-percent-4 (Postfix) with ESMTPSA id 349571800117; Fri, 21 Nov 2025 10:02:53 +0000 (UTC) From: Mohamed Mediouni To: qemu-devel@nongnu.org, mohamed@unpredictable.fr Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Alexander Graf , Peter Maydell , Phil Dennis-Jordan , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-arm@nongnu.org, Pedro Barbuda , Akihiko Odaki , Peter Xu , Mads Ynddal , Richard Henderson , Pierrick Bouvier Subject: [PATCH v11 06/28] whpx: Move around files before introducing AArch64 support Date: Fri, 21 Nov 2025 11:02:18 +0100 Message-ID: <20251121100240.89117-7-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251121100240.89117-1-mohamed@unpredictable.fr> References: <20251121100240.89117-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTIxMDA3NiBTYWx0ZWRfX5jhQ2NHzyEYg XyWWewwJmWR09Irh0Z/f7ruM15YbSvPC/tyVuGfuqE6tISPgwVc4rN4MlhZa6vst2RUSeUn7mho 5l8h0VQQlxSuTmjbRFMOINIAJc/gJJw1APqTy0LOaevEO7vGv6/8/yAgeNSwGezYeUpbCL4m+Nh ZCoAmZdGshdy/lwZNQWirB6fys3WwCSRVQAmXSs6vsIJ3BJu14lRZh+M/LKDCtES9Z1eyIMWm9N Nl/o65uydYkH9MslX9MnoprbyfIyGGMraHq+M20ZgAs9VpWkeMSEBBNgwCoyxTyyB0xmq+Tr3Rh vwqAeWRmg4l8OHClNne X-Authority-Info: v=2.4 cv=dMqrWeZb c=1 sm=1 tr=0 ts=692038d0 cx=c_apl:c_pps a=bsP7O+dXZ5uKcj+dsLqiMw==:117 a=bsP7O+dXZ5uKcj+dsLqiMw==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=KKAkSRfTAAAA:8 a=yMhMjlubAAAA:8 a=5-iGLm-LtT_B5TT3xKgA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: CVzIocsIm6Z96PMwKqdDQ6QP7-60aL8w X-Proofpoint-ORIG-GUID: CVzIocsIm6Z96PMwKqdDQ6QP7-60aL8w X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-21_03,2025-11-20_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 clxscore=1030 mlxlogscore=999 spamscore=0 adultscore=0 phishscore=0 suspectscore=0 mlxscore=0 bulkscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511210076 X-JNJ: AAAAAAABSeGiIV21PP3QIJPaE+FDF+hN8Me+zEaaQU/0v34hb3sJR1TQswlZs91+VCxWnHMIW2l5a5mb4l7fhfceoKw4qAeNixMoLD4u1y8vjPx9ECy4hhDep+xfcgNNZFZdby03R/mBO7N2xB7xwKSzHdlD2JQnFq/CKHshNxBHgOJY7RVcy32wJ/dWCBahArmbnmrxA1FgDVwBgWHaeP4NY9coqKrzXUW9CJJ/nUedWKr1kNHhKR4wBlDBhJbp2bu1WgTCVHWFI1CU6P/e6Fr6Q01i5RUCJgSWln6fdoQY6rPLgJT/53J18kcJ6IBINfLr2hMAqUodvAIbjBbWGuiUotJ1YPVXmsy+x8MNj0oIALl0hUthVlQ5L0ZBUMkyo9hKQMjQT6f2lyRvZElOvPX0yCsoIXfzbU7UZppmB6/cRZ37fZ37zXsJZLz4i36I5pzsR17EEUQxg6Cow55jQvZdowKtlfh/g1a47PWuWCP6A+qEn8Zz1gXARM12/JXBrdKjCsxp3oePizsfqWbcrShXJs3DljlM3rWqnGuf7RfuzTXt+uw36bJR0Hx5zR/WXm6gK6egzPteojXRhBExFw7zd6LNspKLxhSw6fe3RNi8KW0SlBA5rmjPWOIgW7ktdKDyBMjuWzd0Idw3EG4up8qRY9NiA8FMApCo5iNAjkerT3Fc1zpbWsH9ncEY/qEiLvNwk3hMEKLr5eSpYQMeBiF5nRDdOpvcQ8eRJ3xUQow+TfbXMb2MG/7SB4K+FkvakZlUqS9qGmyhbUeWO+Ks0XZd0vlpuwIDkzps Received-SPF: pass client-ip=57.103.86.77; envelope-from=mohamed@unpredictable.fr; helo=outbound.qs.icloud.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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Switch to a design where we can share whpx code between x86 and AArch64 when it makes sense to do so. Signed-off-by: Mohamed Mediouni Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- MAINTAINERS | 2 ++ accel/meson.build | 1 + accel/whpx/meson.build | 6 ++++++ {target/i386 => accel}/whpx/whpx-accel-ops.c | 4 ++-- {target/i386/whpx => include/system}/whpx-accel-ops.h | 4 ++-- {target/i386/whpx => include/system}/whpx-internal.h | 5 +++-- target/i386/whpx/meson.build | 1 - target/i386/whpx/whpx-all.c | 4 ++-- target/i386/whpx/whpx-apic.c | 2 +- 9 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 accel/whpx/meson.build rename {target/i386 => accel}/whpx/whpx-accel-ops.c (97%) rename {target/i386/whpx => include/system}/whpx-accel-ops.h (92%) rename {target/i386/whpx => include/system}/whpx-internal.h (98%) diff --git a/MAINTAINERS b/MAINTAINERS index d1c5080e50..7fdd1401f0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -550,9 +550,11 @@ WHPX CPUs M: Pedro Barbuda M: Mohamed Mediouni S: Supported +F: accel/whpx/ F: target/i386/whpx/ F: accel/stubs/whpx-stub.c F: include/system/whpx.h +F: include/system/whpx-accel-ops.h MSHV M: Magnus Kulke diff --git a/accel/meson.build b/accel/meson.build index 983dfd0bd5..289b7420ff 100644 --- a/accel/meson.build +++ b/accel/meson.build @@ -6,6 +6,7 @@ user_ss.add(files('accel-user.c')) subdir('tcg') if have_system subdir('hvf') + subdir('whpx') subdir('qtest') subdir('kvm') subdir('xen') diff --git a/accel/whpx/meson.build b/accel/whpx/meson.build new file mode 100644 index 0000000000..7b3d6f1c1c --- /dev/null +++ b/accel/whpx/meson.build @@ -0,0 +1,6 @@ +whpx_ss = ss.source_set() +whpx_ss.add(files( + 'whpx-accel-ops.c', +)) + +specific_ss.add_all(when: 'CONFIG_WHPX', if_true: whpx_ss) diff --git a/target/i386/whpx/whpx-accel-ops.c b/accel/whpx/whpx-accel-ops.c similarity index 97% rename from target/i386/whpx/whpx-accel-ops.c rename to accel/whpx/whpx-accel-ops.c index f75886128d..c84a25c273 100644 --- a/target/i386/whpx/whpx-accel-ops.c +++ b/accel/whpx/whpx-accel-ops.c @@ -16,8 +16,8 @@ #include "qemu/guest-random.h" #include "system/whpx.h" -#include "whpx-internal.h" -#include "whpx-accel-ops.h" +#include "system/whpx-internal.h" +#include "system/whpx-accel-ops.h" static void *whpx_cpu_thread_fn(void *arg) { diff --git a/target/i386/whpx/whpx-accel-ops.h b/include/system/whpx-accel-ops.h similarity index 92% rename from target/i386/whpx/whpx-accel-ops.h rename to include/system/whpx-accel-ops.h index 54cfc25a14..ed9d4c49f4 100644 --- a/target/i386/whpx/whpx-accel-ops.h +++ b/include/system/whpx-accel-ops.h @@ -7,8 +7,8 @@ * See the COPYING file in the top-level directory. */ -#ifndef TARGET_I386_WHPX_ACCEL_OPS_H -#define TARGET_I386_WHPX_ACCEL_OPS_H +#ifndef SYSTEM_WHPX_ACCEL_OPS_H +#define SYSTEM_WHPX_ACCEL_OPS_H #include "system/cpus.h" diff --git a/target/i386/whpx/whpx-internal.h b/include/system/whpx-internal.h similarity index 98% rename from target/i386/whpx/whpx-internal.h rename to include/system/whpx-internal.h index 2dcad1f565..c59f9de091 100644 --- a/target/i386/whpx/whpx-internal.h +++ b/include/system/whpx-internal.h @@ -1,5 +1,6 @@ -#ifndef TARGET_I386_WHPX_INTERNAL_H -#define TARGET_I386_WHPX_INTERNAL_H +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#ifndef SYSTEM_WHPX_INTERNAL_H +#define SYSTEM_WHPX_INTERNAL_H #include #include diff --git a/target/i386/whpx/meson.build b/target/i386/whpx/meson.build index 9c54aaad39..c3aaaff9fd 100644 --- a/target/i386/whpx/meson.build +++ b/target/i386/whpx/meson.build @@ -1,5 +1,4 @@ i386_system_ss.add(when: 'CONFIG_WHPX', if_true: files( 'whpx-all.c', 'whpx-apic.c', - 'whpx-accel-ops.c', )) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 6bf8d5f4bb..c0bd429d19 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -31,8 +31,8 @@ #include "accel/accel-cpu-target.h" #include -#include "whpx-internal.h" -#include "whpx-accel-ops.h" +#include "system/whpx-internal.h" +#include "system/whpx-accel-ops.h" #include #include diff --git a/target/i386/whpx/whpx-apic.c b/target/i386/whpx/whpx-apic.c index afcb25843b..b934fdcbe1 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 "system/hw_accel.h" #include "system/whpx.h" -#include "whpx-internal.h" +#include "system/whpx-internal.h" struct whpx_lapic_state { struct { -- 2.50.1 (Apple Git-155)