The branch main has been updated by chuck:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=92dfc3fbcd79422a4586590edabe483f361b7e0e

commit 92dfc3fbcd79422a4586590edabe483f361b7e0e
Author:     Chuck Tuffli <ch...@freebsd.org>
AuthorDate: 2025-07-26 22:09:59 +0000
Commit:     Chuck Tuffli <ch...@freebsd.org>
CommitDate: 2025-07-26 23:01:42 +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
    Reported by:    demik+free...@lostwave.net
    Tested by:      demik+free...@lostwave.net
    Obtained from:  Illumos
    MFC after:      1 week
    Reviewed by:    avg, markj, jhb
    Differential Revision:  https://reviews.freebsd.org/D51480
---
 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 cd80e4ef782e..7c174728f4fa 100644
--- a/usr.sbin/bhyve/amd64/xmsr.c
+++ b/usr.sbin/bhyve/amd64/xmsr.c
@@ -204,6 +204,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;

Reply via email to