From owner-svn-src-all@freebsd.org Mon May 18 07:06:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F29D138B05; Mon, 18 May 2020 07:06:36 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QVRw0D2hz4H23; Mon, 18 May 2020 07:06:36 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02D8D1D99D; Mon, 18 May 2020 07:06:36 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I76ZiR074972; Mon, 18 May 2020 07:06:35 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I76ZPe074971; Mon, 18 May 2020 07:06:35 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202005180706.04I76ZPe074971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Mon, 18 May 2020 07:06:35 +0000 (UTC) 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 X-SVN-Group: releng X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: releng/11.4/sys/amd64/vmm X-SVN-Commit-Revision: 361151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 07:06:36 -0000 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, ®s[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)