git: 321a15380668 - stable/14 - bhyve: Report SVM as disabled on AMD

From: Chuck Tuffli <chuck_at_FreeBSD.org>
Date: Mon, 17 Nov 2025 22:16:38 UTC
The branch stable/14 has been updated by chuck:

URL: https://cgit.FreeBSD.org/src/commit/?id=321a153806685dff031c6ab2d453f077914910ec

commit 321a153806685dff031c6ab2d453f077914910ec
Author:     Chuck Tuffli <chuck@FreeBSD.org>
AuthorDate: 2025-07-26 22:09:59 +0000
Commit:     Chuck Tuffli <chuck@FreeBSD.org>
CommitDate: 2025-11-17 21:54:00 +0000

    bhyve: Report SVM as disabled on AMD
    
    bhyve with a Windows 2025 guest will hang/freeze with the message
        rdmsr to register 0xc0010114
    on a system with an AMD Ryzen 5. Evidently, recent versions of Windows
    ignore the CPUID bits and still read this MSR.
    
    Fix is to report Secure Virtual Machine (SVM) mode as disabled in the VM CR.
    
    PR:             288308
    
    (cherry picked from commit 92dfc3fbcd79422a4586590edabe483f361b7e0e)
---
 usr.sbin/bhyve/amd64/xmsr.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/usr.sbin/bhyve/amd64/xmsr.c b/usr.sbin/bhyve/amd64/xmsr.c
index 7481df4669e7..b245fc27045d 100644
--- a/usr.sbin/bhyve/amd64/xmsr.c
+++ b/usr.sbin/bhyve/amd64/xmsr.c
@@ -205,6 +205,15 @@ emulate_rdmsr(struct vcpu *vcpu __unused, uint32_t num, uint64_t *val)
 			*val = 1;
 			break;
 
+		case MSR_VM_CR:
+			/*
+			 * We currently don't support nested virt.
+			 * Windows seems to ignore the cpuid bits and reads this
+			 * MSR anyways.
+			 */
+			*val = VM_CR_SVMDIS;
+			break;
+
 		default:
 			error = -1;
 			break;