From c8c95121f802c4f6a63edc7145ec493573589639 Mon Sep 17 00:00:00 2001 From: dv Date: Wed, 4 Sep 2024 16:12:40 +0000 Subject: [PATCH] vmm: set highest cpuid feature leaf based on host cpu. Fixes Linux guests on older Intel hardware. vmm was reporting a value that doesn't match the host. Cap it at the highest value vmm currently emulates. ok bluhm@, ratchov@ --- sys/arch/amd64/amd64/vmm_machdep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/arch/amd64/amd64/vmm_machdep.c b/sys/arch/amd64/amd64/vmm_machdep.c index 0e8e2a52645..04944d513bf 100644 --- a/sys/arch/amd64/amd64/vmm_machdep.c +++ b/sys/arch/amd64/amd64/vmm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm_machdep.c,v 1.35 2024/09/04 07:54:51 mglocker Exp $ */ +/* $OpenBSD: vmm_machdep.c,v 1.36 2024/09/04 16:12:40 dv Exp $ */ /* * Copyright (c) 2014 Mike Larkin * @@ -6282,7 +6282,8 @@ vmm_handle_cpuid(struct vcpu *vcpu) *rdx = 0; break; case 0x80000000: /* Extended function level */ - *rax = 0x8000001f; /* curcpu()->ci_pnfeatset */ + /* We don't emulate past 0x8000001f currently. */ + *rax = min(curcpu()->ci_pnfeatset, 0x8000001f); *rbx = 0; *rcx = 0; *rdx = 0; -- 2.20.1