git: nvmm: Improve CPUID emulation #2: mask upper bits of guest EAX/ECX

Aaron LI aly at crater.dragonflybsd.org
Tue Jul 20 16:30:29 PDT 2021


commit 1cc8c8a2fcca3f7d8724ad0bf495c5a54f6ca553
Author: Aaron LI <aly at aaronly.me>
Date:   Sat Jul 3 12:04:35 2021 +0800

    nvmm: Improve CPUID emulation #2: mask upper bits of guest EAX/ECX
    
    Use uint32_t instead of uint64_t for guest EAX/ECX and mask the upper
    bits, to prevent wrong results if the upper bits happen to contain
    garbage.  Not encountered in the wild so far, but could happen.

Summary of changes:
 sys/dev/virtual/nvmm/x86/nvmm_x86_svm.c | 10 +++++-----
 sys/dev/virtual/nvmm/x86/nvmm_x86_vmx.c | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1cc8c8a2fcca3f7d8724ad0bf495c5a54f6ca553


-- 
DragonFly BSD source repository


More information about the Commits mailing list