Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 May 2020 07:06:35 +0000 (UTC)
From:      Peter Grehan <grehan@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org
Subject:   svn commit: r361151 - releng/11.4/sys/amd64/vmm
Message-ID:  <202005180706.04I76ZPe074971@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: grehan
Date: Mon May 18 07:06:35 2020
New Revision: 361151
URL: https://svnweb.freebsd.org/changeset/base/361151

Log:
  MFS r361132
     Hide host CPUID 0x15 TSC/Crystal ratio/freq info from guest
  
  Approved by: re (kib), bz (mentor)

Modified:
  releng/11.4/sys/amd64/vmm/x86.c
  releng/11.4/sys/amd64/vmm/x86.h
Directory Properties:
  releng/11.4/   (props changed)

Modified: releng/11.4/sys/amd64/vmm/x86.c
==============================================================================
--- releng/11.4/sys/amd64/vmm/x86.c	Mon May 18 02:14:25 2020	(r361150)
+++ releng/11.4/sys/amd64/vmm/x86.c	Mon May 18 07:06:35 2020	(r361151)
@@ -554,6 +554,18 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
 			}
 			break;
 
+		case CPUID_0000_0015:
+			/*
+			 * Don't report CPU TSC/Crystal ratio and clock
+			 * values since guests may use these to derive the
+			 * local APIC frequency..
+			 */
+			regs[0] = 0;
+			regs[1] = 0;
+			regs[2] = 0;
+			regs[3] = 0;
+			break;
+
 		case 0x40000000:
 			regs[0] = CPUID_VM_HIGH;
 			bcopy(bhyve_id, &regs[1], 4);

Modified: releng/11.4/sys/amd64/vmm/x86.h
==============================================================================
--- releng/11.4/sys/amd64/vmm/x86.h	Mon May 18 02:14:25 2020	(r361150)
+++ releng/11.4/sys/amd64/vmm/x86.h	Mon May 18 07:06:35 2020	(r361151)
@@ -39,6 +39,7 @@
 #define	CPUID_0000_000A	(0xA)
 #define	CPUID_0000_000B	(0xB)
 #define	CPUID_0000_000D	(0xD)
+#define	CPUID_0000_0015	(0x15)
 #define CPUID_8000_0000	(0x80000000)
 #define CPUID_8000_0001	(0x80000001)
 #define CPUID_8000_0002	(0x80000002)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005180706.04I76ZPe074971>