From nobody Fri Apr 3 22:21:23 2026 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=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1774274558; cv=none; d=zohomail.com; s=zohoarc; b=YOG5LwYalWIq8DFaMXqhyVpRFDGzWANu6/SUhPeemtk4lFWAsNlQXnNSGK3fKA5rK3Wouwq6vvQcZ7H5LIGb9MyE/M59wIWOpCXy1QSX59hOdp94vpmZsaz21fSq5ndSZ5WJNFqQPNxZhEKwxbi/wNa6p4ipZ+8Y2pXBIaafj+I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774274558; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ASHwIUqJhX6VXNhjtPjQt2QC4yNFkvq7Vac2whkLBwE=; b=KVAzMOyAMrMfaeVSxkDHTS/7QNXROX+j+NwvPnzxqK2QNqnyV4EmVP3cjYCIhtVeW86YGnz3Bx61TcrJMWBUEAVk1Anj/HhXRqsd/8pfIMxN+wi2kB80DQnm2vXIV3DId3aAJ00YYJf1v8jHScQp+i6AuWpTANWc5dlHIaRDgY8= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1774274558614528.3591066330786; Mon, 23 Mar 2026 07:02:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w4fqs-0001aL-1L; Mon, 23 Mar 2026 10:02:05 -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 1w4fog-0000Sx-Op for qemu-devel@nongnu.org; Mon, 23 Mar 2026 09:59:42 -0400 Received: from linux.microsoft.com ([13.77.154.182]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w4fod-0006xu-RP for qemu-devel@nongnu.org; Mon, 23 Mar 2026 09:59:38 -0400 Received: from DESKTOP-TUU1E5L.localdomain (unknown [167.220.208.76]) by linux.microsoft.com (Postfix) with ESMTPSA id 4AD4820B6F1F; Mon, 23 Mar 2026 06:59:22 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4AD4820B6F1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1774274365; bh=ASHwIUqJhX6VXNhjtPjQt2QC4yNFkvq7Vac2whkLBwE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AEtv4OcTVKomZFVNK/kGBko1z4d0IDgkNtbtPVl/n7a9C/U4RgbmeMHzA3L53fdpy n+T0JSs5ZkVnVDg3u0KUJDwGSPdjtQmD6HS0CIXxU5EgywxL8v2H5RAWwYdtwz+hG/ layGbJuszzJhBQ9zC2SFfpMvc5bxICZWPAQzBwMY= From: Magnus Kulke To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, Wei Liu , Richard Henderson , Marcelo Tosatti , Marcel Apfelbaum , Wei Liu , Alex Williamson , Paolo Bonzini , Zhao Liu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Magnus Kulke , Magnus Kulke , "Michael S. Tsirkin" Subject: [RFC 18/32] target/i386/mshv: expose msvh_get_generic_regs Date: Mon, 23 Mar 2026 14:57:58 +0100 Message-Id: <20260323135812.383509-19-magnuskulke@linux.microsoft.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260323135812.383509-1-magnuskulke@linux.microsoft.com> References: <20260323135812.383509-1-magnuskulke@linux.microsoft.com> MIME-Version: 1.0 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=13.77.154.182; envelope-from=magnuskulke@linux.microsoft.com; helo=linux.microsoft.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linux.microsoft.com) X-ZM-MESSAGEID: 1774274559856154100 Content-Type: text/plain; charset="utf-8" We expose the fn, so we can call them from the other source files (msr.c). Signed-off-by: Magnus Kulke --- include/system/mshv_int.h | 2 ++ target/i386/mshv/mshv-cpu.c | 15 ++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/system/mshv_int.h b/include/system/mshv_int.h index 2b6d7b2f35..2c5d16bf9a 100644 --- a/include/system/mshv_int.h +++ b/include/system/mshv_int.h @@ -81,6 +81,8 @@ int mshv_configure_vcpu(const CPUState *cpu); int mshv_run_vcpu(int vm_fd, CPUState *cpu, hv_message *msg, MshvVmExit *e= xit); int mshv_set_generic_regs(const CPUState *cpu, const hv_register_assoc *as= socs, size_t n_regs); +int mshv_get_generic_regs(CPUState *cpu, hv_register_assoc *assocs, + size_t n_regs); int mshv_arch_store_vcpu_state(const CPUState *cpu); int mshv_arch_load_vcpu_state(CPUState *cpu); void mshv_arch_init_vcpu(CPUState *cpu); diff --git a/target/i386/mshv/mshv-cpu.c b/target/i386/mshv/mshv-cpu.c index 906f5b0c3d..ecb4711b95 100644 --- a/target/i386/mshv/mshv-cpu.c +++ b/target/i386/mshv/mshv-cpu.c @@ -108,9 +108,6 @@ static enum hv_register_name FPU_REGISTER_NAMES[26] =3D= { }; =20 static int set_special_regs(const CPUState *cpu); -static int get_generic_regs(CPUState *cpu, - struct hv_register_assoc *assocs, - size_t n_regs); =20 static int get_lapic(CPUState *cpu) { @@ -187,7 +184,7 @@ static int get_fpu(CPUState *cpu) for (size_t i =3D 0; i < n_regs; i++) { assocs[i].name =3D FPU_REGISTER_NAMES[i]; } - ret =3D get_generic_regs(cpu, assocs, n_regs); + ret =3D mshv_get_generic_regs(cpu, assocs, n_regs); if (ret < 0) { error_report("failed to get special registers"); return -errno; @@ -207,7 +204,7 @@ static int get_xc_reg(CPUState *cpu) =20 assocs[0].name =3D HV_X64_REGISTER_XFEM; =20 - ret =3D get_generic_regs(cpu, assocs, 1); + ret =3D mshv_get_generic_regs(cpu, assocs, 1); if (ret < 0) { error_report("failed to get xcr0"); return -1; @@ -300,8 +297,8 @@ int mshv_set_generic_regs(const CPUState *cpu, const hv= _register_assoc *assocs, return 0; } =20 -static int get_generic_regs(CPUState *cpu, hv_register_assoc *assocs, - size_t n_regs) +int mshv_get_generic_regs(CPUState *cpu, hv_register_assoc *assocs, + size_t n_regs) { int cpu_fd =3D mshv_vcpufd(cpu); int vp_index =3D cpu->cpu_index; @@ -450,7 +447,7 @@ static int get_standard_regs(CPUState *cpu) for (size_t i =3D 0; i < n_regs; i++) { assocs[i].name =3D STANDARD_REGISTER_NAMES[i]; } - ret =3D get_generic_regs(cpu, assocs, n_regs); + ret =3D mshv_get_generic_regs(cpu, assocs, n_regs); if (ret < 0) { error_report("failed to get standard registers"); return -1; @@ -527,7 +524,7 @@ static int get_special_regs(CPUState *cpu) for (size_t i =3D 0; i < n_regs; i++) { assocs[i].name =3D SPECIAL_REGISTER_NAMES[i]; } - ret =3D get_generic_regs(cpu, assocs, n_regs); + ret =3D mshv_get_generic_regs(cpu, assocs, n_regs); if (ret < 0) { error_report("failed to get special registers"); return -errno; --=20 2.34.1