From: Magnus Kulke <magnuskulke@linux.microsoft.com>
To: qemu-devel@nongnu.org
Cc: Wei Liu <liuwe@microsoft.com>,
Paolo Bonzini <pbonzini@redhat.com>, Wei Liu <wei.liu@kernel.org>,
Magnus Kulke <magnuskulke@linux.microsoft.com>,
Magnus Kulke <magnuskulke@microsoft.com>,
Zhao Liu <zhao1.liu@intel.com>
Subject: [PATCH v3 9/9] accel/mshv: disable la57 (5lvl paging)
Date: Mon, 23 Mar 2026 12:57:11 +0100 [thread overview]
Message-ID: <20260323115711.353793-10-magnuskulke@linux.microsoft.com> (raw)
In-Reply-To: <20260323115711.353793-1-magnuskulke@linux.microsoft.com>
This change disable la57 paging on the mshv hypervisor on both the
mshv processor feature bitmap and mask the cpuid feature leaf to the
guest.
Since the removal of hypervisor-assisted gva=>gpa translation in
1c85a4a3d7 we have seen MMIO errors in guests on la57-enabled hw. We
will have to investigate and test this further.
Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
---
accel/mshv/mshv-all.c | 7 +++++++
include/system/mshv_int.h | 2 ++
target/i386/mshv/mshv-cpu.c | 12 ++++++++++++
3 files changed, 21 insertions(+)
diff --git a/accel/mshv/mshv-all.c b/accel/mshv/mshv-all.c
index c50641f174..a557623531 100644
--- a/accel/mshv/mshv-all.c
+++ b/accel/mshv/mshv-all.c
@@ -142,6 +142,8 @@ static int create_partition(int mshv_fd, int *vm_fd)
int ret;
uint64_t pt_flags, host_proc_features;
union hv_partition_processor_xsave_features disabled_xsave_features;
+ union hv_partition_processor_features disabled_partition_features = {0};
+
struct mshv_create_partition_v2 args = {0};
QEMU_BUILD_BUG_ON(MSHV_NUM_CPU_FEATURES_BANKS != 2);
@@ -177,6 +179,11 @@ static int create_partition(int mshv_fd, int *vm_fd)
}
args.pt_cpu_fbanks[1] = ~host_proc_features;
+ /* arch-specific features we disable regardless of host support */
+ mshv_arch_disable_partition_proc_features(&disabled_partition_features);
+ args.pt_cpu_fbanks[0] |= disabled_partition_features.as_uint64[0];
+ args.pt_cpu_fbanks[1] |= disabled_partition_features.as_uint64[1];
+
/* populate args structure */
args.pt_flags = pt_flags;
args.pt_isolation = MSHV_PT_ISOLATION_NONE;
diff --git a/include/system/mshv_int.h b/include/system/mshv_int.h
index 35386c422f..ca156cdf4b 100644
--- a/include/system/mshv_int.h
+++ b/include/system/mshv_int.h
@@ -94,6 +94,8 @@ void mshv_arch_init_vcpu(CPUState *cpu);
void mshv_arch_destroy_vcpu(CPUState *cpu);
void mshv_arch_amend_proc_features(
union hv_partition_synthetic_processor_features *features);
+void mshv_arch_disable_partition_proc_features(
+ union hv_partition_processor_features *disabled_features);
int mshv_arch_post_init_vm(int vm_fd);
typedef struct mshv_root_hvcall mshv_root_hvcall;
diff --git a/target/i386/mshv/mshv-cpu.c b/target/i386/mshv/mshv-cpu.c
index 2c66a52709..433f7a4069 100644
--- a/target/i386/mshv/mshv-cpu.c
+++ b/target/i386/mshv/mshv-cpu.c
@@ -1111,6 +1111,12 @@ void mshv_arch_amend_proc_features(
features->access_guest_idle_reg = 1;
}
+void mshv_arch_disable_partition_proc_features(
+ union hv_partition_processor_features *disabled_features)
+{
+ disabled_features->la57_support = 1;
+}
+
static int set_memory_info(const struct hyperv_message *msg,
struct hv_x64_memory_intercept_message *info)
{
@@ -1677,6 +1683,12 @@ uint32_t mshv_get_supported_cpuid(uint32_t func, uint32_t idx, int reg)
*/
if (func == 0x07 && idx == 0 && reg == R_ECX) {
ret &= ~CPUID_7_0_ECX_CET_SHSTK;
+ /*
+ * LA57 (5-level paging) causes incorrect GVA=>GPA translations
+ * in the instruction decoder/emulator. Disable until page table
+ * walk in x86_mmu.c works w/ 5-level paging.
+ */
+ ret &= ~CPUID_7_0_ECX_LA57;
}
if (func == 0x07 && idx == 0 && reg == R_EDX) {
ret &= ~CPUID_7_0_EDX_CET_IBT;
--
2.34.1
next prev parent reply other threads:[~2026-03-23 11:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 11:57 [PATCH v3 0/9] Support QEMU cpu models in MSHV accelerator Magnus Kulke
2026-03-23 11:57 ` [PATCH v3 1/9] accel/mshv: use mshv_create_partition_v2 payload Magnus Kulke
2026-03-27 4:16 ` Anirudh Rayabharam
2026-03-23 11:57 ` [PATCH v3 2/9] target/i386/mshv: fix cpuid propagation bug Magnus Kulke
2026-03-27 4:15 ` Anirudh Rayabharam
2026-03-23 11:57 ` [PATCH v3 3/9] target/i386/mshv: fix various cpuid traversal bugs Magnus Kulke
2026-03-23 11:57 ` [PATCH v3 4/9] target/i386/mshv: change cpuid mask to UINT32_MAX Magnus Kulke
2026-03-23 11:57 ` [PATCH v3 5/9] target/i386/mshv: set cpu model name on -cpu host Magnus Kulke
2026-03-23 11:57 ` [PATCH v3 6/9] target/i386: query mshv accel for supported cpuids Magnus Kulke
2026-03-23 11:57 ` [PATCH v3 7/9] target/i386/mshv: populate xsave area offsets Magnus Kulke
2026-03-27 4:37 ` Anirudh Rayabharam
2026-03-23 11:57 ` [PATCH v3 8/9] target/i386/mshv: filter out CET bits in cpuid Magnus Kulke
2026-03-27 4:41 ` Anirudh Rayabharam
2026-03-23 11:57 ` Magnus Kulke [this message]
2026-03-27 4:23 ` [PATCH v3 9/9] accel/mshv: disable la57 (5lvl paging) Anirudh Rayabharam
2026-03-27 16:08 ` Paolo Bonzini
2026-03-27 16:40 ` Magnus Kulke
2026-03-27 16:54 ` Magnus Kulke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260323115711.353793-10-magnuskulke@linux.microsoft.com \
--to=magnuskulke@linux.microsoft.com \
--cc=liuwe@microsoft.com \
--cc=magnuskulke@microsoft.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=wei.liu@kernel.org \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.